The Annotated Synacor Challenge
by Matt Keeter
based on the puzzles by Eric Wastl

See this blog post for details

self-test:
0000 | noop
0001 | noop
0002 | out 'W'
0004 | out 'e'
0006 | out 'l'
0008 | out 'c'
0010 | out 'o'
0012 | out 'm'
0014 | out 'e'
0016 | out ' '
0018 | out 't'
0020 | out 'o'
0022 | out ' '
0024 | out 't'
0026 | out 'h'
0028 | out 'e'
0030 | out ' '
0032 | out 'S'
0034 | out 'y'
0036 | out 'n'
0038 | out 'a'
0040 | out 'c'
0042 | out 'o'
0044 | out 'r'
0046 | out ' '
0048 | out 'O'
0050 | out 'S'
0052 | out 'C'
0054 | out 'O'
0056 | out 'N'
0058 | out ' '
0060 | out '2'
0062 | out '0'
0064 | out '1'
0066 | out '2'
0068 | out ' '
0070 | out 'C'
0072 | out 'h'
0074 | out 'a'
0076 | out 'l'
0078 | out 'l'
0080 | out 'e'
0082 | out 'n'
0084 | out 'g'
0086 | out 'e'
0088 | out '!'
0090 | out '\n' "Welcome to the Synacor OSCON 2012 Challenge!"
0092 | out 'P'
0094 | out 'l'
0096 | out 'e'
0098 | out 'a'
0100 | out 's'
0102 | out 'e'
0104 | out ' '
0106 | out 'r'
0108 | out 'e'
0110 | out 'c'
0112 | out 'o'
0114 | out 'r'
0116 | out 'd'
0118 | out ' '
0120 | out 'y'
0122 | out 'o'
0124 | out 'u'
0126 | out 'r'
0128 | out ' '
0130 | out 'p'
0132 | out 'r'
0134 | out 'o'
0136 | out 'g'
0138 | out 'r'
0140 | out 'e'
0142 | out 's'
0144 | out 's'
0146 | out ' '
0148 | out 'b'
0150 | out 'y'
0152 | out ' '
0154 | out 'p'
0156 | out 'u'
0158 | out 't'
0160 | out 't'
0162 | out 'i'
0164 | out 'n'
0166 | out 'g'
0168 | out ' '
0170 | out 'c'
0172 | out 'o'
0174 | out 'd'
0176 | out 'e'
0178 | out 's'
0180 | out ' '
0182 | out 'l'
0184 | out 'i'
0186 | out 'k'
0188 | out 'e'
0190 | out '\n' "Please record your progress by putting codes like"
0192 | out 't'
0194 | out 'h'
0196 | out 'i'
0198 | out 's'
0200 | out ' '
0202 | out 'o'
0204 | out 'n'
0206 | out 'e'
0208 | out ' '
0210 | out 'i'
0212 | out 'n'
0214 | out 't'
0216 | out 'o'
0218 | out ' '
0220 | out 't'
0222 | out 'h'
0224 | out 'e'
0226 | out ' '
0228 | out 'c'
0230 | out 'h'
0232 | out 'a'
0234 | out 'l'
0236 | out 'l'
0238 | out 'e'
0240 | out 'n'
0242 | out 'g'
0244 | out 'e'
0246 | out ' '
0248 | out 'w'
0250 | out 'e'
0252 | out 'b'
0254 | out 's'
0256 | out 'i'
0258 | out 't'
0260 | out 'e'
0262 | out ':'
0264 | out ' '
0266 | out 'I'
0268 | out 'm'
0270 | out 'o'
0272 | out 'F'
0274 | out 'z'
0276 | out 't'
0278 | out 'W'
0280 | out 'Q'
0282 | out 'C'
0284 | out 'v'
0286 | out 'x'
0288 | out 'j'
0290 | out '\n' "this one into the challenge website: ImoFztWQCvxj"
0292 | out '\n'
0294 | out 'E'
0296 | out 'x'
0298 | out 'e'
0300 | out 'c'
0302 | out 'u'
0304 | out 't'
0306 | out 'i'
0308 | out 'n'
0310 | out 'g'
0312 | out ' '
0314 | out 's'
0316 | out 'e'
0318 | out 'l'
0320 | out 'f'
0322 | out '-'
0324 | out 't'
0326 | out 'e'
0328 | out 's'
0330 | out 't'
0332 | out '.'
0334 | out '.'
0336 | out '.'
0338 | out '\n' "Executing self-test..."
0340 | out '\n'
0342 | jmp 369
0344 | out 'j'
0346 | out 'm'
0348 | out 'p'
0350 | out ' '
0352 | out 'f'
0354 | out 'a'
0356 | out 'i'
0358 | out 'l'
0360 | out 's'
0362 | out '\n' "jmp fails"
0364 | halt
0365 | noop
0366 | noop
0367 | noop
0368 | noop
0369 | noop
0370 | noop
0371 | noop
0372 | noop
0373 | noop
0374 | jmp 380
0376 | jmp 390
0378 | jmp 419
0380 | jmp 506
0382 | jmp 446
0384 | jmp 475
0386 | noop
0387 | noop
0388 | noop
0389 | noop
0390 | out 'j'
0392 | out 'm'
0394 | out 'p'
0396 | out ' '
0398 | out 'l'
0400 | out 'a'
0402 | out 'n'
0404 | out 'd'
0406 | out 's'
0408 | out ' '
0410 | out '-'
0412 | out '2'
0414 | out '\n' "jmp lands -2"
0416 | halt
0417 | noop
0418 | noop
0419 | out 'j'
0421 | out 'm'
0423 | out 'p'
0425 | out ' '
0427 | out 'l'
0429 | out 'a'
0431 | out 'n'
0433 | out 'd'
0435 | out 's'
0437 | out ' '
0439 | out '-'
0441 | out '1'
0443 | out '\n' "jmp lands -1"
0445 | halt
0446 | noop
0447 | noop
0448 | out 'j'
0450 | out 'm'
0452 | out 'p'
0454 | out ' '
0456 | out 'l'
0458 | out 'a'
0460 | out 'n'
0462 | out 'd'
0464 | out 's'
0466 | out ' '
0468 | out '+'
0470 | out '1'
0472 | out '\n' "jmp lands +1"
0474 | halt
0475 | noop
0476 | noop
0477 | noop
0478 | noop
0479 | out 'j'
0481 | out 'm'
0483 | out 'p'
0485 | out ' '
0487 | out 'l'
0489 | out 'a'
0491 | out 'n'
0493 | out 'd'
0495 | out 's'
0497 | out ' '
0499 | out '+'
0501 | out '2'
0503 | out '\n' "jmp lands +2"
0505 | halt
0506 | jt 0 1096
0509 | jf 1 1096
0512 | jt 1 517
0515 | jmp 1096
0517 | jf 0 522
0520 | jmp 1096
0522 | jt r0 1115
0525 | jt r1 1115
0528 | jt r2 1115
0531 | jt r3 1115
0534 | jt r4 1115
0537 | jt r5 1115
0540 | jt r6 1115
0543 | jt r7 1115
0546 | r0 = 1
0549 | jf r0 1140
0552 | r0 = 0
0555 | jt r0 1140
0558 | r0 = 1 + 1
0562 | jt r0 586
0565 | out 'n'
0567 | out 'o'
0569 | out ' '
0571 | out 'a'
0573 | out 'd'
0575 | out 'd'
0577 | out ' '
0579 | out 'o'
0581 | out 'p'
0583 | out '\n' "no add op"
0585 | halt
0586 | r1 = r0 == 2
0590 | jt r1 612
0593 | out 'n'
0595 | out 'o'
0597 | out ' '
0599 | out 'e'
0601 | out 'q'
0603 | out ' '
0605 | out 'o'
0607 | out 'p'
0609 | out '\n' "no eq op"
0611 | halt
0612 | push r0
0614 | push r1
0616 | pop r0
0618 | pop r1
0620 | r2 = r1 == 2
0624 | jf r2 1180
0627 | r2 = r0 == 1
0631 | jf r2 1180
0634 | r2 = r1 > r0
0638 | jf r2 1161
0641 | r2 = r0 > r1
0645 | jt r2 1161
0648 | r2 = 42 > 42
0652 | jt r2 1161
0655 | r0 = 28912 & 19626
0659 | r1 = r0 == 16544
0663 | jf r1 1199
0666 | r1 = 28912 | 19626
0670 | r0 = r1 == 31994
0674 | jt r0 706
0677 | out 'n'
0679 | out 'o'
0681 | out ' '
0683 | out 'b'
0685 | out 'i'
0687 | out 't'
0689 | out 'w'
0691 | out 'i'
0693 | out 's'
0695 | out 'e'
0697 | out ' '
0699 | out 'o'
0701 | out 'r'
0703 | out '\n' "no bitwise or"
0705 | halt
0706 | r0 = !0
0709 | r1 = r0 == 32767
0713 | jf r1 1230
0716 | r0 = !21845
0719 | r1 = r0 == 10922
0723 | jf r1 1230
0726 | call 1307
0728 | jmp 1311
0730 | pop r0
0732 | r1 = r0 == 730
0736 | jt r1 1311
0739 | r1 = r0 == 728
0743 | jf r1 1311
0746 | r0 = 1309
0749 | call r0 1309
0751 | jmp 1311
0753 | pop r0
0755 | r1 = r0 == 753
0759 | jt r1 1311
0762 | r1 = r0 == 751
0766 | jf r1 1311
0769 | r0 = 32767 + 32767
0773 | r1 = r0 == 32766
0777 | jf r1 1334
0780 | r1 = 32766 == r0
0784 | jf r1 1334
0787 | r0 = 16384 + 16384
0791 | jt r0 1334
0794 | r0 = 16384 + 16384
0798 | jt r0 1334
0801 | r0 = 6 * 9
0805 | r1 = r0 == 42
0809 | jt r1 1403
0812 | r1 = r0 == 54
0816 | jf r1 1436
0819 | r0 = 12345 * 32123
0823 | r1 = r0 == 99
0827 | jf r1 1334
0830 | r0 = 6 % 3
0834 | r1 = r0 == 0
0838 | jf r1 1459
0841 | r0 = 70 % 6
0845 | r1 = r0 == 4
0849 | jf r1 1459
0852 | r0 = 32766 * 15
0856 | r1 = r0 == 32738
0860 | jf r1 1334
0863 | jmp 867
0865 | [30000]
0866 | [10000]
0867 | rmem r0 865
0870 | r1 = r0 == 20000
0874 | jf r1 1261
0877 | r2 = 865 + 1
0881 | rmem r0 r2
0884 | r1 = r0 == 10000
0888 | jf r1 1261
0891 | r0 = 865
0894 | wmem r0 30000
0897 | rmem r2 r0
0900 | r1 = r2 == 30000
0904 | jf r1 1284
0907 | call 1745(decrypt-data)
0909 | rmem r0 6090
0912 | r1 = r0 == 11
0916 | jf r1 1261
0919 | r2 = 6090 + 1
0923 | rmem r0 r2
0926 | r1 = r0 == 116
0930 | jf r1 1261
0933 | wmem r2 84
0936 | rmem r0 r2
0939 | r1 = r0 == 116
0943 | jt r1 1284
0946 | r1 = r0 == 84
0950 | jf r1 1284
0953 | wmem 959 21
0956 | wmem 960 7
0959 | noop
0960 | jt 19 1000
0963 | out 'w'
0965 | out 'm'
0967 | out 'e'
0969 | out 'm'
0971 | out ' '
0973 | out 'o'
0975 | out 'p'
0977 | out 'w'
0979 | out 'r'
0981 | out 'i'
0983 | out 't'
0985 | out 'e'
0987 | out ' '
0989 | out 'f'
0991 | out 'a'
0993 | out 'i'
0995 | out 'l'
0997 | out '\n' "wmem opwrite fail"
0999 | halt
1000 | r1 = 10 + 6102
1004 | r1 = r1 + 1
1008 | rmem r2 6138
1011 | r2 = r2 + 6138
1015 | r0 = 6138
1018 | r0 = r0 + 1
1022 | r3 = r0 > r2
1026 | jt r3 1045
1029 | rmem r4 r0
1032 | wmem r1 r4
1035 | r0 = r0 + 1
1039 | r1 = r1 + 1
1043 | jmp 1022
1045 | rmem r0 6102
1048 | rmem r1 6121
1051 | r0 = r0 + r1
1055 | r0 = r0 + 1
1059 | wmem 6102 r0
1062 | wmem 6121 44
1065 | r0 = 6102
1068 | call 1540(print) "self-test complete, all tests pass\n "
1070 | push r0
1072 | push r1
1074 | push r2
1076 | r0 = 26865
1079 | r1 = 1553
1082 | r2 = 16691 + 11842
1086 | call 1480(map) "The self-test completion code is: BNCyODLfQkIl\n\n"
1088 | pop r2
1090 | pop r1
1092 | pop r0
1094 | jmp 2756(game-loop)
1096 | out 'n'
1098 | out 'o'
1100 | out ' '
1102 | out 'j'
1104 | out 't'
1106 | out '/'
1108 | out 'j'
1110 | out 'f'
1112 | out '\n' "no jt/jf"
1114 | halt
1115 | out 'n'
1117 | out 'o'
1119 | out 'n'
1121 | out 'z'
1123 | out 'e'
1125 | out 'r'
1127 | out 'o'
1129 | out ' '
1131 | out 'r'
1133 | out 'e'
1135 | out 'g'
1137 | out '\n' "nonzero reg"
1139 | halt
1140 | out 'n'
1142 | out 'o'
1144 | out ' '
1146 | out 's'
1148 | out 'e'
1150 | out 't'
1152 | out ' '
1154 | out 'o'
1156 | out 'p'
1158 | out '\n' "no set op"
1160 | halt
1161 | out 'n'
1163 | out 'o'
1165 | out ' '
1167 | out 'g'
1169 | out 't'
1171 | out ' '
1173 | out 'o'
1175 | out 'p'
1177 | out '\n' "no gt op"
1179 | halt
1180 | out 'n'
1182 | out 'o'
1184 | out ' '
1186 | out 's'
1188 | out 't'
1190 | out 'a'
1192 | out 'c'
1194 | out 'k'
1196 | out '\n' "no stack"
1198 | halt
1199 | out 'n'
1201 | out 'o'
1203 | out ' '
1205 | out 'b'
1207 | out 'i'
1209 | out 't'
1211 | out 'w'
1213 | out 'i'
1215 | out 's'
1217 | out 'e'
1219 | out ' '
1221 | out 'a'
1223 | out 'n'
1225 | out 'd'
1227 | out '\n' "no bitwise and"
1229 | halt
1230 | out 'n'
1232 | out 'o'
1234 | out ' '
1236 | out 'b'
1238 | out 'i'
1240 | out 't'
1242 | out 'w'
1244 | out 'i'
1246 | out 's'
1248 | out 'e'
1250 | out ' '
1252 | out 'n'
1254 | out 'o'
1256 | out 't'
1258 | out '\n' "no bitwise not"
1260 | halt
1261 | out 'n'
1263 | out 'o'
1265 | out ' '
1267 | out 'r'
1269 | out 'm'
1271 | out 'e'
1273 | out 'm'
1275 | out ' '
1277 | out 'o'
1279 | out 'p'
1281 | out '\n' "no rmem op"
1283 | halt
1284 | out 'n'
1286 | out 'o'
1288 | out ' '
1290 | out 'w'
1292 | out 'm'
1294 | out 'e'
1296 | out 'm'
1298 | out ' '
1300 | out 'o'
1302 | out 'p'
1304 | out '\n' "no wmem op"
1306 | halt

