#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ strcmp(char *, char *);
scalar_t__ time(int /*<<< orphan*/ *);
int value_of_card(int, int);
int main() {
  int dealer_cards[7];
  int my_cards[7];
  int number_of_dealer_cards, number_of_my_cards, sum_dealer_cards,
      sum_my_cards, temp_counter, stand, dealer_ace_position, my_ace_position;
  char input[20];
  char consume;
  srand((unsigned int)time(NULL));
  dealer_ace_position = -1;
  my_ace_position = -1;
  my_cards[0] = value_of_card(rand() % (14 - 2 + 1) + 2, my_ace_position);
  if (my_cards[0] == 11)
    my_ace_position = 0;
  my_cards[1] = value_of_card(rand() % (14 - 2 + 1) + 2, my_ace_position);
  if (my_cards[1] == 11)
    my_ace_position = 1;
  sum_my_cards = my_cards[0] + my_cards[1];
  number_of_my_cards = 2;
  dealer_cards[0] =
      value_of_card(rand() % (14 - 2 + 1) + 2, dealer_ace_position);
  if (dealer_cards[0] == 11)
    dealer_ace_position = 0;
  dealer_cards[1] =
      value_of_card(rand() % (14 - 2 + 1) + 2, dealer_ace_position);
  if (dealer_cards[1] == 11)
    dealer_ace_position = 1;
  sum_dealer_cards = dealer_cards[0] + dealer_cards[1];
  number_of_dealer_cards = 2;
  printf("Welcome to the Blackjack game!\n\nPress Enter to play!\n\n");
  getchar();
  printf("The dealer:\n? + %d\n\n", dealer_cards[1]);
  printf("You:\n%d + %d = %d\n\n", my_cards[0], my_cards[1], sum_my_cards);
  stand = 0;
  while (stand == 0) {
    printf("Would you like to \"hit\" or \"stand\"? ");
    scanf("%19s", &input);
    scanf("%c", &consume);
    if (strcmp(input, "stand") == 0)
      stand = 1;
    else if (strcmp(input, "hit") == 0) {
      my_cards[number_of_my_cards] =
          value_of_card(rand() % (14 - 2 + 1) + 2, my_ace_position);
      if (my_cards[number_of_my_cards] == 11)
        my_ace_position = number_of_my_cards;
      sum_my_cards += my_cards[number_of_my_cards];
      number_of_my_cards++;
      if (sum_my_cards > 21) {
        if ((my_ace_position < 0)) {
          printf("\nBusted!\n");
          stand = 1;
        }
        if (my_ace_position >= 0) {
          my_cards[my_ace_position] = 1;
          sum_my_cards -= 10;
          my_ace_position = -2;
        }
      }
      printf("\nYou:\n%d", my_cards[0]);
      for (temp_counter = 1; temp_counter < number_of_my_cards; temp_counter++)
        printf(" + %d", my_cards[temp_counter]);
      printf(" = %d\n", sum_my_cards);
      if (number_of_my_cards == 7)
        stand = 1;
    } else
      printf("You entered something invalid. Try again.\n ");
  }
  stand = 0;
  while (stand == 0) {
    if ((sum_dealer_cards >= 17) || (sum_my_cards > 21))
      stand = 1;
    else {
      dealer_cards[number_of_dealer_cards] =
          value_of_card(rand() % (14 - 2 + 1) + 2, dealer_ace_position);
      if (dealer_cards[number_of_dealer_cards] == 11)
        dealer_ace_position = number_of_dealer_cards;
      sum_dealer_cards += dealer_cards[number_of_dealer_cards];
      number_of_dealer_cards++;
      if (sum_dealer_cards > 21) {
        if ((dealer_ace_position < 0)) {
          printf("\nDealer busted!\n");
          stand = 1;
        }
        if (dealer_ace_position >= 0) {
          dealer_cards[my_ace_position] = 1;
          sum_dealer_cards -= 10;
          dealer_ace_position = -2;
        }
      }
      if (sum_dealer_cards >= 17)
        stand = 1;
    }
  }
  printf("\nDealer has: %d\n", sum_dealer_cards);
  if (sum_my_cards > 21)
    printf("Dealer wins!\n");
  else if (sum_dealer_cards > 21)
    printf("Player wins!\n");
  else if (sum_dealer_cards > sum_my_cards)
    printf("Dealer wins!\n");
  else if (sum_dealer_cards < sum_my_cards)
    printf("Player wins!\n");
  else if (sum_dealer_cards == sum_my_cards)
    printf("Dealer wins!\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0xffffffff,-0x5c(%rbp)
movl   $0xffffffff,-0x60(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x2,%edi
mov    -0x60(%rbp),%esi
call   10a0 <value_of_card@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0xb,-0x40(%rbp)
jne    11e0 <main+0x60>
movl   $0x0,-0x60(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x2,%edi
mov    -0x60(%rbp),%esi
call   10a0 <value_of_card@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0xb,-0x3c(%rbp)
jne    1210 <main+0x90>
movl   $0x1,-0x60(%rbp)
mov    -0x40(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x50(%rbp)
movl   $0x2,-0x48(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x2,%edi
mov    -0x5c(%rbp),%esi
call   10a0 <value_of_card@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xb,-0x20(%rbp)
jne    1250 <main+0xd0>
movl   $0x0,-0x5c(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x2,%edi
mov    -0x5c(%rbp),%esi
call   10a0 <value_of_card@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xb,-0x1c(%rbp)
jne    1280 <main+0x100>
movl   $0x1,-0x5c(%rbp)
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x2,-0x44(%rbp)
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x1c(%rbp),%esi
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x50(%rbp),%ecx
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0x0,-0x58(%rbp)
jne    1480 <main+0x300>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd92(%rip),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xd85(%rip),%rdi
lea    -0x81(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    -0x80(%rbp),%rdi
lea    0xd6f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1339 <main+0x1b9>
movl   $0x1,-0x58(%rbp)
jmp    147b <main+0x2fb>
lea    -0x80(%rbp),%rdi
lea    0xd4f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1468 <main+0x2e8>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x2,%edi
mov    -0x60(%rbp),%esi
call   10a0 <value_of_card@plt>
mov    %eax,%ecx
movslq -0x48(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
movslq -0x48(%rbp),%rax
cmpl   $0xb,-0x40(%rbp,%rax,4)
jne    138e <main+0x20e>
mov    -0x48(%rbp),%eax
mov    %eax,-0x60(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
add    -0x50(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x15,-0x50(%rbp)
jle    13f9 <main+0x279>
cmpl   $0x0,-0x60(%rbp)
jge    13ce <main+0x24e>
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x58(%rbp)
cmpl   $0x0,-0x60(%rbp)
jl     13f4 <main+0x274>
movslq -0x60(%rbp),%rax
movl   $0x1,-0x40(%rbp,%rax,4)
mov    -0x50(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x50(%rbp)
movl   $0xfffffffe,-0x60(%rbp)
jmp    13f9 <main+0x279>
mov    -0x40(%rbp),%esi
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1441 <main+0x2c1>
movslq -0x54(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xc7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1411 <main+0x291>
mov    -0x50(%rbp),%esi
lea    0xc65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x7,-0x48(%rbp)
jne    1463 <main+0x2e3>
movl   $0x1,-0x58(%rbp)
jmp    1476 <main+0x2f6>
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    147b <main+0x2fb>
jmp    12d4 <main+0x154>
movl   $0x0,-0x58(%rbp)
cmpl   $0x0,-0x58(%rbp)
jne    1572 <main+0x3f2>
cmpl   $0x11,-0x4c(%rbp)
jge    14a5 <main+0x325>
cmpl   $0x15,-0x50(%rbp)
jle    14b1 <main+0x331>
movl   $0x1,-0x58(%rbp)
jmp    156d <main+0x3ed>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x2,%edi
mov    -0x5c(%rbp),%esi
call   10a0 <value_of_card@plt>
mov    %eax,%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
movslq -0x44(%rbp),%rax
cmpl   $0xb,-0x20(%rbp,%rax,4)
jne    14ec <main+0x36c>
mov    -0x44(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movslq -0x44(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x15,-0x4c(%rbp)
jle    1557 <main+0x3d7>
cmpl   $0x0,-0x5c(%rbp)
jge    152c <main+0x3ac>
lea    0xbc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x58(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jl     1552 <main+0x3d2>
movslq -0x60(%rbp),%rax
movl   $0x1,-0x20(%rbp,%rax,4)
mov    -0x4c(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4c(%rbp)
movl   $0xfffffffe,-0x5c(%rbp)
jmp    1557 <main+0x3d7>
cmpl   $0x11,-0x4c(%rbp)
jl     1568 <main+0x3e8>
movl   $0x1,-0x58(%rbp)
jmp    156d <main+0x3ed>
jmp    1487 <main+0x307>
mov    -0x4c(%rbp),%esi
lea    0xb78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x15,-0x50(%rbp)
jle    15a0 <main+0x420>
lea    0xb71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1629 <main+0x4a9>
cmpl   $0x15,-0x4c(%rbp)
jle    15bd <main+0x43d>
lea    0xb62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1624 <main+0x4a4>
mov    -0x4c(%rbp),%eax
cmp    -0x50(%rbp),%eax
jle    15dc <main+0x45c>
lea    0xb35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    161f <main+0x49f>
mov    -0x4c(%rbp),%eax
cmp    -0x50(%rbp),%eax
jge    15fb <main+0x47b>
lea    0xb24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    161a <main+0x49a>
mov    -0x4c(%rbp),%eax
cmp    -0x50(%rbp),%eax
jne    1615 <main+0x495>
lea    0xaf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    161a <main+0x49a>
jmp    161f <main+0x49f>
jmp    1624 <main+0x4a4>
jmp    1629 <main+0x4a9>
mov    $0x0,%al
call   1060 <getchar@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    $0x58,%rsp
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   10a0 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x2,%edi
mov    $0xffffffff,%esi
call   10b0 <value_of_card@plt>
mov    %eax,%r12d
mov    %eax,0x20(%rsp)
xor    %ebp,%ebp
cmp    $0xb,%eax
setne  %bpl
neg    %ebp
xor    %eax,%eax
call   10a0 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x2,%edi
mov    %ebp,%esi
call   10b0 <value_of_card@plt>
mov    %eax,%ebx
mov    %eax,0x24(%rsp)
cmp    $0xb,%eax
mov    $0x1,%r15d
cmove  %r15d,%ebp
mov    %ebp,0xc(%rsp)
lea    (%rbx,%r12,1),%ebp
xor    %eax,%eax
call   10a0 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x2,%edi
mov    $0xffffffff,%esi
call   10b0 <value_of_card@plt>
xor    %r13d,%r13d
mov    %eax,0x1c(%rsp)
cmp    $0xb,%eax
setne  %r13b
neg    %r13d
xor    %eax,%eax
call   10a0 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x2,%edi
mov    %r13d,%esi
call   10b0 <value_of_card@plt>
mov    %eax,%r14d
cmp    $0xb,%eax
cmove  %r15d,%r13d
lea    0xde9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
lea    0xd23(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd27(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %ebp,0x10(%rsp)
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%ebx
lea    0xd5d(%rip),%r12
jmp    132e <main+0x19e>
xchg   %ax,%ax
xor    %r15d,%r15d
lea    0xd5c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%ebp
mov    %ebp,%ebx
test   %r15d,%r15d
jne    14b5 <main+0x325>
lea    0xcf4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd0b(%rip),%rdi
lea    0x40(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xcfa(%rip),%rdi
lea    0x1b(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    %rbp,%rdi
lea    0xce7(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     14b5 <main+0x325>
mov    %rbp,%rdi
lea    0xcd5(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1310 <main+0x180>
movl   $0x0,0x14(%rsp)
xor    %eax,%eax
call   10a0 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x2,%edi
mov    0xc(%rsp),%ebp
mov    %ebp,%esi
call   10b0 <value_of_card@plt>
movslq %ebx,%rcx
mov    %eax,0x20(%rsp,%rcx,4)
cmp    $0xb,%eax
cmove  %ebx,%ebp
mov    0x10(%rsp),%r15d
add    %eax,%r15d
cmp    $0x16,%r15d
jl     140a <main+0x27a>
test   %ebp,%ebp
js     1410 <main+0x280>
mov    %ebp,%eax
movl   $0x1,0x20(%rsp,%rax,4)
add    $0xfffffff6,%r15d
movl   $0xfffffffe,0xc(%rsp)
ff
jmp    1430 <main+0x2a0>
mov    %ebp,0xc(%rsp)
jmp    1430 <main+0x2a0>
mov    %ebp,0xc(%rsp)
lea    0xcf8(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,0x14(%rsp)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    0x20(%rsp),%esi
lea    0xc22(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
mov    %r15d,0x10(%rsp)
jle    149a <main+0x30a>
mov    %ebp,%ebx
mov    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rsp,%r15,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%rbx
jne    1460 <main+0x2d0>
lea    0xbf0(%rip),%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x7,%ebp
mov    0x14(%rsp),%r15d
jne    1323 <main+0x193>
jmp    14b5 <main+0x325>
lea    0xbce(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r15d
jmp    1323 <main+0x193>
add    0x1c(%rsp),%r14d
mov    $0x2,%ebp
mov    0x10(%rsp),%r15d
jmp    14e6 <main+0x356>
cs nopw 0x0(%rax,%rax,1)
add    $0xfffffff6,%ebx
mov    $0xfffffffe,%eax
add    $0x1,%ebp
mov    %eax,%r13d
mov    %ebx,%r14d
cmp    $0x11,%ebx
jge    154e <main+0x3be>
cmp    $0x10,%r14d
jg     154b <main+0x3bb>
cmp    $0x15,%r15d
jg     154b <main+0x3bb>
xor    %eax,%eax
call   10a0 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x2,%edi
mov    %r13d,%esi
call   10b0 <value_of_card@plt>
mov    %eax,%ebx
mov    %ebp,%eax
cmp    $0xb,%ebx
je     1531 <main+0x3a1>
mov    %r13d,%eax
add    %r14d,%ebx
cmp    $0x16,%ebx
jl     14d8 <main+0x348>
test   %eax,%eax
jns    14d0 <main+0x340>
lea    0xbbf(%rip),%rdi
call   1030 <puts@plt>
jmp    154e <main+0x3be>
mov    %r14d,%ebx
lea    0xb4d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xb91(%rip),%rax
cmp    $0x15,%r15d
jg     157c <main+0x3ec>
lea    0xb77(%rip),%rdi
cmp    $0x15,%ebx
jg     157f <main+0x3ef>
cmp    %r15d,%ebx
jle    159c <main+0x40c>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
jl     157f <main+0x3ef>
mov    %rax,%rdi
jne    1584 <main+0x3f4>
jmp    157f <main+0x3ef>

LLVM IR (-O0):
@.str = [55 x i8] c"Welcome to the Blackjack game!\0A\0APress Enter to play!\0A\0A\00"
@.str.1 = [21 x i8] c"The dealer:\0A? + %d\0A\0A\00"
@.str.2 = [20 x i8] c"You:\0A%d + %d = %d\0A\0A\00"
@.str.3 = [37 x i8] c"Would you like to \22hit\22 or \22stand\22? \00"
@.str.4 = [5 x i8] c"%19s\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [6 x i8] c"stand\00"
@.str.7 = [4 x i8] c"hit\00"
@.str.8 = [10 x i8] c"\0ABusted!\0A\00"
@.str.9 = [9 x i8] c"\0AYou:\0A%d\00"
@.str.10 = [6 x i8] c" + %d\00"
@.str.11 = [7 x i8] c" = %d\0A\00"
@.str.12 = [44 x i8] c"You entered something invalid. Try again.\0A \00"
@.str.13 = [17 x i8] c"\0ADealer busted!\0A\00"
@.str.14 = [17 x i8] c"\0ADealer has: %d\0A\00"
@.str.15 = [14 x i8] c"Dealer wins!\0A\00"
@.str.16 = [14 x i8] c"Player wins!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca [7 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
%12 = alloca [20 x i8]
%13 = alloca i8
store i32 0, i32* %1
%14 = call i64 @time(i32* null)
%15 = trunc i64 %14 to i32
%16 = call i32 @srand(i32 %15)
store i32 -1, i32* %10
store i32 -1, i32* %11
%17 = call i32 (...) @rand()
%18 = srem i32 %17, 13
%19 = add nsw i32 %18, 2
%20 = load i32, i32* %11
%21 = call i32 @value_of_card(i32 %19, i32 %20)
%22 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
store i32 %21, i32* %22
%23 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 11
br i1 %25, label %26, label %27
26: ; preds = %0
store i32 0, i32* %11
br label %27
27: ; preds = %26, %0
%28 = call i32 (...) @rand()
%29 = srem i32 %28, 13
%30 = add nsw i32 %29, 2
%31 = load i32, i32* %11
%32 = call i32 @value_of_card(i32 %30, i32 %31)
%33 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
store i32 %32, i32* %33
%34 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 11
br i1 %36, label %37, label %38
37: ; preds = %27
store i32 1, i32* %11
br label %38
38: ; preds = %37, %27
%39 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%40 = load i32, i32* %39
%41 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
%42 = load i32, i32* %41
%43 = add nsw i32 %40, %42
store i32 %43, i32* %7
store i32 2, i32* %5
%44 = call i32 (...) @rand()
%45 = srem i32 %44, 13
%46 = add nsw i32 %45, 2
%47 = load i32, i32* %10
%48 = call i32 @value_of_card(i32 %46, i32 %47)
%49 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
store i32 %48, i32* %49
%50 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%51 = load i32, i32* %50
%52 = icmp eq i32 %51, 11
br i1 %52, label %53, label %54
53: ; preds = %38
store i32 0, i32* %10
br label %54
54: ; preds = %53, %38
%55 = call i32 (...) @rand()
%56 = srem i32 %55, 13
%57 = add nsw i32 %56, 2
%58 = load i32, i32* %10
%59 = call i32 @value_of_card(i32 %57, i32 %58)
%60 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 1
store i32 %59, i32* %60
%61 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 1
%62 = load i32, i32* %61
%63 = icmp eq i32 %62, 11
br i1 %63, label %64, label %65
64: ; preds = %54
store i32 1, i32* %10
br label %65
65: ; preds = %64, %54
%66 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%67 = load i32, i32* %66
%68 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 1
%69 = load i32, i32* %68
%70 = add nsw i32 %67, %69
store i32 %70, i32* %6
store i32 2, i32* %4
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%72 = call i32 (...) @getchar()
%73 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 1
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %74)
%76 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%77 = load i32, i32* %76
%78 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
%79 = load i32, i32* %78
%80 = load i32, i32* %7
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %77, i32 %79, i32 %80)
store i32 0, i32* %9
br label %82
82: ; preds = %166, %65
%83 = load i32, i32* %9
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %167
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%87 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), [20 x i8]* %12)
%88 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%89 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%90 = call i64 @strcmp(i8* %89, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %85
store i32 1, i32* %9
br label %166
93: ; preds = %85
%94 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %163
97: ; preds = %93
%98 = call i32 (...) @rand()
%99 = srem i32 %98, 13
%100 = add nsw i32 %99, 2
%101 = load i32, i32* %11
%102 = call i32 @value_of_card(i32 %100, i32 %101)
%103 = load i32, i32* %5
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %104
store i32 %102, i32* %105
%106 = load i32, i32* %5
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %107
%109 = load i32, i32* %108
%110 = icmp eq i32 %109, 11
br i1 %110, label %111, label %113
111: ; preds = %97
%112 = load i32, i32* %5
store i32 %112, i32* %11
br label %113
113: ; preds = %111, %97
%114 = load i32, i32* %5
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %115
%117 = load i32, i32* %116
%118 = load i32, i32* %7
%119 = add nsw i32 %118, %117
store i32 %119, i32* %7
%120 = load i32, i32* %5
%121 = add nsw i32 %120, 1
store i32 %121, i32* %5
%122 = load i32, i32* %7
%123 = icmp sgt i32 %122, 21
br i1 %123, label %124, label %139
124: ; preds = %113
%125 = load i32, i32* %11
%126 = icmp slt i32 %125, 0
br i1 %126, label %127, label %129
127: ; preds = %124
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %9
br label %129
129: ; preds = %127, %124
%130 = load i32, i32* %11
%131 = icmp sge i32 %130, 0
br i1 %131, label %132, label %138
132: ; preds = %129
%133 = load i32, i32* %11
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %134
store i32 1, i32* %135
%136 = load i32, i32* %7
%137 = sub nsw i32 %136, 10
store i32 %137, i32* %7
store i32 -2, i32* %11
br label %138
138: ; preds = %132, %129
br label %139
139: ; preds = %138, %113
%140 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%141 = load i32, i32* %140
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %141)
store i32 1, i32* %8
br label %143
143: ; preds = %153, %139
%144 = load i32, i32* %8
%145 = load i32, i32* %5
%146 = icmp slt i32 %144, %145
br i1 %146, label %147, label %156
147: ; preds = %143
%148 = load i32, i32* %8
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %149
%151 = load i32, i32* %150
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %147
%154 = load i32, i32* %8
%155 = add nsw i32 %154, 1
store i32 %155, i32* %8
br label %143
156: ; preds = %143
%157 = load i32, i32* %7
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %157)
%159 = load i32, i32* %5
%160 = icmp eq i32 %159, 7
br i1 %160, label %161, label %162
161: ; preds = %156
store i32 1, i32* %9
br label %162
162: ; preds = %161, %156
br label %165
163: ; preds = %93
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.12, i64 0, i64 0))
br label %165
165: ; preds = %163, %162
br label %166
166: ; preds = %165, %92
br label %82
167: ; preds = %82
store i32 0, i32* %9
br label %168
168: ; preds = %225, %167
%169 = load i32, i32* %9
%170 = icmp eq i32 %169, 0
br i1 %170, label %171, label %226
171: ; preds = %168
%172 = load i32, i32* %6
%173 = icmp sge i32 %172, 17
br i1 %173, label %177, label %174
174: ; preds = %171
%175 = load i32, i32* %7
%176 = icmp sgt i32 %175, 21
br i1 %176, label %177, label %178
177: ; preds = %174, %171
store i32 1, i32* %9
br label %225
178: ; preds = %174
%179 = call i32 (...) @rand()
%180 = srem i32 %179, 13
%181 = add nsw i32 %180, 2
%182 = load i32, i32* %10
%183 = call i32 @value_of_card(i32 %181, i32 %182)
%184 = load i32, i32* %4
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %185
store i32 %183, i32* %186
%187 = load i32, i32* %4
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %188
%190 = load i32, i32* %189
%191 = icmp eq i32 %190, 11
br i1 %191, label %192, label %194
192: ; preds = %178
%193 = load i32, i32* %4
store i32 %193, i32* %10
br label %194
194: ; preds = %192, %178
%195 = load i32, i32* %4
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %196
%198 = load i32, i32* %197
%199 = load i32, i32* %6
%200 = add nsw i32 %199, %198
store i32 %200, i32* %6
%201 = load i32, i32* %4
%202 = add nsw i32 %201, 1
store i32 %202, i32* %4
%203 = load i32, i32* %6
%204 = icmp sgt i32 %203, 21
br i1 %204, label %205, label %220
205: ; preds = %194
%206 = load i32, i32* %10
%207 = icmp slt i32 %206, 0
br i1 %207, label %208, label %210
208: ; preds = %205
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %9
br label %210
210: ; preds = %208, %205
%211 = load i32, i32* %10
%212 = icmp sge i32 %211, 0
br i1 %212, label %213, label %219
213: ; preds = %210
%214 = load i32, i32* %11
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %215
store i32 1, i32* %216
%217 = load i32, i32* %6
%218 = sub nsw i32 %217, 10
store i32 %218, i32* %6
store i32 -2, i32* %10
br label %219
219: ; preds = %213, %210
br label %220
220: ; preds = %219, %194
%221 = load i32, i32* %6
%222 = icmp sge i32 %221, 17
br i1 %222, label %223, label %224
223: ; preds = %220
store i32 1, i32* %9
br label %224
224: ; preds = %223, %220
br label %225
225: ; preds = %224, %177
br label %168
226: ; preds = %168
%227 = load i32, i32* %6
%228 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i32 %227)
%229 = load i32, i32* %7
%230 = icmp sgt i32 %229, 21
br i1 %230, label %231, label %233
231: ; preds = %226
%232 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
br label %260
233: ; preds = %226
%234 = load i32, i32* %6
%235 = icmp sgt i32 %234, 21
br i1 %235, label %236, label %238
236: ; preds = %233
%237 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
br label %259
238: ; preds = %233
%239 = load i32, i32* %6
%240 = load i32, i32* %7
%241 = icmp sgt i32 %239, %240
br i1 %241, label %242, label %244
242: ; preds = %238
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
br label %258
244: ; preds = %238
%245 = load i32, i32* %6
%246 = load i32, i32* %7
%247 = icmp slt i32 %245, %246
br i1 %247, label %248, label %250
248: ; preds = %244
%249 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
br label %257
250: ; preds = %244
%251 = load i32, i32* %6
%252 = load i32, i32* %7
%253 = icmp eq i32 %251, %252
br i1 %253, label %254, label %256
254: ; preds = %250
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
br label %256
256: ; preds = %254, %250
br label %257
257: ; preds = %256, %248
br label %258
258: ; preds = %257, %242
br label %259
259: ; preds = %258, %236
br label %260
260: ; preds = %259, %231
%261 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"The dealer:\0A? + %d\0A\0A\00"
@.str.2 = [20 x i8] c"You:\0A%d + %d = %d\0A\0A\00"
@.str.3 = [37 x i8] c"Would you like to \22hit\22 or \22stand\22? \00"
@.str.4 = [5 x i8] c"%19s\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [6 x i8] c"stand\00"
@.str.7 = [4 x i8] c"hit\00"
@.str.9 = [9 x i8] c"\0AYou:\0A%d\00"
@.str.10 = [6 x i8] c" + %d\00"
@.str.11 = [7 x i8] c" = %d\0A\00"
@.str.12 = [44 x i8] c"You entered something invalid. Try again.\0A \00"
@.str.14 = [17 x i8] c"\0ADealer has: %d\0A\00"
@str = [54 x i8] c"Welcome to the Blackjack game!\0A\0APress Enter to play!\0A\00"
@str.20 = [13 x i8] c"Player wins!\00"
@str.21 = [13 x i8] c"Dealer wins!\00"
@str.22 = [16 x i8] c"\0ADealer busted!\00"
@str.23 = [9 x i8] c"\0ABusted!\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [20 x i8]
%3 = alloca i8
%4 = bitcast [7 x i32]* %1 to i8*
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = tail call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = tail call i32 @srand(i32 %7)
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 13
%11 = add nsw i32 %10, 2
%12 = tail call i32 @value_of_card(i32 %11, i32 -1)
%13 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
store i32 %12, i32* %13
%14 = icmp ne i32 %12, 11
%15 = sext i1 %14 to i32
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 13
%18 = add nsw i32 %17, 2
%19 = tail call i32 @value_of_card(i32 %18, i32 %15)
%20 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 1
store i32 %19, i32* %20
%21 = icmp eq i32 %19, 11
%22 = select i1 %21, i32 1, i32 %15
%23 = add nsw i32 %19, %12
%24 = tail call i32 (...) @rand()
%25 = srem i32 %24, 13
%26 = add nsw i32 %25, 2
%27 = tail call i32 @value_of_card(i32 %26, i32 -1)
%28 = icmp ne i32 %27, 11
%29 = sext i1 %28 to i32
%30 = tail call i32 (...) @rand()
%31 = srem i32 %30, 13
%32 = add nsw i32 %31, 2
%33 = tail call i32 @value_of_card(i32 %32, i32 %29)
%34 = icmp eq i32 %33, 11
%35 = select i1 %34, i32 1, i32 %29
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%37 = tail call i32 (...) @getchar()
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %19, i32 %23)
br label %44
40: ; preds = %94, %44, %99
%41 = phi i32 [ %101, %99 ], [ %46, %44 ], [ %77, %94 ]
%42 = add nsw i32 %33, %27
%43 = icmp sgt i32 %41, 21
br label %105
44: ; preds = %0, %99
%45 = phi i32 [ %22, %0 ], [ %103, %99 ]
%46 = phi i32 [ %23, %0 ], [ %101, %99 ]
%47 = phi i32 [ 2, %0 ], [ %100, %99 ]
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), [20 x i8]* %2)
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%51 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %40, label %53
53: ; preds = %44
%54 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %97
56: ; preds = %53
%57 = call i32 (...) @rand()
%58 = srem i32 %57, 13
%59 = add nsw i32 %58, 2
%60 = call i32 @value_of_card(i32 %59, i32 %45)
%61 = sext i32 %47 to i64
%62 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 %61
store i32 %60, i32* %62
%63 = icmp eq i32 %60, 11
%64 = select i1 %63, i32 %47, i32 %45
%65 = add nsw i32 %60, %46
%66 = add i32 %47, 1
%67 = icmp sgt i32 %65, 21
br i1 %67, label %68, label %76
68: ; preds = %56
%69 = icmp slt i32 %64, 0
br i1 %69, label %70, label %72
70: ; preds = %68
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.23, i64 0, i64 0))
br label %76
72: ; preds = %68
%73 = zext i32 %64 to i64
%74 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 %73
store i32 1, i32* %74
%75 = add nsw i32 %65, -10
br label %76
76: ; preds = %70, %72, %56
%77 = phi i32 [ %75, %72 ], [ %65, %70 ], [ %65, %56 ]
%78 = phi i32 [ 0, %72 ], [ 1, %70 ], [ 0, %56 ]
%79 = phi i32 [ -2, %72 ], [ %64, %70 ], [ %64, %56 ]
%80 = load i32, i32* %13
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %80)
%82 = icmp slt i32 %47, 1
br i1 %82, label %83, label %85
83: ; preds = %76
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %77)
br label %99
85: ; preds = %76
%86 = zext i32 %66 to i64
br label %87
87: ; preds = %85, %87
%88 = phi i64 [ 1, %85 ], [ %92, %87 ]
%89 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 %88
%90 = load i32, i32* %89
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %90)
%92 = add nuw nsw i64 %88, 1
%93 = icmp eq i64 %92, %86
br i1 %93, label %94, label %87
94: ; preds = %87
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %77)
%96 = icmp eq i32 %66, 7
br i1 %96, label %40, label %99
97: ; preds = %53
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.12, i64 0, i64 0))
br label %99
99: ; preds = %83, %94, %97
%100 = phi i32 [ %47, %97 ], [ %66, %94 ], [ %66, %83 ]
%101 = phi i32 [ %46, %97 ], [ %77, %94 ], [ %77, %83 ]
%102 = phi i32 [ 0, %97 ], [ %78, %94 ], [ %78, %83 ]
%103 = phi i32 [ %45, %97 ], [ %79, %94 ], [ %79, %83 ]
%104 = icmp eq i32 %102, 0
br i1 %104, label %44, label %40
105: ; preds = %127, %40
%106 = phi i32 [ %35, %40 ], [ %129, %127 ]
%107 = phi i32 [ %42, %40 ], [ %128, %127 ]
%108 = phi i32 [ 2, %40 ], [ %119, %127 ]
%109 = icmp sgt i32 %107, 16
%110 = select i1 %109, i1 true, i1 %43
br i1 %110, label %131, label %111
111: ; preds = %105
%112 = call i32 (...) @rand()
%113 = srem i32 %112, 13
%114 = add nsw i32 %113, 2
%115 = call i32 @value_of_card(i32 %114, i32 %106)
%116 = icmp eq i32 %115, 11
%117 = select i1 %116, i32 %108, i32 %106
%118 = add nsw i32 %115, %107
%119 = add nuw nsw i32 %108, 1
%120 = icmp sgt i32 %118, 21
br i1 %120, label %121, label %127
121: ; preds = %111
%122 = icmp slt i32 %117, 0
br i1 %122, label %123, label %125
123: ; preds = %121
%124 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.22, i64 0, i64 0))
br label %131
125: ; preds = %121
%126 = add nsw i32 %118, -10
br label %127
127: ; preds = %125, %111
%128 = phi i32 [ %126, %125 ], [ %118, %111 ]
%129 = phi i32 [ -2, %125 ], [ %117, %111 ]
%130 = icmp sgt i32 %128, 16
br i1 %130, label %131, label %105
131: ; preds = %127, %105, %123
%132 = phi i32 [ %118, %123 ], [ %128, %127 ], [ %107, %105 ]
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i32 %132)
br i1 %43, label %142, label %134
134: ; preds = %131
%135 = icmp sgt i32 %132, 21
br i1 %135, label %142, label %136
136: ; preds = %134
%137 = icmp sgt i32 %132, %41
br i1 %137, label %142, label %138
138: ; preds = %136
%139 = icmp slt i32 %132, %41
br i1 %139, label %142, label %140
140: ; preds = %138
%141 = icmp eq i32 %132, %41
br i1 %141, label %142, label %145
142: ; preds = %140, %138, %136, %134, %131
%143 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.21, i64 0, i64 0), %131 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.20, i64 0, i64 0), %134 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.21, i64 0, i64 0), %136 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.20, i64 0, i64 0), %138 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.21, i64 0, i64 0), %140 ]
%144 = call i32 @puts(i8* dereferenceable(1) %143)
br label %145
145: ; preds = %142, %140
%146 = call i32 (...) @getchar()
ret i32 0
}