#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *);
int /*<<< orphan*/ wait(int);
void purchase(int history[][6], int day) {
  int *money, *pots, *boats;
  money = &history[day][1];
  pots = &history[day][2];
  boats = &history[day][3];
  printf("\x1B[0m"
         "\nYou have $");
  printf("\x1B[1;32m"
         "%d\n",
         *money);
  int max_boats = *money / 100;
  int boats_to_buy;
  if (max_boats > 0) {
    while (1) {
      printf("\x1B[0m"
             "Enter the number of boats you want to buy (max %d): ",
             max_boats);
      if (scanf("%d", &boats_to_buy) != 1 || boats_to_buy < 0 ||
          boats_to_buy > max_boats) {
        printf("Please enter a digit greater or equal to 0, try again.\n\n");
        while (getchar() != '\n')
          ;
      } else {
        break;
      }
    }
    *money -= boats_to_buy * 100;
    history[day][3] += boats_to_buy;
  } else {
    printf("\x1B[0m"
           "You don't have enough money to buy any boats . ");
    wait(1);
    printf(". ");
    wait(1);
    printf(". \n");
  }
  int pots_to_buy;
  int max_pots = *money / 5;
  if (max_pots + *pots > *boats * 10) {
    max_pots = *boats * 10 - *pots;
  }
  if (max_pots > 0) {
    while (1) {
      printf("Enter the number of pots you'd like to buy (max %d): ", max_pots);
      if (scanf("%d", &pots_to_buy) != 1 || pots_to_buy < 0 ||
          pots_to_buy > max_pots) {
        printf("Please enter a digit greater or equal to 0, try again.\n\n");
        while (getchar() != '\n')
          ;
      } else {
        break;
      }
    }
    history[day][1] -= 5 * pots_to_buy;
    history[day][2] += pots_to_buy;
  } else {
    printf("\x1B[0m"
           "You don't have enough boats/money to buy any pots . ");
    wait(1);
    printf(". ");
    wait(1);
    printf(". ");
  }
}


