#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*/ printf(char *);
int /*<<< orphan*/ resolve_config_path(char *, char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
void test_resolve_config_path() {
  printf("\nTesting resolve_config_path\n");
  if (strcmp(resolve_config_path("/tmp/test-container-executor", NULL),
             "/tmp/test-container-executor") != 0) {
    printf("FAIL: failed to resolve config_name on an absolute path name: "
           "/tmp/test-container-executor"
           "\n");
    exit(1);
  }
  if (strcmp(resolve_config_path(".."
                                 "/tmp/test-container-executor",
                                 "/tmp/test-container-executor"),
             "/tmp/test-container-executor") != 0) {
    printf("FAIL: failed to resolve config_name on a relative path name: "
           ".."
           "/tmp/test-container-executor"
           " (relative to "
           "/tmp/test-container-executor"
           ")");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<test_resolve_config_path>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xf25(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <resolve_config_path@plt>
mov    %eax,%edi
lea    0xf13(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     118e <test_resolve_config_path+0x4e>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <resolve_config_path@plt>
mov    %eax,%edi
lea    0xed2(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11cf <test_resolve_config_path+0x8f>
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_resolve_config_path>:
push   %rbx
lea    0xf4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9d(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <resolve_config_path@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11a4 <test_resolve_config_path+0x54>
lea    0xe7c(%rip),%rdi
lea    0xf76(%rip),%rbx
mov    %rbx,%rsi
call   1040 <resolve_config_path@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11ba <test_resolve_config_path+0x6a>
pop    %rbx
ret
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    0xe5e(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0ATesting resolve_config_path\0A\00"
@.str.1 = [29 x i8] c"/tmp/test-container-executor\00"
@.str.2 = [92 x i8] c"FAIL: failed to resolve config_name on an absolute path name: /tmp/test-container-executor\0A\00"
@.str.3 = [31 x i8] c"../tmp/test-container-executor\00"
@.str.4 = [135 x i8] c"FAIL: failed to resolve config_name on a relative path name: ../tmp/test-container-executor (relative to /tmp/test-container-executor)\00"
define void @test_resolve_config_path() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @resolve_config_path(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* null)
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = call i32 @resolve_config_path(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%10 = call i64 @strcmp(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"/tmp/test-container-executor\00"
@.str.3 = [31 x i8] c"../tmp/test-container-executor\00"
@.str.4 = [135 x i8] c"FAIL: failed to resolve config_name on a relative path name: ../tmp/test-container-executor (relative to /tmp/test-container-executor)\00"
@str = [29 x i8] c"\0ATesting resolve_config_path\00"
@str.5 = [91 x i8] c"FAIL: failed to resolve config_name on an absolute path name: /tmp/test-container-executor\00"
define void @test_resolve_config_path() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @resolve_config_path(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* null)
%3 = tail call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str.5, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = tail call i32 @resolve_config_path(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i64 @strcmp(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([135 x i8], [135 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %8
ret void
}