#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 *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2)
    return 1;
  char password[16];
  int checked = 0;
  strcpy(password, argv[1]);
  if (strcmp(password, "password") == 0) {
    checked = 1;
    printf("You password is correct. \n");
  } else {
    printf("Wrong password \n");
  }
  if (checked) {
    printf("\nSomething secret happens here!\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)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11cf <main+0x9f>
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11a6 <main+0x76>
movl   $0x1,-0x24(%rbp)
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
jmp    11b2 <main+0x82>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x24(%rbp)
je     11c8 <main+0x98>
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     118a <main+0x5a>
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     116b <main+0x3b>
lea    0xea0(%rip),%rdi
jmp    117e <main+0x4e>
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"password\00"
@.str.1 = [27 x i8] c"You password is correct. \0A\00"
@.str.2 = [17 x i8] c"Wrong password \0A\00"
@.str.3 = [33 x i8] c"\0ASomething secret happens here!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %30
11: ; preds = %2
store i32 0, i32* %7
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strcpy(i8* %12, i8* %15)
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %11
store i32 1, i32* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %24
22: ; preds = %11
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %29
29: ; preds = %27, %24
store i32 0, i32* %3
br label %30
30: ; preds = %29, %10
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@.str = [9 x i8] c"password\00"
@str = [16 x i8] c"Wrong password \00"
@str.4 = [32 x i8] c"\0ASomething secret happens here!\00"
@str.5 = [26 x i8] c"You password is correct. \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = icmp slt i32 %0, 2
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %6, i8* %8)
%10 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %5
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
br label %14
14: ; preds = %5, %12
%15 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0), %12 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0), %5 ]
%16 = call i32 @puts(i8* dereferenceable(1) %15)
br label %17
17: ; preds = %2, %14
%18 = phi i32 [ 0, %14 ], [ 1, %2 ]
ret i32 %18
}