#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*/ draw(int, char);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ rules();
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  char player_name[100];
  int amt, bett_amt, guess, dice;
  char choice[1];
  srand(time(0));
  draw(60, '_');
  printf("\n\n\n\t\t CASINO GAME \n\n\n\n");
  draw(60, '_');
  printf("\n\nEnter Your Name : ");
  scanf("%s", player_name);
  printf("Hi %s!", player_name);
  printf("\n\nEnter amount to start the game : Rs. ");
  scanf("%d", &amt);
  do {
    rules();
    printf("\n\nYour current balance is Rs. %d\n", amt);
    do {
      printf("%s Enter money to bet : Rs. ", player_name);
      scanf("%d", &bett_amt);
      if (bett_amt > amt)
        printf("You cannot bet more then what you have common!\n Renter the "
               "amount");
    } while (bett_amt > amt);
    do {
      printf("Guess the number between 1 to 29 to bet on : ");
      scanf("%d", &guess);
      if (guess <= 0 || guess > 29)
        printf("Oh, the range is 1 to 29 included \n Renter the number to bet "
               "on : ");
    } while (guess <= 0 || guess > 29);
    dice = rand() % 29 + 1;
    if (dice == guess) {
      printf("Cool, You won. You get Rs. %d more", bett_amt * 5);
      amt = amt + bett_amt * 5;
    } else {
      printf("woops, You loose. You lost Rs. %d", bett_amt);
      amt = amt - bett_amt;
    }
    if (amt <= 0) {
      printf("You have no money :(");
      break;
    }
    printf("\n\nDo you want to play again (y/n)?");
    scanf("%s", choice);
  } while (choice[0] == 'Y' || choice[0] == 'y');
  printf("\n\n\n");
  draw(70, '=');
  printf("\n\n Thanks for palying. :) Your balance amount is Rs. %d\n\n", amt);
  draw(70, '=');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x3c,%edi
