#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*/ checkpositiveinv(int *);
int /*<<< orphan*/ getint(int *);
int min(int, int);
int /*<<< orphan*/ nameitem(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ removeslave(int *, int);
void useitemcombat(int *hpmax, int *hpnow, int *inv, int *slave, int *bonusnext,
                   int *bonuscomb) {
  int k = -1;
  char s[20];
  printf("Do you want to use an item or seek help from a prisoner?\n[0]: "
         "Item\n[1]: Prisoner\n");
  getint(&k);
  if (k == 0) {
    printf("What item do you want to use?\n");
    getint(&k);
    if ((k < 0) || (k >= 10) || (*(inv + k) == 0)) {
      printf("Maybe you are a little too much excited for this fight!\n");
      return;
    } else if (*(inv + k) < 14) {
      if (*hpmax == *hpnow) {
        printf("Not really useful now...\n");
        return;
      }
      nameitem(s, *(inv + k));
      printf("You use %s!\n", s);
      *hpnow = min(*hpmax, *hpnow + (*(inv + k) % 13) + 1);
      *(inv + k) = 0;
    } else if (*(inv + k) < 27) {
      printf("Gems are nice, but not really useful in a fight!\n");
      return;
    } else if (*(inv + k) < 40) {
      printf("If you want to do magic, maybe you have to cast a spell...\n");
      return;
    } else {
      nameitem(s, *(inv + k));
      printf("You use %s!\n", s);
      *bonusnext = *bonusnext + (*(inv + k) % 13) + 1;
      *(inv + k) = 0;
    }
  } else if (k == 1) {
    if (!checkpositiveinv(slave)) {
      printf("There aren't other adventures with you!\n");
      return;
    } else {
      *bonuscomb = *bonuscomb + 3;
      removeslave(slave, 1);
      printf("A prisoner join your fight for his freedom!\n");
    }
  } else {
    printf("Maybe you are a little too much excited for this fight!\n");
  }
}


x86 assembly (clang, -O0):
<useitemcombat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0xffffffff,-0x34(%rbp)
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x34(%rbp),%rdi
call   1050 <getint@plt>
cmpl   $0x0,-0x34(%rbp)
jne    1351 <useitemcombat+0x1f1>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x34(%rbp),%rdi
call   1050 <getint@plt>
cmpl   $0x0,-0x34(%rbp)
jl     11e5 <useitemcombat+0x85>
cmpl   $0xa,-0x34(%rbp)
jge    11e5 <useitemcombat+0x85>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11f8 <useitemcombat+0x98>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c3 <useitemcombat+0x263>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0xe,(%rax,%rcx,4)
jge    129a <useitemcombat+0x13a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    122f <useitemcombat+0xcf>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c3 <useitemcombat+0x263>
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1060 <nameitem@plt>
lea    -0x50(%rbp),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
add    %edx,%esi
add    $0x1,%esi
call   1040 <min@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    1347 <useitemcombat+0x1e7>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x1b,(%rax,%rcx,4)
jge    12bf <useitemcombat+0x15f>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c3 <useitemcombat+0x263>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x28,(%rax,%rcx,4)
jge    12e4 <useitemcombat+0x184>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c3 <useitemcombat+0x263>
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1060 <nameitem@plt>
lea    -0x50(%rbp),%rsi
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
mov    $0xd,%esi
cltd
idiv   %esi
add    %edx,%ecx
add    $0x1,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    1342 <useitemcombat+0x1e2>
jmp    1347 <useitemcombat+0x1e7>
jmp    134c <useitemcombat+0x1ec>
jmp    13c3 <useitemcombat+0x263>
cmpl   $0x1,-0x34(%rbp)
jne    13b0 <useitemcombat+0x250>
mov    -0x20(%rbp),%rdi
call   1070 <checkpositiveinv@plt>
cmp    $0x0,%eax
jne    1380 <useitemcombat+0x220>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c3 <useitemcombat+0x263>
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
add    $0x3,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1080 <removeslave@plt>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13be <useitemcombat+0x25e>
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c3 <useitemcombat+0x263>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useitemcombat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%rbp
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r13
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xe6e(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1060 <getint@plt>
mov    0xc(%rsp),%eax
cmp    $0x1,%eax
je     1204 <useitemcombat+0x94>
test   %eax,%eax
jne    11fb <useitemcombat+0x8b>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1060 <getint@plt>
mov    0xc(%rsp),%eax
cmp    $0x9,%rax
ja     11fb <useitemcombat+0x8b>
mov    (%r14,%rax,4),%esi
test   %esi,%esi
je     11fb <useitemcombat+0x8b>
cmp    $0xd,%esi
jg     1245 <useitemcombat+0xd5>
mov    0x0(%r13),%eax
cmp    (%r12),%eax
jne    1253 <useitemcombat+0xe3>
lea    0xf43(%rip),%rdi
jmp    1231 <useitemcombat+0xc1>
lea    0xf53(%rip),%rdi
jmp    1231 <useitemcombat+0xc1>
mov    %rbx,%rdi
call   1080 <checkpositiveinv@plt>
test   %eax,%eax
je     122a <useitemcombat+0xba>
addl   $0x3,0x0(%rbp)
mov    %rbx,%rdi
mov    $0x1,%esi
call   1090 <removeslave@plt>
lea    0xe5e(%rip),%rdi
jmp    1231 <useitemcombat+0xc1>
lea    0xe2d(%rip),%rdi
call   1030 <puts@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x1a,%esi
ja     12bf <useitemcombat+0x14f>
lea    0xeba(%rip),%rdi
jmp    1231 <useitemcombat+0xc1>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <nameitem@plt>
lea    0xd99(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%r13),%edi
mov    (%r12),%eax
movslq 0xc(%rsp),%rcx
movslq (%r14,%rcx,4),%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,2),%esi
lea    (%rdx,%rsi,4),%edx
sub    %edx,%ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
call   1050 <min@plt>
mov    %eax,(%r12)
movslq 0xc(%rsp),%rax
movl   $0x0,(%r14,%rax,4)
jmp    1236 <useitemcombat+0xc6>
cmp    $0x27,%esi
ja     12d0 <useitemcombat+0x160>
lea    0xe05(%rip),%rdi
jmp    1231 <useitemcombat+0xc1>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <nameitem@plt>
lea    0xd1c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%eax
movslq 0xc(%rsp),%rcx
movslq (%r14,%rcx,4),%rdx
imul   $0x4ec4ec4f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,2),%edi
lea    (%rsi,%rdi,4),%esi
sub    %esi,%edx
add    %edx,%eax
add    $0x1,%eax
mov    %eax,(%r15)
movl   $0x0,(%r14,%rcx,4)
jmp    1236 <useitemcombat+0xc6>