map:
1480 | push r0
1482 | push r3
1484 | push r4
1486 | push r5
1488 | push r6
1490 | r6 = r0
1493 | r5 = r1
1496 | rmem r4 r0
1499 | r1 = 0
1502 | r3 = 1 + r1
1506 | r0 = r3 > r4
1510 | jt r0 1529
1513 | r3 = r3 + r6
1517 | rmem r0 r3
1520 | call r5 1550(putc), 1553(xor-putc), 1627, 1641, 1670, 5836(print-list-item), 5868, 5915, 5986
1522 | r1 = r1 + 1
1526 | jt r1 1502
1529 | pop r6
1531 | pop r5
1533 | pop r4
1535 | pop r3
1537 | pop r0
1539 | ret

print:
1540 | push r1
1542 | r1 = 1550
1545 | call 1480(map)
1547 | pop r1
1549 | ret

putc:
1550 | out r0
1552 | ret

xor-putc:
1553 | push r1
1555 | r1 = r2
1558 | call 2147(xor)
1560 | out r0
1562 | pop r1
1564 | ret

1565 | push r1
1567 | push r3
1569 | rmem r3 r0
1572 | jf r3 1585
1575 | call 1480(map)
1577 | jt r1 1585
1580 | r0 = r2
1583 | jmp 1588
1585 | r0 = 32767
1588 | pop r3
1590 | pop r1
1592 | ret

