#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  const int secret_code = 13;
  int code_entered;
  printf("To enter the triskaidekaphobia therapy club, \n");
  printf("please enter the secret code number: ");
  scanf("%d", &code_entered);
  while (code_entered != secret_code) {
    printf("To enter the triskaidekaphobia therapy club, \n");
    printf("please enter the secret code number: ");
    scanf("%d", &code_entered);
  }
  printf("Congratulations! You are cured!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xd,-0xc(%rbp)
je     1195 <main+0x75>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
jmp    115e <main+0x3e>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0xd,0x4(%rsp)
je     11b2 <main+0x82>
lea    0xeda(%rip),%r14
lea    0xe8a(%rip),%r15
lea    0xea9(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0xd,0x4(%rsp)
jne    1190 <main+0x60>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [47 x i8] c"To enter the triskaidekaphobia therapy club, \0A\00"
@.str.1 = [38 x i8] c"please enter the secret code number: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [33 x i8] c"Congratulations! You are cured!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 13
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %7
14: ; preds = %7
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"please enter the secret code number: \00"
@.str.2 = [3 x i8] c"%d\00"
@str.4 = [32 x i8] c"Congratulations! You are cured!\00"
@str.5 = [46 x i8] c"To enter the triskaidekaphobia therapy club, \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 13
br i1 %7, label %14, label %8
8: ; preds = %0, %8
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 13
br i1 %13, label %14, label %8
14: ; preds = %8, %0
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}