#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 *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char buffer[256];
  printf("What is the password?\n");
  gets(buffer);
  if (!strcmp(buffer, "the password")) {
    printf("FLAG:db2f62a36a018bce28e46d976e3f9864\n");
  } else {
    printf("Wrong!!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x110(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    118e <main+0x5e>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    119a <main+0x6a>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <gets@plt>
movabs $0x7373617020656874,%rax
61 73 73
xor    (%rsp),%rax
movabs $0x64726f77737361,%rcx
xor    0x5(%rsp),%rcx
or     %rax,%rcx
lea    0xec1(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"What is the password?\0A\00"
@.str.1 = [13 x i8] c"the password\00"
@.str.2 = [39 x i8] c"FLAG:db2f62a36a018bce28e46d976e3f9864\0A\00"
@.str.3 = [9 x i8] c"Wrong!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"the password\00"
@str = [22 x i8] c"What is the password?\00"
@str.4 = [38 x i8] c"FLAG:db2f62a36a018bce28e46d976e3f9864\00"
@str.5 = [8 x i8] c"Wrong!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gets(i8* %4)
%7 = call i32 @bcmp(i8* dereferenceable(13) %4, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 13)
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}