1593 | push r1
1595 | push r2
1597 | r2 = r1
1600 | r1 = 1627
1603 | call 1565
1605 | pop r2
1607 | pop r1
1609 | ret

1610 | push r1
1612 | push r2
1614 | r2 = r1
1617 | r1 = 1670
1620 | call 1565
1622 | pop r2
1624 | pop r1
1626 | ret

1627 | r0 = r0 == r2
1631 | jf r0 1640
1634 | r2 = r1
1637 | r1 = 32767
1640 | ret

1641 | push r3
1643 | r3 = r2 + 1
1647 | r3 = r3 + r1
1651 | rmem r3 r3
1654 | r3 = r0 == r3
1658 | jt r3 1667
1661 | r2 = r1
1664 | r1 = 32767
1667 | pop r3
1669 | ret

1670 | push r1
1672 | r1 = r2
1675 | call 1689(strcmp)
1677 | pop r1
1679 | jf r0 1688
1682 | r2 = r1
1685 | r1 = 32767
1688 | ret

strcmp:
1689 | push r1
1691 | push r2
1693 | push r3
1695 | push r4
1697 | rmem r3 r0
1700 | rmem r4 r1
1703 | r2 = r3 == r4
1707 | jf r2 1733
1710 | r2 = r3 | r4
1714 | jf r2 1728
1717 | r2 = r1
1720 | r1 = 1641
1723 | call 1480(map)
1725 | jf r1 1733
1728 | r0 = 1
1731 | jmp 1736
1733 | r0 = 0
1736 | pop r4
1738 | pop r3
1740 | pop r2
1742 | pop r1
1744 | ret

decrypt-data:
1745 | push r0
1747 | push r1
1749 | r1 = 6090
1752 | rmem r0 r1
1755 | push r1
1757 | r1 = r1 * r1
1761 | call 2147(xor)
1763 | r1 = 16724
1766 | call 2147(xor)
1768 | pop r1
1770 | wmem r1 r0
1773 | r1 = r1 + 1
1777 | r0 = 29957 == r1
1781 | jf r0 1752
1784 | pop r1
1786 | pop r0
1788 | ret

read-user-input:
1789 | push r0
1791 | push r2
1793 | push r3
1795 | push r4
1797 | push r5
1799 | r2 = r1 + r0
1803 | r0 = r1
1806 | r5 = 0
1809 | r0 = r0 + 1
1813 | r3 = r0 > r2
1817 | jt r3 1838
1820 | in r4
1822 | r3 = r4 == 10
1826 | jt r3 1838
1829 | wmem r0 r4
1832 | r5 = r5 + 1
1836 | jmp 1809
1838 | wmem r1 r5
1841 | r3 = r4 == 10
1845 | jt r3 1852
1848 | in r4
1850 | jmp 1841
1852 | pop r5
1854 | pop r4
1856 | pop r3
1858 | pop r2
1860 | pop r0
1862 | ret

print-code:
1863 | push r3
1865 | push r4
1867 | push r5
1869 | push r6
1871 | r6 = 1
1874 | r4 = r3 + r6
1878 | rmem r4 r4
1881 | r5 = 6147 + r6
1885 | wmem r5 r4
1888 | r6 = r6 + 1
1892 | rmem r5 6147[code-scratch]
1895 | r4 = r6 > r5
1899 | jf r4 1874
1902 | r3 = 0
1905 | r4 = 0
1908 | rmem r5 6147[code-scratch]
1911 | r5 = r4 % r5
1915 | r5 = r5 + 6147
1919 | r5 = r5 + 1
1923 | rmem r6 r5
1926 | r6 = r6 * 5249
1930 | r6 = r6 + 12345
1934 | wmem r5 r6
1937 | push r0
1939 | push r1
1941 | r1 = r6
1944 | call 2147(xor)
1946 | r6 = r0
1949 | pop r1
1951 | pop r0
1953 | rmem r5 r1
1956 | r6 = r6 % r5
1960 | r6 = r6 + 1
1964 | r5 = r6 > r2
1968 | jt r5 1974
1971 | r3 = 1
1974 | r6 = r6 + r1
1978 | rmem r6 r6
1981 | r4 = r4 + 1
1985 | r5 = r4 + 6151
1989 | wmem r5 r6
1992 | rmem r5 6151[code-buffer]
1995 | r5 = r4 == r5
1999 | jf r5 1908
2002 | jf r3 1902
2005 | push r0
2007 | r0 = 6151
2010 | call 1540(print) "\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0} "
2012 | pop r0
2014 | pop r6
2016 | pop r5
2018 | pop r4
2020 | pop r3
2022 | ret

print-number:
2023 | push r0
2025 | push r1
2027 | push r2
2029 | push r3
2031 | push r4
2033 | push r5
2035 | r2 = 1
2038 | r5 = 0
2041 | jf r0 2114
2044 | r4 = r2 == 10000
2048 | r3 = r0
2051 | jt r4 2062
2054 | r1 = r2 * 10
2058 | r3 = r0 % r1
2062 | r4 = 0
2065 | r2 = r2 * 32767
2069 | jf r3 2082
2072 | r4 = r4 + 1
2076 | r3 = r3 + r2
2080 | jmp 2069
2082 | r2 = r2 * 32767
2086 | r3 = r4 * r2
2090 | r3 = r3 * 32767
2094 | r0 = r0 + r3
2098 | r4 = r4 + 48
2102 | r2 = r2 * 10
2106 | r5 = r5 + 1
2110 | push r4
2112 | jmp 2041
2114 | jt r5 2121
2117 | out '0'
2119 | jmp 2134
2121 | jf r5 2134
2124 | pop r0
2126 | out r0
2128 | r5 = r5 + 32767
2132 | jmp 2121
2134 | pop r5
2136 | pop r4
2138 | pop r3
2140 | pop r2
2142 | pop r1
2144 | pop r0
2146 | ret

xor:
2147 | push r1
2149 | push r2
2151 | r2 = r0 & r1
2155 | r2 = !r2
2158 | r0 = r0 | r1
2162 | r0 = r0 & r2
2166 | pop r2
2168 | pop r1
2170 | ret

add-with-overflow-check:
2171 | r0 = r0 + r1
2175 | r1 = r1 > r0
2179 | ret

sub-with-overflow-check:
2180 | push r2
2182 | r2 = r1 > r0
2186 | r1 = r1 * 32767
2190 | r0 = r0 + r1
2194 | r1 = r2
2197 | pop r2
2199 | ret

mul-with-overflow-check:
2200 | jf r0 2263
2203 | jf r1 2263
2206 | push r2
2208 | push r3
2210 | r2 = r1 > r0
2214 | jt r2 2226
2217 | r2 = r0
2220 | r0 = r1
2223 | r1 = r2
2226 | r2 = r0
2229 | r0 = 0
2232 | r0 = r0 + r1
2236 | r3 = r1 > r0
2240 | jt r3 2255
2243 | r2 = r2 + 32767
2247 | jt r2 2232
2250 | r1 = 0
2253 | jmp 2258
2255 | r1 = 1
2258 | pop r3
2260 | pop r2
2262 | ret
2263 | r0 = 0
2266 | r1 = 0
2269 | ret

