#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 */
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ readPile(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ writePile(char *, char *, char *);
waitBot(int numBot, char *keyFile) {
  char result[256];
  printf("On attend les bots\n");
  int nbBot = numBot;
  char *id = malloc(10 * sizeof(int));
  for (int i = 1; i <= nbBot; i++) {
    sprintf(id, "%d", i);
    readPile(result, "./keyfile", id);
    if (strcmp(result, "Ready") == 0) {
      printf("Bot %d prêt\n", i);
      continue;
    }
  }
  id = malloc(10 * sizeof(int));
  char *msg = malloc(10 * sizeof(int));
  for (int i = 1; i <= nbBot; i++) {
    sprintf(id, "%d", i);
    sprintf(msg, "Go,%d", (10 * i));
    writePile(keyFile, msg, id);
  }
  printf("Wait\n");
  id = malloc(10 * sizeof(int));
  int maxBot = 1;
  while (1) {
    for (int i = maxBot; i <= nbBot; i++) {
      sprintf(id, "%d", (10 * i));
      readPile(result, keyFile, id);
      if (strcmp(result, "Stop") == 0) {
        if (i == 1)
          maxBot++;
        else if (i == 2)
          nbBot--;
        printf("max %d nb %d\n", maxBot, nbBot);
      }
    }
    if (maxBot > nbBot) {
      break;
    }
    for (int i = maxBot; i <= nbBot; i++) {
      sprintf(id, "%d", (10 * i) + 1);
      writePile(keyFile, "Go", id);
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<waitBot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x114(%rbp)
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,-0x120(%rbp)
movl   $0x1,-0x124(%rbp)
mov    -0x124(%rbp),%eax
cmp    -0x114(%rbp),%eax
jg     1238 <waitBot+0xd8>
mov    -0x120(%rbp),%rdi
mov    -0x124(%rbp),%edx
lea    0xe6b(%rip),%rsi
call   1080 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    -0x120(%rbp),%rdx
lea    0xe30(%rip),%rsi
call   1050 <readPile@plt>
lea    -0x110(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    121f <waitBot+0xbf>
mov    -0x124(%rbp),%esi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1224 <waitBot+0xc4>
jmp    1224 <waitBot+0xc4>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    11a4 <waitBot+0x44>
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,-0x120(%rbp)
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,-0x130(%rbp)
movl   $0x1,-0x134(%rbp)
mov    -0x134(%rbp),%eax
cmp    -0x114(%rbp),%eax
jg     12d4 <waitBot+0x174>
mov    -0x120(%rbp),%rdi
mov    -0x134(%rbp),%edx
lea    0xdab(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x130(%rbp),%rdi
imul   $0xa,-0x134(%rbp),%edx
lea    0xd8e(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x130(%rbp),%rsi
mov    -0x120(%rbp),%rdx
call   1030 <writePile@plt>
mov    -0x134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x134(%rbp)
jmp    1264 <waitBot+0x104>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,-0x120(%rbp)
movl   $0x1,-0x138(%rbp)
mov    -0x138(%rbp),%eax
mov    %eax,-0x13c(%rbp)
mov    -0x13c(%rbp),%eax
cmp    -0x114(%rbp),%eax
jg     13de <waitBot+0x27e>
mov    -0x120(%rbp),%rdi
imul   $0xa,-0x13c(%rbp),%edx
lea    0xd05(%rip),%rsi
call   1080 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x120(%rbp),%rdx
call   1050 <readPile@plt>
lea    -0x110(%rbp),%rdi
lea    0xce4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    13c5 <waitBot+0x265>
cmpl   $0x1,-0x13c(%rbp)
jne    138a <waitBot+0x22a>
mov    -0x138(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x138(%rbp)
jmp    13ab <waitBot+0x24b>
cmpl   $0x2,-0x13c(%rbp)
jne    13a6 <waitBot+0x246>
mov    -0x114(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x114(%rbp)
jmp    13ab <waitBot+0x24b>
mov    -0x138(%rbp),%esi
mov    -0x114(%rbp),%edx
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ca <waitBot+0x26a>
mov    -0x13c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13c(%rbp)
jmp    1309 <waitBot+0x1a9>
mov    -0x138(%rbp),%eax
cmp    -0x114(%rbp),%eax
jle    13f5 <waitBot+0x295>
jmp    1460 <waitBot+0x300>
mov    -0x138(%rbp),%eax
mov    %eax,-0x140(%rbp)
mov    -0x140(%rbp),%eax
cmp    -0x114(%rbp),%eax
jg     145b <waitBot+0x2fb>
mov    -0x120(%rbp),%rdi
imul   $0xa,-0x140(%rbp),%edx
add    $0x1,%edx
lea    0xc0a(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x120(%rbp),%rdx
lea    0xc0f(%rip),%rsi
call   1030 <writePile@plt>
mov    -0x140(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x140(%rbp)
jmp    1401 <waitBot+0x2a1>
jmp    12fd <waitBot+0x19d>
mov    $0x1,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitBot>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
mov    $0x28,%edi
call   1080 <malloc@plt>
mov    %rbp,(%rsp)
test   %ebp,%ebp
jle    1228 <waitBot+0xb8>
mov    %rax,%rbx
mov    (%rsp),%r12
neg    %r12d
mov    $0x1,%ebp
lea    0x10(%rsp),%r13
lea    0xe47(%rip),%r14
jmp    11e3 <waitBot+0x73>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r12,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
je     1228 <waitBot+0xb8>
mov    %rbx,%rdi
lea    0xe34(%rip),%rsi
mov    %ebp,%edx
call   1090 <sprintf@plt>
mov    %r13,%rdi
lea    0xe02(%rip),%rsi
mov    %rbx,%rdx
call   1060 <readPile@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    11d0 <waitBot+0x60>
lea    0xdf3(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11d0 <waitBot+0x60>
mov    $0x28,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
mov    $0x28,%edi
call   1080 <malloc@plt>
cmpl   $0x0,(%rsp)
jle    12a9 <waitBot+0x139>
mov    %rax,%rbp
mov    (%rsp),%r13
neg    %r13d
mov    $0x1,%r12d
mov    $0xa,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
lea    0xdb7(%rip),%rsi
mov    %r12d,%edx
call   1090 <sprintf@plt>
mov    %rbp,%rdi
lea    0xda2(%rip),%rsi
mov    %ebx,%edx
call   1090 <sprintf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1030 <writePile@plt>
lea    (%r12,%r13,1),%eax
add    $0x1,%eax
mov    %r12d,%ecx
add    $0x1,%ecx
add    $0xa,%ebx
mov    %ecx,%r12d
cmp    $0x1,%eax
jne    1260 <waitBot+0xf0>
mov    %r15,0x8(%rsp)
lea    0xd98(%rip),%rdi
call   1040 <puts@plt>
mov    $0x28,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    $0x1,%ebp
lea    0xd4e(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    (%rsp),%r15
cmp    %r15d,%ebp
jle    1362 <waitBot+0x1f2>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%r13d
cmp    %r15d,%r13d
jg     13df <waitBot+0x26f>
mov    %r15,(%rsp)
lea    0x1(%r15),%ebx
lea    0x0(%r13,%r13,1),%eax
lea    (%rax,%rax,4),%ebp
or     $0x1,%ebp
mov    0x8(%rsp),%r14
lea    0xd1c(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xcf7(%rip),%rsi
mov    %ebp,%edx
call   1090 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <writePile@plt>
lea    0xcdb(%rip),%rsi
add    $0xffffffff,%ebx
add    $0xa,%ebp
cmp    %ebx,%r13d
jne    1320 <waitBot+0x1b0>
mov    %r13d,%ebp
mov    (%rsp),%r15
lea    0x10(%rsp),%rbx
cmp    %r15d,%ebp
jg     12f0 <waitBot+0x180>
lea    0x0(%rbp,%rbp,1),%eax
lea    (%rax,%rax,4),%r14d
mov    %ebp,%r13d
jmp    13a0 <waitBot+0x230>
add    $0xffffffff,%r15d
lea    0xcaf(%rip),%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc93(%rip),%rsi
lea    0x1(%rbp),%eax
add    $0xa,%r14d
cmp    %r15d,%ebp
mov    %eax,%ebp
jge    12f3 <waitBot+0x183>
mov    %r12,%rdi
mov    %r14d,%edx
call   1090 <sprintf@plt>
mov    %rbx,%rdi
mov    0x8(%rsp),%rsi
mov    %r12,%rdx
call   1060 <readPile@plt>
mov    %rbx,%rdi
lea    0xc5f(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1387 <waitBot+0x217>
cmp    $0x2,%ebp
je     136f <waitBot+0x1ff>
cmp    $0x1,%ebp
jne    1373 <waitBot+0x203>
add    $0x1,%r13d
jmp    1373 <waitBot+0x203>
mov    $0x1,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"On attend les bots\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"./keyfile\00"
@.str.3 = [6 x i8] c"Ready\00"
@.str.4 = [14 x i8] c"Bot %d pr\C3\AAt\0A\00"
@.str.5 = [6 x i8] c"Go,%d\00"
@.str.6 = [6 x i8] c"Wait\0A\00"
@.str.7 = [5 x i8] c"Stop\00"
@.str.8 = [14 x i8] c"max %d nb %d\0A\00"
@.str.9 = [3 x i8] c"Go\00"
define i32 @waitBot(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %3
store i32 %15, i32* %6
%16 = call i8* @malloc(i32 40)
store i8* %16, i8** %7
store i32 1, i32* %8
br label %17
17: ; preds = %35, %2
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %38
21: ; preds = %17
%22 = load i8*, i8** %7
%23 = load i32, i32* %8
%24 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%26 = load i8*, i8** %7
%27 = call i32 @readPile(i8* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %21
%32 = load i32, i32* %8
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %32)
br label %35
34: ; preds = %21
br label %35
35: ; preds = %34, %31
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %17
38: ; preds = %17
%39 = call i8* @malloc(i32 40)
store i8* %39, i8** %7
%40 = call i8* @malloc(i32 40)
store i8* %40, i8** %9
store i32 1, i32* %10
br label %41
41: ; preds = %57, %38
%42 = load i32, i32* %10
%43 = load i32, i32* %6
%44 = icmp sle i32 %42, %43
br i1 %44, label %45, label %60
45: ; preds = %41
%46 = load i8*, i8** %7
%47 = load i32, i32* %10
%48 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = load i8*, i8** %9
%50 = load i32, i32* %10
%51 = mul nsw i32 10, %50
%52 = call i32 @sprintf(i8* %49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %51)
%53 = load i8*, i8** %4
%54 = load i8*, i8** %9
%55 = load i8*, i8** %7
%56 = call i32 @writePile(i8* %53, i8* %54, i8* %55)
br label %57
57: ; preds = %45
%58 = load i32, i32* %10
%59 = add nsw i32 %58, 1
store i32 %59, i32* %10
br label %41
60: ; preds = %41
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%62 = call i8* @malloc(i32 40)
store i8* %62, i8** %7
store i32 1, i32* %11
br label %63
63: ; preds = %60, %125
%64 = load i32, i32* %11
store i32 %64, i32* %12
br label %65
65: ; preds = %99, %63
%66 = load i32, i32* %12
%67 = load i32, i32* %6
%68 = icmp sle i32 %66, %67
br i1 %68, label %69, label %102
69: ; preds = %65
%70 = load i8*, i8** %7
%71 = load i32, i32* %12
%72 = mul nsw i32 10, %71
%73 = call i32 @sprintf(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %72)
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%75 = load i8*, i8** %4
%76 = load i8*, i8** %7
%77 = call i32 @readPile(i8* %74, i8* %75, i8* %76)
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%79 = call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %98
81: ; preds = %69
%82 = load i32, i32* %12
%83 = icmp eq i32 %82, 1
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = load i32, i32* %11
%86 = add nsw i32 %85, 1
store i32 %86, i32* %11
br label %94
87: ; preds = %81
%88 = load i32, i32* %12
%89 = icmp eq i32 %88, 2
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = load i32, i32* %6
%92 = add nsw i32 %91, -1
store i32 %92, i32* %6
br label %93
93: ; preds = %90, %87
br label %94
94: ; preds = %93, %84
%95 = load i32, i32* %11
%96 = load i32, i32* %6
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 %95, i32 %96)
br label %98
98: ; preds = %94, %69
br label %99
99: ; preds = %98
%100 = load i32, i32* %12
%101 = add nsw i32 %100, 1
store i32 %101, i32* %12
br label %65
102: ; preds = %65
%103 = load i32, i32* %11
%104 = load i32, i32* %6
%105 = icmp sgt i32 %103, %104
br i1 %105, label %106, label %107
106: ; preds = %102
br label %126
107: ; preds = %102
%108 = load i32, i32* %11
store i32 %108, i32* %13
br label %109
109: ; preds = %122, %107
%110 = load i32, i32* %13
%111 = load i32, i32* %6
%112 = icmp sle i32 %110, %111
br i1 %112, label %113, label %125
113: ; preds = %109
%114 = load i8*, i8** %7
%115 = load i32, i32* %13
%116 = mul nsw i32 10, %115
%117 = add nsw i32 %116, 1
%118 = call i32 @sprintf(i8* %114, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %117)
%119 = load i8*, i8** %4
%120 = load i8*, i8** %7
%121 = call i32 @writePile(i8* %119, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %120)
br label %122
122: ; preds = %113
%123 = load i32, i32* %13
%124 = add nsw i32 %123, 1
store i32 %124, i32* %13
br label %109
125: ; preds = %109
br label %63
126: ; preds = %106
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"./keyfile\00"
@.str.3 = [6 x i8] c"Ready\00"
@.str.4 = [14 x i8] c"Bot %d pr\C3\AAt\0A\00"
@.str.5 = [6 x i8] c"Go,%d\00"
@.str.7 = [5 x i8] c"Stop\00"
@.str.8 = [14 x i8] c"max %d nb %d\0A\00"
@.str.9 = [3 x i8] c"Go\00"
@str = [19 x i8] c"On attend les bots\00"
@str.10 = [5 x i8] c"Wait\00"
define i32 @waitBot(i32 %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = tail call dereferenceable_or_null(40) i8* @malloc(i32 40)
%7 = icmp slt i32 %0, 1
br i1 %7, label %8, label %11
8: ; preds = %19, %2
%9 = call dereferenceable_or_null(40) i8* @malloc(i32 40)
%10 = call dereferenceable_or_null(40) i8* @malloc(i32 40)
br i1 %7, label %22, label %25
11: ; preds = %2, %19
%12 = phi i32 [ %20, %19 ], [ 1, %2 ]
%13 = call i32 @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = call i32 @readPile(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%15 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %12)
br label %19
19: ; preds = %11, %17
%20 = add nuw i32 %12, 1
%21 = icmp eq i32 %12, %0
br i1 %21, label %8, label %11
22: ; preds = %25, %8
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0))
%24 = call dereferenceable_or_null(40) i8* @malloc(i32 40)
br label %33
25: ; preds = %8, %25
%26 = phi i32 [ %31, %25 ], [ 1, %8 ]
%27 = call i32 @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = mul nsw i32 %26, 10
%29 = call i32 @sprintf(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%30 = call i32 @writePile(i8* %1, i8* %10, i8* %9)
%31 = add nuw i32 %26, 1
%32 = icmp eq i32 %26, %0
br i1 %32, label %22, label %25
33: ; preds = %64, %22
%34 = phi i32 [ %0, %22 ], [ %38, %64 ]
%35 = phi i32 [ 1, %22 ], [ %39, %64 ]
%36 = icmp sgt i32 %35, %34
br i1 %36, label %37, label %41
37: ; preds = %59, %33
%38 = phi i32 [ %34, %33 ], [ %60, %59 ]
%39 = phi i32 [ %35, %33 ], [ %61, %59 ]
%40 = icmp sgt i32 %39, %38
br i1 %40, label %72, label %64
41: ; preds = %33, %59
%42 = phi i32 [ %62, %59 ], [ %35, %33 ]
%43 = phi i32 [ %61, %59 ], [ %35, %33 ]
%44 = phi i32 [ %60, %59 ], [ %34, %33 ]
%45 = mul nsw i32 %42, 10
%46 = call i32 @sprintf(i8* dereferenceable(1) %24, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = call i32 @readPile(i8* %4, i8* %1, i8* %24)
%48 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %59
50: ; preds = %41
switch i32 %42, label %55 [
i32 1, label %51
i32 2, label %53
]
51: ; preds = %50
%52 = add nsw i32 %43, 1
br label %55
53: ; preds = %50
%54 = add nsw i32 %44, -1
br label %55
55: ; preds = %50, %53, %51
%56 = phi i32 [ %44, %51 ], [ %54, %53 ], [ %44, %50 ]
%57 = phi i32 [ %52, %51 ], [ %43, %53 ], [ %43, %50 ]
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 %57, i32 %56)
br label %59
59: ; preds = %41, %55
%60 = phi i32 [ %56, %55 ], [ %44, %41 ]
%61 = phi i32 [ %57, %55 ], [ %43, %41 ]
%62 = add nsw i32 %42, 1
%63 = icmp slt i32 %42, %60
br i1 %63, label %41, label %37
64: ; preds = %37, %64
%65 = phi i32 [ %70, %64 ], [ %39, %37 ]
%66 = mul nsw i32 %65, 10
%67 = or i32 %66, 1
%68 = call i32 @sprintf(i8* dereferenceable(1) %24, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %67)
%69 = call i32 @writePile(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %24)
%70 = add i32 %65, 1
%71 = icmp eq i32 %65, %38
br i1 %71, label %33, label %64
72: ; preds = %37
ret i32 1
}