#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int age = 0;
  int id = 0;
  int smoney = 0;
  int num = 0;
  int data = 0;
  int umoney = 0;
  printf("    WELLCOME TO OUR LOTTERT GAME    \n Please enter your age:");
  scanf("%d", &age);
  if (age > 17) {
    printf("You Can Play The Game!\n Please Enter Your ID:");
    scanf("%d", &id);
    while (id == 111) {
      printf("Please Show Your Money:");
      scanf("%d", &smoney);
      printf("Please Enter The Money You Want To Use\n(It must be more than "
             "1000ks) 🙂");
      scanf("%d", &umoney);
      while (umoney > 999) {
        printf("Please Enter The Number You Like: ");
        scanf("%d", &num);
        if (num == 333) {
          smoney = (smoney + (umoney * 10));
          printf("##Congracutions you win the game##\n Now your money is:%d\n",
                 smoney);
          printf("If you want to continue,press 1:  ");
          scanf("%d", &data);
          printf("You Can Play the Game again");
        } else {
          printf("Sorry! Try Again!\n Now your money is:%d", smoney);
          smoney = smoney - umoney;
          printf("##Ohh sorry you lose the game##\n Now your money is:%d\n",
                 smoney);
        }
        if (data == 1) {
          printf("You Can Play Again Now\n");
        } else {
          exit(0);
        }
      }
    }
  } else {
    printf("Sorry! You Can't Play The Game");
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1010(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x11,-0x8(%rbp)
jle    12d9 <main+0x1a9>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x6f,-0xc(%rbp)
jne    12d4 <main+0x1a4>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa2(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3e7,-0x1c(%rbp)
jle    12cf <main+0x19f>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf77(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x14d,-0x14(%rbp)
jne    127b <main+0x14b>
mov    -0x10(%rbp),%eax
imul   $0xa,-0x1c(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2f(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a6 <main+0x176>
mov    -0x10(%rbp),%esi
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x18(%rbp)
jne    12c3 <main+0x193>
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ca <main+0x19a>
xor    %edi,%edi
call   1050 <exit@plt>
jmp    11f5 <main+0xc5>
jmp    11af <main+0x7f>
jmp    12ee <main+0x1be>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,(%rsp)
lea    0xe7c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xffc(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x12,0x14(%rsp)
jl     1318 <main+0x1d8>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfd2(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x6f,0x8(%rsp)
jne    1300 <main+0x1c0>
lea    0xfb6(%rip),%rbx
lea    0xeee(%rip),%rbp
lea    0x10(%rsp),%r14
lea    0xffc(%rip),%r12
lea    0xf77(%rip),%r13
lea    0xf98(%rip),%r15
jmp    120b <main+0xcb>
nopl   0x0(%rax,%rax,1)
cmpl   $0x6f,0x8(%rsp)
jne    1300 <main+0x1c0>
lea    0xe59(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmpl   $0x3e8,(%rsp)
jl     1200 <main+0xc0>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
cmpl   $0x14d,0x10(%rsp)
mov    0x4(%rsp),%esi
jne    12c0 <main+0x180>
mov    (%rsp),%eax
lea    (%rax,%rax,4),%eax
lea    (%rsi,%rax,2),%esi
mov    %esi,0x4(%rsp)
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12df <main+0x19f>
nopl   0x0(%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
sub    (%rsp),%esi
mov    %esi,0x4(%rsp)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x1,0xc(%rsp)
jne    1311 <main+0x1d1>
mov    %r12,%rdi
call   1030 <puts@plt>
cmpl   $0x3e7,(%rsp)
jg     1250 <main+0x110>
jmp    1200 <main+0xc0>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c" WELLCOME TO OUR LOTTERT GAME \0A Please enter your age:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [46 x i8] c"You Can Play The Game!\0A Please Enter Your ID:\00"
@.str.3 = [24 x i8] c"Please Show Your Money:\00"
@.str.4 = [74 x i8] c"Please Enter The Money You Want To Use\0A(It must be more than 1000ks) \F0\9F\99\82\00"
@.str.5 = [35 x i8] c"Please Enter The Number You Like: \00"
@.str.6 = [58 x i8] c"##Congracutions you win the game##\0A Now your money is:%d\0A\00"
@.str.7 = [35 x i8] c"If you want to continue,press 1: \00"
@.str.8 = [28 x i8] c"You Can Play the Game again\00"
@.str.9 = [40 x i8] c"Sorry! Try Again!\0A Now your money is:%d\00"
@.str.10 = [55 x i8] c"##Ohh sorry you lose the game##\0A Now your money is:%d\0A\00"
@.str.11 = [24 x i8] c"You Can Play Again Now\0A\00"
@.str.12 = [31 x i8] c"Sorry! You Can't Play The Game\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 17
br i1 %11, label %12, label %59
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %15
15: ; preds = %57, %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 111
br i1 %17, label %18, label %58
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
br label %23
23: ; preds = %56, %18
%24 = load i32, i32* %7
%25 = icmp sgt i32 %24, 999
br i1 %25, label %26, label %57
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%29 = load i32, i32* %5
%30 = icmp eq i32 %29, 333
br i1 %30, label %31, label %41
31: ; preds = %26
%32 = load i32, i32* %4
%33 = load i32, i32* %7
%34 = mul nsw i32 %33, 10
%35 = add nsw i32 %32, %34
store i32 %35, i32* %4
%36 = load i32, i32* %4
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
br label %49
41: ; preds = %26
%42 = load i32, i32* %4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %4
%45 = load i32, i32* %7
%46 = sub nsw i32 %44, %45
store i32 %46, i32* %4
%47 = load i32, i32* %4
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %41, %31
%50 = load i32, i32* %6
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %56
54: ; preds = %49
%55 = call i32 @exit(i32 0)
unreachable
56: ; preds = %52
br label %23
57: ; preds = %23
br label %15
58: ; preds = %15
br label %62
59: ; preds = %0
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
%61 = call i32 @exit(i32 0)
unreachable
62: ; preds = %58
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c" WELLCOME TO OUR LOTTERT GAME \0A Please enter your age:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [46 x i8] c"You Can Play The Game!\0A Please Enter Your ID:\00"
@.str.3 = [24 x i8] c"Please Show Your Money:\00"
@.str.4 = [74 x i8] c"Please Enter The Money You Want To Use\0A(It must be more than 1000ks) \F0\9F\99\82\00"
@.str.5 = [35 x i8] c"Please Enter The Number You Like: \00"
@.str.6 = [58 x i8] c"##Congracutions you win the game##\0A Now your money is:%d\0A\00"
@.str.7 = [35 x i8] c"If you want to continue,press 1: \00"
@.str.8 = [28 x i8] c"You Can Play the Game again\00"
@.str.9 = [40 x i8] c"Sorry! Try Again!\0A Now your money is:%d\00"
@.str.10 = [55 x i8] c"##Ohh sorry you lose the game##\0A Now your money is:%d\0A\00"
@.str.12 = [31 x i8] c"Sorry! You Can't Play The Game\00"
@str = [23 x i8] c"You Can Play Again Now\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%8 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%9 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%10 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%11 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%12 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
%16 = icmp sgt i32 %15, 17
br i1 %16, label %17, label %61
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 111
br i1 %21, label %25, label %64
22: ; preds = %55, %25
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 111
br i1 %24, label %25, label %64
25: ; preds = %17, %22
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%30 = load i32, i32* %6
%31 = icmp sgt i32 %30, 999
br i1 %31, label %32, label %22
32: ; preds = %25, %55
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%35 = load i32, i32* %4
%36 = icmp eq i32 %35, 333
%37 = load i32, i32* %3
br i1 %36, label %38, label %46
38: ; preds = %32
%39 = load i32, i32* %6
%40 = mul nsw i32 %39, 10
%41 = add nsw i32 %40, %37
store i32 %41, i32* %3
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
br label %52
46: ; preds = %32
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %37)
%48 = load i32, i32* %3
%49 = load i32, i32* %6
%50 = sub nsw i32 %48, %49
store i32 %50, i32* %3
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %46, %38
%53 = load i32, i32* %5
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %59
55: ; preds = %52
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%57 = load i32, i32* %6
%58 = icmp sgt i32 %57, 999
br i1 %58, label %32, label %22
59: ; preds = %52
%60 = call i32 @exit(i32 0)
unreachable
61: ; preds = %0
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
%63 = call i32 @exit(i32 0)
unreachable
64: ; preds = %22, %17
ret i32 0
}