rotate-left:
2270 | push r1
2272 | push r2
2274 | jf r1 2298
2277 | r1 = r1 + 32767
2281 | r2 = r0 & 16384
2285 | r0 = r0 * 2
2289 | jf r2 2274
2292 | r0 = r0 | 1
2296 | jmp 2274
2298 | pop r2
2300 | pop r1
2302 | ret

power-of-two:
2303 | push r1
2305 | r1 = r0 > 14
2309 | jt r1 2331
2312 | r1 = r0
2315 | r0 = 1
2318 | jf r1 2334
2321 | r1 = r1 + 32767
2325 | r0 = r0 * 2
2329 | jmp 2318
2331 | r0 = 32767
2334 | pop r1
2336 | ret

game-loop:
2756 | push r0
2758 | push r1
2760 | push r2
2762 | push r3
2764 | rmem r1 2754[current-room]
2767 | rmem r0 2755[prev-room]
2770 | r0 = r0 == r1
2774 | jt r0 2792
2777 | rmem r0 2754[current-room]
2780 | r0 = r0 + 4
2784 | rmem r0 r0
2787 | jf r0 2792
2790 | call r0 3678, 3723(eaten-by-grue), 3764(reset-maze-bitmask), 3768(set-maze-bitmask-1), 3778(set-maze-bitmask-2), 3788(set-maze-bitmask-4), 3798(set-maze-bitmask-8), 3808(set-maze-bitmask-16), 3818(set-maze-bitmask-32), 3828(maze-escape), 3915(exit-ruins-north), 3980(enter-orb-symbol-room-1), 3997(enter-orb-number-room-1), 4014(enter-orb-symbol-room-2), 4031(enter-orb-vault-room), 4050(enter-orb-number-room-2), 4067(enter-orb-symbol-room-3), 4084(enter-orb-number-room-3), 4101(enter-orb-symbol-room-4), 4118(enter-orb-symbol-room-5), 4135(enter-orb-number-room-4), 4152(enter-orb-symbol-room-6), 4169(enter-orb-number-room-5), 4186(enter-vault-antechamber), 4189(enter-orb-symbol-room-7), 4206(enter-orb-number-room-6), 4223(enter-orb-symbol-room-8), 4633(reset-orb), 4712(enter-vault)
2792 | rmem r1 2754[current-room]
2795 | rmem r0 2755[prev-room]
2798 | r0 = r0 == r1
2802 | jt r0 2813
2805 | r0 = 25988
2808 | wmem r0 0
2811 | call 2986(look)
2813 | wmem 2755[prev-room] r1
2816 | push r0
2818 | push r1
2820 | push r2
2822 | r0 = 27428
2825 | r1 = 1553
2828 | r2 = 3958 + 20602
2832 | call 1480(map) "\nWhat do you do?\n"
2834 | pop r2
2836 | pop r1
2838 | pop r0
2840 | r0 = 32
2843 | r1 = 25988
2846 | call 1789(read-user-input)
2848 | out '\n'
2850 | out '\n'
2852 | r0 = 25988
2855 | r1 = 32
2858 | call 1593
2860 | r1 = r0 == 32767
2864 | jf r1 2870
2867 | rmem r0 25988[input-buffer]
2870 | r2 = r0
2873 | rmem r1 25988[input-buffer]
2876 | push r1
2878 | wmem 25988[input-buffer] r2
2881 | r0 = 27412
2884 | r1 = 25988
2887 | call 1610
2889 | pop r1
2891 | wmem 25988[input-buffer] r1
2894 | r1 = r0 == 32767
2898 | jf r1 2907
2901 | r0 = 0
2904 | r2 = 0
2907 | r1 = 27420 + 1
2911 | r1 = r1 + r0
2915 | rmem r1 r1
2918 | rmem r3 25988[input-buffer]
2921 | r3 = r3 == r2
2925 | jt r3 2966
2928 | r0 = r2 * 32767
2932 | rmem r3 25988[input-buffer]
2935 | r3 = r0 + r3
2939 | jf r2 2946
2942 | r3 = r3 + 32767
2946 | r3 = r3 % 32
2950 | r0 = 25988 + r2
2954 | jf r2 2961
2957 | r0 = r0 + 1
2961 | wmem r0 r3
2964 | jmp 2972
2966 | r0 = 25988
2969 | wmem r0 0
2972 | call r1 2986(look), 3267(other-action), 3422(take-item), 3590(use-item)
2974 | jt r1 2764
2977 | pop r3
2979 | pop r2
2981 | pop r1
2983 | pop r0
2985 | ret

look:
2986 | push r0
2988 | push r1
2990 | push r2
2992 | rmem r1 r0
2995 | jf r1 3054
2998 | call 5943
3000 | jf r0 3028
3003 | push r0
3005 | call 6012
3007 | r1 = r0
3010 | pop r0
3012 | jf r1 3028
3015 | r1 = r0 + 1
3019 | rmem r0 r1
3022 | call 1540(print)
3024 | out '\n'
3026 | jmp 3260
3028 | push r0
3030 | push r1
3032 | push r2
3034 | r0 = 27446
3037 | r1 = 1553
3040 | r2 = 10341 + 18451
3044 | call 1480(map) "You see no such item.\n"
3046 | pop r2
3048 | pop r1
3050 | pop r0
3052 | jmp 3260
3054 | rmem r0 2754[current-room]
3057 | push r0
3059 | out '='
3061 | out '='
3063 | out ' '
3065 | r0 = r0 + 0
3069 | rmem r0 r0
3072 | call 1540(print)
3074 | out ' '
3076 | out '='
3078 | out '='
3080 | out '\n' " =="
3082 | pop r0
3084 | push r0
3086 | r0 = r0 + 1
3090 | rmem r0 r0
3093 | rmem r1 r0
3096 | r1 = r1 == 2
3100 | jf r1 3126
3103 | push r0
3105 | r0 = 2702
3108 | call 6012
3110 | r1 = r0
3113 | pop r0
3115 | r0 = r0 + 1
3119 | r0 = r0 + r1
3123 | rmem r0 r0
3126 | call 1540(print)
3128 | out '\n'
3130 | pop r0
3132 | push r0
3134 | call 5845
3136 | jf r0 3168
3139 | push r0
3141 | push r1
3143 | push r2
3145 | r0 = 27469
3148 | r1 = 1553
3151 | r2 = 3231 + 7496
3155 | call 1480(map) "\nThings of interest here:\n"
3157 | pop r2
3159 | pop r1
3161 | pop r0
3163 | rmem r2 2754[current-room]
3166 | call 5898
3168 | pop r0
3170 | push r0
3172 | r0 = r0 + 2
3176 | rmem r0 r0
3179 | rmem r0 r0
3182 | r2 = r0 == 1
3186 | out '\n'
3188 | out 'T'
3190 | out 'h'
3192 | out 'e'
3194 | out 'r'
3196 | out 'e'
3198 | out ' '
3200 | jt r2 3211
3203 | out 'a'
3205 | out 'r'
3207 | out 'e'
3209 | jmp 3215
3211 | out 'i'
3213 | out 's'
3215 | out ' '
3217 | call 2023(print-number)
3219 | out ' '
3221 | out 'e'
3223 | out 'x'
3225 | out 'i'
3227 | out 't'
3229 | r2 = r0 == 1
3233 | jt r2 3238
3236 | out 's'
3238 | out ':'
3240 | out '\n' "s:"
3242 | pop r0
3244 | push r0
3246 | r0 = r0 + 2
3250 | rmem r0 r0
3253 | r1 = 5836
3256 | call 1480(map)
3258 | pop r0
3260 | pop r2
3262 | pop r1
3264 | pop r0
3266 | ret

other-action:
3267 | push r0
3269 | push r1
3271 | push r2
3273 | r1 = r0
3276 | rmem r0 2754[current-room]
3279 | r0 = r0 + 2
3283 | rmem r0 r0
3286 | call 1610
3288 | r2 = r0 == 32767
3292 | jt r2 3324
3295 | rmem r2 2754[current-room]
3298 | r2 = r2 + 3
3302 | rmem r2 r2
3305 | r2 = r2 + 1
3309 | r2 = r2 + r0
3313 | rmem r2 r2
3316 | wmem 2754[current-room] r2
3319 | wmem 2755[prev-room] 0
3322 | jmp 3348
3324 | push r0
3326 | push r1
3328 | push r2
3330 | r0 = 27496
3333 | r1 = 1553
3336 | r2 = 11010 + 5751
3340 | call 1480(map) "I don\'t understand; try \'help\' for instructions.\n"
3342 | pop r2
3344 | pop r1
3346 | pop r0
3348 | pop r2
3350 | pop r1
3352 | pop r0
3354 | ret