mov    $0x5f,%esi
call   1030 <draw@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3c,%edi
mov    $0x5f,%esi
call   1030 <draw@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf8f(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    $0x0,%al
call   1070 <rules@plt>
mov    -0x74(%rbp),%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf53(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x78(%rbp),%eax
cmp    -0x74(%rbp),%eax
jle    1264 <main+0xf4>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1269 <main+0xf9>
mov    -0x78(%rbp),%eax
cmp    -0x74(%rbp),%eax
jg     1226 <main+0xb6>
jmp    127a <main+0x10a>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf03(%rip),%rdi
lea    -0x7c(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
cmpl   $0x0,-0x7c(%rbp)
jle    12ae <main+0x13e>
cmpl   $0x1d,-0x7c(%rbp)
jle    12bc <main+0x14c>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12c1 <main+0x151>
mov    $0x1,%al
cmpl   $0x0,-0x7c(%rbp)
mov    %al,-0x82(%rbp)
jle    12e0 <main+0x170>
cmpl   $0x1d,-0x7c(%rbp)
setg   %al
mov    %al,-0x82(%rbp)
mov    -0x82(%rbp),%al
test   $0x1,%al
jne    127a <main+0x10a>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x1d,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jne    1332 <main+0x1c2>
imul   $0x5,-0x78(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x74(%rbp),%eax
imul   $0x5,-0x78(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x74(%rbp)
jmp    134c <main+0x1dc>
mov    -0x78(%rbp),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x74(%rbp),%eax
sub    -0x78(%rbp),%eax
mov    %eax,-0x74(%rbp)
cmpl   $0x0,-0x74(%rbp)
jg     1369 <main+0x1f9>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13c5 <main+0x255>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x81(%rbp),%rsi
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
movsbl -0x81(%rbp),%ecx
mov    $0x1,%al
cmp    $0x59,%ecx
mov    %al,-0x83(%rbp)
je     13b7 <main+0x247>
movsbl -0x81(%rbp),%eax
cmp    $0x79,%eax
sete   %al
mov    %al,-0x83(%rbp)
mov    -0x83(%rbp),%al
test   $0x1,%al
jne    120e <main+0x9e>
lea    0xc47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x46,%edi
mov    $0x3d,%esi
call   1030 <draw@plt>
mov    -0x74(%rbp),%esi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x46,%edi
mov    $0x3d,%esi
call   1030 <draw@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x3c,%edi
mov    $0x5f,%esi
call   1040 <draw@plt>
lea    0x103e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c,%edi
mov    $0x5f,%esi
call   1040 <draw@plt>
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3a(%rip),%rdi
lea    0x10(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xe27(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe1d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf6b(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xe45(%rip),%r13
lea    0x8(%rsp),%rbp
lea    0xe98(%rip),%r12
lea    0xc(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1080 <rules@plt>
mov    (%rsp),%esi
lea    0xdf6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1264 <main+0xe4>
nopw   0x0(%rax,%rax,1)
cmp    %ecx,%eax
jle    12a0 <main+0x120>
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x8(%rsp),%eax
mov    (%rsp),%ecx
cmp    %ecx,%eax
jle    1260 <main+0xe0>
lea    0xdf6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%eax
mov    (%rsp),%ecx
jmp    1260 <main+0xe0>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffe2,%eax
cmp    $0xffffffe2,%eax
ja     12dd <main+0x15d>
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffe2,%eax
cmp    $0xffffffe3,%eax
jb     12a0 <main+0x120>
xor    %eax,%eax
call   10a0 <rand@plt>
cltq
imul   $0xffffffff8d3dcb09,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x4,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%edx
lea    (%rdx,%rdx,2),%edx
add    %ecx,%edx
add    %ecx,%edx
neg    %edx
add    %edx,%eax
add    $0x1,%eax
mov    0x8(%rsp),%esi
cmp    0xc(%rsp),%eax
jne    1340 <main+0x1c0>
lea    (%rsi,%rsi,4),%esi
lea    0xe17(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%eax
lea    (%rax,%rax,4),%eax
add    (%rsp),%eax
jmp    1355 <main+0x1d5>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe15(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%eax
sub    0x8(%rsp),%eax
mov    %eax,(%rsp)
test   %eax,%eax
jle    138d <main+0x20d>
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xca4(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x7(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
je     1240 <main+0xc0>
jmp    139b <main+0x21b>
lea    0xdea(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
mov    $0x46,%edi
mov    $0x3d,%esi
call   1040 <draw@plt>
mov    (%rsp),%esi
lea    0xdf6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x46,%edi
mov    $0x3d,%esi
call   1040 <draw@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A\0A\0A\09\09 CASINO GAME \0A\0A\0A\0A\00"
@.str.1 = [21 x i8] c"\0A\0AEnter Your Name : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [7 x i8] c"Hi %s!\00"
@.str.4 = [40 x i8] c"\0A\0AEnter amount to start the game : Rs. \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [34 x i8] c"\0A\0AYour current balance is Rs. %d\0A\00"
@.str.7 = [29 x i8] c"%s Enter money to bet : Rs. \00"
@.str.8 = [66 x i8] c"You cannot bet more then what you have common!\0A Renter the amount\00"
@.str.9 = [46 x i8] c"Guess the number between 1 to 29 to bet on : \00"
@.str.10 = [67 x i8] c"Oh, the range is 1 to 29 included \0A Renter the number to bet on : \00"
@.str.11 = [35 x i8] c"Cool, You won. You get Rs. %d more\00"
@.str.12 = [34 x i8] c"woops, You loose. You lost Rs. %d\00"
@.str.13 = [21 x i8] c"You have no money :(\00"
@.str.14 = [35 x i8] c"\0A\0ADo you want to play again (y/n)?\00"
@.str.15 = [4 x i8] c"\0A\0A\0A\00"
@.str.16 = [58 x i8] c"\0A\0A Thanks for palying. :) Your balance amount is Rs. %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [1 x i8]
store i32 0, i32* %1
%8 = call i32 @time(i32 0)
%9 = call i32 @srand(i32 %8)
%10 = call i32 @draw(i32 60, i8 signext 95)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @draw(i32 60, i8 signext 95)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
br label %20
20: ; preds = %98, %0
%21 = call i32 (...) @rules()
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %34, %20
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i8* %25)
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %24
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0))
br label %33
33: ; preds = %31, %24
br label %34
34: ; preds = %33
%35 = load i32, i32* %4
%36 = load i32, i32* %3
%37 = icmp sgt i32 %35, %36
br i1 %37, label %24, label %38
38: ; preds = %34
br label %39
39: ; preds = %56, %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%42 = load i32, i32* %5
%43 = icmp sle i32 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %39
%45 = load i32, i32* %5
%46 = icmp sgt i32 %45, 29
br i1 %46, label %47, label %49
47: ; preds = %44, %39
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.10, i64 0, i64 0))
br label %49
49: ; preds = %47, %44
br label %50
50: ; preds = %49
%51 = load i32, i32* %5
%52 = icmp sle i32 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load i32, i32* %5
%55 = icmp sgt i32 %54, 29
br label %56
56: ; preds = %53, %50
%57 = phi i1 [ true, %50 ], [ %55, %53 ]
br i1 %57, label %39, label %58
58: ; preds = %56
%59 = call i32 (...) @rand()
%60 = srem i32 %59, 29
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
%62 = load i32, i32* %6
%63 = load i32, i32* %5
%64 = icmp eq i32 %62, %63
br i1 %64, label %65, label %73
65: ; preds = %58
%66 = load i32, i32* %4
%67 = mul nsw i32 %66, 5
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i32 %67)
%69 = load i32, i32* %3
%70 = load i32, i32* %4
%71 = mul nsw i32 %70, 5
%72 = add nsw i32 %69, %71
store i32 %72, i32* %3
br label %79
73: ; preds = %58
%74 = load i32, i32* %4
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %3
%77 = load i32, i32* %4
%78 = sub nsw i32 %76, %77
store i32 %78, i32* %3
br label %79
79: ; preds = %73, %65
%80 = load i32, i32* %3
%81 = icmp sle i32 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %79
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
br label %100
84: ; preds = %79
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
%86 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%87 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %86)
br label %88
88: ; preds = %84
%89 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 89
br i1 %92, label %98, label %93
93: ; preds = %88
%94 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = icmp eq i32 %96, 121
br label %98
98: ; preds = %93, %88
%99 = phi i1 [ true, %88 ], [ %97, %93 ]
br i1 %99, label %20, label %100
100: ; preds = %98, %82
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%102 = call i32 @draw(i32 70, i8 signext 61)
%103 = load i32, i32* %3
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.16, i64 0, i64 0), i32 %103)
%105 = call i32 @draw(i32 70, i8 signext 61)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"\0A\0AEnter Your Name : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [7 x i8] c"Hi %s!\00"
@.str.4 = [40 x i8] c"\0A\0AEnter amount to start the game : Rs. \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [34 x i8] c"\0A\0AYour current balance is Rs. %d\0A\00"
@.str.7 = [29 x i8] c"%s Enter money to bet : Rs. \00"
@.str.8 = [66 x i8] c"You cannot bet more then what you have common!\0A Renter the amount\00"
@.str.9 = [46 x i8] c"Guess the number between 1 to 29 to bet on : \00"
@.str.10 = [67 x i8] c"Oh, the range is 1 to 29 included \0A Renter the number to bet on : \00"
@.str.11 = [35 x i8] c"Cool, You won. You get Rs. %d more\00"
@.str.12 = [34 x i8] c"woops, You loose. You lost Rs. %d\00"
@.str.13 = [21 x i8] c"You have no money :(\00"
@.str.14 = [35 x i8] c"\0A\0ADo you want to play again (y/n)?\00"
@.str.16 = [58 x i8] c"\0A\0A Thanks for palying. :) Your balance amount is Rs. %d\0A\0A\00"
@str = [22 x i8] c"\0A\0A\0A\09\09 CASINO GAME \0A\0A\0A\00"
@str.17 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%11 = tail call i32 @time(i32 0)
%12 = tail call i32 @srand(i32 %11)
%13 = tail call i32 @draw(i32 60, i8 signext 95)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @draw(i32 60, i8 signext 95)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
br label %21
21: ; preds = %74, %0
%22 = call i32 (...) @rules()
%23 = load i32, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %35, %21
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%28 = load i32, i32* %3
%29 = load i32, i32* %2
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %35
31: ; preds = %25
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0))
%33 = load i32, i32* %3
%34 = load i32, i32* %2
br label %35
35: ; preds = %25, %31
%36 = phi i32 [ %29, %25 ], [ %34, %31 ]
%37 = phi i32 [ %28, %25 ], [ %33, %31 ]
%38 = icmp sgt i32 %37, %36
br i1 %38, label %25, label %39
39: ; preds = %35, %45
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%42 = load i32, i32* %4
%43 = add i32 %42, -30
%44 = icmp ult i32 %43, -29
br i1 %44, label %45, label %50
45: ; preds = %39
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.10, i64 0, i64 0))
%47 = load i32, i32* %4
%48 = add i32 %47, -30
%49 = icmp ult i32 %48, -29
br i1 %49, label %39, label %50
50: ; preds = %39, %45
%51 = call i32 (...) @rand()
%52 = srem i32 %51, 29
%53 = add nsw i32 %52, 1
%54 = load i32, i32* %4
%55 = icmp eq i32 %53, %54
%56 = load i32, i32* %3
br i1 %55, label %57, label %64
57: ; preds = %50
%58 = mul nsw i32 %56, 5
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i32 %58)
%60 = load i32, i32* %2
%61 = load i32, i32* %3
%62 = mul nsw i32 %61, 5
%63 = add nsw i32 %62, %60
br label %69
64: ; preds = %50
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i32 %56)
%66 = load i32, i32* %2
%67 = load i32, i32* %3
%68 = sub nsw i32 %66, %67
br label %69
69: ; preds = %64, %57
%70 = phi i32 [ %68, %64 ], [ %63, %57 ]
store i32 %70, i32* %2
%71 = icmp slt i32 %70, 1
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
br label %80
74: ; preds = %69
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
%76 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%77 = load i8, i8* %10
%78 = and i8 %77, -33
%79 = icmp eq i8 %78, 89
br i1 %79, label %21, label %80
80: ; preds = %74, %72
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.17, i64 0, i64 0))
%82 = call i32 @draw(i32 70, i8 signext 61)
%83 = load i32, i32* %2
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.16, i64 0, i64 0), i32 %83)
%85 = call i32 @draw(i32 70, i8 signext 61)
ret i32 0
}