#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*/ assert(int);
int /*<<< orphan*/ free(char *);
scalar_t__ get_job_acls_file(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
void test_get_job_acls_file() {
  char *job_acls_file =
      (char *)get_job_acls_file("/tmp/testing/userlogs/job_200906101234_0001");
  printf("job acls file obtained is %s\n", job_acls_file);
  int ret = 0;
  if (strcmp(job_acls_file,
             "/tmp/testing/userlogs/job_200906101234_0001/job-acls.xml") != 0) {
    ret = -1;
  }
  free(job_acls_file);
  assert(ret == 0);
}


x86 assembly (clang, -O0):
<test_get_job_acls_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1050 <get_job_acls_file@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11a0 <test_get_job_acls_file+0x50>
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_job_acls_file>:
push   %rbp
push   %rbx
push   %rax
lea    0xea6(%rip),%rdi
call   1050 <get_job_acls_file@plt>
mov    %rax,%rbx
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <assert@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"/tmp/testing/userlogs/job_200906101234_0001\00"
@.str.1 = [30 x i8] c"job acls file obtained is %s\0A\00"
@.str.2 = [57 x i8] c"/tmp/testing/userlogs/job_200906101234_0001/job-acls.xml\00"
define void @test_get_job_acls_file() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i64 @get_job_acls_file(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %5)
store i32 0, i32* %2
%7 = load i8*, i8** %1
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %0
%12 = load i8*, i8** %1
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"/tmp/testing/userlogs/job_200906101234_0001\00"
@.str.1 = [30 x i8] c"job acls file obtained is %s\0A\00"
@.str.2 = [57 x i8] c"/tmp/testing/userlogs/job_200906101234_0001/job-acls.xml\00"
define void @test_get_job_acls_file() {
%1 = tail call i64 @get_job_acls_file(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = tail call i32 @free(i8* %2)
%7 = zext i1 %5 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}