#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 *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, char const *argv[]) {
  char username;
  int password;
  printf("%s", "Username: ");
  scanf("%c", &username);
  printf("%s", "Password: ");
  scanf("%d", &password);
  if (username == 'a') {
    if (password == 12345)
      printf("%s\n", "Login successful");
    else
      printf("%s\n", "Password is incorrect, Try again.");
  } else
    printf("%s\n", "Username is incorrect, Try again.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9e(%rip),%rdi
lea    0xea8(%rip),%rsi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x61,%eax
jne    11ca <main+0xaa>
cmpl   $0x3039,-0x18(%rbp)
jne    11b2 <main+0x92>
lea    0xe7e(%rip),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <printf@plt>
jmp    11c5 <main+0xa5>
lea    0xe66(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
lea    0xe4e(%rip),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x3039,0xc(%rsp)
lea    0xea4(%rip),%rax
lea    0xeae(%rip),%rcx
cmove  %rax,%rcx
cmpb   $0x61,0xb(%rsp)
lea    0xec0(%rip),%rsi
cmove  %rcx,%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"Username: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [11 x i8] c"Password: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [17 x i8] c"Login successful\00"
@.str.7 = [34 x i8] c"Password is incorrect, Try again.\00"
@.str.8 = [34 x i8] c"Username is incorrect, Try again.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 97
br i1 %14, label %15, label %23
15: ; preds = %2
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, 12345
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %22
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %25
23: ; preds = %2
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
br label %25
25: ; preds = %23, %22
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"Username: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [11 x i8] c"Password: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [17 x i8] c"Login successful\00"
@.str.7 = [34 x i8] c"Password is incorrect, Try again.\00"
@.str.8 = [34 x i8] c"Username is incorrect, Try again.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%10 = load i8, i8* %3
%11 = icmp eq i8 %10, 97
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 12345
%14 = select i1 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0)
%15 = select i1 %11, i8* %14, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %15)
ret i32 0
}