#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(int argc, char const *argv[]) {
  const int secret_code = 13;
  int code_entered;
  do {
    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("Congratulations! You are cured!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xd,-0x14(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xd,-0x18(%rbp)
jne    113d <main+0x1d>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeea(%rip),%r14
lea    0xeba(%rip),%r15
lea    0xed9(%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    1160 <main+0x30>
lea    0xecd(%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 = [46 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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 13, i32* %6
br label %8
8: ; preds = %12, %2
%9 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* 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* %7)
br label %12
12: ; preds = %8
%13 = load i32, i32* %7
%14 = icmp ne i32 %13, 13
br i1 %14, label %8, label %15
15: ; preds = %12
%16 = 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 = [45 x i8] c"To enter the triskaidekaphobia therapy club,\00"
@str.4 = [32 x i8] c"Congratulations! You are cured!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 13
br i1 %10, label %11, label %5
11: ; preds = %5
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}