LLVM IR (-O0):
@.str = [82 x i8] c"Do you want to use an item or seek help from a prisoner?\0A[0]: Item\0A[1]: Prisoner\0A\00"
@.str.1 = [31 x i8] c"What item do you want to use?\0A\00"
@.str.2 = [57 x i8] c"Maybe you are a little too much excited for this fight!\0A\00"
@.str.3 = [26 x i8] c"Not really useful now...\0A\00"
@.str.4 = [13 x i8] c"You use %s!\0A\00"
@.str.5 = [50 x i8] c"Gems are nice, but not really useful in a fight!\0A\00"
@.str.6 = [60 x i8] c"If you want to do magic, maybe you have to cast a spell...\0A\00"
@.str.7 = [41 x i8] c"There aren't other adventures with you!\0A\00"
@.str.8 = [45 x i8] c"A prisoner join your fight for his freedom!\0A\00"
define void @useitemcombat(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca [20 x i8]
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
store i32 -1, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @getint(i32* %13)
%17 = load i32, i32* %13
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %126
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @getint(i32* %13)
%22 = load i32, i32* %13
%23 = icmp slt i32 %22, 0
br i1 %23, label %34, label %24
24: ; preds = %19
%25 = load i32, i32* %13
%26 = icmp sge i32 %25, 10
br i1 %26, label %34, label %27
27: ; preds = %24
%28 = load i32*, i32** %9
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %27, %24, %19
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
br label %147
36: ; preds = %27
%37 = load i32*, i32** %9
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %37, i64 %39
%41 = load i32, i32* %40
%42 = icmp slt i32 %41, 14
br i1 %42, label %43, label %79
43: ; preds = %36
%44 = load i32*, i32** %7
%45 = load i32, i32* %44
%46 = load i32*, i32** %8
%47 = load i32, i32* %46
%48 = icmp eq i32 %45, %47
br i1 %48, label %49, label %51
49: ; preds = %43
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %147
51: ; preds = %43
%52 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%53 = load i32*, i32** %9
%54 = load i32, i32* %13
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
%58 = call i32 @nameitem(i8* %52, i32 %57)
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %59)
%61 = load i32*, i32** %7
%62 = load i32, i32* %61
%63 = load i32*, i32** %8
%64 = load i32, i32* %63
%65 = load i32*, i32** %9
%66 = load i32, i32* %13
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %65, i64 %67
%69 = load i32, i32* %68
%70 = srem i32 %69, 13
%71 = add nsw i32 %64, %70
%72 = add nsw i32 %71, 1
%73 = call i32 @min(i32 %62, i32 %72)
%74 = load i32*, i32** %8
store i32 %73, i32* %74
%75 = load i32*, i32** %9
%76 = load i32, i32* %13
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i32, i32* %75, i64 %77
store i32 0, i32* %78
br label %124
79: ; preds = %36
%80 = load i32*, i32** %9
%81 = load i32, i32* %13
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i32, i32* %80, i64 %82
%84 = load i32, i32* %83
%85 = icmp slt i32 %84, 27
br i1 %85, label %86, label %88
86: ; preds = %79
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %147
88: ; preds = %79
%89 = load i32*, i32** %9
%90 = load i32, i32* %13
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %89, i64 %91
%93 = load i32, i32* %92
%94 = icmp slt i32 %93, 40
br i1 %94, label %95, label %97
95: ; preds = %88
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
br label %147
97: ; preds = %88
%98 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%99 = load i32*, i32** %9
%100 = load i32, i32* %13
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %99, i64 %101
%103 = load i32, i32* %102
%104 = call i32 @nameitem(i8* %98, i32 %103)
%105 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %105)
%107 = load i32*, i32** %11
%108 = load i32, i32* %107
%109 = load i32*, i32** %9
%110 = load i32, i32* %13
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i32, i32* %109, i64 %111
%113 = load i32, i32* %112
%114 = srem i32 %113, 13
%115 = add nsw i32 %108, %114
%116 = add nsw i32 %115, 1
%117 = load i32*, i32** %11
store i32 %116, i32* %117
%118 = load i32*, i32** %9
%119 = load i32, i32* %13
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i32, i32* %118, i64 %120
store i32 0, i32* %121
br label %122
122: ; preds = %97
br label %123
123: ; preds = %122
br label %124
124: ; preds = %123, %51
br label %125
125: ; preds = %124
br label %147
126: ; preds = %6
%127 = load i32, i32* %13
%128 = icmp eq i32 %127, 1
br i1 %128, label %129, label %144
129: ; preds = %126
%130 = load i32*, i32** %10
%131 = call i32 @checkpositiveinv(i32* %130)
%132 = icmp ne i32 %131, 0
br i1 %132, label %135, label %133
133: ; preds = %129
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
br label %147
135: ; preds = %129
%136 = load i32*, i32** %12
%137 = load i32, i32* %136
%138 = add nsw i32 %137, 3
%139 = load i32*, i32** %12
store i32 %138, i32* %139
%140 = load i32*, i32** %10
%141 = call i32 @removeslave(i32* %140, i32 1)
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
br label %143
143: ; preds = %135
br label %146
144: ; preds = %126
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
br label %146
146: ; preds = %144, %143
br label %147
147: ; preds = %34, %49, %86, %95, %133, %146, %125
ret void
}

