#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);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int main() {
  char response[50];
  setbuf(stdout, NULL);
  setbuf(stdin, NULL);
  setbuf(stderr, NULL);
  puts("Welcome to the more advanced math class!");
  puts("Unlike the folks in regular analysis, you'll have to put in more "
       "effort.");
  puts("That's because this class has a strict anti-cheating defense.");
  puts("Ha, take that!");
  puts("We have to maintain the BCA reputation somehow, y'know.");
  printf("> ");
  gets(response);
  if (strcmp(response, "i pledge to not cheat")) {
    puts("I'm sorry, but you did not type out the honor pledge.");
    puts("This obviously means that you are a cheater.");
    puts("And we certainly cannot have that.");
    puts("Goodbye.");
    exit(1);
  }
  puts("Hey, I'm glad you decided to be honest and not cheat!");
  puts("Makes my life a whole lot easier when I can let my guard down.");
  puts("You still have to do tests and whatnot, but that's a you problem.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1070 <gets@plt>
lea    -0x40(%rbp),%rdi
lea    0xf00(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1243 <main+0xe3>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf62(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xf55(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7f(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <gets@plt>
lea    0xf0b(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1228 <main+0xc8>
lea    0xf9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc6(%rip),%rdi
call   1030 <puts@plt>
lea    0xff9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf43(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
@stderr = global i32 0
@.str = [41 x i8] c"Welcome to the more advanced math class!\00"
@.str.1 = [73 x i8] c"Unlike the folks in regular analysis, you'll have to put in more effort.\00"
@.str.2 = [62 x i8] c"That's because this class has a strict anti-cheating defense.\00"
@.str.3 = [15 x i8] c"Ha, take that!\00"
@.str.4 = [56 x i8] c"We have to maintain the BCA reputation somehow, y'know.\00"
@.str.5 = [3 x i8] c"> \00"
@.str.6 = [22 x i8] c"i pledge to not cheat\00"
@.str.7 = [54 x i8] c"I'm sorry, but you did not type out the honor pledge.\00"
@.str.8 = [45 x i8] c"This obviously means that you are a cheater.\00"
@.str.9 = [35 x i8] c"And we certainly cannot have that.\00"
@.str.10 = [9 x i8] c"Goodbye.\00"
@.str.11 = [54 x i8] c"Hey, I'm glad you decided to be honest and not cheat!\00"
@.str.12 = [63 x i8] c"Makes my life a whole lot easier when I can let my guard down.\00"
@.str.13 = [66 x i8] c"You still have to do tests and whatnot, but that's a you problem.\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = load i32, i32* @stdout
%3 = call i32 @setbuf(i32 %2, i32* null)
%4 = load i32, i32* @stdin
%5 = call i32 @setbuf(i32 %4, i32* null)
%6 = load i32, i32* @stderr
%7 = call i32 @setbuf(i32 %6, i32* null)
%8 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%15 = call i32 @gets(i8* %14)
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %0
%20 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%21 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%22 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %0
%26 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%27 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.12, i64 0, i64 0))
%28 = call i32 @puts(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.13, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
@stderr = global i32 0
@.str = [41 x i8] c"Welcome to the more advanced math class!\00"
@.str.1 = [73 x i8] c"Unlike the folks in regular analysis, you'll have to put in more effort.\00"
@.str.2 = [62 x i8] c"That's because this class has a strict anti-cheating defense.\00"
@.str.3 = [15 x i8] c"Ha, take that!\00"
@.str.4 = [56 x i8] c"We have to maintain the BCA reputation somehow, y'know.\00"
@.str.5 = [3 x i8] c"> \00"
@.str.6 = [22 x i8] c"i pledge to not cheat\00"
@.str.7 = [54 x i8] c"I'm sorry, but you did not type out the honor pledge.\00"
@.str.8 = [45 x i8] c"This obviously means that you are a cheater.\00"
@.str.9 = [35 x i8] c"And we certainly cannot have that.\00"
@.str.10 = [9 x i8] c"Goodbye.\00"
@.str.11 = [54 x i8] c"Hey, I'm glad you decided to be honest and not cheat!\00"
@.str.12 = [63 x i8] c"Makes my life a whole lot easier when I can let my guard down.\00"
@.str.13 = [66 x i8] c"You still have to do tests and whatnot, but that's a you problem.\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdout
%4 = tail call i32 @setbuf(i32 %3, i32* null)
%5 = load i32, i32* @stdin
%6 = tail call i32 @setbuf(i32 %5, i32* null)
%7 = load i32, i32* @stderr
%8 = tail call i32 @setbuf(i32 %7, i32* null)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @gets(i8* %2)
%16 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %0
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %0
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.12, i64 0, i64 0))
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.13, i64 0, i64 0))
ret i32 0
}