#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*/ fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  int agent;
  char code;
  printf("Enter your agent number: ");
  scanf("%d", &agent);
  fpurge(stdin);
  printf("Enter your single-digit code key: ");
  scanf("%ch", &code);
  if (agent == 7 && code == 'B' || code == 'b') {
    puts("Welcome aboard, James Bond!");
    puts("You may commence with operation \"FreeCell\"");
  } else {
    puts("The authorities have been notified by this illegal access");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1060 <fpurge@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x7,-0x8(%rbp)
jne    11b0 <main+0x70>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
je     11bd <main+0x7d>
movsbl -0x9(%rbp),%eax
cmp    $0x62,%eax
jne    11da <main+0x9a>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
jmp    11e6 <main+0xa6>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1060 <fpurge@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x7,0x4(%rsp)
sete   %cl
mov    0x3(%rsp),%al
cmp    $0x42,%al
sete   %dl
test   %dl,%cl
jne    11af <main+0x6f>
cmp    $0x62,%al
je     11af <main+0x6f>
lea    0xede(%rip),%rdi
jmp    11c2 <main+0x82>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter your agent number: \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.2 = [35 x i8] c"Enter your single-digit code key: \00"
@.str.3 = [4 x i8] c"%ch\00"
@.str.4 = [28 x i8] c"Welcome aboard, James Bond!\00"
@.str.5 = [43 x i8] c"You may commence with operation \22FreeCell\22\00"
@.str.6 = [58 x i8] c"The authorities have been notified by this illegal access\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* @stdin
%7 = call i32 @fpurge(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 7
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 66
br i1 %15, label %20, label %16
16: ; preds = %12, %0
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 98
br i1 %19, label %20, label %23
20: ; preds = %16, %12
%21 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
br label %25
23: ; preds = %16
%24 = call i32 @puts(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter your agent number: \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.2 = [35 x i8] c"Enter your single-digit code key: \00"
@.str.3 = [4 x i8] c"%ch\00"
@.str.4 = [28 x i8] c"Welcome aboard, James Bond!\00"
@.str.5 = [43 x i8] c"You may commence with operation \22FreeCell\22\00"
@.str.6 = [58 x i8] c"The authorities have been notified by this illegal access\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* @stdin
%7 = call i32 @fpurge(i32 %6)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 7
%12 = load i8, i8* %2
%13 = icmp eq i8 %12, 66
%14 = select i1 %11, i1 %13, i1 false
%15 = icmp eq i8 %12, 98
%16 = select i1 %14, i1 true, i1 %15
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %0, %17
%20 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), %17 ], [ getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), %0 ]
%21 = call i32 @puts(i8* dereferenceable(1) %20)
ret i32 0
}