take-item:
3422 | push r0
3424 | push r1
3426 | push r2
3428 | call 5943
3430 | jf r0 3479
3433 | r1 = r0 + 2
3437 | rmem r0 r1
3440 | rmem r2 2754[current-room]
3443 | r2 = r0 == r2
3447 | jf r2 3479
3450 | wmem r1 0
3453 | push r0
3455 | push r1
3457 | push r2
3459 | r0 = 28068
3462 | r1 = 1553
3465 | r2 = 380 + 996
3469 | call 1480(map) "Taken.\n"
3471 | pop r2
3473 | pop r1
3475 | pop r0
3477 | jmp 3503
3479 | push r0
3481 | push r1
3483 | push r2
3485 | r0 = 28076
3488 | r1 = 1553
3491 | r2 = 4508 + 20821
3495 | call 1480(map) "You see no such item here.\n"
3497 | pop r2
3499 | pop r1
3501 | pop r0
3503 | pop r2
3505 | pop r1
3507 | pop r0
3509 | ret

use-item:
3590 | push r0
3592 | push r1
3594 | call 5943
3596 | jf r0 3623
3599 | r1 = r0 + 2
3603 | rmem r1 r1
3606 | jt r1 3623
3609 | r1 = r0 + 3
3613 | rmem r1 r1
3616 | jf r1 3649
3619 | call r1 4742(use-tablet), 4821(use-can), 4907(use-lantern), 5382(use-red-coin), 5399(use-corroded-coin), 5416(use-shiny-coin), 5433(use-concave-coin), 5450(use-blue-coin), 5467(use-teleporter), 5743(use-mirror)
3621 | jmp 3673
3623 | push r0
3625 | push r1
3627 | push r2
3629 | r0 = 28149
3632 | r1 = 1553
3635 | r2 = 526 + 83
3639 | call 1480(map) "You can\'t find that in your pack.\n"
3641 | pop r2
3643 | pop r1
3645 | pop r0
3647 | jmp 3673
3649 | push r0
3651 | push r1
3653 | push r2
3655 | r0 = 28184
3658 | r1 = 1553
3661 | r2 = 3367 + 5963
3665 | call 1480(map) "You aren\'t sure how to use that.\n"
3667 | pop r2
3669 | pop r1
3671 | pop r0
3673 | pop r1
3675 | pop r0
3677 | ret

3678 | push r0
3680 | push r1
3682 | push r2
3684 | r0 = 2702
3687 | call 6012
3689 | jt r0 3716
3692 | r0 = 2698 + 2
3696 | wmem r0 32767
3699 | r0 = 2702 + 2
3703 | wmem r0 32767
3706 | r0 = 2694 + 2
3710 | wmem r0 32767
3713 | wmem 2754[current-room] 2670
3716 | pop r2
3718 | pop r1
3720 | pop r0
3722 | ret

eaten-by-grue:
3723 | push r0
3725 | push r1
3727 | push r2
3729 | r0 = 28218
3732 | r1 = 1553
3735 | r2 = 14633 + 15953
3739 | call 1480(map) "You have been eaten by a grue.\n"
3741 | pop r2
3743 | pop r1
3745 | pop r0
3747 | halt
3748 | [0]

set-maze-bitmask:
3749 | push r1
3751 | rmem r1 3748
3754 | r1 = r1 | r0
3758 | wmem 3748 r1
3761 | pop r1
3763 | ret

reset-maze-bitmask:
3764 | wmem 3748 0
3767 | ret

set-maze-bitmask-1:
3768 | push r0
3770 | r0 = 1
3773 | call 3749(set-maze-bitmask)
3775 | pop r0
3777 | ret

set-maze-bitmask-2:
3778 | push r0
3780 | r0 = 2
3783 | call 3749(set-maze-bitmask)
3785 | pop r0
3787 | ret

set-maze-bitmask-4:
3788 | push r0
3790 | r0 = 4
3793 | call 3749(set-maze-bitmask)
3795 | pop r0
3797 | ret

set-maze-bitmask-8:
3798 | push r0
3800 | r0 = 8
3803 | call 3749(set-maze-bitmask)
3805 | pop r0
3807 | ret

set-maze-bitmask-16:
3808 | push r0
3810 | r0 = 16
3813 | call 3749(set-maze-bitmask)
3815 | pop r0
3817 | ret

set-maze-bitmask-32:
3818 | push r0
3820 | r0 = 32
3823 | call 3749(set-maze-bitmask)
3825 | pop r0
3827 | ret

maze-escape:
3828 | push r0
3830 | push r1
3832 | push r2
3834 | push r3
3836 | r0 = 64
3839 | call 3749(set-maze-bitmask)
3841 | push r0
3843 | push r1
3845 | push r2
3847 | r0 = 28250
3850 | r1 = 1553
3853 | r2 = 7662 + 19058
3857 | call 1480(map) "Chiseled on the wall of one of the passageways, you see:\n\n "
3859 | pop r2
3861 | pop r1
3863 | pop r0
3865 | rmem r0 3748
3868 | r1 = 25880
3871 | r2 = 32767
3874 | r3 = 28313
3877 | call 1863(print-code)
3879 | push r0
3881 | push r1
3883 | push r2
3885 | r0 = 28317
3888 | r1 = 1553
3891 | r2 = 12862 + 39
3895 | call 1480(map) "\n\nYou take note of this and keep walking.\n\n"
3897 | pop r2
3899 | pop r1
3901 | pop r0
3903 | wmem 2754[current-room] 2439
3906 | pop r3
3908 | pop r2
3910 | pop r1
3912 | pop r0
3914 | ret

exit-ruins-north:
3915 | push r0
3917 | push r1
3919 | rmem r0 2484
3922 | rmem r1 27115[placed-coins]
3925 | r0 = r0 == r1
3929 | jt r0 3962
3932 | push r0
3934 | push r1
3936 | push r2
3938 | r0 = 28361
3941 | r1 = 1553
3944 | r2 = 2737 + 22709
3948 | call 1480(map) "That door is locked.\n"
3950 | pop r2
3952 | pop r1
3954 | pop r0
3956 | wmem 2754[current-room] 2479
3959 | wmem 2755[prev-room] 2479
3962 | pop r1
3964 | pop r0
3966 | ret

enter-orb-symbol-room-1:
3980 | push r0
3982 | push r1
3984 | r0 = 2
3987 | r1 = 0
3990 | call 4240(orb-enter-symbol-room)
3992 | pop r1
3994 | pop r0
3996 | ret

enter-orb-number-room-1:
3997 | push r0
3999 | push r1
4001 | r0 = 8
4004 | r1 = 1
4007 | call 4301(orb-enter-number-room)
4009 | pop r1
4011 | pop r0
4013 | ret

enter-orb-symbol-room-2:
4014 | push r0
4016 | push r1
4018 | r0 = 1
4021 | r1 = 2
4024 | call 4240(orb-enter-symbol-room)
4026 | pop r1
4028 | pop r0
4030 | ret

enter-orb-vault-room:
4031 | push r0
4033 | push r1
4035 | r0 = 1
4038 | r1 = 3
4041 | call 4301(orb-enter-number-room)
4043 | call 4555(vault-door)
4045 | pop r1
4047 | pop r0
4049 | ret

enter-orb-number-room-2:
4050 | push r0
4052 | push r1
4054 | r0 = 4
4057 | r1 = 4
4060 | call 4301(orb-enter-number-room)
4062 | pop r1
4064 | pop r0
4066 | ret

enter-orb-symbol-room-3:
4067 | push r0
4069 | push r1
4071 | r0 = 2
4074 | r1 = 5
4077 | call 4240(orb-enter-symbol-room)
4079 | pop r1
4081 | pop r0
4083 | ret

