#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_directory(char *, char *, char *);
scalar_t__ get_task_launcher_file(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
void test_get_task_launcher_file() {
  char *job_dir =
      (char *)get_job_directory("/tmp", "user", "job_200906101234_0001");
  char *task_file = (char *)get_task_launcher_file(
      job_dir, "attempt_200906112028_0001_m_000000_0");
  printf("task_file obtained is %s\n", task_file);
  int ret = 0;
  if (strcmp(task_file, "/tmp/taskTracker/user/jobcache/job_200906101234_0001/"
                        "attempt_200906112028_0001_m_000000_0/taskjvm.sh") !=
      0) {
    ret = -1;
  }
  free(task_file);
  assert(ret == 0);
}


x86 assembly (clang, -O0):
<test_get_task_launcher_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe91(%rip),%rdi
lea    0xe8f(%rip),%rsi
lea    0xe8d(%rip),%rdx
call   1080 <get_job_directory@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1050 <get_task_launcher_file@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11d2 <test_get_task_launcher_file+0x72>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_task_launcher_file>:
push   %rbp
push   %rbx
push   %rax
lea    0xe96(%rip),%rdi
lea    0xe94(%rip),%rsi
lea    0xe92(%rip),%rdx
call   1080 <get_job_directory@plt>
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
call   1050 <get_task_launcher_file@plt>
mov    %rax,%rbx
lea    0xeaf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xeba(%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 = [5 x i8] c"/tmp\00"
@.str.1 = [5 x i8] c"user\00"
@.str.2 = [22 x i8] c"job_200906101234_0001\00"
@.str.3 = [37 x i8] c"attempt_200906112028_0001_m_000000_0\00"
@.str.4 = [26 x i8] c"task_file obtained is %s\0A\00"
@.str.5 = [101 x i8] c"/tmp/taskTracker/user/jobcache/job_200906101234_0001/attempt_200906112028_0001_m_000000_0/taskjvm.sh\00"
define void @test_get_task_launcher_file() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = call i64 @get_job_directory(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i64 @get_task_launcher_file(i8* %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %9)
store i32 0, i32* %3
%11 = load i8*, i8** %2
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.5, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %0
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %0
%16 = load i8*, i8** %2
%17 = call i32 @free(i8* %16)
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [5 x i8] c"user\00"
@.str.2 = [22 x i8] c"job_200906101234_0001\00"
@.str.3 = [37 x i8] c"attempt_200906112028_0001_m_000000_0\00"
@.str.4 = [26 x i8] c"task_file obtained is %s\0A\00"
@.str.5 = [101 x i8] c"/tmp/taskTracker/user/jobcache/job_200906101234_0001/attempt_200906112028_0001_m_000000_0/taskjvm.sh\00"
define void @test_get_task_launcher_file() {
%1 = tail call i64 @get_job_directory(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @get_task_launcher_file(i8* %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%6 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.5, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = tail call i32 @free(i8* %4)
%9 = zext i1 %7 to i32
%10 = tail call i32 @assert(i32 %9)
ret void
}