LLVM IR (-O2):
@.str.4 = [13 x i8] c"You use %s!\0A\00"
@str = [81 x i8] c"Do you want to use an item or seek help from a prisoner?\0A[0]: Item\0A[1]: Prisoner\00"
@str.10 = [40 x i8] c"There aren't other adventures with you!\00"
@str.11 = [44 x i8] c"A prisoner join your fight for his freedom!\00"
@str.12 = [30 x i8] c"What item do you want to use?\00"
@str.13 = [59 x i8] c"If you want to do magic, maybe you have to cast a spell...\00"
@str.14 = [49 x i8] c"Gems are nice, but not really useful in a fight!\00"
@str.15 = [25 x i8] c"Not really useful now...\00"
@str.16 = [56 x i8] c"Maybe you are a little too much excited for this fight!\00"
define void @useitemcombat(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* %3, i32* nocapture %4, i32* nocapture %5) {
%7 = alloca i32
%8 = alloca [20 x i8]
%9 = bitcast i32* %7 to i8*
store i32 -1, i32* %7
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%12 = call i32 @getint(i32* %7)
%13 = load i32, i32* %7
switch i32 %13, label %79 [
i32 0, label %14
i32 1, label %69
]
14: ; preds = %6
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.12, i64 0, i64 0))
%16 = call i32 @getint(i32* %7)
%17 = load i32, i32* %7
%18 = icmp ugt i32 %17, 9
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = zext i32 %17 to i64
%21 = getelementptr inbounds i32, i32* %2, i64 %20
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %19, %14
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.16, i64 0, i64 0))
br label %81
26: ; preds = %19
%27 = icmp slt i32 %22, 14
br i1 %27, label %28, label %50
28: ; preds = %26
%29 = load i32, i32* %0
%30 = load i32, i32* %1
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0))
br label %81
34: ; preds = %28
%35 = call i32 @nameitem(i8* %10, i32 %22)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%37 = load i32, i32* %0
%38 = load i32, i32* %1
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %2, i64 %40
%42 = load i32, i32* %41
%43 = srem i32 %42, 13
%44 = add i32 %38, 1
%45 = add i32 %44, %43
%46 = call i32 @min(i32 %37, i32 %45)
store i32 %46, i32* %1
%47 = load i32, i32* %7
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %2, i64 %48
store i32 0, i32* %49
br label %81
50: ; preds = %26
%51 = icmp ult i32 %22, 27
br i1 %51, label %52, label %54
52: ; preds = %50
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.14, i64 0, i64 0))
br label %81
54: ; preds = %50
%55 = icmp ult i32 %22, 40
br i1 %55, label %56, label %58
56: ; preds = %54
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.13, i64 0, i64 0))
br label %81
58: ; preds = %54
%59 = call i32 @nameitem(i8* %10, i32 %22)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%61 = load i32, i32* %4
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %2, i64 %63
%65 = load i32, i32* %64
%66 = srem i32 %65, 13
%67 = add i32 %61, 1
%68 = add i32 %67, %66
store i32 %68, i32* %4
store i32 0, i32* %64
br label %81
69: ; preds = %6
%70 = call i32 @checkpositiveinv(i32* %3)
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.10, i64 0, i64 0))
br label %81
74: ; preds = %69
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 3
store i32 %76, i32* %5
%77 = call i32 @removeslave(i32* %3, i32 1)
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.11, i64 0, i64 0))
br label %81
79: ; preds = %6
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.16, i64 0, i64 0))
br label %81
81: ; preds = %34, %58, %79, %74, %72, %56, %52, %32, %24
ret void
}