int test_path_join(void) {
  char *path;
  char *expect;
  path = path_join(2, "Hello", "World");
  expect = malloc_string("Hello/World");
  printf("%s\n", path);
  do {
    if (!(strcmp(expect, path) == 0)) {
      printf("%sERROR!%s [%s:%d] %s %sFAILED!%s\n", "\x1B[1;31m", "\x1B[1;0m",
             __func__, 302, "strcmp(expect, path) == 0", "\x1B[1;31m",
             "\x1B[1;0m");
      return -1;
    }
  } while (0);
  free(path);
  free(expect);
  path = path_join(2, "Hello/", "World");
  expect = malloc_string("Hello/World");
  printf("%s\n", path);
  do {
    if (!(strcmp(expect, path) == 0)) {
      printf("%sERROR!%s [%s:%d] %s %sFAILED!%s\n", "\x1B[1;31m", "\x1B[1;0m",
             __func__, 310, "strcmp(expect, path) == 0", "\x1B[1;31m",
             "\x1B[1;0m");
      return -1;
    }
  } while (0);
  free(path);
  free(expect);
  path = path_join(2, "Hello", "/World");
  expect = malloc_string("Hello/World");
  printf("%s\n", path);
  do {
    if (!(strcmp(expect, path) == 0)) {
      printf("%sERROR!%s [%s:%d] %s %sFAILED!%s\n", "\x1B[1;31m", "\x1B[1;0m",
             __func__, 317, "strcmp(expect, path) == 0", "\x1B[1;31m",
             "\x1B[1;0m");
      return -1;
    }
  } while (0);
  free(path);
  free(expect);
  path = path_join(2, "Hello/", "/World");
  expect = malloc_string("Hello/World");
  printf("%s\n", path);
  do {
    if (!(strcmp(expect, path) == 0)) {
      printf("%sERROR!%s [%s:%d] %s %sFAILED!%s\n", "\x1B[1;31m", "\x1B[1;0m",
             __func__, 324, "strcmp(expect, path) == 0", "\x1B[1;31m",
             "\x1B[1;0m");
      return -1;
    }
  } while (0);
  free(path);
  free(expect);
  return 0;
}


