#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 *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char password[] = "passw0rd";
  char buffer[9];
  gets(buffer);
  if (strcmp(buffer, password) == 0)
    printf("You are in!\n");
  else
    printf("Wrong password!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x22(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x22(%rbp),%rdi
lea    -0x19(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118b <main+0x5b>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    1197 <main+0x67>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x6472307773736170,%rax
30 72 64
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x17(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xeac(%rip),%rax
lea    0xe95(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.password = [9 x i8] c"passw0rd\00"
@.str = [13 x i8] c"You are in!\0A\00"
@.str.1 = [17 x i8] c"Wrong password!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i8]
%7 = alloca [9 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [9 x i8]* %6 to i8*
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
ret i32 0
}

LLVM IR (-O2):
@__const.main.password = [9 x i8] c"passw0rd\00"
@str = [16 x i8] c"Wrong password!\00"
@str.2 = [12 x i8] c"You are in!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i8]
%4 = alloca [9 x i8]
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i64 @strcmp(i8* %6, i8* %5)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}