#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*/ exit(int);
int /*<<< orphan*/ free(char *);
scalar_t__ get_job_directory(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void test_get_job_directory() {
  char *expected = "/tmp/taskTracker/user/jobcache/job_200906101234_0001";
  char *job_dir =
      (char *)get_job_directory("/tmp", "user", "job_200906101234_0001");
  if (strcmp(job_dir, expected) != 0) {
    exit(1);
  }
  free(job_dir);
}


x86 assembly (clang, -O0):
<test_get_job_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedb(%rip),%rdi
lea    0xed9(%rip),%rsi
lea    0xeb7(%rip),%rdx
call   1060 <get_job_directory@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1192 <test_get_job_directory+0x52>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_job_directory>:
push   %rbx
lea    0xeed(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xec9(%rip),%rdx
call   1060 <get_job_directory@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    117b <test_get_job_directory+0x3b>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"/tmp/taskTracker/user/jobcache/job_200906101234_0001\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [5 x i8] c"user\00"
@.str.3 = [22 x i8] c"job_200906101234_0001\00"
define void @test_get_job_directory() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = call i64 @get_job_directory(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %1
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"/tmp/taskTracker/user/jobcache/job_200906101234_0001\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [5 x i8] c"user\00"
@.str.3 = [22 x i8] c"job_200906101234_0001\00"
define void @test_get_job_directory() {
%1 = tail call i64 @get_job_directory(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = tail call i32 @free(i8* %2)
ret void
}