#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 get_auth_file(char *, char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int test_get_auth_file(char *user, char *host, char *file, int proxy, int out) {
  int auth;
  printf("   get_auth_file( '%s', '%s', '%s', %i,  %i ) ", user, host, file,
         proxy, out);
  auth = get_auth_file(user, host, file, proxy);
  printf(" = '%i'", auth);
  if (auth == out) {
    printf(" passed\n");
    return (0);
  }
  printf(" failed\n");
  return (1);
}


x86 assembly (clang, -O0):
<test_get_auth_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <get_auth_file@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    11ab <test_get_auth_file+0x8b>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c0 <test_get_auth_file+0xa0>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_auth_file>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    %r15d,%ecx
call   1040 <get_auth_file@plt>
mov    %eax,%ebx
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %ebp,%ebp
cmp    %r14d,%ebx
setne  %bpl
lea    0xea8(%rip),%rax
lea    0xe99(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [47 x i8] c" get_auth_file( '%s', '%s', '%s', %i, %i ) \00"
@.str.1 = [8 x i8] c" = '%i'\00"
@str = [8 x i8] c" failed\00"
@str.4 = [8 x i8] c" passed\00"
define i32 @test_get_auth_file(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i32 %3, i32 %4)
%7 = tail call i32 @get_auth_file(i8* %0, i8* %1, i8* %2, i32 %3)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = icmp eq i32 %7, %4
%10 = select i1 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0)
%11 = xor i1 %9, true
%12 = zext i1 %11 to i32
%13 = tail call i32 @puts(i8* dereferenceable(1) %10)
ret i32 %12
}