enter-orb-number-room-3:
4084 | push r0
4086 | push r1
4088 | r0 = 11
4091 | r1 = 6
4094 | call 4301(orb-enter-number-room)
4096 | pop r1
4098 | pop r0
4100 | ret

enter-orb-symbol-room-4:
4101 | push r0
4103 | push r1
4105 | r0 = 2
4108 | r1 = 7
4111 | call 4240(orb-enter-symbol-room)
4113 | pop r1
4115 | pop r0
4117 | ret

enter-orb-symbol-room-5:
4118 | push r0
4120 | push r1
4122 | r0 = 0
4125 | r1 = 8
4128 | call 4240(orb-enter-symbol-room)
4130 | pop r1
4132 | pop r0
4134 | ret

enter-orb-number-room-4:
4135 | push r0
4137 | push r1
4139 | r0 = 4
4142 | r1 = 9
4145 | call 4301(orb-enter-number-room)
4147 | pop r1
4149 | pop r0
4151 | ret

enter-orb-symbol-room-6:
4152 | push r0
4154 | push r1
4156 | r0 = 1
4159 | r1 = 10
4162 | call 4240(orb-enter-symbol-room)
4164 | pop r1
4166 | pop r0
4168 | ret

enter-orb-number-room-5:
4169 | push r0
4171 | push r1
4173 | r0 = 18
4176 | r1 = 11
4179 | call 4301(orb-enter-number-room)
4181 | pop r1
4183 | pop r0
4185 | ret

enter-vault-antechamber:
4186 | call 4633(reset-orb)
4188 | ret

enter-orb-symbol-room-7:
4189 | push r0
4191 | push r1
4193 | r0 = 1
4196 | r1 = 12
4199 | call 4240(orb-enter-symbol-room)
4201 | pop r1
4203 | pop r0
4205 | ret

enter-orb-number-room-6:
4206 | push r0
4208 | push r1
4210 | r0 = 9
4213 | r1 = 13
4216 | call 4301(orb-enter-number-room)
4218 | pop r1
4220 | pop r0
4222 | ret

enter-orb-symbol-room-8:
4223 | push r0
4225 | push r1
4227 | r0 = 2
4230 | r1 = 14
4233 | call 4240(orb-enter-symbol-room)
4235 | pop r1
4237 | pop r0
4239 | ret

orb-enter-symbol-room:
4240 | push r0
4242 | push r1
4244 | push r2
4246 | r2 = 2738 + 2
4250 | rmem r2 r2
4253 | jt r2 4294
4256 | call 4427
4258 | wmem 3973 r0
4261 | r1 = r0 + 3967
4265 | rmem r1 r1
4268 | r0 = 26038
4271 | call 1540(print) "As you enter the room, the symbol on the floor briefly flashes "
4273 | r0 = r1
4276 | call 1540(print)
4278 | r0 = 26102
4281 | call 1540(print) ". The orb begins subtly glowing "
4283 | r0 = r1
4286 | call 1540(print)
4288 | out '.'
4290 | out '\n' "."
4292 | out '\n'
4294 | pop r2
4296 | pop r1
4298 | pop r0
4300 | ret

orb-enter-number-room:
4301 | push r0
4303 | push r1
4305 | push r2
4307 | r2 = 2738 + 2
4311 | rmem r2 r2
4314 | jt r2 4420
4317 | call 4427
4319 | push r0
4321 | rmem r0 3973
4324 | r1 = r0 + 3967
4328 | rmem r1 r1
4331 | r0 = 26136
4334 | call 1540(print) "As you enter the room, the orb briefly flashes "
4336 | r0 = r1
4339 | call 1540(print)
4341 | r0 = 26184
4344 | call 1540(print) ". The number on the floor vibrates strangely beneath your feet. "
4346 | pop r0
4348 | r1 = r0
4351 | rmem r0 3974
4354 | rmem r2 3973
4357 | r2 = r2 + 3970
4361 | rmem r2 r2
4364 | call r2 2171(add-with-overflow-check), 2180(sub-with-overflow-check), 2200(mul-with-overflow-check)
4366 | jt r1 4413
4369 | rmem r1 3974
4372 | wmem 3974 r0
4375 | r2 = r0 > r1
4379 | jf r2 4391
4382 | push r0
4384 | r0 = 26249
4387 | call 1540(print) " The orb seems to get heavier. "
4389 | pop r0
4391 | r2 = r1 > r0
4395 | jf r2 4407
4398 | push r0
4400 | r0 = 26281
4403 | call 1540(print) " The orb seems to get lighter. "
4405 | pop r0
4407 | out '\n'
4409 | out '\n'
4411 | jmp 4420
4413 | call 4682(reset-orb-data)
4415 | r0 = 26313
4418 | call 1540(print) " The orb shatters!\n\n "
4420 | pop r2
4422 | pop r1
4424 | pop r0
4426 | ret

4427 | push r0
4429 | push r1
4431 | push r2
4433 | push r3
4435 | push r4
4437 | push r5
4439 | rmem r5 3975
4442 | r3 = r5 > 29999
4446 | jt r3 4456
4449 | r5 = r5 + 1
4453 | wmem 3975 r5
4456 | r3 = r0
4459 | r4 = r1
4462 | r0 = r5 + 2
4466 | call 2303(power-of-two)
4468 | rmem r1 3976
4471 | r0 = r1 | r0
4475 | r1 = r4
4478 | call 2270(rotate-left)
4480 | wmem 3976 r0
4483 | r0 = 3977
4486 | r1 = r5 + 2
4490 | r2 = r4
4493 | call 4537
4495 | r0 = 3978
4498 | r1 = r5 * r5
4502 | r2 = r4 * r4
4506 | call 4537
4508 | r0 = 3979
4511 | r1 = 13
4514 | r2 = r3 * 9
4518 | r2 = r2 * r2
4522 | call 4537
4524 | pop r5
4526 | pop r4
4528 | pop r3
4530 | pop r2
4532 | pop r1
4534 | pop r0
4536 | ret

4537 | push r0
4539 | rmem r0 r0
4542 | call 2270(rotate-left)
4544 | r1 = r2
4547 | call 2147(xor)
4549 | pop r1
4551 | wmem r1 r0
4554 | ret

vault-door:
4555 | push r0
4557 | r0 = 2738 + 2
4561 | rmem r0 r0
4564 | jt r0 4630
4567 | r0 = 26335
4570 | call 1540(print) "As you approach the vault door, "
4572 | rmem r0 3974
4575 | r0 = r0 == 30
4579 | jt r0 4596
4582 | r0 = 26368
4585 | call 1540(print) "the number on the vault door flashes black. "
4587 | r0 = 26412
4590 | call 1540(print) " The orb evaporates out of your hands.\n\n "
4592 | call 4682(reset-orb-data)
4594 | jmp 4630
4596 | r0 = 26454
4599 | call 1540(print) "the number on the vault door flashes white! "
4601 | rmem r0 3976
4604 | r0 = r0 + 1
4608 | jt r0 4618
4611 | r0 = 26498
4614 | call 1540(print) " The hourglass has already run out. It flashes black and flips over, restarting the flow of sand. "
4616 | jmp 4587
4618 | r0 = 26598
4621 | call 1540(print) " The hourglass is still running! It flashes white! You hear a click from the vault door. The orb evaporates out of hour hands.\n\n "
4623 | r0 = 2738 + 2
4627 | wmem r0 32767
4630 | pop r0
4632 | ret

reset-orb:
4633 | push r0
4635 | r0 = 2738 + 2
4639 | rmem r0 r0
4642 | jt r0 4679
4645 | r0 = 26731
4648 | call 1540(print) "As you "
4650 | rmem r0 2754[current-room]
4653 | r0 = r0 == 2645
4657 | jt r0 4667
4660 | r0 = 26739
4663 | call 1540(print) "leave "
4665 | jmp 4672
4667 | r0 = 26745
4670 | call 1540(print) "enter "
4672 | r0 = 26751
4675 | call 1540(print) " the room, the orb evaporates out of your hands! It rematerializes on its pedestal.\n\n "
4677 | call 4682(reset-orb-data)
4679 | pop r0
4681 | ret