x86 assembly (clang, -O0):
<purchase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
add    $0xc,%rax
mov    %rax,-0x28(%rbp)
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    1276 <purchase+0x136>
jmp    11d6 <purchase+0x96>
mov    -0x2c(%rbp),%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1216 <purchase+0xd6>
cmpl   $0x0,-0x30(%rbp)
jl     1216 <purchase+0xd6>
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    1241 <purchase+0x101>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     123c <purchase+0xfc>
jmp    1224 <purchase+0xe4>
jmp    1246 <purchase+0x106>
jmp    124b <purchase+0x10b>
jmp    11d6 <purchase+0x96>
imul   $0x64,-0x30(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
imul   $0x18,%rdx,%rdx
add    %rdx,%rax
add    0xc(%rax),%ecx
mov    %ecx,0xc(%rax)
jmp    12b4 <purchase+0x174>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <wait@plt>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <wait@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x20(%rbp),%rcx
add    (%rcx),%eax
mov    -0x28(%rbp),%rcx
imul   $0xa,(%rcx),%ecx
cmp    %ecx,%eax
jle    12ed <purchase+0x1ad>
mov    -0x28(%rbp),%rax
imul   $0xa,(%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jle    13a9 <purchase+0x269>
jmp    12fc <purchase+0x1bc>
mov    -0x38(%rbp),%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd40(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    133c <purchase+0x1fc>
cmpl   $0x0,-0x34(%rbp)
jl     133c <purchase+0x1fc>
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jle    1367 <purchase+0x227>
lea    0xd14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1362 <purchase+0x222>
jmp    134a <purchase+0x20a>
jmp    136c <purchase+0x22c>
jmp    1371 <purchase+0x231>
jmp    12fc <purchase+0x1bc>
imul   $0x5,-0x34(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0x4(%rax),%ecx
sub    %edx,%ecx
mov    %ecx,0x4(%rax)
mov    -0x34(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
imul   $0x18,%rdx,%rdx
add    %rdx,%rax
add    0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
jmp    13e7 <purchase+0x2a7>
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <wait@plt>
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <wait@plt>
lea    0xce1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<purchase>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
movslq %esi,%rax
lea    (%rax,%rax,2),%rbx
lea    (%rdi,%rbx,8),%r14
add    $0x4,%r14
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%r15,%rbx,8),%esi
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x4(%r15,%rbx,8),%rax
cmp    $0x64,%rax
jl     11fd <purchase+0xad>
imul   $0x51eb851f,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x25,%rbx
add    %eax,%ebx
nopl   0x0(%rax,%rax,1)
lea    0xe64(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    11e2 <purchase+0x92>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     11e2 <purchase+0x92>
cmp    %ebx,%eax
jle    1241 <purchase+0xf1>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    11f0 <purchase+0xa0>
jmp    11b0 <purchase+0x60>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <wait@plt>
lea    0xe6c(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <wait@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    (%r14),%ecx
mov    0x8(%r14),%eax
jmp    1252 <purchase+0x102>
imul   $0xffffff9c,%eax,%ecx
add    (%r14),%ecx
mov    %ecx,(%r14)
add    0x8(%r14),%eax
mov    %eax,0x8(%r14)
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
mov    0x4(%r14),%edx
lea    (%rcx,%rdx,1),%esi
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,%ebx
sub    %edx,%ebx
cmp    %eax,%esi
cmovle %ecx,%ebx
test   %ebx,%ebx
jle    12e9 <purchase+0x199>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xdf4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdad(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    12c2 <purchase+0x172>
mov    0x8(%rsp),%eax
test   %eax,%eax
js     12c2 <purchase+0x172>
cmp    %ebx,%eax
jle    12dd <purchase+0x18d>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    12d0 <purchase+0x180>
jmp    1290 <purchase+0x140>
lea    (%rax,%rax,4),%ecx
sub    %ecx,(%r14)
add    %eax,0x4(%r14)
jmp    1326 <purchase+0x1d6>
lea    0xdd1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <wait@plt>
lea    0xd80(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <wait@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\1B[0m\0AYou have $\00"
@.str.1 = [11 x i8] c"\1B[1;32m%d\0A\00"
@.str.2 = [57 x i8] c"\1B[0mEnter the number of boats you want to buy (max %d): \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [57 x i8] c"Please enter a digit greater or equal to 0, try again.\0A\0A\00"
@.str.5 = [52 x i8] c"\1B[0mYou don't have enough money to buy any boats . \00"
@.str.6 = [3 x i8] c". \00"
@.str.7 = [4 x i8] c". \0A\00"
@.str.8 = [54 x i8] c"Enter the number of pots you'd like to buy (max %d): \00"
@.str.9 = [57 x i8] c"\1B[0mYou don't have enough boats/money to buy any pots . \00"
define void @purchase([6 x i32]* %0, i32 %1) {
%3 = alloca [6 x i32]*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store [6 x i32]* %0, [6 x i32]** %3
store i32 %1, i32* %4
%12 = load [6 x i32]*, [6 x i32]** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 %14
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %15, i64 0, i64 1
store i32* %16, i32** %5
%17 = load [6 x i32]*, [6 x i32]** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %17, i64 %19
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %20, i64 0, i64 2
store i32* %21, i32** %6
%22 = load [6 x i32]*, [6 x i32]** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [6 x i32], [6 x i32]* %22, i64 %24
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %25, i64 0, i64 3
store i32* %26, i32** %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%28 = load i32*, i32** %5
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32*, i32** %5
%32 = load i32, i32* %31
%33 = sdiv i32 %32, 100
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %73
36: ; preds = %2
br label %37
37: ; preds = %36, %58
%38 = load i32, i32* %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%41 = icmp ne i32 %40, 1
br i1 %41, label %49, label %42
42: ; preds = %37
%43 = load i32, i32* %9
%44 = icmp slt i32 %43, 0
br i1 %44, label %49, label %45
45: ; preds = %42
%46 = load i32, i32* %9
%47 = load i32, i32* %8
%48 = icmp sgt i32 %46, %47
br i1 %48, label %49, label %57
49: ; preds = %45, %42, %37
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0))
br label %51
51: ; preds = %55, %49
%52 = call signext i8 (...) @getchar()
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 10
br i1 %54, label %55, label %56
55: ; preds = %51
br label %51
56: ; preds = %51
br label %58
57: ; preds = %45
br label %59
58: ; preds = %56
br label %37
59: ; preds = %57
%60 = load i32, i32* %9
%61 = mul nsw i32 %60, 100
%62 = load i32*, i32** %5
%63 = load i32, i32* %62
%64 = sub nsw i32 %63, %61
store i32 %64, i32* %62
%65 = load i32, i32* %9
%66 = load [6 x i32]*, [6 x i32]** %3
%67 = load i32, i32* %4
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [6 x i32], [6 x i32]* %66, i64 %68
%70 = getelementptr inbounds [6 x i32], [6 x i32]* %69, i64 0, i64 3
%71 = load i32, i32* %70
%72 = add nsw i32 %71, %65
store i32 %72, i32* %70
br label %79
73: ; preds = %2
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%75 = call i32 @wait(i32 1)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%77 = call i32 @wait(i32 1)
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %79
79: ; preds = %73, %59
%80 = load i32*, i32** %5
%81 = load i32, i32* %80
%82 = sdiv i32 %81, 5
store i32 %82, i32* %11
%83 = load i32, i32* %11
%84 = load i32*, i32** %6
%85 = load i32, i32* %84
%86 = add nsw i32 %83, %85
%87 = load i32*, i32** %7
%88 = load i32, i32* %87
%89 = mul nsw i32 %88, 10
%90 = icmp sgt i32 %86, %89
br i1 %90, label %91, label %98
91: ; preds = %79
%92 = load i32*, i32** %7
%93 = load i32, i32* %92
%94 = mul nsw i32 %93, 10
%95 = load i32*, i32** %6
%96 = load i32, i32* %95
%97 = sub nsw i32 %94, %96
store i32 %97, i32* %11
br label %98
98: ; preds = %91, %79
%99 = load i32, i32* %11
%100 = icmp sgt i32 %99, 0
br i1 %100, label %101, label %142
101: ; preds = %98
br label %102
102: ; preds = %101, %123
%103 = load i32, i32* %11
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i32 %103)
%105 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%106 = icmp ne i32 %105, 1
br i1 %106, label %114, label %107
107: ; preds = %102
%108 = load i32, i32* %10
%109 = icmp slt i32 %108, 0
br i1 %109, label %114, label %110
110: ; preds = %107
%111 = load i32, i32* %10
%112 = load i32, i32* %11
%113 = icmp sgt i32 %111, %112
br i1 %113, label %114, label %122
114: ; preds = %110, %107, %102
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0))
br label %116
116: ; preds = %120, %114
%117 = call signext i8 (...) @getchar()
%118 = sext i8 %117 to i32
%119 = icmp ne i32 %118, 10
br i1 %119, label %120, label %121
120: ; preds = %116
br label %116
121: ; preds = %116
br label %123
122: ; preds = %110
br label %124
123: ; preds = %121
br label %102
124: ; preds = %122
%125 = load i32, i32* %10
%126 = mul nsw i32 5, %125
%127 = load [6 x i32]*, [6 x i32]** %3
%128 = load i32, i32* %4
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [6 x i32], [6 x i32]* %127, i64 %129
%131 = getelementptr inbounds [6 x i32], [6 x i32]* %130, i64 0, i64 1
%132 = load i32, i32* %131
%133 = sub nsw i32 %132, %126
store i32 %133, i32* %131
%134 = load i32, i32* %10
%135 = load [6 x i32]*, [6 x i32]** %3
%136 = load i32, i32* %4
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [6 x i32], [6 x i32]* %135, i64 %137
%139 = getelementptr inbounds [6 x i32], [6 x i32]* %138, i64 0, i64 2
%140 = load i32, i32* %139
%141 = add nsw i32 %140, %134
store i32 %141, i32* %139
br label %148
142: ; preds = %98
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0))
%144 = call i32 @wait(i32 1)
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%146 = call i32 @wait(i32 1)
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %148
148: ; preds = %142, %124
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\1B[0m\0AYou have $\00"
@.str.1 = [11 x i8] c"\1B[1;32m%d\0A\00"
@.str.2 = [57 x i8] c"\1B[0mEnter the number of boats you want to buy (max %d): \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [52 x i8] c"\1B[0mYou don't have enough money to buy any boats . \00"
@.str.8 = [54 x i8] c"Enter the number of pots you'd like to buy (max %d): \00"
@.str.9 = [57 x i8] c"\1B[0mYou don't have enough boats/money to buy any pots . \00"
@str = [3 x i8] c". \00"
@str.11 = [56 x i8] c"Please enter a digit greater or equal to 0, try again.\0A\00"
define void @purchase([6 x i32]* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %0, i64 %5, i64 1
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %0, i64 %5, i64 2
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %0, i64 %5, i64 3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %6
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 100
%14 = bitcast i32* %3 to i8*
%15 = icmp sgt i32 %12, 99
br i1 %15, label %16, label %46
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%19 = icmp ne i32 %18, 1
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 0
%22 = select i1 %19, i1 true, i1 %21
%23 = icmp sgt i32 %20, %13
%24 = select i1 %22, i1 true, i1 %23
br i1 %24, label %34, label %39
25: ; preds = %36
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%28 = icmp ne i32 %27, 1
%29 = load i32, i32* %3
%30 = icmp slt i32 %29, 0
%31 = select i1 %28, i1 true, i1 %30
%32 = icmp sgt i32 %29, %13
%33 = select i1 %31, i1 true, i1 %32
br i1 %33, label %34, label %39
34: ; preds = %16, %25
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.11, i64 0, i64 0))
br label %36
36: ; preds = %36, %34
%37 = call signext i8 (...) @getchar()
%38 = icmp eq i8 %37, 10
br i1 %38, label %25, label %36
39: ; preds = %25, %16
%40 = phi i32 [ %20, %16 ], [ %29, %25 ]
%41 = mul i32 %40, -100
%42 = load i32, i32* %6
%43 = add i32 %42, %41
store i32 %43, i32* %6
%44 = load i32, i32* %8
%45 = add nsw i32 %44, %40
store i32 %45, i32* %8
br label %54
46: ; preds = %2
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%48 = tail call i32 @wait(i32 1)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%50 = tail call i32 @wait(i32 1)
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%52 = load i32, i32* %6
%53 = load i32, i32* %8
br label %54
54: ; preds = %46, %39
%55 = phi i32 [ %53, %46 ], [ %45, %39 ]
%56 = phi i32 [ %52, %46 ], [ %43, %39 ]
%57 = bitcast i32* %4 to i8*
%58 = sdiv i32 %56, 5
%59 = load i32, i32* %7
%60 = add nsw i32 %58, %59
%61 = mul nsw i32 %55, 10
%62 = icmp sgt i32 %60, %61
%63 = sub nsw i32 %61, %59
%64 = select i1 %62, i32 %63, i32 %58
%65 = icmp sgt i32 %64, 0
br i1 %65, label %66, label %96
66: ; preds = %54
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i32 %64)
%68 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%69 = icmp ne i32 %68, 1
%70 = load i32, i32* %4
%71 = icmp slt i32 %70, 0
%72 = select i1 %69, i1 true, i1 %71
%73 = icmp sgt i32 %70, %64
%74 = select i1 %72, i1 true, i1 %73
br i1 %74, label %84, label %89
75: ; preds = %86
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i32 %64)
%77 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%78 = icmp ne i32 %77, 1
%79 = load i32, i32* %4
%80 = icmp slt i32 %79, 0
%81 = select i1 %78, i1 true, i1 %80
%82 = icmp sgt i32 %79, %64
%83 = select i1 %81, i1 true, i1 %82
br i1 %83, label %84, label %89
84: ; preds = %66, %75
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.11, i64 0, i64 0))
br label %86
86: ; preds = %86, %84
%87 = call signext i8 (...) @getchar()
%88 = icmp eq i8 %87, 10
br i1 %88, label %75, label %86
89: ; preds = %75, %66
%90 = phi i32 [ %70, %66 ], [ %79, %75 ]
%91 = mul i32 %90, -5
%92 = load i32, i32* %6
%93 = add i32 %92, %91
store i32 %93, i32* %6
%94 = load i32, i32* %7
%95 = add nsw i32 %94, %90
store i32 %95, i32* %7
br label %102
96: ; preds = %54
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0))
%98 = call i32 @wait(i32 1)
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%100 = call i32 @wait(i32 1)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %102
102: ; preds = %96, %89
ret void
}