#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 */
char const *_auth_login(char const *);
char *_auth_password(char const *);
int /*<<< orphan*/ strcmp(char const *, char const *);
char const *_default_auth_attempt_login(char const *username,
                                        char const *password) {
  char const *compare_password = _auth_password(username);
  if (password && compare_password && !strcmp(compare_password, password))
    return _auth_login(username);
  return NULL;
}


x86 assembly (clang, -O0):
<_default_auth_attempt_login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_auth_password@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118b <_default_auth_attempt_login+0x5b>
cmpq   $0x0,-0x20(%rbp)
je     118b <_default_auth_attempt_login+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    118b <_default_auth_attempt_login+0x5b>
mov    -0x10(%rbp),%rdi
call   1050 <_auth_login@plt>
mov    %rax,-0x8(%rbp)
jmp    1193 <_default_auth_attempt_login+0x63>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_default_auth_attempt_login>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <_auth_password@plt>
test   %rbx,%rbx
je     1158 <_default_auth_attempt_login+0x28>
test   %rax,%rax
je     1158 <_default_auth_attempt_login+0x28>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1162 <_default_auth_attempt_login+0x32>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <_auth_login@plt>

LLVM IR (-O0):
define i8* @_default_auth_attempt_login(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i8* @_auth_password(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i8*, i8** %6
%16 = load i8*, i8** %5
%17 = call i32 @strcmp(i8* %15, i8* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %14
%20 = load i8*, i8** %4
%21 = call i8* @_auth_login(i8* %20)
store i8* %21, i8** %3
br label %23
22: ; preds = %14, %11, %2
store i8* null, i8** %3
br label %23
23: ; preds = %22, %19
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @_default_auth_attempt_login(i8* %0, i8* %1) {
%3 = tail call i8* @_auth_password(i8* %0)
%4 = icmp ne i8* %1, null
%5 = icmp ne i8* %3, null
%6 = select i1 %4, i1 %5, i1 false
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = tail call i32 @strcmp(i8* %3, i8* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i8* @_auth_login(i8* %0)
br label %12
12: ; preds = %2, %7, %10
%13 = phi i8* [ %11, %10 ], [ null, %7 ], [ null, %2 ]
ret i8* %13
}