#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 */
struct timeval {
  int tv_usec;
  int tv_sec;
};
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int combat(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *,
           int *, int *, int *, int *, int *, int *, int);
int /*<<< orphan*/ getint(int *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int rand();
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ trade(int *, int *, int *, int *, int *, int *, int *, int *,
                         int *, int *, int *, int *, int *, int *,
                         int /*<<< orphan*/);
void adventurer(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) {
  struct timespec a;
  a.tv_sec = 0;
  a.tv_nsec = 1000;
  nanosleep(&a, NULL);
  struct timeval t1;
  gettimeofday(&t1, NULL);
  srand(t1.tv_usec * t1.tv_sec);
  int i;
  printf("It's another adventurer! Do you want to battle ");
  i = rand() % 2;
  if (i == 0) {
    printf("her ");
  } else {
    printf("him ");
  }
  printf("or you want to trade something?\n");
  if (*(loot + *pos) == -1) {
    printf("The adventurer recognise you! You have to fight!\n");
    *control = combat(hpmax, hpnow, aces, inv, slave, future, map, loot, vision,
                      end, pos, floor, start, antimag, checkcurse, nomag, 10);
  } else {
    printf("[0]: Battle\n[1]: Trade\n");
    do {
      getint(&i);
      if (i == 0)
        *control =
            combat(hpmax, hpnow, aces, inv, slave, future, map, loot, vision,
                   end, pos, floor, start, antimag, checkcurse, nomag, 10);
      else if (i == 1)
        trade(hpmax, hpnow, aces, inv, slave, future, map, loot, vision, end,
              pos, floor, start, antimag, 0);
      else {
        printf("The adventurer didn't understand your intentions! Do you want "
               "to battle or to trade?\n[0]: Battle\n[1]: Trade\n");
        i = -1;
      }
    } while ((i != 0) && (i != 1));
  }
}


x86 assembly (clang, -O0):
<adventurer>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    0x60(%rbp),%rax
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)
movq   $0x0,-0x60(%rbp)
movl   $0x3e8,-0x68(%rbp)
lea    -0x68(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <nanosleep@plt>
lea    -0x70(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x70(%rbp),%edi
imul   -0x6c(%rbp),%edi
call   1080 <srand@plt>
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   10a0 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x74(%rbp)
cmpl   $0x0,-0x74(%rbp)
jne    1246 <adventurer+0xc6>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
jmp    1252 <adventurer+0xd2>
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
lea    0xde1(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rbp),%rax
mov    0x30(%rbp),%rcx
movslq (%rcx),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    132e <adventurer+0x1ae>
lea    0xde1(%rip),%rdi
call   1030 <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),%rax
mov    %rax,-0x90(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    0x20(%rbp),%r13
mov    0x28(%rbp),%r12
mov    0x30(%rbp),%r15
mov    0x38(%rbp),%r14
mov    0x40(%rbp),%rbx
mov    0x48(%rbp),%r11
mov    0x50(%rbp),%r10
mov    0x58(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x88(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x80(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %rbx,0x30(%rsp)
mov    %r11,0x38(%rsp)
mov    %r10,0x40(%rsp)
mov    %rax,0x48(%rsp)
movl   $0xa,0x50(%rsp)
call   1040 <combat@plt>
mov    %eax,%ecx
mov    0x60(%rbp),%rax
mov    %ecx,(%rax)
jmp    14dc <adventurer+0x35c>
lea    0xdad(%rip),%rdi
call   1030 <printf@plt>
lea    -0x74(%rbp),%rdi
call   1070 <getint@plt>
cmpl   $0x0,-0x74(%rbp)
jne    1402 <adventurer+0x282>
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,-0xa8(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    0x20(%rbp),%r13
mov    0x28(%rbp),%r12
mov    0x30(%rbp),%r15
mov    0x38(%rbp),%r14
mov    0x40(%rbp),%rbx
mov    0x48(%rbp),%r11
mov    0x50(%rbp),%r10
mov    0x58(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,(%rsp)
mov    -0xa0(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x98(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %rbx,0x30(%rsp)
mov    %r11,0x38(%rsp)
mov    %r10,0x40(%rsp)
mov    %rax,0x48(%rsp)
movl   $0xa,0x50(%rsp)
call   1040 <combat@plt>
mov    %eax,%ecx
mov    0x60(%rbp),%rax
mov    %ecx,(%rax)
jmp    14a5 <adventurer+0x325>
cmpl   $0x1,-0x74(%rbp)
jne    148d <adventurer+0x30d>
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    %rax,-0xb0(%rbp)
xor    %eax,%eax
mov    -0xb0(%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)
movl   $0x0,0x40(%rsp)
call   1090 <trade@plt>
jmp    14a0 <adventurer+0x320>
lea    0xbf9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x74(%rbp)
jmp    14a5 <adventurer+0x325>
jmp    14aa <adventurer+0x32a>
xor    %eax,%eax
cmpl   $0x0,-0x74(%rbp)
mov    %al,-0xb1(%rbp)
je     14c9 <adventurer+0x349>
cmpl   $0x1,-0x74(%rbp)
setne  %al
mov    %al,-0xb1(%rbp)
mov    -0xb1(%rbp),%al
test   $0x1,%al
jne    133a <adventurer+0x1ba>
jmp    14dc <adventurer+0x35c>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<adventurer>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,%r12
mov    %rcx,%r13
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%r14
movq   $0x0,0x20(%rsp)
movl   $0x3e8,0x18(%rsp)
mov    0x68(%rsp),%rbx
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   1060 <nanosleep@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1070 <gettimeofday@plt>
mov    0x14(%rsp),%edi
imul   0x10(%rsp),%edi
call   1090 <srand@plt>
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rsp)
lea    0xe18(%rip),%rax
lea    0xe16(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
lea    0xe0b(%rip),%rdi
call   1030 <puts@plt>
mov    0x80(%rsp),%rax
movslq (%rax),%rax
cmpl   $0xffffffff,(%rbx,%rax,4)
je     1384 <adventurer+0x1f4>
mov    %r15,%rbx
mov    0x8(%rsp),%r15
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
jmp    12c6 <adventurer+0x136>
nop
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %r15,%r9
push   $0x0
push   0xa8(%rsp)
push   0xa8(%rsp)
push   0xa8(%rsp)
push   0xa8(%rsp)
push   0xa8(%rsp)
push   0xa8(%rsp)
push   0xa8(%rsp)
push   0xa8(%rsp)
call   10a0 <trade@plt>
add    $0x50,%rsp
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
jbe    1403 <adventurer+0x273>
lea    0x4(%rsp),%rdi
call   1080 <getint@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     1260 <adventurer+0xd0>
test   %eax,%eax
jne    1360 <adventurer+0x1d0>
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %r15,%r9
push   $0xa
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
call   1050 <combat@plt>
add    $0x60,%rsp
mov    0xb0(%rsp),%rcx
mov    %eax,(%rcx)
jmp    12b9 <adventurer+0x129>
nopw   0x0(%rax,%rax,1)
lea    0xcf3(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,0x4(%rsp)
ff
mov    $0xffffffff,%eax
cmp    $0x1,%eax
ja     12c6 <adventurer+0x136>
jmp    1403 <adventurer+0x273>
lea    0xd3b(%rip),%rdi
call   1030 <puts@plt>
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    0x10(%rsp),%r9
push   $0xa
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
push   0xb8(%rsp)
call   1050 <combat@plt>
add    $0x60,%rsp
mov    0xb0(%rsp),%rcx
mov    %eax,(%rcx)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
%struct.timeval = type { i32, i32 }
@.str = [48 x i8] c"It's another adventurer! Do you want to battle \00"
@.str.1 = [5 x i8] c"her \00"
@.str.2 = [5 x i8] c"him \00"
@.str.3 = [33 x i8] c"or you want to trade something?\0A\00"
@.str.4 = [50 x i8] c"The adventurer recognise you! You have to fight!\0A\00"
@.str.5 = [24 x i8] c"[0]: Battle\0A[1]: Trade\0A\00"
@.str.6 = [109 x i8] c"The adventurer didn't understand your intentions! Do you want to battle or to trade?\0A[0]: Battle\0A[1]: Trade\0A\00"
define void @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* %16) {
%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*
%35 = alloca %struct.timespec
%36 = alloca %struct.timeval
%37 = alloca i32
store i32* %0, i32** %18
store i32* %1, i32** %19
store i32* %2, i32** %20
store i32* %3, i32** %21
store i32* %4, i32** %22
store i32* %5, i32** %23
store i32* %6, i32** %24
store i32* %7, i32** %25
store i32* %8, i32** %26
store i32* %9, i32** %27
store i32* %10, i32** %28
store i32* %11, i32** %29
store i32* %12, i32** %30
store i32* %13, i32** %31
store i32* %14, i32** %32
store i32* %15, i32** %33
store i32* %16, i32** %34
%38 = getelementptr inbounds %struct.timespec, %struct.timespec* %35, i32 0, i32 1
store i64 0, i64* %38
%39 = getelementptr inbounds %struct.timespec, %struct.timespec* %35, i32 0, i32 0
store i32 1000, i32* %39
%40 = call i32 @nanosleep(%struct.timespec* %35, i32* null)
%41 = call i32 @gettimeofday(%struct.timeval* %36, i32* null)
%42 = getelementptr inbounds %struct.timeval, %struct.timeval* %36, i32 0, i32 0
%43 = load i32, i32* %42
%44 = getelementptr inbounds %struct.timeval, %struct.timeval* %36, i32 0, i32 1
%45 = load i32, i32* %44
%46 = mul nsw i32 %43, %45
%47 = call i32 @srand(i32 %46)
%48 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%49 = call i32 (...) @rand()
%50 = srem i32 %49, 2
store i32 %50, i32* %37
%51 = load i32, i32* %37
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %17
%54 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %57
55: ; preds = %17
%56 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %57
57: ; preds = %55, %53
%58 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%59 = load i32*, i32** %25
%60 = load i32*, i32** %28
%61 = load i32, i32* %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %59, i64 %62
%64 = load i32, i32* %63
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %86
66: ; preds = %57
%67 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%68 = load i32*, i32** %18
%69 = load i32*, i32** %19
%70 = load i32*, i32** %20
%71 = load i32*, i32** %21
%72 = load i32*, i32** %22
%73 = load i32*, i32** %23
%74 = load i32*, i32** %24
%75 = load i32*, i32** %25
%76 = load i32*, i32** %26
%77 = load i32*, i32** %27
%78 = load i32*, i32** %28
%79 = load i32*, i32** %29
%80 = load i32*, i32** %30
%81 = load i32*, i32** %31
%82 = load i32*, i32** %32
%83 = load i32*, i32** %33
%84 = call i32 @combat(i32* %68, i32* %69, i32* %70, 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 10)
%85 = load i32*, i32** %34
store i32 %84, i32* %85
br label %143
86: ; preds = %57
%87 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %88
88: ; preds = %140, %86
%89 = call i32 @getint(i32* %37)
%90 = load i32, i32* %37
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %111
92: ; preds = %88
%93 = load i32*, i32** %18
%94 = load i32*, i32** %19
%95 = load i32*, i32** %20
%96 = load i32*, i32** %21
%97 = load i32*, i32** %22
%98 = load i32*, i32** %23
%99 = load i32*, i32** %24
%100 = load i32*, i32** %25
%101 = load i32*, i32** %26
%102 = load i32*, i32** %27
%103 = load i32*, i32** %28
%104 = load i32*, i32** %29
%105 = load i32*, i32** %30
%106 = load i32*, i32** %31
%107 = load i32*, i32** %32
%108 = load i32*, i32** %33
%109 = call i32 @combat(i32* %93, 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* %106, i32* %107, i32* %108, i32 10)
%110 = load i32*, i32** %34
store i32 %109, i32* %110
br label %133
111: ; preds = %88
%112 = load i32, i32* %37
%113 = icmp eq i32 %112, 1
br i1 %113, label %114, label %130
114: ; preds = %111
%115 = load i32*, i32** %18
%116 = load i32*, i32** %19
%117 = load i32*, i32** %20
%118 = load i32*, i32** %21
%119 = load i32*, i32** %22
%120 = load i32*, i32** %23
%121 = load i32*, i32** %24
%122 = load i32*, i32** %25
%123 = load i32*, i32** %26
%124 = load i32*, i32** %27
%125 = load i32*, i32** %28
%126 = load i32*, i32** %29
%127 = load i32*, i32** %30
%128 = load i32*, i32** %31
%129 = call i32 @trade(i32* %115, i32* %116, i32* %117, i32* %118, i32* %119, i32* %120, i32* %121, i32* %122, i32* %123, i32* %124, i32* %125, i32* %126, i32* %127, i32* %128, i32 0)
br label %132
130: ; preds = %111
%131 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %37
br label %132
132: ; preds = %130, %114
br label %133
133: ; preds = %132, %92
br label %134
134: ; preds = %133
%135 = load i32, i32* %37
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %140
137: ; preds = %134
%138 = load i32, i32* %37
%139 = icmp ne i32 %138, 1
br label %140
140: ; preds = %137, %134
%141 = phi i1 [ false, %134 ], [ %139, %137 ]
br i1 %141, label %88, label %142
142: ; preds = %140
br label %143
143: ; preds = %142, %66
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
%struct.timeval = type { i32, i32 }
@.str = [48 x i8] c"It's another adventurer! Do you want to battle \00"
@.str.1 = [5 x i8] c"her \00"
@.str.2 = [5 x i8] c"him \00"
@str = [32 x i8] c"or you want to trade something?\00"
@str.7 = [23 x i8] c"[0]: Battle\0A[1]: Trade\00"
@str.8 = [108 x i8] c"The adventurer didn't understand your intentions! Do you want to battle or to trade?\0A[0]: Battle\0A[1]: Trade\00"
@str.9 = [49 x i8] c"The adventurer recognise you! You have to fight!\00"
define void @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* nocapture writeonly %16) {
%18 = alloca %struct.timespec
%19 = alloca %struct.timeval
%20 = alloca i32
%21 = bitcast %struct.timespec* %18 to i8*
%22 = getelementptr inbounds %struct.timespec, %struct.timespec* %18, i64 0, i32 1
store i64 0, i64* %22
%23 = getelementptr inbounds %struct.timespec, %struct.timespec* %18, i64 0, i32 0
store i32 1000, i32* %23
%24 = call i32 @nanosleep(%struct.timespec* %18, i32* null)
%25 = bitcast %struct.timeval* %19 to i8*
%26 = call i32 @gettimeofday(%struct.timeval* %19, i32* null)
%27 = getelementptr inbounds %struct.timeval, %struct.timeval* %19, i64 0, i32 0
%28 = load i32, i32* %27
%29 = getelementptr inbounds %struct.timeval, %struct.timeval* %19, i64 0, i32 1
%30 = load i32, i32* %29
%31 = mul nsw i32 %30, %28
%32 = call i32 @srand(i32 %31)
%33 = bitcast i32* %20 to i8*
%34 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%35 = call i32 (...) @rand()
%36 = srem i32 %35, 2
store i32 %36, i32* %20
%37 = icmp eq i32 %36, 0
%38 = select i1 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%39 = call i32 @printf(i8* dereferenceable(1) %38)
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %7, i64 %42
%44 = load i32, i32* %43
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %49
46: ; preds = %17
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.9, i64 0, i64 0))
%48 = 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 10)
store i32 %48, i32* %16
br label %65
49: ; preds = %17
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
br label %51
51: ; preds = %62, %49
%52 = call i32 @getint(i32* %20)
%53 = load i32, i32* %20
switch i32 %53, label %58 [
i32 0, label %54
i32 1, label %56
]
54: ; preds = %51
%55 = 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 10)
store i32 %55, i32* %16
br label %60
56: ; preds = %51
%57 = call i32 @trade(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 0)
br label %60
58: ; preds = %51
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.8, i64 0, i64 0))
store i32 -1, i32* %20
br label %62
60: ; preds = %56, %54
%61 = load i32, i32* %20
br label %62
62: ; preds = %60, %58
%63 = phi i32 [ %61, %60 ], [ -1, %58 ]
%64 = icmp ult i32 %63, 2
br i1 %64, label %65, label %51
65: ; preds = %62, %46
ret void
}