#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*/ gets(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(void) {
  char coupon_number[12];
  int jackpot_won = 0;
  printf("Enter the 10 digit Coupon Number:\n");
  gets(coupon_number);
  if (strcmp(coupon_number, "9876543210") == 0) {
    jackpot_won = 1;
  }
  if (jackpot_won) {
    printf("Congrats, You have won a jackpot.\n");
  } else {
    printf("You are not the lucky winner. Better luck next time\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117c <main+0x4c>
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1197 <main+0x67>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x73>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xefa(%rip),%rax
lea    0xebf(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Enter the 10 digit Coupon Number:\0A\00"
@.str.1 = [11 x i8] c"9876543210\00"
@.str.2 = [35 x i8] c"Congrats, You have won a jackpot.\0A\00"
@.str.3 = [53 x i8] c"You are not the lucky winner. Better luck next time\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %3
br label %11
11: ; preds = %10, %0
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"9876543210\00"
@str = [34 x i8] c"Enter the 10 digit Coupon Number:\00"
@str.4 = [52 x i8] c"You are not the lucky winner. Better luck next time\00"
@str.5 = [34 x i8] c"Congrats, You have won a jackpot.\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @str.4, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}