#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 /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
void login() {
  int passcode1;
  int passcode2;
  printf("enter passcode1 : ");
  scanf("%d", passcode1);
  fflush(stdin);
  printf("enter passcode2 : ");
  scanf("%d", passcode2);
  printf("checking...\n");
  if (passcode1 == 338150 && passcode2 == 13371337) {
    printf("Login OK!\n");
    system("/bin/cat flag");
  } else {
    printf("Login Failed!\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe7c(%rip),%rdi
call   1060 <scanf@plt>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x528e6,-0x4(%rbp)
jne    11df <login+0x8f>
cmpl   $0xcc07c9,-0x8(%rbp)
jne    11df <login+0x8f>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6c(%rip),%rdi
call   1030 <system@plt>
jmp    11f2 <login+0xa2>
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<login>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rbx
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"enter passcode1 : \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.2 = [19 x i8] c"enter passcode2 : \00"
@.str.3 = [13 x i8] c"checking...\0A\00"
@.str.4 = [11 x i8] c"Login OK!\0A\00"
@.str.5 = [14 x i8] c"/bin/cat flag\00"
@.str.6 = [15 x i8] c"Login Failed!\0A\00"
define void @login() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdin
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 338150
br i1 %13, label %14, label %20
14: ; preds = %0
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 13371337
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %23
20: ; preds = %14, %0
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"enter passcode1 : \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.2 = [19 x i8] c"enter passcode2 : \00"
@str = [12 x i8] c"checking...\00"
@str.7 = [14 x i8] c"Login Failed!\00"
define void @login() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%3 = load i32, i32* @stdin
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
}