#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 Bank_CreateAcct(char *);
int Bank_GetAcctByName(char *);
scalar_t__ strcmp(char const *, char *);
int Bank_GetUserAuth(const char *Salt, const char *Username,
                     const char *Password) {
  if (Salt == NULL)
    return -1;
  if (Password == NULL)
    return -1;
  if (strcmp(Username, "tpg") == 0)
    return Bank_GetAcctByName("tpg");
  if (strcmp(Username, "root") == 0) {
    int ret = Bank_GetAcctByName("root");
    if (ret == -1)
      return Bank_CreateAcct("root");
    return ret;
  }
  return -1;
}


x86 assembly (clang, -O0):
<Bank_GetUserAuth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <Bank_GetUserAuth+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    11f9 <Bank_GetUserAuth+0xc9>
cmpq   $0x0,-0x20(%rbp)
jne    1172 <Bank_GetUserAuth+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    11f9 <Bank_GetUserAuth+0xc9>
mov    -0x18(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a0 <Bank_GetUserAuth+0x70>
lea    0xe6d(%rip),%rdi
call   1050 <Bank_GetAcctByName@plt>
mov    %eax,-0x4(%rbp)
jmp    11f9 <Bank_GetUserAuth+0xc9>
mov    -0x18(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f2 <Bank_GetUserAuth+0xc2>
lea    0xe43(%rip),%rdi
call   1050 <Bank_GetAcctByName@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    11e7 <Bank_GetUserAuth+0xb7>
lea    0xe2a(%rip),%rdi
call   1030 <Bank_CreateAcct@plt>
mov    %eax,-0x4(%rbp)
jmp    11f9 <Bank_GetUserAuth+0xc9>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11f9 <Bank_GetUserAuth+0xc9>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bank_GetUserAuth>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffffffff,%ebp
test   %rdi,%rdi
je     1180 <Bank_GetUserAuth+0x50>
test   %rdx,%rdx
je     1180 <Bank_GetUserAuth+0x50>
mov    %rsi,%rbx
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1189 <Bank_GetUserAuth+0x59>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1180 <Bank_GetUserAuth+0x50>
lea    0xe90(%rip),%rdi
call   1050 <Bank_GetAcctByName@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     119b <Bank_GetUserAuth+0x6b>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe70(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Bank_GetAcctByName@plt>
lea    0xe62(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <Bank_CreateAcct@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"tpg\00"
@.str.1 = [5 x i8] c"root\00"
define i32 @Bank_GetUserAuth(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 -1, i32* %4
br label %35
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 -1, i32* %4
br label %35
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @Bank_GetAcctByName(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %21, i32* %4
br label %35
22: ; preds = %16
%23 = load i8*, i8** %6
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %22
%27 = call i32 @Bank_GetAcctByName(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 @Bank_CreateAcct(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %31, i32* %4
br label %35
32: ; preds = %26
%33 = load i32, i32* %8
store i32 %33, i32* %4
br label %35
34: ; preds = %22
store i32 -1, i32* %4
br label %35
35: ; preds = %34, %32, %30, %20, %15, %11
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
@.str = [4 x i8] c"tpg\00"
@.str.1 = [5 x i8] c"root\00"
define i32 @Bank_GetUserAuth(i8* readnone %0, i8* %1, i8* readnone %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i8* %2, null
%6 = or i1 %4, %5
br i1 %6, label %20, label %7
7: ; preds = %3
%8 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @Bank_GetAcctByName(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %20
12: ; preds = %7
%13 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = tail call i32 @Bank_GetAcctByName(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @Bank_CreateAcct(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %12, %18, %15, %3, %10
%21 = phi i32 [ %11, %10 ], [ -1, %3 ], [ %19, %18 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %21
}