#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int fscanf(int /*<<< orphan*/ *, char *, char *, char *, char *);
int /*<<< orphan*/ gameStart(int, int, int);
size_t getline(char **, size_t *, int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ instruction();
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srand(time(NULL));
  int pid = getpid();
  gameStart(7, 6, pid);
  char path[100][20];
  instruction();
  char direct[18];
  snprintf(direct, 18, "stammbr.room.%d", pid);
  int i, j, m;
  char compareArray[7][20];
  i = 1;
  while (i < 8) {
    char file[25];
    snprintf(file, 25, "%s/room%d", direct, i);
    FILE *f = fopen(file, "r");
    char wasteE1[20];
    char wasteE2[20];
    char compareRoom[20];
    char anotherRoom[20];
    fscanf(f, "%s %s %s", wasteE1, wasteE2, compareRoom);
    snprintf(anotherRoom, 20, "%s\n", compareRoom);
    strcpy(compareArray[i - 1], anotherRoom);
    fclose(f);
    i++;
  }
  char file[25];
  snprintf(file, 25, "%s/room1", direct);
  FILE *f = fopen(file, "r");
  char waste1[20];
  char waste2[20];
  char keep[20];
  char fileArray[8][20];
  m = 0;
  while (42) {
    int ret = fscanf(f, "%s %s %s", waste1, waste2, keep);
    if (ret == EOF) {
      break;
    } else {
      strcpy(fileArray[m], keep);
      m++;
    }
  }
  fclose(f);
  char currentRoom[20];
  char endRoom[20];
  strcpy(currentRoom, compareArray[0]);
  strcpy(endRoom, compareArray[1]);
  int journey = 0;
  char connectArray[6][20];
  int n = 0;
  while (strcmp(currentRoom, endRoom) != 0) {
    if (journey == 99) {
      printf("Wow.  That's been a journey for you.\n");
      printf("Let's call it quits for now.\n'");
      break;
    }
    printf("CURRENT LOCTION: %s\n", fileArray[0]);
    printf("POSSIBLE CONNECTIONS: ");
    for (i = 1; i < m - 1; i++) {
      snprintf(connectArray[n], 20, "%s\n", fileArray[i]);
      n++;
      if (i == (m - 2)) {
        printf("%s.\n", fileArray[i]);
      } else {
        printf("%s, ", fileArray[i]);
      }
    }
    int error = 1;
    while (error == 1) {
      char *compare;
      size_t MAXSIZE = 25;
      size_t userRoom;
      compare = (char *)malloc(MAXSIZE * sizeof(char));
      if (compare == NULL) {
        printf("Goo.");
      }
      printf("WHERE TO?> ");
      userRoom = getline(&compare, &MAXSIZE, stdin);
      for (j = 0; j < n; j++) {
        char temp[20];
        strcpy(temp, connectArray[j]);
        if (strcmp(temp, compare) == 0) {
          strcpy(path[journey], temp);
          journey++;
          strcpy(currentRoom, temp);
          error = 0;
          n = 0;
          j = 0;
          for (i = 0; i < 7; i++) {
            if (strcmp(temp, compareArray[i]) == 0) {
              j = i;
              break;
            }
          }
          char fileloop[25];
          snprintf(fileloop, 25, "%s/room%d", direct, (j + 1));
          FILE *f = fopen(fileloop, "r");
          char wasteloop1[20];
          char wasteloop2[20];
          char keep[20];
          m = 0;
          while (42) {
            int ret = fscanf(f, "%s %s %s", wasteloop1, wasteloop2, keep);
            if (ret == EOF) {
              break;
            } else {
              strcpy(fileArray[m], keep);
              m++;
            }
          }
          fclose(f);
          break;
        }
      }
      printf("\n");
      if (error == 1) {
        printf("HUH?  I DON'T UNDERSTAND THAT ROOM.  TRY AGAIN.\n\n");
      }
      free(compare);
    }
  }
  printf("YOU HAVE FOUND THE END ROOM.  CONGRATULATIONS!\n");
  printf("YOU TOOK %d STEPS.  YOUR PATH TO VICTORY WAS:\n", journey);
  for (i = 0; i < journey; i++) {
    printf("%s", path[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc00,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <time@plt>
mov    %eax,%edi
call   10a0 <srand@plt>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x7,%edi
mov    $0x6,%esi
call   10d0 <gameStart@plt>
mov    $0x0,%al
call   10c0 <instruction@plt>
lea    -0x810(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x12,%esi
lea    0xdae(%rip),%rdx
mov    $0x0,%al
call   1080 <snprintf@plt>
movl   $0x1,-0x814(%rbp)
cmpl   $0x8,-0x814(%rbp)
jge    1340 <main+0x150>
lea    -0x8d0(%rbp),%rdi
lea    -0x810(%rbp),%rcx
mov    -0x814(%rbp),%r8d
mov    $0x19,%esi
lea    0xd7f(%rip),%rdx
mov    $0x0,%al
call   1080 <snprintf@plt>
lea    -0x8d0(%rbp),%rdi
lea    0xd74(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x8d8(%rbp)
mov    -0x8d8(%rbp),%rdi
lea    -0x8f0(%rbp),%rdx
lea    -0x910(%rbp),%rcx
lea    -0x930(%rbp),%r8
lea    0xd47(%rip),%rsi
call   1090 <fscanf@plt>
lea    -0x950(%rbp),%rdi
lea    -0x930(%rbp),%rcx
mov    $0x14,%esi
lea    0xd90(%rip),%rdx
mov    $0x0,%al
call   1080 <snprintf@plt>
mov    -0x814(%rbp),%eax
sub    $0x1,%eax
cltq
lea    -0x8b0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
lea    -0x950(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8d8(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
jmp    1263 <main+0x73>
lea    -0x970(%rbp),%rdi
lea    -0x810(%rbp),%rcx
mov    $0x19,%esi
lea    0xccb(%rip),%rdx
mov    $0x0,%al
call   1080 <snprintf@plt>
lea    -0x970(%rbp),%rdi
lea    0xcab(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x978(%rbp)
movl   $0x0,-0x81c(%rbp)
mov    -0x978(%rbp),%rdi
lea    -0x990(%rbp),%rdx
lea    -0x9b0(%rbp),%rcx
lea    -0x9d0(%rbp),%r8
lea    0xc74(%rip),%rsi
call   1090 <fscanf@plt>
mov    %eax,-0xa74(%rbp)
mov    -0xa74(%rbp),%eax
mov    0x2c20(%rip),%rcx
cmp    (%rcx),%eax
jne    13cd <main+0x1dd>
jmp    1402 <main+0x212>
movslq -0x81c(%rbp),%rax
lea    -0xa70(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
lea    -0x9d0(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x81c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x81c(%rbp)
jmp    1385 <main+0x195>
mov    -0x978(%rbp),%rdi
call   1060 <fclose@plt>
lea    -0xa90(%rbp),%rdi
lea    -0x8b0(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0xab0(%rbp),%rdi
lea    -0x8b0(%rbp),%rsi
add    $0x14,%rsi
call   1040 <strcpy@plt>
movl   $0x0,-0xab4(%rbp)
movl   $0x0,-0xb34(%rbp)
lea    -0xa90(%rbp),%rdi
lea    -0xab0(%rbp),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     1885 <main+0x695>
cmpl   $0x63,-0xab4(%rbp)
jne    1497 <main+0x2a7>
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xbc9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1885 <main+0x695>
lea    -0xa70(%rbp),%rsi
lea    0xbce(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xbd5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x814(%rbp)
mov    -0x814(%rbp),%eax
mov    -0x81c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15a2 <main+0x3b2>
movslq -0xb34(%rbp),%rax
lea    -0xb30(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
movslq -0x814(%rbp),%rax
lea    -0xa70(%rbp),%rcx
imul   $0x14,%rax,%rax
add    %rax,%rcx
mov    $0x14,%esi
lea    0xb73(%rip),%rdx
mov    $0x0,%al
call   1080 <snprintf@plt>
mov    -0xb34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb34(%rbp)
mov    -0x814(%rbp),%eax
mov    -0x81c(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jne    1566 <main+0x376>
movslq -0x814(%rbp),%rax
lea    -0xa70(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xb45(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1589 <main+0x399>
movslq -0x814(%rbp),%rax
lea    -0xa70(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xb22(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    158e <main+0x39e>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
jmp    14c4 <main+0x2d4>
movl   $0x1,-0xb38(%rbp)
cmpl   $0x1,-0xb38(%rbp)
jne    1880 <main+0x690>
movq   $0x19,-0xb48(%rbp)
mov    -0xb48(%rbp),%rdi
shl    $0x0,%rdi
call   10f0 <malloc@plt>
mov    %rax,-0xb40(%rbp)
cmpq   $0x0,-0xb40(%rbp)
jne    15f7 <main+0x407>
lea    0xab9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xab0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x29dc(%rip),%rax
mov    (%rax),%edx
lea    -0xb40(%rbp),%rdi
lea    -0xb48(%rbp),%rsi
call   1110 <getline@plt>
mov    %rax,-0xb50(%rbp)
movl   $0x0,-0x818(%rbp)
mov    -0x818(%rbp),%eax
cmp    -0xb34(%rbp),%eax
jge    1846 <main+0x656>
lea    -0xb70(%rbp),%rdi
movslq -0x818(%rbp),%rax
lea    -0xb30(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
call   1040 <strcpy@plt>
lea    -0xb70(%rbp),%rdi
mov    -0xb40(%rbp),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    182d <main+0x63d>
movslq -0xab4(%rbp),%rax
lea    -0x7f0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
lea    -0xb70(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0xab4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xab4(%rbp)
lea    -0xa90(%rbp),%rdi
lea    -0xb70(%rbp),%rsi
call   1040 <strcpy@plt>
movl   $0x0,-0xb38(%rbp)
movl   $0x0,-0xb34(%rbp)
movl   $0x0,-0x818(%rbp)
movl   $0x0,-0x814(%rbp)
cmpl   $0x7,-0x814(%rbp)
jge    174f <main+0x55f>
lea    -0xb70(%rbp),%rdi
movslq -0x814(%rbp),%rax
lea    -0x8b0(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1736 <main+0x546>
mov    -0x814(%rbp),%eax
mov    %eax,-0x818(%rbp)
jmp    174f <main+0x55f>
jmp    173b <main+0x54b>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
jmp    16ed <main+0x4fd>
lea    -0xb90(%rbp),%rdi
lea    -0x810(%rbp),%rcx
mov    -0x818(%rbp),%r8d
add    $0x1,%r8d
mov    $0x19,%esi
lea    0x89c(%rip),%rdx
mov    $0x0,%al
call   1080 <snprintf@plt>
lea    -0xb90(%rbp),%rdi
lea    0x891(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0xb98(%rbp)
movl   $0x0,-0x81c(%rbp)
mov    -0xb98(%rbp),%rdi
lea    -0xbb0(%rbp),%rdx
lea    -0xbd0(%rbp),%rcx
lea    -0xbf0(%rbp),%r8
lea    0x85a(%rip),%rsi
call   1090 <fscanf@plt>
mov    %eax,-0xbf4(%rbp)
mov    -0xbf4(%rbp),%eax
mov    0x2806(%rip),%rcx
cmp    (%rcx),%eax
jne    17e7 <main+0x5f7>
jmp    181c <main+0x62c>
movslq -0x81c(%rbp),%rax
lea    -0xa70(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
lea    -0xbf0(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x81c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x81c(%rbp)
jmp    179f <main+0x5af>
mov    -0xb98(%rbp),%rdi
call   1060 <fclose@plt>
jmp    1846 <main+0x656>
jmp    1832 <main+0x642>
mov    -0x818(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x818(%rbp)
jmp    1632 <main+0x442>
lea    0x89d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x1,-0xb38(%rbp)
jne    186f <main+0x67f>
lea    0x852(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xb40(%rbp),%rdi
call   1030 <free@plt>
jmp    15ac <main+0x3bc>
jmp    144c <main+0x25c>
lea    0x860(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xab4(%rbp),%esi
lea    0x87c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x814(%rbp)
mov    -0x814(%rbp),%eax
cmp    -0xab4(%rbp),%eax
jge    18fa <main+0x70a>
movslq -0x814(%rbp),%rax
lea    -0x7f0(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0x743(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
jmp    18b1 <main+0x6c1>
xor    %eax,%eax
add    $0xc00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb28,%rsp
xor    %edi,%edi
call   1100 <time@plt>
mov    %eax,%edi
call   10c0 <srand@plt>
xor    %eax,%eax
call   1070 <getpid@plt>
mov    %eax,%ebx
mov    $0x7,%edi
mov    $0x6,%esi
mov    %eax,%edx
call   10f0 <gameStart@plt>
xor    %eax,%eax
call   10e0 <instruction@plt>
lea    0xda9(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0x12,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    $0xfffffffffffffff9,%rbp
lea    0x140(%rsp),%rbx
lea    0x2b0(%rsp),%r12
lea    0x120(%rsp),%r15
lea    0x100(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x8(%rbp),%r8d
lea    0x350(%rsp),%r13
mov    %r13,%rdi
mov    $0x19,%esi
lea    0xd55(%rip),%rdx
lea    0x20(%rsp),%rcx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %r13,%rdi
lea    0xd49(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,%r13
mov    %rax,%rdi
lea    0xd39(%rip),%rsi
mov    %r12,%rdx
lea    0x230(%rsp),%rcx
mov    %r15,%r8
call   10b0 <fscanf@plt>
mov    %r14,%rdi
mov    $0x14,%esi
lea    0xd59(%rip),%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
mov    %r13,%rdi
call   1080 <fclose@plt>
add    $0x14,%rbx
inc    %rbp
jne    12a0 <main+0x90>
lea    0xcef(%rip),%rdx
lea    0x120(%rsp),%rbx
lea    0x20(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x19,%esi
xor    %eax,%eax
call   10a0 <snprintf@plt>
lea    0xcc1(%rip),%rsi
mov    %rbx,%rdi
call   1120 <fopen@plt>
mov    %rax,%r14
lea    0xcb1(%rip),%rsi
lea    0xe0(%rsp),%rdx
lea    0xc0(%rsp),%rcx
lea    0xa0(%rsp),%r8
mov    %rax,%rdi
call   10b0 <fscanf@plt>
mov    0x2c4e(%rip),%r13
mov    $0x0,%r15d
cmp    0x0(%r13),%eax
je     13f6 <main+0x1e6>
xor    %r15d,%r15d
lea    0xa0(%rsp),%rbx
lea    0xc0(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <strcpy@plt>
mov    %r14,%rdi
lea    0xc47(%rip),%rsi
lea    0xe0(%rsp),%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
call   10b0 <fscanf@plt>
add    $0x14,%r12
add    $0x1,%r15d
cmp    0x0(%r13),%eax
jne    13c0 <main+0x1b0>
mov    %r14,%rdi
call   1080 <fclose@plt>
lea    0x40(%rsp),%rbx
lea    0x140(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strcpy@plt>
lea    0x154(%rsp),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x0,%ebp
je     1827 <main+0x617>
xor    %ebp,%ebp
jmp    1490 <main+0x280>
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%ebp
add    $0x1,%ebp
mov    0x8(%rsp),%rdi
call   1080 <fclose@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
lea    0x40(%rsp),%rdi
lea    0x80(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1827 <main+0x617>
cmp    $0x63,%ebp
je     1808 <main+0x5f8>
mov    %ebp,0x4(%rsp)
xor    %r12d,%r12d
lea    0xba6(%rip),%rdi
lea    0x2b0(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xba5(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
cmp    $0x3,%r15d
jl     154a <main+0x33a>
lea    -0x1(%r15),%eax
add    $0xfffffffe,%r15d
add    $0xffffffffffffffff,%r15
add    $0xffffffffffffffff,%rax
mov    %rax,0x8(%rsp)
lea    0x2c4(%rsp),%rbx
lea    0x230(%rsp),%r14
xor    %r12d,%r12d
lea    0xb81(%rip),%rbp
nopl   (%rax)
mov    %r12,%r13
mov    %r14,%rdi
mov    $0x14,%esi
lea    0xb4c(%rip),%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   10a0 <snprintf@plt>
add    $0x1,%r12
cmp    %r13,%r15
mov    %rbp,%rdi
lea    0xb4c(%rip),%rax
cmove  %rax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x14,%r14
add    $0x14,%rbx
cmp    %r12,0x8(%rsp)
jne    1500 <main+0x2f0>
mov    %r12d,%r14d
lea    0xb34(%rip),%r15
jmp    1580 <main+0x370>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xb81(%rip),%rdi
call   1060 <puts@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
movq   $0x19,0x18(%rsp)
mov    $0x19,%edi
call   1110 <malloc@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
jne    15ab <main+0x39b>
lea    0xadf(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2a2c(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1130 <getline@plt>
test   %r14d,%r14d
jle    1560 <main+0x350>
mov    %r14,%rbp
lea    0x230(%rsp),%rbx
nopl   (%rax)
lea    0x60(%rsp),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <strcpy@plt>
mov    0x10(%rsp),%rsi
mov    %r13,%rdi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1620 <main+0x410>
add    $0x14,%rbx
add    $0xffffffffffffffff,%rbp
jne    15e0 <main+0x3d0>
jmp    1560 <main+0x350>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%ebp
mov    %ebp,%eax
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,4),%rdi
add    $0x350,%rdi
lea    0x60(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <strcpy@plt>
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
lea    0x140(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1700 <main+0x4f0>
mov    %rbx,%rdi
lea    0x154(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1710 <main+0x500>
mov    %rbx,%rdi
lea    0x168(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1718 <main+0x508>
mov    %rbx,%rdi
lea    0x17c(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1720 <main+0x510>
mov    %rbx,%rdi
lea    0x190(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1728 <main+0x518>
mov    %rbx,%rdi
lea    0x1a4(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1730 <main+0x520>
mov    %rbx,%rdi
lea    0x1b8(%rsp),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x1,%r8d
mov    $0x7,%eax
cmove  %eax,%r8d
jmp    1740 <main+0x530>
nopl   (%rax)
mov    $0x1,%r8d
jmp    1740 <main+0x530>
nopl   0x0(%rax,%rax,1)
mov    $0x2,%r8d
jmp    1740 <main+0x530>
mov    $0x3,%r8d
jmp    1740 <main+0x530>
mov    $0x4,%r8d
jmp    1740 <main+0x530>
mov    $0x5,%r8d
jmp    1740 <main+0x530>
mov    $0x6,%r8d
cs nopw 0x0(%rax,%rax,1)
xor    %r15d,%r15d
lea    0x100(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x19,%esi
lea    0x8b6(%rip),%rdx
lea    0x20(%rsp),%rcx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
lea    0x8aa(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
lea    0x898(%rip),%rsi
lea    0x210(%rsp),%r14
mov    %r14,%rdx
lea    0x1f0(%rsp),%r12
mov    %r12,%rcx
lea    0x1d0(%rsp),%rbx
mov    %rbx,%r8
call   10b0 <fscanf@plt>
mov    0x282f(%rip),%r13
cmp    0x0(%r13),%eax
je     1450 <main+0x240>
xor    %r15d,%r15d
lea    0x2b0(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <strcpy@plt>
mov    0x8(%rsp),%rdi
lea    0x835(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   10b0 <fscanf@plt>
add    $0x14,%rbp
add    $0x1,%r15d
cmp    0x0(%r13),%eax
jne    17d0 <main+0x5c0>
jmp    1450 <main+0x240>
lea    0x914(%rip),%rdi
call   1060 <puts@plt>
lea    0x813(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x63,%ebp
lea    0x895(%rip),%rdi
call   1060 <puts@plt>
lea    0x85a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1090 <printf@plt>
test   %ebp,%ebp
lea    0x350(%rsp),%rbx
jle    1877 <main+0x667>
mov    %ebp,%ebp
lea    0x7ca(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x14,%rbx
add    $0xffffffffffffffff,%rbp
jne    1860 <main+0x650>
xor    %eax,%eax
add    $0xb28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"stammbr.room.%d\00"
@.str.1 = [10 x i8] c"%s/room%d\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [9 x i8] c"%s %s %s\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [9 x i8] c"%s/room1\00"
@EOF = global i32 0
@.str.6 = [38 x i8] c"Wow. That's been a journey for you.\0A\00"
@.str.7 = [31 x i8] c"Let's call it quits for now.\0A'\00"
@.str.8 = [21 x i8] c"CURRENT LOCTION: %s\0A\00"
@.str.9 = [23 x i8] c"POSSIBLE CONNECTIONS: \00"
@.str.10 = [5 x i8] c"%s.\0A\00"
@.str.11 = [5 x i8] c"%s, \00"
@.str.12 = [5 x i8] c"Goo.\00"
@.str.13 = [12 x i8] c"WHERE TO?> \00"
@stdin = global i32 0
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [50 x i8] c"HUH? I DON'T UNDERSTAND THAT ROOM. TRY AGAIN.\0A\0A\00"
@.str.16 = [48 x i8] c"YOU HAVE FOUND THE END ROOM. CONGRATULATIONS!\0A\00"
@.str.17 = [47 x i8] c"YOU TOOK %d STEPS. YOUR PATH TO VICTORY WAS:\0A\00"
@.str.18 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [100 x [20 x i8]]
%8 = alloca [18 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [7 x [20 x i8]]
%13 = alloca [25 x i8]
%14 = alloca i32*
%15 = alloca [20 x i8]
%16 = alloca [20 x i8]
%17 = alloca [20 x i8]
%18 = alloca [20 x i8]
%19 = alloca [25 x i8]
%20 = alloca i32*
%21 = alloca [20 x i8]
%22 = alloca [20 x i8]
%23 = alloca [20 x i8]
%24 = alloca [8 x [20 x i8]]
%25 = alloca i32
%26 = alloca [20 x i8]
%27 = alloca [20 x i8]
%28 = alloca i32
%29 = alloca [6 x [20 x i8]]
%30 = alloca i32
%31 = alloca i32
%32 = alloca i8*
%33 = alloca i64
%34 = alloca i64
%35 = alloca [20 x i8]
%36 = alloca [25 x i8]
%37 = alloca i32*
%38 = alloca [20 x i8]
%39 = alloca [20 x i8]
%40 = alloca [20 x i8]
%41 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%42 = call i32 @time(i32* null)
%43 = call i32 @srand(i32 %42)
%44 = call i32 (...) @getpid()
store i32 %44, i32* %6
%45 = load i32, i32* %6
%46 = call i32 @gameStart(i32 7, i32 6, i32 %45)
%47 = call i32 (...) @instruction()
%48 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%49 = load i32, i32* %6
%50 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %48, i32 18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %49)
store i32 1, i32* %9
br label %51
51: ; preds = %54, %2
%52 = load i32, i32* %9
%53 = icmp slt i32 %52, 8
br i1 %53, label %54, label %80
54: ; preds = %51
%55 = getelementptr inbounds [25 x i8], [25 x i8]* %13, i64 0, i64 0
%56 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%57 = load i32, i32* %9
%58 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %55, i32 25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %56, i32 %57)
%59 = getelementptr inbounds [25 x i8], [25 x i8]* %13, i64 0, i64 0
%60 = call i32* @fopen(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %60, i32** %14
%61 = load i32*, i32** %14
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %16, i64 0, i64 0
%64 = getelementptr inbounds [20 x i8], [20 x i8]* %17, i64 0, i64 0
%65 = call i32 @fscanf(i32* %61, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %62, i8* %63, i8* %64)
%66 = getelementptr inbounds [20 x i8], [20 x i8]* %18, i64 0, i64 0
%67 = getelementptr inbounds [20 x i8], [20 x i8]* %17, i64 0, i64 0
%68 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %66, i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %67)
%69 = load i32, i32* %9
%70 = sub nsw i32 %69, 1
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %12, i64 0, i64 %71
%73 = getelementptr inbounds [20 x i8], [20 x i8]* %72, i64 0, i64 0
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %18, i64 0, i64 0
%75 = call i32 @strcpy(i8* %73, i8* %74)
%76 = load i32*, i32** %14
%77 = call i32 @fclose(i32* %76)
%78 = load i32, i32* %9
%79 = add nsw i32 %78, 1
store i32 %79, i32* %9
br label %51
80: ; preds = %51
%81 = getelementptr inbounds [25 x i8], [25 x i8]* %19, i64 0, i64 0
%82 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%83 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %81, i32 25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %82)
%84 = getelementptr inbounds [25 x i8], [25 x i8]* %19, i64 0, i64 0
%85 = call i32* @fopen(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %85, i32** %20
store i32 0, i32* %11
br label %86
86: ; preds = %80, %105
%87 = load i32*, i32** %20
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %21, i64 0, i64 0
%89 = getelementptr inbounds [20 x i8], [20 x i8]* %22, i64 0, i64 0
%90 = getelementptr inbounds [20 x i8], [20 x i8]* %23, i64 0, i64 0
%91 = call i32 @fscanf(i32* %87, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %88, i8* %89, i8* %90)
store i32 %91, i32* %25
%92 = load i32, i32* %25
%93 = load i32, i32* @EOF
%94 = icmp eq i32 %92, %93
br i1 %94, label %95, label %96
95: ; preds = %86
br label %106
96: ; preds = %86
%97 = load i32, i32* %11
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %24, i64 0, i64 %98
%100 = getelementptr inbounds [20 x i8], [20 x i8]* %99, i64 0, i64 0
%101 = getelementptr inbounds [20 x i8], [20 x i8]* %23, i64 0, i64 0
%102 = call i32 @strcpy(i8* %100, i8* %101)
%103 = load i32, i32* %11
%104 = add nsw i32 %103, 1
store i32 %104, i32* %11
br label %105
105: ; preds = %96
br label %86
106: ; preds = %95
%107 = load i32*, i32** %20
%108 = call i32 @fclose(i32* %107)
%109 = getelementptr inbounds [20 x i8], [20 x i8]* %26, i64 0, i64 0
%110 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %12, i64 0, i64 0
%111 = getelementptr inbounds [20 x i8], [20 x i8]* %110, i64 0, i64 0
%112 = call i32 @strcpy(i8* %109, i8* %111)
%113 = getelementptr inbounds [20 x i8], [20 x i8]* %27, i64 0, i64 0
%114 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %12, i64 0, i64 1
%115 = getelementptr inbounds [20 x i8], [20 x i8]* %114, i64 0, i64 0
%116 = call i32 @strcpy(i8* %113, i8* %115)
store i32 0, i32* %28
store i32 0, i32* %30
br label %117
117: ; preds = %275, %106
%118 = getelementptr inbounds [20 x i8], [20 x i8]* %26, i64 0, i64 0
%119 = getelementptr inbounds [20 x i8], [20 x i8]* %27, i64 0, i64 0
%120 = call i64 @strcmp(i8* %118, i8* %119)
%121 = icmp ne i64 %120, 0
br i1 %121, label %122, label %276
122: ; preds = %117
%123 = load i32, i32* %28
%124 = icmp eq i32 %123, 99
br i1 %124, label %125, label %128
125: ; preds = %122
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %276
128: ; preds = %122
%129 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %24, i64 0, i64 0
%130 = getelementptr inbounds [20 x i8], [20 x i8]* %129, i64 0, i64 0
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %130)
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %9
br label %133
133: ; preds = %167, %128
%134 = load i32, i32* %9
%135 = load i32, i32* %11
%136 = sub nsw i32 %135, 1
%137 = icmp slt i32 %134, %136
br i1 %137, label %138, label %170
138: ; preds = %133
%139 = load i32, i32* %30
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %29, i64 0, i64 %140
%142 = getelementptr inbounds [20 x i8], [20 x i8]* %141, i64 0, i64 0
%143 = load i32, i32* %9
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %24, i64 0, i64 %144
%146 = getelementptr inbounds [20 x i8], [20 x i8]* %145, i64 0, i64 0
%147 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %142, i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %146)
%148 = load i32, i32* %30
%149 = add nsw i32 %148, 1
store i32 %149, i32* %30
%150 = load i32, i32* %9
%151 = load i32, i32* %11
%152 = sub nsw i32 %151, 2
%153 = icmp eq i32 %150, %152
br i1 %153, label %154, label %160
154: ; preds = %138
%155 = load i32, i32* %9
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %24, i64 0, i64 %156
%158 = getelementptr inbounds [20 x i8], [20 x i8]* %157, i64 0, i64 0
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %158)
br label %166
160: ; preds = %138
%161 = load i32, i32* %9
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %24, i64 0, i64 %162
%164 = getelementptr inbounds [20 x i8], [20 x i8]* %163, i64 0, i64 0
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* %164)
br label %166
166: ; preds = %160, %154
br label %167
167: ; preds = %166
%168 = load i32, i32* %9
%169 = add nsw i32 %168, 1
store i32 %169, i32* %9
br label %133
170: ; preds = %133
store i32 1, i32* %31
br label %171
171: ; preds = %272, %170
%172 = load i32, i32* %31
%173 = icmp eq i32 %172, 1
br i1 %173, label %174, label %275
174: ; preds = %171
store i64 25, i64* %33
%175 = load i64, i64* %33
%176 = mul i64 %175, 1
%177 = call i64 @malloc(i64 %176)
%178 = inttoptr i64 %177 to i8*
store i8* %178, i8** %32
%179 = load i8*, i8** %32
%180 = icmp eq i8* %179, null
br i1 %180, label %181, label %183
181: ; preds = %174
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %183
183: ; preds = %181, %174
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%185 = load i32, i32* @stdin
%186 = call i64 @getline(i8** %32, i64* %33, i32 %185)
store i64 %186, i64* %34
store i32 0, i32* %10
br label %187
187: ; preds = %263, %183
%188 = load i32, i32* %10
%189 = load i32, i32* %30
%190 = icmp slt i32 %188, %189
br i1 %190, label %191, label %266
191: ; preds = %187
%192 = getelementptr inbounds [20 x i8], [20 x i8]* %35, i64 0, i64 0
%193 = load i32, i32* %10
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %29, i64 0, i64 %194
%196 = getelementptr inbounds [20 x i8], [20 x i8]* %195, i64 0, i64 0
%197 = call i32 @strcpy(i8* %192, i8* %196)
%198 = getelementptr inbounds [20 x i8], [20 x i8]* %35, i64 0, i64 0
%199 = load i8*, i8** %32
%200 = call i64 @strcmp(i8* %198, i8* %199)
%201 = icmp eq i64 %200, 0
br i1 %201, label %202, label %262
202: ; preds = %191
%203 = load i32, i32* %28
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [100 x [20 x i8]], [100 x [20 x i8]]* %7, i64 0, i64 %204
%206 = getelementptr inbounds [20 x i8], [20 x i8]* %205, i64 0, i64 0
%207 = getelementptr inbounds [20 x i8], [20 x i8]* %35, i64 0, i64 0
%208 = call i32 @strcpy(i8* %206, i8* %207)
%209 = load i32, i32* %28
%210 = add nsw i32 %209, 1
store i32 %210, i32* %28
%211 = getelementptr inbounds [20 x i8], [20 x i8]* %26, i64 0, i64 0
%212 = getelementptr inbounds [20 x i8], [20 x i8]* %35, i64 0, i64 0
%213 = call i32 @strcpy(i8* %211, i8* %212)
store i32 0, i32* %31
store i32 0, i32* %30
store i32 0, i32* %10
store i32 0, i32* %9
br label %214
214: ; preds = %228, %202
%215 = load i32, i32* %9
%216 = icmp slt i32 %215, 7
br i1 %216, label %217, label %231
217: ; preds = %214
%218 = getelementptr inbounds [20 x i8], [20 x i8]* %35, i64 0, i64 0
%219 = load i32, i32* %9
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %12, i64 0, i64 %220
%222 = getelementptr inbounds [20 x i8], [20 x i8]* %221, i64 0, i64 0
%223 = call i64 @strcmp(i8* %218, i8* %222)
%224 = icmp eq i64 %223, 0
br i1 %224, label %225, label %227
225: ; preds = %217
%226 = load i32, i32* %9
store i32 %226, i32* %10
br label %231
227: ; preds = %217
br label %228
228: ; preds = %227
%229 = load i32, i32* %9
%230 = add nsw i32 %229, 1
store i32 %230, i32* %9
br label %214
231: ; preds = %225, %214
%232 = getelementptr inbounds [25 x i8], [25 x i8]* %36, i64 0, i64 0
%233 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%234 = load i32, i32* %10
%235 = add nsw i32 %234, 1
%236 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %232, i32 25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %233, i32 %235)
%237 = getelementptr inbounds [25 x i8], [25 x i8]* %36, i64 0, i64 0
%238 = call i32* @fopen(i8* %237, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %238, i32** %37
store i32 0, i32* %11
br label %239
239: ; preds = %231, %258
%240 = load i32*, i32** %37
%241 = getelementptr inbounds [20 x i8], [20 x i8]* %38, i64 0, i64 0
%242 = getelementptr inbounds [20 x i8], [20 x i8]* %39, i64 0, i64 0
%243 = getelementptr inbounds [20 x i8], [20 x i8]* %40, i64 0, i64 0
%244 = call i32 @fscanf(i32* %240, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %241, i8* %242, i8* %243)
store i32 %244, i32* %41
%245 = load i32, i32* %41
%246 = load i32, i32* @EOF
%247 = icmp eq i32 %245, %246
br i1 %247, label %248, label %249
248: ; preds = %239
br label %259
249: ; preds = %239
%250 = load i32, i32* %11
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %24, i64 0, i64 %251
%253 = getelementptr inbounds [20 x i8], [20 x i8]* %252, i64 0, i64 0
%254 = getelementptr inbounds [20 x i8], [20 x i8]* %40, i64 0, i64 0
%255 = call i32 @strcpy(i8* %253, i8* %254)
%256 = load i32, i32* %11
%257 = add nsw i32 %256, 1
store i32 %257, i32* %11
br label %258
258: ; preds = %249
br label %239
259: ; preds = %248
%260 = load i32*, i32** %37
%261 = call i32 @fclose(i32* %260)
br label %266
262: ; preds = %191
br label %263
263: ; preds = %262
%264 = load i32, i32* %10
%265 = add nsw i32 %264, 1
store i32 %265, i32* %10
br label %187
266: ; preds = %259, %187
%267 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%268 = load i32, i32* %31
%269 = icmp eq i32 %268, 1
br i1 %269, label %270, label %272
270: ; preds = %266
%271 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.15, i64 0, i64 0))
br label %272
272: ; preds = %270, %266
%273 = load i8*, i8** %32
%274 = call i32 @free(i8* %273)
br label %171
275: ; preds = %171
br label %117
276: ; preds = %125, %117
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.16, i64 0, i64 0))
%278 = load i32, i32* %28
%279 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0), i32 %278)
store i32 0, i32* %9
br label %280
280: ; preds = %290, %276
%281 = load i32, i32* %9
%282 = load i32, i32* %28
%283 = icmp slt i32 %281, %282
br i1 %283, label %284, label %293
284: ; preds = %280
%285 = load i32, i32* %9
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds [100 x [20 x i8]], [100 x [20 x i8]]* %7, i64 0, i64 %286
%288 = getelementptr inbounds [20 x i8], [20 x i8]* %287, i64 0, i64 0
%289 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %288)
br label %290
290: ; preds = %284
%291 = load i32, i32* %9
%292 = add nsw i32 %291, 1
store i32 %292, i32* %9
br label %280
293: ; preds = %280
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"stammbr.room.%d\00"
@.str.1 = [10 x i8] c"%s/room%d\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [9 x i8] c"%s %s %s\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [9 x i8] c"%s/room1\00"
@EOF = global i32 0
@.str.7 = [31 x i8] c"Let's call it quits for now.\0A'\00"
@.str.8 = [21 x i8] c"CURRENT LOCTION: %s\0A\00"
@.str.9 = [23 x i8] c"POSSIBLE CONNECTIONS: \00"
@.str.10 = [5 x i8] c"%s.\0A\00"
@.str.11 = [5 x i8] c"%s, \00"
@.str.12 = [5 x i8] c"Goo.\00"
@.str.13 = [12 x i8] c"WHERE TO?> \00"
@stdin = global i32 0
@.str.17 = [47 x i8] c"YOU TOOK %d STEPS. YOUR PATH TO VICTORY WAS:\0A\00"
@.str.18 = [3 x i8] c"%s\00"
@str = [47 x i8] c"YOU HAVE FOUND THE END ROOM. CONGRATULATIONS!\00"
@str.19 = [49 x i8] c"HUH? I DON'T UNDERSTAND THAT ROOM. TRY AGAIN.\0A\00"
@str.20 = [37 x i8] c"Wow. That's been a journey for you.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x [20 x i8]]
%4 = alloca [18 x i8]
%5 = alloca [7 x [20 x i8]]
%6 = alloca [25 x i8]
%7 = alloca [20 x i8]
%8 = alloca [20 x i8]
%9 = alloca [20 x i8]
%10 = alloca [20 x i8]
%11 = alloca [25 x i8]
%12 = alloca [20 x i8]
%13 = alloca [20 x i8]
%14 = alloca [20 x i8]
%15 = alloca [8 x [20 x i8]]
%16 = alloca [20 x i8]
%17 = alloca [20 x i8]
%18 = alloca [6 x [20 x i8]]
%19 = alloca i8*
%20 = alloca i64
%21 = alloca [20 x i8]
%22 = alloca [25 x i8]
%23 = alloca [20 x i8]
%24 = alloca [20 x i8]
%25 = alloca [20 x i8]
%26 = tail call i32 @time(i32* null)
%27 = tail call i32 @srand(i32 %26)
%28 = tail call i32 (...) @getpid()
%29 = tail call i32 @gameStart(i32 7, i32 6, i32 %28)
%30 = getelementptr inbounds [100 x [20 x i8]], [100 x [20 x i8]]* %3, i64 0, i64 0, i64 0
%31 = tail call i32 (...) @instruction()
%32 = getelementptr inbounds [18 x i8], [18 x i8]* %4, i64 0, i64 0
%33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %32, i32 18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %28)
%34 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 0, i64 0
%35 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
br label %40
40: ; preds = %2, %40
%41 = phi i64 [ 1, %2 ], [ %51, %40 ]
%42 = trunc i64 %41 to i32
%43 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %35, i32 25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %32, i32 %42)
%44 = call i32* @fopen(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%45 = call i32 @fscanf(i32* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %36, i8* %37, i8* %38)
%46 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %39, i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %38)
%47 = add nsw i64 %41, -1
%48 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 %47, i64 0
%49 = call i32 @strcpy(i8* %48, i8* %39)
%50 = call i32 @fclose(i32* %44)
%51 = add nuw nsw i64 %41, 1
%52 = icmp eq i64 %51, 8
br i1 %52, label %53, label %40
53: ; preds = %40
%54 = getelementptr inbounds [25 x i8], [25 x i8]* %11, i64 0, i64 0
%55 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %54, i32 25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %32)
%56 = call i32* @fopen(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%58 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%60 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %15, i64 0, i64 0, i64 0
%61 = call i32 @fscanf(i32* %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %57, i8* %58, i8* %59)
%62 = load i32, i32* @EOF
%63 = icmp eq i32 %61, %62
br i1 %63, label %74, label %64
64: ; preds = %53, %64
%65 = phi i64 [ %68, %64 ], [ 0, %53 ]
%66 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %15, i64 0, i64 %65, i64 0
%67 = call i32 @strcpy(i8* %66, i8* %59)
%68 = add nuw i64 %65, 1
%69 = call i32 @fscanf(i32* %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %57, i8* %58, i8* %59)
%70 = load i32, i32* @EOF
%71 = icmp eq i32 %69, %70
br i1 %71, label %72, label %64
72: ; preds = %64
%73 = trunc i64 %68 to i32
br label %74
74: ; preds = %72, %53
%75 = phi i32 [ 0, %53 ], [ %73, %72 ]
%76 = call i32 @fclose(i32* %56)
%77 = getelementptr inbounds [20 x i8], [20 x i8]* %16, i64 0, i64 0
%78 = getelementptr inbounds [20 x i8], [20 x i8]* %17, i64 0, i64 0
%79 = call i32 @strcpy(i8* %77, i8* %34)
%80 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 1, i64 0
%81 = call i32 @strcpy(i8* %78, i8* %80)
%82 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %18, i64 0, i64 0, i64 0
%83 = call i64 @strcmp(i8* %77, i8* %78)
%84 = icmp eq i64 %83, 0
br i1 %84, label %209, label %85
85: ; preds = %74
%86 = bitcast i8** %19 to i8*
%87 = bitcast i64* %20 to i8*
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %21, i64 0, i64 0
%89 = getelementptr inbounds [25 x i8], [25 x i8]* %22, i64 0, i64 0
%90 = getelementptr inbounds [20 x i8], [20 x i8]* %23, i64 0, i64 0
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %24, i64 0, i64 0
%92 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%93 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 2, i64 0
%94 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 3, i64 0
%95 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 4, i64 0
%96 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 5, i64 0
%97 = getelementptr inbounds [7 x [20 x i8]], [7 x [20 x i8]]* %5, i64 0, i64 6, i64 0
br label %106
98: ; preds = %184, %202
%99 = phi i32 [ 0, %184 ], [ %203, %202 ]
%100 = call i32 @fclose(i32* %187)
%101 = call i32 @putchar(i32 10)
%102 = load i8*, i8** %19
%103 = call i32 @free(i8* %102)
%104 = call i64 @strcmp(i8* %77, i8* %78)
%105 = icmp eq i64 %104, 0
br i1 %105, label %209, label %106
106: ; preds = %85, %98
%107 = phi i32 [ 0, %85 ], [ %161, %98 ]
%108 = phi i32 [ %75, %85 ], [ %99, %98 ]
%109 = icmp eq i32 %107, 99
br i1 %109, label %110, label %113
110: ; preds = %106
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.20, i64 0, i64 0))
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %209
113: ; preds = %106
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %60)
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%116 = icmp sgt i32 %108, 2
br i1 %116, label %117, label %124
117: ; preds = %113
%118 = add nsw i32 %108, -1
%119 = add nsw i32 %108, -2
%120 = zext i32 %119 to i64
%121 = zext i32 %118 to i64
br label %128
122: ; preds = %128
%123 = trunc i64 %134 to i32
br label %124
124: ; preds = %122, %113
%125 = phi i32 [ 0, %113 ], [ %123, %122 ]
%126 = icmp sgt i32 %125, 0
%127 = zext i32 %125 to i64
br label %140
128: ; preds = %117, %128
%129 = phi i64 [ 0, %117 ], [ %134, %128 ]
%130 = phi i64 [ 1, %117 ], [ %138, %128 ]
%131 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %18, i64 0, i64 %129, i64 0
%132 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %15, i64 0, i64 %130, i64 0
%133 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %131, i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %132)
%134 = add nuw nsw i64 %129, 1
%135 = icmp eq i64 %130, %120
%136 = select i1 %135, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0)
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %136, i8* %132)
%138 = add nuw nsw i64 %130, 1
%139 = icmp eq i64 %138, %121
br i1 %139, label %122, label %128
140: ; preds = %204, %124
store i64 25, i64* %20
%141 = call i64 @malloc(i64 25)
%142 = inttoptr i64 %141 to i8*
store i8* %142, i8** %19
%143 = icmp eq i64 %141, 0
br i1 %143, label %144, label %146
144: ; preds = %140
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %146
146: ; preds = %144, %140
%147 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%148 = load i32, i32* @stdin
%149 = call i64 @getline(i8** %19, i64* %20, i32 %148)
br i1 %126, label %150, label %204
150: ; preds = %146, %199
%151 = phi i64 [ %200, %199 ], [ 0, %146 ]
%152 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %18, i64 0, i64 %151, i64 0
%153 = call i32 @strcpy(i8* %88, i8* %152)
%154 = load i8*, i8** %19
%155 = call i64 @strcmp(i8* %88, i8* %154)
%156 = icmp eq i64 %155, 0
br i1 %156, label %157, label %199
157: ; preds = %150
%158 = zext i32 %107 to i64
%159 = getelementptr inbounds [100 x [20 x i8]], [100 x [20 x i8]]* %3, i64 0, i64 %158, i64 0
%160 = call i32 @strcpy(i8* %159, i8* %88)
%161 = add nuw nsw i32 %107, 1
%162 = call i32 @strcpy(i8* %77, i8* %88)
%163 = call i64 @strcmp(i8* %88, i8* %34)
%164 = icmp eq i64 %163, 0
br i1 %164, label %184, label %165
165: ; preds = %157
%166 = call i64 @strcmp(i8* %88, i8* %80)
%167 = icmp eq i64 %166, 0
br i1 %167, label %184, label %168
168: ; preds = %165
%169 = call i64 @strcmp(i8* %88, i8* %93)
%170 = icmp eq i64 %169, 0
br i1 %170, label %184, label %171
171: ; preds = %168
%172 = call i64 @strcmp(i8* %88, i8* %94)
%173 = icmp eq i64 %172, 0
br i1 %173, label %184, label %174
174: ; preds = %171
%175 = call i64 @strcmp(i8* %88, i8* %95)
%176 = icmp eq i64 %175, 0
br i1 %176, label %184, label %177
177: ; preds = %174
%178 = call i64 @strcmp(i8* %88, i8* %96)
%179 = icmp eq i64 %178, 0
br i1 %179, label %184, label %180
180: ; preds = %177
%181 = call i64 @strcmp(i8* %88, i8* %97)
%182 = icmp eq i64 %181, 0
%183 = select i1 %182, i32 7, i32 1
br label %184
184: ; preds = %180, %177, %174, %171, %168, %165, %157
%185 = phi i32 [ 1, %157 ], [ 2, %165 ], [ 3, %168 ], [ 4, %171 ], [ 5, %174 ], [ 6, %177 ], [ %183, %180 ]
%186 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %89, i32 25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %32, i32 %185)
%187 = call i32* @fopen(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%188 = call i32 @fscanf(i32* %187, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %90, i8* %91, i8* %92)
%189 = load i32, i32* @EOF
%190 = icmp eq i32 %188, %189
br i1 %190, label %98, label %191
191: ; preds = %184, %191
%192 = phi i64 [ %195, %191 ], [ 0, %184 ]
%193 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %15, i64 0, i64 %192, i64 0
%194 = call i32 @strcpy(i8* %193, i8* %92)
%195 = add nuw i64 %192, 1
%196 = call i32 @fscanf(i32* %187, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %90, i8* %91, i8* %92)
%197 = load i32, i32* @EOF
%198 = icmp eq i32 %196, %197
br i1 %198, label %202, label %191
199: ; preds = %150
%200 = add nuw nsw i64 %151, 1
%201 = icmp eq i64 %200, %127
br i1 %201, label %204, label %150
202: ; preds = %191
%203 = trunc i64 %195 to i32
br label %98
204: ; preds = %199, %146
%205 = call i32 @putchar(i32 10)
%206 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.19, i64 0, i64 0))
%207 = load i8*, i8** %19
%208 = call i32 @free(i8* %207)
br label %140
209: ; preds = %98, %74, %110
%210 = phi i32 [ 99, %110 ], [ 0, %74 ], [ %161, %98 ]
%211 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%212 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0), i32 %210)
%213 = icmp sgt i32 %210, 0
br i1 %213, label %214, label %222
214: ; preds = %209
%215 = zext i32 %210 to i64
br label %216
216: ; preds = %214, %216
%217 = phi i64 [ 0, %214 ], [ %220, %216 ]
%218 = getelementptr inbounds [100 x [20 x i8]], [100 x [20 x i8]]* %3, i64 0, i64 %217, i64 0
%219 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* %218)
%220 = add nuw nsw i64 %217, 1
%221 = icmp eq i64 %220, %215
br i1 %221, label %222, label %216
222: ; preds = %216, %209
ret i32 0
}