x86 assembly (clang, -O0):
<test_path_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x2,%edi
lea    0xe9c(%rip),%rsi
lea    0xea1(%rip),%rdx
mov    $0x0,%al
call   1060 <path_join@plt>
cltq
mov    %rax,-0x10(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1070 <malloc_string@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11ff <test_path_join+0xaf>
lea    0xe57(%rip),%rdi
lea    0xe73(%rip),%r10
lea    0xe74(%rip),%rax
lea    0xe74(%rip),%rcx
mov    $0x12e,%r8d
lea    0xe76(%rip),%r9
mov    %r10,%rsi
mov    %rax,%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <test_path_join+0x307>
jmp    1204 <test_path_join+0xb4>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x2,%edi
lea    0xe4b(%rip),%rsi
lea    0xde3(%rip),%rdx
mov    $0x0,%al
call   1060 <path_join@plt>
cltq
mov    %rax,-0x10(%rbp)
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1070 <malloc_string@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     12bd <test_path_join+0x16d>
lea    0xd99(%rip),%rdi
lea    0xdb5(%rip),%r10
lea    0xdb6(%rip),%rax
lea    0xdb6(%rip),%rcx
mov    $0x136,%r8d
lea    0xdb8(%rip),%r9
mov    %r10,%rsi
mov    %rax,%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <test_path_join+0x307>
jmp    12c2 <test_path_join+0x172>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x2,%edi
lea    0xd20(%rip),%rsi
lea    0xd24(%rip),%rdx
mov    $0x0,%al
call   1060 <path_join@plt>
cltq
mov    %rax,-0x10(%rbp)
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1070 <malloc_string@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     137b <test_path_join+0x22b>
lea    0xcdb(%rip),%rdi
lea    0xcf7(%rip),%r10
lea    0xcf8(%rip),%rax
lea    0xcf8(%rip),%rcx
mov    $0x13d,%r8d
lea    0xcfa(%rip),%r9
mov    %r10,%rsi
mov    %rax,%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <test_path_join+0x307>
jmp    1380 <test_path_join+0x230>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x2,%edi
lea    0xccf(%rip),%rsi
lea    0xc66(%rip),%rdx
mov    $0x0,%al
call   1060 <path_join@plt>
cltq
mov    %rax,-0x10(%rbp)
lea    0xc4d(%rip),%rdi
mov    $0x0,%al
call   1070 <malloc_string@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     1439 <test_path_join+0x2e9>
lea    0xc1d(%rip),%rdi
lea    0xc39(%rip),%r10
lea    0xc3a(%rip),%rax
lea    0xc3a(%rip),%rcx
mov    $0x144,%r8d
lea    0xc3c(%rip),%r9
mov    %r10,%rsi
mov    %rax,%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <test_path_join+0x307>
jmp    143e <test_path_join+0x2ee>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_path_join>:
push   %r15
push   %r14
push   %rbx
lea    0xe94(%rip),%rsi
lea    0xe99(%rip),%rdx
mov    $0x2,%edi
xor    %eax,%eax
call   1070 <path_join@plt>
movslq %eax,%rbx
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1080 <malloc_string@plt>
movslq %eax,%r14
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     11d8 <test_path_join+0x78>
lea    0xe8c(%rip),%rdx
lea    0xe7d(%rip),%rsi
lea    0xe53(%rip),%rdi
lea    0xe7e(%rip),%rcx
lea    0xe86(%rip),%r9
mov    $0x12e,%r8d
jmp    135e <test_path_join+0x1fe>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xe7e(%rip),%rsi
lea    0xe16(%rip),%rdx
mov    $0x2,%edi
xor    %eax,%eax
call   1070 <path_join@plt>
movslq %eax,%rbx
lea    0xdfa(%rip),%rdi
xor    %eax,%eax
call   1080 <malloc_string@plt>
movslq %eax,%r14
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     125b <test_path_join+0xfb>
lea    0xe09(%rip),%rdx
lea    0xdfa(%rip),%rsi
lea    0xdd0(%rip),%rdi
lea    0xdfb(%rip),%rcx
lea    0xe03(%rip),%r9
mov    $0x136,%r8d
jmp    135e <test_path_join+0x1fe>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xd8e(%rip),%rsi
lea    0xd92(%rip),%rdx
mov    $0x2,%edi
xor    %eax,%eax
call   1070 <path_join@plt>
movslq %eax,%rbx
lea    0xd77(%rip),%rdi
xor    %eax,%eax
call   1080 <malloc_string@plt>
movslq %eax,%r14
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     12de <test_path_join+0x17e>
lea    0xd86(%rip),%rdx
lea    0xd77(%rip),%rsi
lea    0xd4d(%rip),%rdi
lea    0xd78(%rip),%rcx
lea    0xd80(%rip),%r9
mov    $0x13d,%r8d
jmp    135e <test_path_join+0x1fe>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xd78(%rip),%rsi
lea    0xd0f(%rip),%rdx
xor    %ebx,%ebx
mov    $0x2,%edi
xor    %eax,%eax
call   1070 <path_join@plt>
movslq %eax,%r14
lea    0xcf2(%rip),%rdi
xor    %eax,%eax
call   1080 <malloc_string@plt>
movslq %eax,%r15
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1378 <test_path_join+0x218>
lea    0xd01(%rip),%rdx
lea    0xcf2(%rip),%rsi
lea    0xcc8(%rip),%rdi
lea    0xcf3(%rip),%rcx
lea    0xcfb(%rip),%r9
mov    $0x144,%r8d
xor    %eax,%eax
push   %rdx
push   %rsi
call   1050 <printf@plt>
add    $0x10,%rsp
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    1370 <test_path_join+0x210>

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [6 x i8] c"World\00"
@.str.2 = [12 x i8] c"Hello/World\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [35 x i8] c"%sERROR!%s [%s:%d] %s %sFAILED!%s\0A\00"
@.str.5 = [8 x i8] c"\1B[1;31m\00"
@.str.6 = [7 x i8] c"\1B[1;0m\00"
@__func__.test_path_join = [15 x i8] c"test_path_join\00"
@.str.7 = [26 x i8] c"strcmp(expect, path) == 0\00"
@.str.8 = [7 x i8] c"Hello/\00"
@.str.9 = [7 x i8] c"/World\00"
define i32 @test_path_join() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %0
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcmp(i8* %13, i8* %14)
%16 = icmp eq i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %12
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 302, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %1
br label %80
19: ; preds = %12
br label %20
20: ; preds = %19
%21 = load i8*, i8** %2
%22 = load i8*, i8** %3
%23 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %2
%26 = call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %3
%29 = load i8*, i8** %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %20
%32 = load i8*, i8** %3
%33 = load i8*, i8** %2
%34 = call i32 @strcmp(i8* %32, i8* %33)
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %31
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %1
br label %80
38: ; preds = %31
br label %39
39: ; preds = %38
%40 = load i8*, i8** %2
%41 = load i8*, i8** %3
%42 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%43 = sext i32 %42 to i64
%44 = inttoptr i64 %43 to i8*
store i8* %44, i8** %2
%45 = call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%46 = sext i32 %45 to i64
%47 = inttoptr i64 %46 to i8*
store i8* %47, i8** %3
%48 = load i8*, i8** %2
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %39
%51 = load i8*, i8** %3
%52 = load i8*, i8** %2
%53 = call i32 @strcmp(i8* %51, i8* %52)
%54 = icmp eq i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %50
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 317, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %1
br label %80
57: ; preds = %50
br label %58
58: ; preds = %57
%59 = load i8*, i8** %2
%60 = load i8*, i8** %3
%61 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%62 = sext i32 %61 to i64
%63 = inttoptr i64 %62 to i8*
store i8* %63, i8** %2
%64 = call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%65 = sext i32 %64 to i64
%66 = inttoptr i64 %65 to i8*
store i8* %66, i8** %3
%67 = load i8*, i8** %2
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %67)
br label %69
69: ; preds = %58
%70 = load i8*, i8** %3
%71 = load i8*, i8** %2
%72 = call i32 @strcmp(i8* %70, i8* %71)
%73 = icmp eq i32 %72, 0
br i1 %73, label %76, label %74
74: ; preds = %69
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 324, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %1
br label %80
76: ; preds = %69
br label %77
77: ; preds = %76
%78 = load i8*, i8** %2
%79 = load i8*, i8** %3
store i32 0, i32* %1
br label %80
80: ; preds = %77, %74, %55, %36, %17
%81 = load i32, i32* %1
ret i32 %81
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [6 x i8] c"World\00"
@.str.2 = [12 x i8] c"Hello/World\00"
@.str.4 = [35 x i8] c"%sERROR!%s [%s:%d] %s %sFAILED!%s\0A\00"
@.str.5 = [8 x i8] c"\1B[1;31m\00"
@.str.6 = [7 x i8] c"\1B[1;0m\00"
@__func__.test_path_join = [15 x i8] c"test_path_join\00"
@.str.7 = [26 x i8] c"strcmp(expect, path) == 0\00"
@.str.8 = [7 x i8] c"Hello/\00"
@.str.9 = [7 x i8] c"/World\00"
define i32 @test_path_join() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) %3)
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(1) %3)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 302, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %49
12: ; preds = %0
tail call void @free(i8* %3)
tail call void @free(i8* %6)
%13 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = tail call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = tail call i32 @puts(i8* dereferenceable(1) %15)
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(1) %15)
%21 = icmp eq i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %12
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %49
24: ; preds = %12
tail call void @free(i8* %15)
tail call void @free(i8* %18)
%25 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
%28 = tail call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i8*
%31 = tail call i32 @puts(i8* dereferenceable(1) %27)
%32 = tail call i32 @strcmp(i8* dereferenceable(1) %30, i8* dereferenceable(1) %27)
%33 = icmp eq i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %24
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 317, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %49
36: ; preds = %24
tail call void @free(i8* %27)
tail call void @free(i8* %30)
%37 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @path_join to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%38 = sext i32 %37 to i64
%39 = inttoptr i64 %38 to i8*
%40 = tail call i32 (i8*, ...) bitcast (i32 (...)* @malloc_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i8*
%43 = tail call i32 @puts(i8* dereferenceable(1) %39)
%44 = tail call i32 @strcmp(i8* dereferenceable(1) %42, i8* dereferenceable(1) %39)
%45 = icmp eq i32 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %36
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_path_join, i64 0, i64 0), i32 324, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %49
48: ; preds = %36
tail call void @free(i8* %39)
tail call void @free(i8* %42)
br label %49
49: ; preds = %48, %46, %34, %22, %10
%50 = phi i32 [ 0, %48 ], [ -1, %46 ], [ -1, %34 ], [ -1, %22 ], [ -1, %10 ]
ret i32 %50
}