#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*/ editCount(int *, int);
int /*<<< orphan*/ getCard(char *);
int setVal(char *, int *);
int main() {
  char card_name[3];
  int count = 0;
  int flag;
  int val;
  while (card_name[0] != 'X') {
    getCard(card_name);
    flag = setVal(card_name, &val);
    if (flag == 1)
      editCount(&count, val);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movsbl -0x7(%rbp),%eax
cmp    $0x58,%eax
je     1187 <main+0x57>
lea    -0x7(%rbp),%rdi
call   1050 <getCard@plt>
lea    -0x7(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <setVal@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1182 <main+0x52>
mov    -0x14(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1030 <editCount@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0x5(%rsp),%rbx
lea    0x8(%rsp),%r14
lea    0xc(%rsp),%r15
jmp    1167 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x58,0x5(%rsp)
je     118d <main+0x5d>
mov    %rbx,%rdi
call   1050 <getCard@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <setVal@plt>
cmp    $0x1,%eax
jne    1160 <main+0x30>
mov    0x8(%rsp),%esi
mov    %r15,%rdi
call   1030 <editCount@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %21, %0
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 88
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%13 = call i32 @getCard(i8* %12)
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%15 = call i32 @setVal(i8* %14, i32* %5)
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i32, i32* %5
%20 = call i32 @editCount(i32* %3, i32 %19)
br label %21
21: ; preds = %18, %11
br label %6
22: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
br label %7
7: ; preds = %0, %14
%8 = call i32 @getCard(i8* %4)
%9 = call i32 @setVal(i8* %4, i32* %3)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = call i32 @editCount(i32* %2, i32 %12)
br label %14
14: ; preds = %11, %7
%15 = load i8, i8* %4
%16 = icmp eq i8 %15, 88
br i1 %16, label %17, label %7
17: ; preds = %14
ret i32 0
}