reset-orb-data:
4682 | push r0
4684 | wmem 3974 22
4687 | wmem 3975 0
4690 | wmem 3976 0
4693 | wmem 3977 0
4696 | wmem 3978 0
4699 | wmem 3979 0
4702 | r0 = 2738 + 2
4706 | wmem r0 2645
4709 | pop r0
4711 | ret

enter-vault:
4712 | push r0
4714 | r0 = 2738 + 2
4718 | rmem r0 r0
4721 | r0 = r0 == 32767
4725 | jt r0 4739
4728 | r0 = 26838
4731 | call 1540(print) "The vault door is sealed.\n "
4733 | wmem 2754[current-room] 2600
4736 | wmem 2755[prev-room] 2600
4739 | pop r0
4741 | ret

use-tablet:
4742 | push r0
4744 | push r1
4746 | push r2
4748 | push r3
4750 | push r0
4752 | push r1
4754 | push r2
4756 | r0 = 28383
4759 | r1 = 1553
4762 | r2 = 4072 + 25103
4766 | call 1480(map) "You find yourself writing \""
4768 | pop r2
4770 | pop r1
4772 | pop r0
4774 | r0 = 4242
4777 | r1 = 25880
4780 | r2 = 32767
4783 | r3 = 28411
4786 | call 1863(print-code)
4788 | push r0
4790 | push r1
4792 | push r2
4794 | r0 = 28415
4797 | r1 = 1553
4800 | r2 = 9840 + 9847
4804 | call 1480(map) "\" on the tablet. Perhaps it\'s some kind of code?\n\n"
4806 | pop r2
4808 | pop r1
4810 | pop r0
4812 | pop r3
4814 | pop r2
4816 | pop r1
4818 | pop r0
4820 | ret

use-can:
4821 | push r0
4823 | r0 = 2694 + 2
4827 | rmem r0 r0
4830 | jt r0 4880
4833 | r0 = 2706 + 2
4837 | wmem r0 32767
4840 | r0 = 2694 + 2
4844 | wmem r0 32767
4847 | r0 = 2698 + 2
4851 | wmem r0 0
4854 | push r0
4856 | push r1
4858 | push r2
4860 | r0 = 28467
4863 | r1 = 1553
4866 | r2 = 28391 + 3091
4870 | call 1480(map) "You fill your lantern with oil. It seems to cheer up!\n\n"
4872 | pop r2
4874 | pop r1
4876 | pop r0
4878 | jmp 4904
4880 | push r0
4882 | push r1
4884 | push r2
4886 | r0 = 28524
4889 | r1 = 1553
4892 | r2 = 5367 + 25601
4896 | call 1480(map) "You\'ll have to find something to put the oil into first.\n\n"
4898 | pop r2
4900 | pop r1
4902 | pop r0
4904 | pop r0
4906 | ret

use-lantern:
4907 | push r0
4909 | r0 = 2698 + 2
4913 | wmem r0 32767
4916 | r0 = 2702 + 2
4920 | wmem r0 0
4923 | push r0
4925 | push r1
4927 | push r2
4929 | r0 = 28583
4932 | r1 = 1553
4935 | r2 = 18336 + 7637
4939 | call 1480(map) "You light your lantern.\n\n"
4941 | pop r2
4943 | pop r1
4945 | pop r0
4947 | wmem 2755[prev-room] 0
4950 | pop r0
4952 | ret

use-coin:
4999 | push r2
5001 | push r3
5003 | rmem r2 2754[current-room]
5006 | r2 = r2 == 2479
5010 | jt r2 5039
5013 | push r0
5015 | push r1
5017 | push r2
5019 | r0 = 28635
5022 | r1 = 1553
5025 | r2 = 4963 + 14461
5029 | call 1480(map) "You\'re not sure what to do with the coin.\n"
5031 | pop r2
5033 | pop r1
5035 | pop r0
5037 | jmp 5358
5039 | r2 = r0 + 2
5043 | wmem r2 32767
5046 | rmem r2 2484
5049 | r2 = r2 + 27109
5053 | r2 = r2 + 1
5057 | rmem r2 r2
5060 | r3 = 2479 + 1
5064 | rmem r3 r3
5067 | r3 = r3 + r2
5071 | r2 = r1 + 48
5075 | wmem r3 r2
5078 | rmem r2 2484
5081 | r2 = r2 + 27115
5085 | r2 = r2 + 1
5089 | wmem r2 r1
5092 | push r0
5094 | push r0
5096 | push r1
5098 | push r2
5100 | r0 = 28678
5103 | r1 = 1553
5106 | r2 = 14248 + 6463
5110 | call 1480(map) "You place the "
5112 | pop r2
5114 | pop r1
5116 | pop r0
5118 | pop r0
5120 | push r0
5122 | r2 = r0 + 0
5126 | rmem r0 r2
5129 | call 1540(print)
5131 | pop r0
5133 | push r0
5135 | push r0
5137 | push r1
5139 | push r2
5141 | r0 = 28693
5144 | r1 = 1553
5147 | r2 = 348 + 154
5151 | call 1480(map) " into the leftmost open slot.\n"
5153 | pop r2
5155 | pop r1
5157 | pop r0
5159 | pop r0
5161 | rmem r2 2484
5164 | r2 = r2 + 1
5168 | wmem 2484 r2
5171 | rmem r3 27115[placed-coins]
5174 | r3 = r2 == r3
5178 | jf r3 5358
5181 | r0 = 0
5184 | r1 = 27115 + 1
5188 | rmem r1 r1
5191 | r0 = r0 + r1
5195 | r1 = 27115 + 2
5199 | rmem r1 r1
5202 | r2 = 27115 + 3
5206 | rmem r2 r2
5209 | r2 = r2 * r2
5213 | r1 = r1 * r2
5217 | r0 = r0 + r1
5221 | r1 = 27115 + 4
5225 | rmem r1 r1
5228 | r2 = r1 * r1
5232 | r2 = r2 * r1
5236 | r0 = r0 + r2
5240 | r1 = 27115 + 5
5244 | rmem r1 r1
5247 | r1 = r1 * 32767
5251 | r0 = r0 + r1
5255 | r1 = r0 == 399
5259 | jt r1 5334
5262 | r2 = 2710 + 2
5266 | wmem r2 2479
5269 | r2 = 2714 + 2
5273 | wmem r2 2479
5276 | r2 = 2718 + 2
5280 | wmem r2 2479
5283 | r2 = 2722 + 2
5287 | wmem r2 2479
5290 | r2 = 2726 + 2
5294 | wmem r2 2479
5297 | wmem 2484 0
5300 | r0 = 27109
5303 | r1 = 5363
5306 | call 1480(map)
5308 | push r0
5310 | push r1
5312 | push r2
5314 | r0 = 28724
5317 | r1 = 1553
5320 | r2 = 29348 + 1605
5324 | call 1480(map) "As you place the last coin, they are all released onto the floor.\n"
5326 | pop r2
5328 | pop r1
5330 | pop r0
5332 | jmp 5358
5334 | push r0
5336 | push r1
5338 | push r2
5340 | r0 = 28791
5343 | r1 = 1553
5346 | r2 = 72 + 162
5350 | call 1480(map) "As you place the last coin, you hear a click from the north door.\n"
5352 | pop r2
5354 | pop r1
5356 | pop r0
5358 | pop r3
5360 | pop r2
5362 | ret

use-red-coin:
5382 | push r0
5384 | push r1
5386 | r0 = 2710
5389 | r1 = 2
5392 | call 4999(use-coin)
5394 | pop r1
5396 | pop r0
5398 | ret

use-corroded-coin:
5399 | push r0
5401 | push r1
5403 | r0 = 2714
5406 | r1 = 3
5409 | call 4999(use-coin)
5411 | pop r1
5413 | pop r0
5415 | ret

use-shiny-coin:
5416 | push r0
5418 | push r1
5420 | r0 = 2718
5423 | r1 = 5
5426 | call 4999(use-coin)
5428 | pop r1
5430 | pop r0
5432 | ret

use-concave-coin:
5433 | push r0
5435 | push r1
5437 | r0 = 2722
5440 | r1 = 7
5443 | call 4999(use-coin)
5445 | pop r1
5447 | pop r0
5449 | ret

