#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 deal();
int /*<<< orphan*/ printf(char *, int);
int dealerhand(void) {
  int dealerhand[10];
  int dealertotal = 0;
  while (dealertotal < 17) {
    dealertotal = deal();
    printf("%d\n dx", deal());
    dealertotal = dealertotal + deal();
    printf("%d\n D", dealertotal);
  }
}


x86 assembly (clang, -O0):
<dealerhand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x34(%rbp)
cmpl   $0x11,-0x34(%rbp)
jge    1183 <dealerhand+0x63>
mov    $0x0,%al
call   1040 <deal@plt>
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1040 <deal@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    $0x0,%al
call   1040 <deal@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <dealerhand+0xf>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealerhand>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%r14
lea    0xed2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <deal@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <deal@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <deal@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x11,%ebx
jl     1140 <dealerhand+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d\0A dx\00"
@.str.1 = [6 x i8] c"%d\0A D\00"
define i32 @dealerhand() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 17
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = call i32 (...) @deal()
store i32 %8, i32* %3
%9 = call i32 (...) @deal()
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = call i32 (...) @deal()
%13 = add nsw i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %4
16: ; preds = %4
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\0A dx\00"
@.str.1 = [6 x i8] c"%d\0A D\00"
define i32 @dealerhand() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @deal()
%3 = tail call i32 (...) @deal()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @deal()
%6 = add nsw i32 %5, %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = icmp slt i32 %6, 17
br i1 %8, label %1, label %9
9: ; preds = %1
ret i32 undef
}