#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 RAND_MAX;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
float rand();
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  char goal[3], guess[3], input[6];
  int c, pico, fermi, guesses, wins, rounds;
  float rand_const10;
  char yesno[25];
  char goodguess;
  printf("\nBagels\n------\n"
         "In the game of Bagels the computer chooses 3 digits and you have 20\n"
         "chances to  guess it.\n"
         "After every guess the computer will give you hints to tell you how\n"
         "you're doing:\n"
         "Pico\t- You have a correct digit in the wrong place.\n"
         "Fermi\t- You have a correct digit in the right place.\n"
         "Bagels\t- You have no correct digits.\n");
  yesno[0] = 'y';
  rounds = 0;
  wins = 0;
  rand_const10 = (RAND_MAX + 1) / 10;
  srand(time(NULL));
  do {
    rounds++;
    guesses = 1;
    goal[0] = (int)(rand() / rand_const10);
    do
      goal[1] = (int)(rand() / rand_const10);
    while (goal[1] == goal[0]);
    do
      goal[2] = (int)(rand() / rand_const10);
    while ((goal[2] == goal[0]) || (goal[2] == goal[1]));
    do {
      do {
        goodguess = 1;
        printf("\nGuess %d : ", guesses);
        scanf("%s", input);
        if (strlen(input) != 3) {
          printf("\nYou need to input 3 digits only.\n");
          goodguess = 0;
        }
        for (c = 0; c < 3; c++) {
          guess[c] = input[c] - '0';
          if ((guess[c] < 0) || (guess[c] > 9)) {
            printf("\nWhat?\n");
            goodguess = 0;
          }
        }
        if ((guess[0] == guess[1]) || (guess[1] == guess[2]) ||
            (guess[0] == guess[2])) {
          printf("\nBy the way, all digits of the digits you are trying to\n"
                 "guess are unique so no duplicates are allowed in your guess\n"
                 "either. Try again.\n");
          goodguess = 0;
        }
      } while (!goodguess);
      printf("\n", goal[0], goal[1], goal[2]);
      pico = 0;
      fermi = 0;
      for (c = 0; c < 2; c++) {
        if (guess[c] == goal[c + 1])
          pico++;
        if (guess[c + 1] == goal[c])
          pico++;
        if (guess[c] == goal[c])
          fermi++;
      }
      if (guess[0] == goal[2])
        pico++;
      if (guess[2] == goal[0])
        pico++;
      if (guess[2] == goal[2])
        fermi++;
      if (fermi != 0)
        for (c = 1; c <= fermi; c++)
          printf("fermi\n");
      if (pico != 0)
        for (c = 1; c <= pico; c++)
          printf("pico\n");
      if ((fermi == 0) && (pico == 0))
        printf("bagels\n");
      guesses++;
    } while ((guesses <= 20) && (fermi < 3));
    if (fermi == 3) {
      printf("You got it!\n");
      wins++;
    } else {
      printf("You ran out of guesses.\n");
      printf("The number you were trying to guess was %d%d%d\n", goal[0],
             goal[1], goal[2]);
    }
    printf("\nDo you want to play again? (y/n) ");
    scanf("%s", yesno);
  } while ((yesno[0] == 'y') || (yesno[0] == 'Y'));
  printf("\nYou won %d out of %d games.\n", wins, rounds);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x79,-0x50(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    0x2e42(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movl   $0x1,-0x20(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
divss  -0x2c(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x7(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
divss  -0x2c(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
movsbl -0x7(%rbp),%ecx
cmp    %ecx,%eax
je     11ef <main+0x7f>
jmp    1217 <main+0xa7>
mov    $0x0,%al
call   1090 <rand@plt>
divss  -0x2c(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
movsbl -0x7(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x52(%rbp)
je     124f <main+0xdf>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x52(%rbp)
mov    -0x52(%rbp),%al
test   $0x1,%al
jne    1217 <main+0xa7>
jmp    125f <main+0xef>
jmp    1264 <main+0xf4>
movb   $0x1,-0x51(%rbp)
mov    -0x20(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
je     12ad <main+0x13d>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x0,-0x51(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    131d <main+0x1ad>
movslq -0x14(%rbp),%rax
movsbl -0x10(%rbp,%rax,1),%eax
sub    $0x30,%eax
mov    %al,%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xa(%rbp,%rax,1)
movslq -0x14(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%eax
cmp    $0x0,%eax
jl     12f8 <main+0x188>
movslq -0x14(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%eax
cmp    $0x9,%eax
jle    130a <main+0x19a>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x0,-0x51(%rbp)
jmp    130f <main+0x19f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12b4 <main+0x144>
movsbl -0xa(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     134d <main+0x1dd>
movsbl -0x9(%rbp),%eax
movsbl -0x8(%rbp),%ecx
cmp    %ecx,%eax
je     134d <main+0x1dd>
movsbl -0xa(%rbp),%eax
movsbl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    135f <main+0x1ef>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x0,-0x51(%rbp)
jmp    1364 <main+0x1f4>
cmpb   $0x0,-0x51(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1264 <main+0xf4>
movsbl -0x7(%rbp),%esi
movsbl -0x6(%rbp),%edx
movsbl -0x5(%rbp),%ecx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1433 <main+0x2c3>
movslq -0x14(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x7(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    13d6 <main+0x266>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0xa(%rbp,%rax,1),%eax
movslq -0x14(%rbp),%rcx
movsbl -0x7(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    13fd <main+0x28d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movslq -0x14(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%eax
movslq -0x14(%rbp),%rcx
movsbl -0x7(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1420 <main+0x2b0>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1425 <main+0x2b5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13a4 <main+0x234>
movsbl -0xa(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    144c <main+0x2dc>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movsbl -0x8(%rbp),%eax
movsbl -0x7(%rbp),%ecx
cmp    %ecx,%eax
jne    1465 <main+0x2f5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movsbl -0x8(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    147e <main+0x30e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     14bc <main+0x34c>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     14b7 <main+0x347>
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    148f <main+0x31f>
jmp    14bc <main+0x34c>
cmpl   $0x0,-0x18(%rbp)
je     14fa <main+0x38a>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     14f5 <main+0x385>
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14cd <main+0x35d>
jmp    14fa <main+0x38a>
cmpl   $0x0,-0x1c(%rbp)
jne    151c <main+0x3ac>
cmpl   $0x0,-0x18(%rbp)
jne    151c <main+0x3ac>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
cmpl   $0x14,-0x20(%rbp)
mov    %al,-0x53(%rbp)
jg     153e <main+0x3ce>
cmpl   $0x3,-0x1c(%rbp)
setl   %al
mov    %al,-0x53(%rbp)
mov    -0x53(%rbp),%al
test   $0x1,%al
jne    125f <main+0xef>
cmpl   $0x3,-0x1c(%rbp)
jne    156f <main+0x3ff>
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1597 <main+0x427>
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x7(%rbp),%esi
movsbl -0x6(%rbp),%edx
movsbl -0x5(%rbp),%ecx
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xba6(%rip),%rdi
call   1070 <scanf@plt>
movsbl -0x50(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x54(%rbp)
je     15d4 <main+0x464>
movsbl -0x50(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x54(%rbp)
mov    -0x54(%rbp),%al
test   $0x1,%al
jne    11cc <main+0x5c>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xcae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
movb   $0x79,0x30(%rsp)
mov    0x2e32(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
movl   $0x0,0x8(%rsp)
xor    %r14d,%r14d
jmp    1258 <main+0xc8>
cs nopw 0x0(%rax,%rax,1)
lea    0xfc2(%rip),%rdi
call   1040 <puts@plt>
lea    0xdfd(%rip),%rdi
mov    0x20(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe13(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdd2(%rip),%rdi
lea    0x30(%rsp),%rsi
call   1090 <scanf@plt>
mov    0x30(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
mov    0x24(%rsp),%r14d
jne    14b0 <main+0x320>
xor    %eax,%eax
call   10b0 <rand@plt>
divss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,0xc(%rsp)
movsbl %al,%ebp
xor    %eax,%eax
call   10b0 <rand@plt>
divss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%ebx
cmp    %ebp,%ebx
je     1270 <main+0xe0>
mov    %eax,0x28(%rsp)
nopl   0x0(%rax)
xor    %eax,%eax
call   10b0 <rand@plt>
divss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,0x2c(%rsp)
movsbl %al,%eax
cmp    %ebp,%eax
je     1290 <main+0x100>
cmp    %ebx,%eax
je     1290 <main+0x100>
mov    %eax,0x18(%rsp)
mov    %ebx,0x1c(%rsp)
mov    %ebp,0x20(%rsp)
add    $0x1,%r14d
mov    %r14d,0x24(%rsp)
movl   $0x1,(%rsp)
jmp    12e6 <main+0x156>
xchg   %ax,%ax
lea    0xf28(%rip),%rdi
call   1040 <puts@plt>
xor    %ecx,%ecx
test   %cl,%cl
jne    139e <main+0x20e>
lea    0xd13(%rip),%rdi
mov    (%rsp),%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd0f(%rip),%rdi
lea    0x12(%rsp),%rbx
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0x1,%cl
cmp    $0x3,%eax
je     1328 <main+0x198>
lea    0xf6c(%rip),%rdi
call   1040 <puts@plt>
xor    %ecx,%ecx
mov    0x12(%rsp),%bpl
lea    -0x30(%rbp),%r15d
cmp    $0xa,%r15b
jb     1345 <main+0x1b5>
lea    0xf48(%rip),%rdi
call   1040 <puts@plt>
xor    %ecx,%ecx
mov    0x13(%rsp),%bl
lea    -0x30(%rbx),%r12d
cmp    $0xa,%r12b
jb     1361 <main+0x1d1>
lea    0xf2c(%rip),%rdi
call   1040 <puts@plt>
xor    %ecx,%ecx
mov    0x14(%rsp),%r14b
lea    -0x30(%r14),%r13d
cmp    $0xa,%r13b
jb     137e <main+0x1ee>
lea    0xf0f(%rip),%rdi
call   1040 <puts@plt>
xor    %ecx,%ecx
cmp    %bl,%bpl
je     12d0 <main+0x140>
cmp    %r14b,%bl
je     12d0 <main+0x140>
cmp    %r14b,%bpl
jne    12de <main+0x14e>
jmp    12d0 <main+0x140>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
mov    0x28(%rsp),%edx
cmp    %dl,%r15b
sete   %al
xor    %ecx,%ecx
mov    0xc(%rsp),%esi
cmp    %sil,%r12b
sete   %cl
add    %eax,%ecx
xor    %r14d,%r14d
cmp    %sil,%r15b
sete   %r14b
xor    %eax,%eax
mov    0x2c(%rsp),%edi
cmp    %dil,%r12b
sete   %al
add    %ecx,%eax
xor    %ecx,%ecx
cmp    %dl,%r13b
sete   %cl
add    %eax,%ecx
xor    %eax,%eax
cmp    %dl,%r12b
sete   %al
add    %eax,%r14d
xor    %edx,%edx
cmp    %dil,%r15b
sete   %dl
add    %ecx,%edx
xor    %ebx,%ebx
cmp    %sil,%r13b
sete   %bl
add    %edx,%ebx
xor    %ecx,%ecx
cmp    %dil,%r13b
sete   %cl
add    %ecx,%r14d
lea    0xde4(%rip),%r12
je     143d <main+0x2ad>
xor    %ebp,%ebp
cmp    0xc(%rsp),%r15b
sete   %bpl
add    %eax,%ebp
add    %ecx,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1040 <puts@plt>
add    $0xffffffff,%ebp
jne    1430 <main+0x2a0>
test   %ebx,%ebx
lea    0xdae(%rip),%r15
je     145f <main+0x2cf>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <puts@plt>
add    $0x1,%ebp
cmp    %ebx,%ebp
jb     1450 <main+0x2c0>
or     %r14d,%ebx
jne    147b <main+0x2eb>
lea    0xd82(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x14,(%rsp)
jb     1487 <main+0x2f7>
jmp    1200 <main+0x70>
cmpl   $0x13,(%rsp)
ja     1490 <main+0x300>
cmp    $0x2,%r14d
ja     1490 <main+0x300>
addl   $0x1,(%rsp)
jmp    12e6 <main+0x156>
cmp    $0x3,%r14d
jne    1200 <main+0x70>
lea    0xd40(%rip),%rdi
call   1040 <puts@plt>
addl   $0x1,0x8(%rsp)
jmp    1226 <main+0x96>
lea    0xbac(%rip),%rdi
mov    0x8(%rsp),%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [329 x i8] c"\0ABagels\0A------\0AIn the game of Bagels the computer chooses 3 digits and you have 20\0Achances to guess it.\0AAfter every guess the computer will give you hints to tell you how\0Ayou're doing:\0APico\09- You have a correct digit in the wrong place.\0AFermi\09- You have a correct digit in the right place.\0ABagels\09- You have no correct digits.\0A\00"
@RAND_MAX = global i32 0
@.str.1 = [13 x i8] c"\0AGuess %d : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [35 x i8] c"\0AYou need to input 3 digits only.\0A\00"
@.str.4 = [8 x i8] c"\0AWhat?\0A\00"
@.str.5 = [136 x i8] c"\0ABy the way, all digits of the digits you are trying to\0Aguess are unique so no duplicates are allowed in your guess\0Aeither. Try again.\0A\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [7 x i8] c"fermi\0A\00"
@.str.8 = [6 x i8] c"pico\0A\00"
@.str.9 = [8 x i8] c"bagels\0A\00"
@.str.10 = [13 x i8] c"You got it!\0A\00"
@.str.11 = [25 x i8] c"You ran out of guesses.\0A\00"
@.str.12 = [48 x i8] c"The number you were trying to guess was %d%d%d\0A\00"
@.str.13 = [35 x i8] c"\0ADo you want to play again? (y/n) \00"
@.str.14 = [30 x i8] c"\0AYou won %d out of %d games.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca [3 x i8]
%4 = alloca [6 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca [25 x i8]
%13 = alloca i8
store i32 0, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [25 x i8], [25 x i8]* %12, i64 0, i64 0
store i8 121, i8* %15
store i32 0, i32* %10
store i32 0, i32* %9
%16 = load i32, i32* @RAND_MAX
%17 = add nsw i32 %16, 1
%18 = sdiv i32 %17, 10
%19 = sitofp i32 %18 to float
store float %19, float* %11
%20 = call i32 @time(i32* null)
%21 = call i32 @srand(i32 %20)
br label %22
22: ; preds = %327, %0
%23 = load i32, i32* %10
%24 = add nsw i32 %23, 1
store i32 %24, i32* %10
store i32 1, i32* %8
%25 = call float (...) @rand()
%26 = load float, float* %11
%27 = fdiv float %25, %26
%28 = fptosi float %27 to i32
%29 = trunc i32 %28 to i8
%30 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 %29, i8* %30
br label %31
31: ; preds = %38, %22
%32 = call float (...) @rand()
%33 = load float, float* %11
%34 = fdiv float %32, %33
%35 = fptosi float %34 to i32
%36 = trunc i32 %35 to i8
%37 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 %36, i8* %37
br label %38
38: ; preds = %31
%39 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %41, %44
br i1 %45, label %31, label %46
46: ; preds = %38
br label %47
47: ; preds = %70, %46
%48 = call float (...) @rand()
%49 = load float, float* %11
%50 = fdiv float %48, %49
%51 = fptosi float %50 to i32
%52 = trunc i32 %51 to i8
%53 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 %52, i8* %53
br label %54
54: ; preds = %47
%55 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %57, %60
br i1 %61, label %70, label %62
62: ; preds = %54
%63 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %65, %68
br label %70
70: ; preds = %62, %54
%71 = phi i1 [ true, %54 ], [ %69, %62 ]
br i1 %71, label %47, label %72
72: ; preds = %70
br label %73
73: ; preds = %292, %72
br label %74
74: ; preds = %145, %73
store i8 1, i8* %13
%75 = load i32, i32* %8
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %75)
%77 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%78 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %77)
%79 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%80 = call i32 @strlen(i8* %79)
%81 = icmp ne i32 %80, 3
br i1 %81, label %82, label %84
82: ; preds = %74
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
store i8 0, i8* %13
br label %84
84: ; preds = %82, %74
store i32 0, i32* %5
br label %85
85: ; preds = %115, %84
%86 = load i32, i32* %5
%87 = icmp slt i32 %86, 3
br i1 %87, label %88, label %118
88: ; preds = %85
%89 = load i32, i32* %5
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
%94 = sub nsw i32 %93, 48
%95 = trunc i32 %94 to i8
%96 = load i32, i32* %5
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %97
store i8 %95, i8* %98
%99 = load i32, i32* %5
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp slt i32 %103, 0
br i1 %104, label %112, label %105
105: ; preds = %88
%106 = load i32, i32* %5
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %107
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp sgt i32 %110, 9
br i1 %111, label %112, label %114
112: ; preds = %105, %88
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
store i8 0, i8* %13
br label %114
114: ; preds = %112, %105
br label %115
115: ; preds = %114
%116 = load i32, i32* %5
%117 = add nsw i32 %116, 1
store i32 %117, i32* %5
br label %85
118: ; preds = %85
%119 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = icmp eq i32 %121, %124
br i1 %125, label %142, label %126
126: ; preds = %118
%127 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%131 = load i8, i8* %130
%132 = sext i8 %131 to i32
%133 = icmp eq i32 %129, %132
br i1 %133, label %142, label %134
134: ; preds = %126
%135 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%136 = load i8, i8* %135
%137 = sext i8 %136 to i32
%138 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
%141 = icmp eq i32 %137, %140
br i1 %141, label %142, label %144
142: ; preds = %134, %126, %118
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.5, i64 0, i64 0))
store i8 0, i8* %13
br label %144
144: ; preds = %142, %134
br label %145
145: ; preds = %144
%146 = load i8, i8* %13
%147 = icmp ne i8 %146, 0
%148 = xor i1 %147, true
br i1 %148, label %74, label %149
149: ; preds = %145
%150 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%154 = load i8, i8* %153
%155 = sext i8 %154 to i32
%156 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 %152, i32 %155, i32 %158)
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %5
br label %160
160: ; preds = %211, %149
%161 = load i32, i32* %5
%162 = icmp slt i32 %161, 2
br i1 %162, label %163, label %214
163: ; preds = %160
%164 = load i32, i32* %5
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %165
%167 = load i8, i8* %166
%168 = sext i8 %167 to i32
%169 = load i32, i32* %5
%170 = add nsw i32 %169, 1
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 %171
%173 = load i8, i8* %172
%174 = sext i8 %173 to i32
%175 = icmp eq i32 %168, %174
br i1 %175, label %176, label %179
176: ; preds = %163
%177 = load i32, i32* %6
%178 = add nsw i32 %177, 1
store i32 %178, i32* %6
br label %179
179: ; preds = %176, %163
%180 = load i32, i32* %5
%181 = add nsw i32 %180, 1
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %182
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = load i32, i32* %5
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 %187
%189 = load i8, i8* %188
%190 = sext i8 %189 to i32
%191 = icmp eq i32 %185, %190
br i1 %191, label %192, label %195
192: ; preds = %179
%193 = load i32, i32* %6
%194 = add nsw i32 %193, 1
store i32 %194, i32* %6
br label %195
195: ; preds = %192, %179
%196 = load i32, i32* %5
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %197
%199 = load i8, i8* %198
%200 = sext i8 %199 to i32
%201 = load i32, i32* %5
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 %202
%204 = load i8, i8* %203
%205 = sext i8 %204 to i32
%206 = icmp eq i32 %200, %205
br i1 %206, label %207, label %210
207: ; preds = %195
%208 = load i32, i32* %7
%209 = add nsw i32 %208, 1
store i32 %209, i32* %7
br label %210
210: ; preds = %207, %195
br label %211
211: ; preds = %210
%212 = load i32, i32* %5
%213 = add nsw i32 %212, 1
store i32 %213, i32* %5
br label %160
214: ; preds = %160
%215 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%216 = load i8, i8* %215
%217 = sext i8 %216 to i32
%218 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%219 = load i8, i8* %218
%220 = sext i8 %219 to i32
%221 = icmp eq i32 %217, %220
br i1 %221, label %222, label %225
222: ; preds = %214
%223 = load i32, i32* %6
%224 = add nsw i32 %223, 1
store i32 %224, i32* %6
br label %225
225: ; preds = %222, %214
%226 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%227 = load i8, i8* %226
%228 = sext i8 %227 to i32
%229 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%230 = load i8, i8* %229
%231 = sext i8 %230 to i32
%232 = icmp eq i32 %228, %231
br i1 %232, label %233, label %236
233: ; preds = %225
%234 = load i32, i32* %6
%235 = add nsw i32 %234, 1
store i32 %235, i32* %6
br label %236
236: ; preds = %233, %225
%237 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%238 = load i8, i8* %237
%239 = sext i8 %238 to i32
%240 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%241 = load i8, i8* %240
%242 = sext i8 %241 to i32
%243 = icmp eq i32 %239, %242
br i1 %243, label %244, label %247
244: ; preds = %236
%245 = load i32, i32* %7
%246 = add nsw i32 %245, 1
store i32 %246, i32* %7
br label %247
247: ; preds = %244, %236
%248 = load i32, i32* %7
%249 = icmp ne i32 %248, 0
br i1 %249, label %250, label %261
250: ; preds = %247
store i32 1, i32* %5
br label %251
251: ; preds = %257, %250
%252 = load i32, i32* %5
%253 = load i32, i32* %7
%254 = icmp sle i32 %252, %253
br i1 %254, label %255, label %260
255: ; preds = %251
%256 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %257
257: ; preds = %255
%258 = load i32, i32* %5
%259 = add nsw i32 %258, 1
store i32 %259, i32* %5
br label %251
260: ; preds = %251
br label %261
261: ; preds = %260, %247
%262 = load i32, i32* %6
%263 = icmp ne i32 %262, 0
br i1 %263, label %264, label %275
264: ; preds = %261
store i32 1, i32* %5
br label %265
265: ; preds = %271, %264
%266 = load i32, i32* %5
%267 = load i32, i32* %6
%268 = icmp sle i32 %266, %267
br i1 %268, label %269, label %274
269: ; preds = %265
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %271
271: ; preds = %269
%272 = load i32, i32* %5
%273 = add nsw i32 %272, 1
store i32 %273, i32* %5
br label %265
274: ; preds = %265
br label %275
275: ; preds = %274, %261
%276 = load i32, i32* %7
%277 = icmp eq i32 %276, 0
br i1 %277, label %278, label %283
278: ; preds = %275
%279 = load i32, i32* %6
%280 = icmp eq i32 %279, 0
br i1 %280, label %281, label %283
281: ; preds = %278
%282 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %283
283: ; preds = %281, %278, %275
%284 = load i32, i32* %8
%285 = add nsw i32 %284, 1
store i32 %285, i32* %8
br label %286
286: ; preds = %283
%287 = load i32, i32* %8
%288 = icmp sle i32 %287, 20
br i1 %288, label %289, label %292
289: ; preds = %286
%290 = load i32, i32* %7
%291 = icmp slt i32 %290, 3
br label %292
292: ; preds = %289, %286
%293 = phi i1 [ false, %286 ], [ %291, %289 ]
br i1 %293, label %73, label %294
294: ; preds = %292
%295 = load i32, i32* %7
%296 = icmp eq i32 %295, 3
br i1 %296, label %297, label %301
297: ; preds = %294
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%299 = load i32, i32* %9
%300 = add nsw i32 %299, 1
store i32 %300, i32* %9
br label %313
301: ; preds = %294
%302 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0))
%303 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%304 = load i8, i8* %303
%305 = sext i8 %304 to i32
%306 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%307 = load i8, i8* %306
%308 = sext i8 %307 to i32
%309 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%310 = load i8, i8* %309
%311 = sext i8 %310 to i32
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), i32 %305, i32 %308, i32 %311)
br label %313
313: ; preds = %301, %297
%314 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0))
%315 = getelementptr inbounds [25 x i8], [25 x i8]* %12, i64 0, i64 0
%316 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %315)
br label %317
317: ; preds = %313
%318 = getelementptr inbounds [25 x i8], [25 x i8]* %12, i64 0, i64 0
%319 = load i8, i8* %318
%320 = sext i8 %319 to i32
%321 = icmp eq i32 %320, 121
br i1 %321, label %327, label %322
322: ; preds = %317
%323 = getelementptr inbounds [25 x i8], [25 x i8]* %12, i64 0, i64 0
%324 = load i8, i8* %323
%325 = sext i8 %324 to i32
%326 = icmp eq i32 %325, 89
br label %327
327: ; preds = %322, %317
%328 = phi i1 [ true, %317 ], [ %326, %322 ]
br i1 %328, label %22, label %329
329: ; preds = %327
%330 = load i32, i32* %9
%331 = load i32, i32* %10
%332 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 %330, i32 %331)
%333 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
@.str.1 = [13 x i8] c"\0AGuess %d : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.12 = [48 x i8] c"The number you were trying to guess was %d%d%d\0A\00"
@.str.13 = [35 x i8] c"\0ADo you want to play again? (y/n) \00"
@.str.14 = [30 x i8] c"\0AYou won %d out of %d games.\0A\00"
@str = [328 x i8] c"\0ABagels\0A------\0AIn the game of Bagels the computer chooses 3 digits and you have 20\0Achances to guess it.\0AAfter every guess the computer will give you hints to tell you how\0Ayou're doing:\0APico\09- You have a correct digit in the wrong place.\0AFermi\09- You have a correct digit in the right place.\0ABagels\09- You have no correct digits.\00"
@str.15 = [24 x i8] c"You ran out of guesses.\00"
@str.16 = [12 x i8] c"You got it!\00"
@str.17 = [7 x i8] c"bagels\00"
@str.18 = [5 x i8] c"pico\00"
@str.19 = [6 x i8] c"fermi\00"
@str.20 = [135 x i8] c"\0ABy the way, all digits of the digits you are trying to\0Aguess are unique so no duplicates are allowed in your guess\0Aeither. Try again.\00"
@str.21 = [7 x i8] c"\0AWhat?\00"
@str.22 = [34 x i8] c"\0AYou need to input 3 digits only.\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([328 x i8], [328 x i8]* @str, i64 0, i64 0))
store i8 121, i8* %4
%6 = load i32, i32* @RAND_MAX
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %7, 10
%9 = sitofp i32 %8 to float
%10 = tail call i32 @time(i32* null)
%11 = tail call i32 @srand(i32 %10)
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 1
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
br label %14
14: ; preds = %150, %0
%15 = phi i32 [ 0, %0 ], [ %151, %150 ]
%16 = phi i32 [ 0, %0 ], [ %42, %150 ]
%17 = call float (...) @rand()
%18 = fdiv float %17, %9
%19 = fptosi float %18 to i32
%20 = trunc i32 %19 to i8
%21 = shl i32 %19, 24
%22 = ashr exact i32 %21, 24
br label %23
23: ; preds = %23, %14
%24 = call float (...) @rand()
%25 = fdiv float %24, %9
%26 = fptosi float %25 to i32
%27 = shl i32 %26, 24
%28 = ashr exact i32 %27, 24
%29 = icmp eq i32 %28, %22
br i1 %29, label %23, label %30
30: ; preds = %23
%31 = trunc i32 %26 to i8
br label %32
32: ; preds = %30, %32
%33 = call float (...) @rand()
%34 = fdiv float %33, %9
%35 = fptosi float %34 to i32
%36 = shl i32 %35, 24
%37 = ashr exact i32 %36, 24
%38 = icmp eq i32 %37, %22
%39 = icmp eq i32 %37, %28
%40 = select i1 %38, i1 true, i1 %39
br i1 %40, label %32, label %41
41: ; preds = %32
%42 = add nuw nsw i32 %16, 1
%43 = trunc i32 %35 to i8
br label %44
44: ; preds = %137, %41
%45 = phi i32 [ 1, %41 ], [ %138, %137 ]
br label %46
46: ; preds = %83, %44
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%48 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%49 = call i32 @strlen(i8* %3)
%50 = icmp eq i32 %49, 3
br i1 %50, label %53, label %51
51: ; preds = %46
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.22, i64 0, i64 0))
br label %53
53: ; preds = %51, %46
%54 = phi i8 [ 0, %51 ], [ 1, %46 ]
%55 = load i8, i8* %3
%56 = add i8 %55, -48
%57 = icmp ugt i8 %56, 9
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
br label %60
60: ; preds = %53, %58
%61 = phi i8 [ 0, %58 ], [ %54, %53 ]
%62 = load i8, i8* %12
%63 = add i8 %62, -48
%64 = icmp ugt i8 %63, 9
br i1 %64, label %65, label %67
65: ; preds = %60
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
br label %67
67: ; preds = %65, %60
%68 = phi i8 [ 0, %65 ], [ %61, %60 ]
%69 = load i8, i8* %13
%70 = add i8 %69, -48
%71 = icmp ugt i8 %70, 9
br i1 %71, label %72, label %74
72: ; preds = %67
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
br label %74
74: ; preds = %72, %67
%75 = phi i8 [ 0, %72 ], [ %68, %67 ]
%76 = icmp eq i8 %55, %62
br i1 %76, label %81, label %77
77: ; preds = %74
%78 = icmp eq i8 %62, %69
%79 = icmp eq i8 %55, %69
%80 = select i1 %78, i1 true, i1 %79
br i1 %80, label %81, label %83
81: ; preds = %77, %74
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([135 x i8], [135 x i8]* @str.20, i64 0, i64 0))
br label %83
83: ; preds = %77, %81
%84 = phi i8 [ 0, %81 ], [ %75, %77 ]
%85 = icmp eq i8 %84, 0
br i1 %85, label %46, label %86
86: ; preds = %83
%87 = call i32 @putchar(i32 10)
%88 = icmp eq i8 %56, %31
%89 = zext i1 %88 to i32
%90 = icmp eq i8 %63, %20
%91 = zext i1 %90 to i32
%92 = add nuw nsw i32 %89, %91
%93 = icmp eq i8 %56, %20
%94 = zext i1 %93 to i32
%95 = icmp eq i8 %63, %43
%96 = zext i1 %95 to i32
%97 = add nuw nsw i32 %92, %96
%98 = icmp eq i8 %70, %31
%99 = zext i1 %98 to i32
%100 = add nuw nsw i32 %97, %99
%101 = icmp eq i8 %63, %31
%102 = zext i1 %101 to i32
%103 = add nuw nsw i32 %94, %102
%104 = icmp eq i8 %56, %43
%105 = zext i1 %104 to i32
%106 = add nuw nsw i32 %100, %105
%107 = icmp eq i8 %70, %20
%108 = zext i1 %107 to i32
%109 = add nuw nsw i32 %106, %108
%110 = icmp eq i8 %70, %43
%111 = zext i1 %110 to i32
%112 = add nuw nsw i32 %103, %111
%113 = icmp eq i32 %112, 0
br i1 %113, label %123, label %114
114: ; preds = %86
%115 = select i1 %93, i32 2, i32 1
%116 = add nuw nsw i32 %115, %102
%117 = add nuw nsw i32 %116, %111
br label %118
118: ; preds = %114, %118
%119 = phi i32 [ %121, %118 ], [ 1, %114 ]
%120 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.19, i64 0, i64 0))
%121 = add nuw nsw i32 %119, 1
%122 = icmp eq i32 %121, %117
br i1 %122, label %123, label %118
123: ; preds = %118, %86
%124 = icmp eq i32 %109, 0
%125 = icmp eq i32 %109, 0
br i1 %125, label %131, label %126
126: ; preds = %123, %126
%127 = phi i32 [ %129, %126 ], [ 1, %123 ]
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.18, i64 0, i64 0))
%129 = add nuw nsw i32 %127, 1
%130 = icmp ult i32 %127, %109
br i1 %130, label %126, label %131
131: ; preds = %126, %123
%132 = select i1 %113, i1 %124, i1 false
br i1 %132, label %139, label %133
133: ; preds = %131
%134 = icmp ult i32 %45, 20
%135 = icmp ult i32 %112, 3
%136 = select i1 %134, i1 %135, i1 false
br i1 %136, label %137, label %142
137: ; preds = %133, %139
%138 = add nuw nsw i32 %45, 1
br label %44
139: ; preds = %131
%140 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.17, i64 0, i64 0))
%141 = icmp ult i32 %45, 20
br i1 %141, label %137, label %147
142: ; preds = %133
%143 = icmp eq i32 %112, 3
br i1 %143, label %144, label %147
144: ; preds = %142
%145 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.16, i64 0, i64 0))
%146 = add nsw i32 %15, 1
br label %150
147: ; preds = %139, %142
%148 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.15, i64 0, i64 0))
%149 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), i32 %22, i32 %28, i32 %37)
br label %150
150: ; preds = %147, %144
%151 = phi i32 [ %146, %144 ], [ %15, %147 ]
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0))
%153 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%154 = load i8, i8* %4
%155 = and i8 %154, -33
%156 = icmp eq i8 %155, 89
br i1 %156, label %14, label %157
157: ; preds = %150
%158 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 %151, i32 %42)
%159 = call i32 @exit(i32 0)
unreachable
}