use-blue-coin:
5450 | push r0
5452 | push r1
5454 | r0 = 2726
5457 | r1 = 9
5460 | call 4999(use-coin)
5462 | pop r1
5464 | pop r0
5466 | ret

use-teleporter:
5467 | push r0
5469 | push r1
5471 | push r2
5473 | jf r7 5627
5476 | push r0
5478 | push r1
5480 | push r2
5482 | r0 = 28858
5485 | r1 = 1553
5488 | r2 = 16357 + 3
5492 | call 1480(map) "A strange, electronic voice is projected into your mind:\n\n \"Unusual setting detected! Starting calibration process! Estimated time to completion: 1 billion years.\"\n\n"
5494 | pop r2
5496 | pop r1
5498 | pop r0
5500 | noop
5501 | noop
5502 | noop
5503 | noop
5504 | noop
5505 | r0 = 4
5508 | r1 = 1
5511 | call 6049(teleporter-confirmation)
5513 | r1 = r0 == 6
5517 | jf r1 5601
5520 | push r0
5522 | push r1
5524 | push r2
5526 | r0 = 29027
5529 | r1 = 1553
5532 | r2 = 8051 + 14968
5536 | call 1480(map) "You wake up on a sandy beach with a slight headache. The last thing you remember is activating that teleporter... but now you can\'t find it anywhere in your pack. Someone seems to have drawn a message in the sand here:\n\n "
5538 | pop r2
5540 | pop r1
5542 | pop r0
5544 | r0 = r7
5547 | r1 = 25880
5550 | r2 = 32767
5553 | push r3
5555 | r3 = 29254
5558 | call 1863(print-code)
5560 | pop r3
5562 | push r0
5564 | push r1
5566 | push r2
5568 | r0 = 29258
5571 | r1 = 1553
5574 | r2 = 202 + 29735
5578 | call 1480(map) "\n\nIt begins to rain. The message washes away.\n\n"
5580 | pop r2
5582 | pop r1
5584 | pop r0
5586 | wmem 2754[current-room] 2520
5589 | wmem 2755[prev-room] 0
5592 | r1 = 2730 + 2
5596 | wmem r1 32767
5599 | jmp 5736
5601 | push r0
5603 | push r1
5605 | push r2
5607 | r0 = 29307
5610 | r1 = 1553
5613 | r2 = 426 + 12103
5617 | call 1480(map) "A strange, electronic voice is projected into your mind:\n\n \"Miscalibration detected! Aborting teleportation!\"\n\nNothing else seems to happen.\n\n"
5619 | pop r2
5621 | pop r1
5623 | pop r0
5625 | jmp 5736
5627 | push r0
5629 | push r1
5631 | push r2
5633 | r0 = 29452
5636 | r1 = 1553
5639 | r2 = 3485 + 2907
5643 | call 1480(map) "You activate the teleporter! As you spiral through time and space, you think you see a pattern in the stars...\n\n "
5645 | pop r2
5647 | pop r1
5649 | pop r0
5651 | r0 = 0
5654 | r2 = 1 + 27115
5658 | rmem r1 r2
5661 | r0 = r0 + r1
5665 | r0 = r0 * 31660
5669 | call 2147(xor)
5671 | rmem r1 27115[placed-coins]
5674 | r1 = r1 + 27115
5678 | r2 = r2 + 1
5682 | r1 = r2 > r1
5686 | jf r1 5658
5689 | r1 = 25880
5692 | r2 = 32767
5695 | push r3
5697 | r3 = 29570
5700 | call 1863(print-code)
5702 | pop r3
5704 | push r0
5706 | push r1
5708 | push r2
5710 | r0 = 29574
5713 | r1 = 1553
5716 | r2 = 74 + 2852
5720 | call 1480(map) "\n\nAfter a few moments, you find yourself back on solid ground and a little disoriented.\n\n"
5722 | pop r2
5724 | pop r1
5726 | pop r0
5728 | wmem 2754[current-room] 2510
5731 | wmem 2755[prev-room] 0
5734 | jmp 5736
5736 | pop r2
5738 | pop r1
5740 | pop r0
5742 | ret

use-mirror:
5743 | push r0
5745 | push r1
5747 | push r2
5749 | push r3
5751 | push r0
5753 | push r1
5755 | push r2
5757 | r0 = 29664
5760 | r1 = 1553
5763 | r2 = 11087 + 546
5767 | call 1480(map) "You gaze into the mirror, and you see yourself gazing back. But wait! It looks like someone wrote on your face while you were unconscious on the beach! Through the mirror, you see \""
5769 | pop r2
5771 | pop r1
5773 | pop r0
5775 | rmem r0 3977
5778 | rmem r1 3978
5781 | call 2147(xor)
5783 | rmem r1 3979
5786 | call 2147(xor)
5788 | r1 = 25933
5791 | r2 = 4
5794 | push r3
5796 | r3 = 29849
5799 | call 1863(print-code)
5801 | pop r3
5803 | push r0
5805 | push r1
5807 | push r2
5809 | r0 = 29853
5812 | r1 = 1553
5815 | r2 = 601 + 2078
5819 | call 1480(map) "\" scrawled in charcoal on your forehead.\n\nCongratulations; you have reached the end of the challenge!\n\n"
5821 | pop r2
5823 | pop r1
5825 | pop r0
5827 | pop r3
5829 | pop r2
5831 | pop r1
5833 | pop r0
5835 | ret

print-list-item:
5836 | out '-'
5838 | out ' '
5840 | call 1540(print)
5842 | out '\n'
5844 | ret

5845 | push r1
5847 | push r2
5849 | r0 = 27395
5852 | r1 = 5868
5855 | r2 = 0
5858 | call 1480(map)
5860 | r0 = r2
5863 | pop r2
5865 | pop r1
5867 | ret

5868 | push r3
5870 | push r4
5872 | rmem r3 2754[current-room]
5875 | r4 = r0 + 2
5879 | rmem r4 r4
5882 | r3 = r3 == r4
5886 | jf r3 5893
5889 | r2 = r2 + 1
5893 | pop r4
5895 | pop r3
5897 | ret

5898 | push r0
5900 | push r1
5902 | r0 = 27395
5905 | r1 = 5915
5908 | call 1480(map)
5910 | pop r1
5912 | pop r0
5914 | ret

5915 | push r3
5917 | r3 = r0 + 2
5921 | rmem r3 r3
5924 | r3 = r2 == r3
5928 | jf r3 5940
5931 | r0 = r0 + 0
5935 | rmem r0 r0
5938 | call 5836(print-list-item)
5940 | pop r3
5942 | ret

5943 | push r1
5945 | push r2
5947 | r2 = r0
5950 | r0 = 27395
5953 | r1 = 5986
5956 | call 1565
5958 | r1 = r0 == 32767
5962 | jt r1 5978
5965 | r1 = 27395 + r0
5969 | r1 = r1 + 1
5973 | rmem r0 r1
5976 | jmp 5981
5978 | r0 = 0
5981 | pop r2
5983 | pop r1
5985 | ret

5986 | push r1
5988 | r1 = r2
5991 | r0 = r0 + 0
5995 | rmem r0 r0
5998 | call 1689(strcmp)
6000 | pop r1
6002 | jf r0 6011
6005 | r2 = r1
6008 | r1 = 32767
6011 | ret

6012 | push r1
6014 | push r2
6016 | r0 = r0 + 2
6020 | rmem r0 r0
6023 | jf r0 6041
6026 | rmem r1 2754[current-room]
6029 | r1 = r0 == r1
6033 | jt r1 6041
6036 | r0 = 0
6039 | jmp 6044
6041 | r0 = 1
6044 | pop r2
6046 | pop r1
6048 | ret

teleporter-confirmation:
6049 | jt r0 6057
6052 | r0 = r1 + 1
6056 | ret
6057 | jt r1 6070
6060 | r0 = r0 + 32767
6064 | r1 = r7
6067 | call 6049(teleporter-confirmation)
6069 | ret
6070 | push r0
6072 | r1 = r1 + 32767
6076 | call 6049(teleporter-confirmation)
6078 | r1 = r0
6081 | pop r0
6083 | r0 = r0 + 32767
6087 | call 6049(teleporter-confirmation)
6089 | ret