#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 */

/* Variables and functions */
int /*<<< orphan*/ adventurer(int *, int *, int *, int *, int *, int *, int *,
                              int *, int *, int *, int *, int *, int *, int *,
                              int *, int *, int *);
int /*<<< orphan*/ blackqueen(int *, int *, int *, int *, int *, int *, int *,
                              int *, int *, int *, int *, int *,
                              int /*<<< orphan*/);
int combat(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *,
           int *, int *, int *, int *, int *, int *, int);
int /*<<< orphan*/ hebrac(int *, int *, int *, int *, int *, int *, int *,
                          int *, int *, int *, int *, int *, int /*<<< orphan*/,
                          int, int /*<<< orphan*/);
int /*<<< orphan*/ merchant(int *, int *, int *, int *, int *, int *, int *,
                            int *, int *, int *, int *, int *, int *, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ redqueen(int *, int *, int *, int *, int *, int *, int *,
                            int *, int *, int *, int *, int *,
                            int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ treasure(int *, int *, int *, int *, int *, int *, int *,
                            int *, int *, int *, int *, int *,
                            int /*<<< orphan*/, int, int /*<<< orphan*/);
void room(int *hpmax, int *hpnow, int *aces, int *inv, int *slave, int *future,
          int *map, int *loot, int *vision, int *end, int *pos, int *floor,
          int *start, int *antimag, int *checkcurse, int *nomag) {
  int control = 1;
  int r = *(map + *pos);
  if (r == -1) {
    printf("There are stairs here!\n");
    return;
  }
  if (r < 0)
    return;
  if (r >= 52)
    hebrac(hpmax, hpnow, aces, inv, slave, future, map, loot, vision, end, pos,
           antimag, 0, 1, 0);
  else if (r % 13 == 12)
    merchant(hpmax, hpnow, aces, inv, slave, future, map, loot, vision, end,
             pos, floor, start, antimag);
  else if (r % 13 == 11) {
    if (r >= 25)
      blackqueen(hpmax, hpnow, aces, inv, slave, future, map, loot, vision, end,
                 pos, antimag, 0);
    else
      redqueen(hpmax, hpnow, aces, inv, slave, future, map, loot, vision, end,
               pos, antimag, 0, 1, 0);
  } else if (r % 13 == 10)
    adventurer(hpmax, hpnow, aces, inv, slave, future, map, loot, vision, end,
               pos, floor, start, antimag, checkcurse, nomag, &control);
  else if (r % 13 == 0) {
    printf("The room is empty... but maybe there is something interesting!\n");
    treasure(hpmax, hpnow, aces, inv, slave, future, map, loot, vision, end,
             pos, antimag, 0, 1, 0);
  } else
    control = combat(hpmax, hpnow, aces, inv, slave, future, map, loot, vision,
                     end, pos, floor, start, antimag, checkcurse, nomag, r);
  if ((control == 1) && (*(map + *pos) >= 0))
    *(map + *pos) = -2;
}


x86 assembly (clang, -O0):
<room>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    0x10(%rbp),%rax
mov    0x30(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x60(%rbp)
cmpl   $0xffffffff,-0x60(%rbp)
jne    1207 <room+0x87>
lea    0xe03(%rip),%rdi
call   1040 <printf@plt>
jmp    1646 <room+0x4c6>
cmpl   $0x0,-0x60(%rbp)
jge    1216 <room+0x96>
jmp    1646 <room+0x4c6>
cmpl   $0x34,-0x60(%rbp)
jl     1292 <room+0x112>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%r15
mov    0x18(%rbp),%r14
mov    0x20(%rbp),%rbx
mov    0x28(%rbp),%r11
mov    0x30(%rbp),%r10
mov    0x48(%rbp),%rax
xor    %r12d,%r12d
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x1,0x38(%rsp)
movl   $0x0,0x40(%rsp)
call   1070 <hebrac@plt>
jmp    1615 <room+0x495>
mov    -0x60(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cmp    $0xc,%edx
jne    130f <room+0x18f>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%r13
mov    0x18(%rbp),%r12
mov    0x20(%rbp),%r15
mov    0x28(%rbp),%r14
mov    0x30(%rbp),%rbx
mov    0x38(%rbp),%r11
mov    0x40(%rbp),%r10
mov    0x48(%rbp),%rax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1060 <merchant@plt>
jmp    1610 <room+0x490>
mov    -0x60(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cmp    $0xb,%edx
jne    1401 <room+0x281>
cmpl   $0x19,-0x60(%rbp)
jl     138f <room+0x20f>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%r15
mov    0x18(%rbp),%r14
mov    0x20(%rbp),%rbx
mov    0x28(%rbp),%r11
mov    0x30(%rbp),%r10
mov    0x48(%rbp),%rax
xor    %r12d,%r12d
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
movl   $0x0,0x30(%rsp)
call   1090 <blackqueen@plt>
jmp    13fc <room+0x27c>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%r15
mov    0x18(%rbp),%r14
mov    0x20(%rbp),%rbx
mov    0x28(%rbp),%r11
mov    0x30(%rbp),%r10
mov    0x48(%rbp),%rax
xor    %r12d,%r12d
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x1,0x38(%rsp)
movl   $0x0,0x40(%rsp)
call   1080 <redqueen@plt>
jmp    160b <room+0x48b>
mov    -0x60(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cmp    $0xa,%edx
jne    14b9 <room+0x339>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    0x28(%rbp),%r13
mov    0x30(%rbp),%r12
mov    0x38(%rbp),%r15
mov    0x40(%rbp),%r14
mov    0x48(%rbp),%rbx
mov    0x50(%rbp),%r11
mov    0x58(%rbp),%r10
lea    -0x5c(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x78(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x70(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x68(%rbp),%rax
mov    %r13,0x18(%rsp)
mov    %r12,0x20(%rsp)
mov    %r15,0x28(%rsp)
mov    %r14,0x30(%rsp)
mov    %rbx,0x38(%rsp)
mov    %r11,0x40(%rsp)
mov    %r10,0x48(%rsp)
mov    %rax,0x50(%rsp)
call   10a0 <adventurer@plt>
jmp    1606 <room+0x486>
mov    -0x60(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    154b <room+0x3cb>
lea    0xb44(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%r15
mov    0x18(%rbp),%r14
mov    0x20(%rbp),%rbx
mov    0x28(%rbp),%r11
mov    0x30(%rbp),%r10
mov    0x48(%rbp),%rax
xor    %r12d,%r12d
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x1,0x38(%rsp)
movl   $0x0,0x40(%rsp)
call   1030 <treasure@plt>
jmp    1601 <room+0x481>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    0x28(%rbp),%r13
mov    0x30(%rbp),%r12
mov    0x38(%rbp),%r15
mov    0x40(%rbp),%r14
mov    0x48(%rbp),%rbx
mov    0x50(%rbp),%r11
mov    0x58(%rbp),%r10
mov    -0x60(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x98(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x90(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x84(%rbp),%eax
mov    %r13,0x18(%rsp)
mov    %r12,0x20(%rsp)
mov    %r15,0x28(%rsp)
mov    %r14,0x30(%rsp)
mov    %rbx,0x38(%rsp)
mov    %r11,0x40(%rsp)
mov    %r10,0x48(%rsp)
mov    %eax,0x50(%rsp)
call   1050 <combat@plt>
mov    %eax,-0x5c(%rbp)
jmp    1606 <room+0x486>
jmp    160b <room+0x48b>
jmp    1610 <room+0x490>
jmp    1615 <room+0x495>
cmpl   $0x1,-0x5c(%rbp)
jne    1646 <room+0x4c6>
mov    0x10(%rbp),%rax
mov    0x30(%rbp),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jl     1646 <room+0x4c6>
mov    0x10(%rbp),%rax
mov    0x30(%rbp),%rcx
movslq (%rcx),%rcx
movl   $0xfffffffe,(%rax,%rcx,4)
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<room>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,0x18(%rsp)
mov    %rcx,%r15
mov    %rdx,%r13
mov    %rsi,%r12
mov    %rdi,%rbp
mov    0xb8(%rsp),%r10
mov    0xb0(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    0xa8(%rsp),%r8
mov    0xa0(%rsp),%rsi
mov    0x98(%rsp),%rdx
mov    0x90(%rsp),%r14
mov    0x88(%rsp),%rbx
mov    0x80(%rsp),%rax
mov    0x78(%rsp),%rcx
mov    %rcx,0x10(%rsp)
mov    0x70(%rsp),%rdi
movl   $0x1,0x34(%rsp)
movslq (%r14),%rcx
mov    (%rdi,%rcx,4),%r11d
cmp    $0xffffffff,%r11d
je     1276 <room+0xf6>
test   %r11d,%r11d
js     1267 <room+0xe7>
cmp    $0x34,%r11d
jb     1290 <room+0x110>
sub    $0x8,%rsp
mov    %r14,0x10(%rsp)
mov    %rdi,%r14
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r8,%rbp
mov    0x20(%rsp),%r8
push   $0x0
push   $0x1
push   $0x0
push   %rbp
push   0x30(%rsp)
push   %rbx
push   %rax
push   0x50(%rsp)
push   %r14
call   1070 <hebrac@plt>
mov    %r14,%rcx
mov    0x58(%rsp),%r14
add    $0x50,%rsp
movslq (%r14),%rax
cmpl   $0x0,(%rcx,%rax,4)
js     1267 <room+0xe7>
movl   $0xfffffffe,(%rcx,%rax,4)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdf6(%rip),%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>
mov    %rsi,0x20(%rsp)
mov    %rdx,0x28(%rsp)
movzbl %r11b,%ecx
imul   $0x4f,%ecx,%edx
shr    $0xa,%edx
lea    (%rdx,%rdx,2),%esi
lea    (%rdx,%rsi,4),%edx
sub    %dl,%cl
cmp    $0xc,%cl
ja     1329 <room+0x1a9>
movzbl %cl,%ecx
lea    0xd45(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    %rdi,(%rsp)
lea    0xd65(%rip),%rdi
mov    %rax,0x8(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r8,0x20(%rsp)
mov    %r9,%rbx
call   1040 <puts@plt>
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    0x20(%rsp),%r8
mov    %rbx,%r9
push   $0x0
push   $0x1
push   $0x0
push   0x40(%rsp)
push   %r14
push   0x58(%rsp)
push   0x40(%rsp)
push   0x50(%rsp)
push   0x48(%rsp)
call   1030 <treasure@plt>
mov    0x50(%rsp),%rcx
jmp    1253 <room+0xd3>
sub    $0x8,%rsp
mov    %rdi,0x8(%rsp)
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r8,%rbp
mov    0x20(%rsp),%r8
push   %r11
push   %r10
push   0x20(%rsp)
push   %rbp
push   0x48(%rsp)
push   0x58(%rsp)
push   %r14
push   %rbx
push   %rax
push   0x60(%rsp)
push   0x58(%rsp)
call   1050 <combat@plt>
mov    0x60(%rsp),%rcx
add    $0x60,%rsp
cmp    $0x1,%eax
je     1257 <room+0xd7>
jmp    1267 <room+0xe7>
sub    $0x8,%rsp
lea    0x3c(%rsp),%r11
mov    %rdi,0x8(%rsp)
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r8,%rbp
mov    0x20(%rsp),%r8
push   %r11
push   %r10
push   0x20(%rsp)
push   %rbp
push   0x48(%rsp)
push   0x58(%rsp)
push   %r14
push   %rbx
push   %rax
push   0x60(%rsp)
push   0x58(%rsp)
call   10a0 <adventurer@plt>
mov    0x60(%rsp),%rcx
add    $0x60,%rsp
mov    0x34(%rsp),%eax
cmp    $0x1,%eax
je     1257 <room+0xd7>
jmp    1267 <room+0xe7>
mov    %r8,%r10
mov    %rdi,(%rsp)
cmp    $0x19,%r11d
mov    0x18(%rsp),%r8
mov    %r15,%rcx
jb     146a <room+0x2ea>
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
push   $0x0
push   %r10
push   %r14
push   %rbx
push   %rax
push   0x40(%rsp)
mov    0x38(%rsp),%rbx
push   %rbx
call   1090 <blackqueen@plt>
mov    %rbx,%rcx
add    $0x40,%rsp
jmp    1257 <room+0xd7>
mov    %r14,0x8(%rsp)
mov    %rdi,%r14
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r8,%rbp
mov    0x18(%rsp),%r8
push   %rbp
push   0x28(%rsp)
push   0x38(%rsp)
push   0x20(%rsp)
push   %rbx
push   %rax
push   0x40(%rsp)
push   %r14
call   1060 <merchant@plt>
mov    %r14,%rcx
mov    0x48(%rsp),%r14
add    $0x40,%rsp
jmp    1257 <room+0xd7>
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
push   $0x0
push   $0x1
push   $0x0
push   %r10
push   %r14
push   %rbx
push   %rax
push   0x50(%rsp)
mov    0x48(%rsp),%rbx
push   %rbx
call   1080 <redqueen@plt>
mov    %rbx,%rcx
jmp    1253 <room+0xd3>

LLVM IR (-O0):
@.str = [24 x i8] c"There are stairs here!\0A\00"
@.str.1 = [64 x i8] c"The room is empty... but maybe there is something interesting!\0A\00"
define void @room(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15) {
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i32*
%26 = alloca i32*
%27 = alloca i32*
%28 = alloca i32*
%29 = alloca i32*
%30 = alloca i32*
%31 = alloca i32*
%32 = alloca i32*
%33 = alloca i32
%34 = alloca i32
store i32* %0, i32** %17
store i32* %1, i32** %18
store i32* %2, i32** %19
store i32* %3, i32** %20
store i32* %4, i32** %21
store i32* %5, i32** %22
store i32* %6, i32** %23
store i32* %7, i32** %24
store i32* %8, i32** %25
store i32* %9, i32** %26
store i32* %10, i32** %27
store i32* %11, i32** %28
store i32* %12, i32** %29
store i32* %13, i32** %30
store i32* %14, i32** %31
store i32* %15, i32** %32
store i32 1, i32* %33
%35 = load i32*, i32** %23
%36 = load i32*, i32** %27
%37 = load i32, i32* %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %35, i64 %38
%40 = load i32, i32* %39
store i32 %40, i32* %34
%41 = load i32, i32* %34
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %45
43: ; preds = %16
%44 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %203
45: ; preds = %16
%46 = load i32, i32* %34
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %45
br label %203
49: ; preds = %45
%50 = load i32, i32* %34
%51 = icmp sge i32 %50, 52
br i1 %51, label %52, label %66
52: ; preds = %49
%53 = load i32*, i32** %17
%54 = load i32*, i32** %18
%55 = load i32*, i32** %19
%56 = load i32*, i32** %20
%57 = load i32*, i32** %21
%58 = load i32*, i32** %22
%59 = load i32*, i32** %23
%60 = load i32*, i32** %24
%61 = load i32*, i32** %25
%62 = load i32*, i32** %26
%63 = load i32*, i32** %27
%64 = load i32*, i32** %30
%65 = call i32 @hebrac(i32* %53, i32* %54, i32* %55, i32* %56, i32* %57, i32* %58, i32* %59, i32* %60, i32* %61, i32* %62, i32* %63, i32* %64, i32 0, i32 1, i32 0)
br label %186
66: ; preds = %49
%67 = load i32, i32* %34
%68 = srem i32 %67, 13
%69 = icmp eq i32 %68, 12
br i1 %69, label %70, label %86
70: ; preds = %66
%71 = load i32*, i32** %17
%72 = load i32*, i32** %18
%73 = load i32*, i32** %19
%74 = load i32*, i32** %20
%75 = load i32*, i32** %21
%76 = load i32*, i32** %22
%77 = load i32*, i32** %23
%78 = load i32*, i32** %24
%79 = load i32*, i32** %25
%80 = load i32*, i32** %26
%81 = load i32*, i32** %27
%82 = load i32*, i32** %28
%83 = load i32*, i32** %29
%84 = load i32*, i32** %30
%85 = call i32 @merchant(i32* %71, i32* %72, i32* %73, i32* %74, i32* %75, i32* %76, i32* %77, i32* %78, i32* %79, i32* %80, i32* %81, i32* %82, i32* %83, i32* %84)
br label %185
86: ; preds = %66
%87 = load i32, i32* %34
%88 = srem i32 %87, 13
%89 = icmp eq i32 %88, 11
br i1 %89, label %90, label %122
90: ; preds = %86
%91 = load i32, i32* %34
%92 = icmp sge i32 %91, 25
br i1 %92, label %93, label %107
93: ; preds = %90
%94 = load i32*, i32** %17
%95 = load i32*, i32** %18
%96 = load i32*, i32** %19
%97 = load i32*, i32** %20
%98 = load i32*, i32** %21
%99 = load i32*, i32** %22
%100 = load i32*, i32** %23
%101 = load i32*, i32** %24
%102 = load i32*, i32** %25
%103 = load i32*, i32** %26
%104 = load i32*, i32** %27
%105 = load i32*, i32** %30
%106 = call i32 @blackqueen(i32* %94, i32* %95, i32* %96, i32* %97, i32* %98, i32* %99, i32* %100, i32* %101, i32* %102, i32* %103, i32* %104, i32* %105, i32 0)
br label %121
107: ; preds = %90
%108 = load i32*, i32** %17
%109 = load i32*, i32** %18
%110 = load i32*, i32** %19
%111 = load i32*, i32** %20
%112 = load i32*, i32** %21
%113 = load i32*, i32** %22
%114 = load i32*, i32** %23
%115 = load i32*, i32** %24
%116 = load i32*, i32** %25
%117 = load i32*, i32** %26
%118 = load i32*, i32** %27
%119 = load i32*, i32** %30
%120 = call i32 @redqueen(i32* %108, i32* %109, i32* %110, i32* %111, i32* %112, i32* %113, i32* %114, i32* %115, i32* %116, i32* %117, i32* %118, i32* %119, i32 0, i32 1, i32 0)
br label %121
121: ; preds = %107, %93
br label %184
122: ; preds = %86
%123 = load i32, i32* %34
%124 = srem i32 %123, 13
%125 = icmp eq i32 %124, 10
br i1 %125, label %126, label %144
126: ; preds = %122
%127 = load i32*, i32** %17
%128 = load i32*, i32** %18
%129 = load i32*, i32** %19
%130 = load i32*, i32** %20
%131 = load i32*, i32** %21
%132 = load i32*, i32** %22
%133 = load i32*, i32** %23
%134 = load i32*, i32** %24
%135 = load i32*, i32** %25
%136 = load i32*, i32** %26
%137 = load i32*, i32** %27
%138 = load i32*, i32** %28
%139 = load i32*, i32** %29
%140 = load i32*, i32** %30
%141 = load i32*, i32** %31
%142 = load i32*, i32** %32
%143 = call i32 @adventurer(i32* %127, i32* %128, i32* %129, i32* %130, i32* %131, i32* %132, i32* %133, i32* %134, i32* %135, i32* %136, i32* %137, i32* %138, i32* %139, i32* %140, i32* %141, i32* %142, i32* %33)
br label %183
144: ; preds = %122
%145 = load i32, i32* %34
%146 = srem i32 %145, 13
%147 = icmp eq i32 %146, 0
br i1 %147, label %148, label %163
148: ; preds = %144
%149 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%150 = load i32*, i32** %17
%151 = load i32*, i32** %18
%152 = load i32*, i32** %19
%153 = load i32*, i32** %20
%154 = load i32*, i32** %21
%155 = load i32*, i32** %22
%156 = load i32*, i32** %23
%157 = load i32*, i32** %24
%158 = load i32*, i32** %25
%159 = load i32*, i32** %26
%160 = load i32*, i32** %27
%161 = load i32*, i32** %30
%162 = call i32 @treasure(i32* %150, i32* %151, i32* %152, i32* %153, i32* %154, i32* %155, i32* %156, i32* %157, i32* %158, i32* %159, i32* %160, i32* %161, i32 0, i32 1, i32 0)
br label %182
163: ; preds = %144
%164 = load i32*, i32** %17
%165 = load i32*, i32** %18
%166 = load i32*, i32** %19
%167 = load i32*, i32** %20
%168 = load i32*, i32** %21
%169 = load i32*, i32** %22
%170 = load i32*, i32** %23
%171 = load i32*, i32** %24
%172 = load i32*, i32** %25
%173 = load i32*, i32** %26
%174 = load i32*, i32** %27
%175 = load i32*, i32** %28
%176 = load i32*, i32** %29
%177 = load i32*, i32** %30
%178 = load i32*, i32** %31
%179 = load i32*, i32** %32
%180 = load i32, i32* %34
%181 = call i32 @combat(i32* %164, i32* %165, i32* %166, i32* %167, i32* %168, i32* %169, i32* %170, i32* %171, i32* %172, i32* %173, i32* %174, i32* %175, i32* %176, i32* %177, i32* %178, i32* %179, i32 %180)
store i32 %181, i32* %33
br label %182
182: ; preds = %163, %148
br label %183
183: ; preds = %182, %126
br label %184
184: ; preds = %183, %121
br label %185
185: ; preds = %184, %70
br label %186
186: ; preds = %185, %52
%187 = load i32, i32* %33
%188 = icmp eq i32 %187, 1
br i1 %188, label %189, label %203
189: ; preds = %186
%190 = load i32*, i32** %23
%191 = load i32*, i32** %27
%192 = load i32, i32* %191
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds i32, i32* %190, i64 %193
%195 = load i32, i32* %194
%196 = icmp sge i32 %195, 0
br i1 %196, label %197, label %203
197: ; preds = %189
%198 = load i32*, i32** %23
%199 = load i32*, i32** %27
%200 = load i32, i32* %199
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i32, i32* %198, i64 %201
store i32 -2, i32* %202
br label %203
203: ; preds = %43, %48, %197, %189, %186
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"The room is empty... but maybe there is something interesting!\00"
@str.2 = [23 x i8] c"There are stairs here!\00"
define void @room(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15) {
%17 = alloca i32
%18 = bitcast i32* %17 to i8*
store i32 1, i32* %17
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %6, i64 %20
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %26
24: ; preds = %16
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
br label %62
26: ; preds = %16
%27 = icmp slt i32 %22, 0
br i1 %27, label %62, label %28
28: ; preds = %26
%29 = icmp ugt i32 %22, 51
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = tail call i32 @hebrac(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %13, i32 0, i32 1, i32 0)
br label %55
32: ; preds = %28
%33 = trunc i32 %22 to i8
%34 = urem i8 %33, 13
%35 = zext i8 %34 to i32
switch i32 %35, label %50 [
i32 12, label %36
i32 11, label %38
i32 10, label %44
i32 0, label %47
]
36: ; preds = %32
%37 = tail call i32 @merchant(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13)
br label %55
38: ; preds = %32
%39 = icmp ugt i32 %22, 24
br i1 %39, label %40, label %42
40: ; preds = %38
%41 = tail call i32 @blackqueen(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %13, i32 0)
br label %55
42: ; preds = %38
%43 = tail call i32 @redqueen(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %13, i32 0, i32 1, i32 0)
br label %55
44: ; preds = %32
%45 = call i32 @adventurer(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %17)
%46 = load i32, i32* %17
br label %52
47: ; preds = %32
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%49 = tail call i32 @treasure(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %13, i32 0, i32 1, i32 0)
br label %55
50: ; preds = %32
%51 = tail call i32 @combat(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32 %22)
br label %52
52: ; preds = %44, %50
%53 = phi i32 [ %51, %50 ], [ %46, %44 ]
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %62
55: ; preds = %36, %47, %40, %42, %30, %52
%56 = load i32, i32* %10
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %6, i64 %57
%59 = load i32, i32* %58
%60 = icmp sgt i32 %59, -1
br i1 %60, label %61, label %62
61: ; preds = %55
store i32 -2, i32* %58
br label %62
62: ; preds = %52, %55, %61, %26, %24
ret void
}