#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*/ free(char *);
char *ne_malloc(scalar_t__);
char *ne_strdup(char const *);
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ strncat(char *, char *, int);
scalar_t__ strncmp(char *, char *, int);
char *strrchr(char *, char);
char *remove_dot_segments(const char *path) {
  char *in, *inc, *out;
  inc = in = ne_strdup(path);
  out = ne_malloc(strlen(path) + 1);
  out[0] = '\0';
  while (in[0]) {
    if (strncmp(in, "./", 2) == 0) {
      in += 2;
    } else if (strncmp(in, "../", 3) == 0) {
      in += 3;
    } else if (strncmp(in, "/./", 3) == 0) {
      in += 2;
    } else if (strcmp(in, "/.") == 0) {
      in[1] = '\0';
    } else if (strncmp(in, "/../", 4) == 0 || strcmp(in, "/..") == 0) {
      char *p;
      if (in[3] == '\0') {
        in += 2;
        in[0] = '/';
      } else {
        in += 3;
      }
      p = strrchr(out, '/');
      if (p) {
        *p = '\0';
      } else {
        out[0] = '\0';
      }
    } else if (strcmp(in, ".") == 0 || strcmp(in, "..") == 0) {
      in[0] = '\0';
    } else {
      char *p;
      p = strchr(in + (in[0] == '/'), '/');
      if (p == NULL)
        p = strchr(in, '\0');
      strncat(out, in, p - in);
      in = p;
    }
  }
  free(inc);
  return out;
}


x86 assembly (clang, -O0):
<remove_dot_segments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   10b0 <ne_strdup@plt>
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   10a0 <ne_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     13f7 <remove_dot_segments+0x267>
mov    -0x10(%rbp),%rdi
lea    0xe24(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    120a <remove_dot_segments+0x7a>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    13f2 <remove_dot_segments+0x262>
mov    -0x10(%rbp),%rdi
lea    0xdf3(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    123a <remove_dot_segments+0xaa>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x10(%rbp)
jmp    13ed <remove_dot_segments+0x25d>
mov    -0x10(%rbp),%rdi
lea    0xdbb(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    126a <remove_dot_segments+0xda>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    13e8 <remove_dot_segments+0x258>
mov    -0x10(%rbp),%rdi
lea    0xd8f(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1291 <remove_dot_segments+0x101>
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
jmp    13e3 <remove_dot_segments+0x253>
mov    -0x10(%rbp),%rdi
lea    0xd6b(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     12ca <remove_dot_segments+0x13a>
mov    -0x10(%rbp),%rdi
lea    0xd51(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1334 <remove_dot_segments+0x1a4>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x0,%eax
jne    12f3 <remove_dot_segments+0x163>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
jmp    12ff <remove_dot_segments+0x16f>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x2f,%esi
call   1070 <strrchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1328 <remove_dot_segments+0x198>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
jmp    132f <remove_dot_segments+0x19f>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
jmp    13de <remove_dot_segments+0x24e>
mov    -0x10(%rbp),%rdi
lea    0xccf(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1368 <remove_dot_segments+0x1d8>
mov    -0x10(%rbp),%rdi
lea    0xcb4(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1374 <remove_dot_segments+0x1e4>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    13d9 <remove_dot_segments+0x249>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    %rax,%rdi
mov    $0x2f,%esi
call   1060 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    13b7 <remove_dot_segments+0x227>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1060 <strchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1080 <strncat@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    13de <remove_dot_segments+0x24e>
jmp    13e3 <remove_dot_segments+0x253>
jmp    13e8 <remove_dot_segments+0x258>
jmp    13ed <remove_dot_segments+0x25d>
jmp    13f2 <remove_dot_segments+0x262>
jmp    11cd <remove_dot_segments+0x3d>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_dot_segments>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
call   10b0 <ne_strdup@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   10a0 <ne_malloc@plt>
mov    %rax,%r15
movb   $0x0,(%rax)
cmpb   $0x0,0x0(%r13)
je     1360 <remove_dot_segments+0x1d0>
lea    0xe3a(%rip),%r12
lea    0xe32(%rip),%rbx
lea    0xe23(%rip),%rbp
mov    %r13,%r14
jmp    11fe <remove_dot_segments+0x6e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x2,%r14
cmpb   $0x0,(%r14)
je     1360 <remove_dot_segments+0x1d0>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     11f0 <remove_dot_segments+0x60>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1310 <remove_dot_segments+0x180>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     11f0 <remove_dot_segments+0x60>
mov    %r14,%rdi
lea    0xdb9(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1326 <remove_dot_segments+0x196>
mov    %r14,%rdi
lea    0xda4(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1319 <remove_dot_segments+0x189>
mov    %r14,%rdi
lea    0xd8c(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1319 <remove_dot_segments+0x189>
mov    %r14,%rdi
lea    0xd76(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     135c <remove_dot_segments+0x1cc>
mov    %r14,%rdi
lea    0xd5d(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     135c <remove_dot_segments+0x1cc>
mov    %rbp,%rbx
xor    %edi,%edi
cmpb   $0x2f,(%r14)
sete   %dil
add    %r14,%rdi
mov    $0x2f,%esi
call   1060 <strchr@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    12ee <remove_dot_segments+0x15e>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbp
add    %r14,%rbp
mov    %ebp,%edx
sub    %r14d,%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <strncat@plt>
mov    %rbp,%r14
mov    %rbx,%rbp
lea    0xcfd(%rip),%rbx
jmp    11f4 <remove_dot_segments+0x64>
add    $0x3,%r14
jmp    11f4 <remove_dot_segments+0x64>
cmpb   $0x0,0x3(%r14)
je     1330 <remove_dot_segments+0x1a0>
add    $0x3,%r14
jmp    1339 <remove_dot_segments+0x1a9>
movb   $0x0,0x1(%r14)
jmp    11f4 <remove_dot_segments+0x64>
movb   $0x2f,0x2(%r14)
add    $0x2,%r14
mov    %r15,%rdi
mov    $0x2f,%esi
call   1070 <strrchr@plt>
test   %rax,%rax
je     1353 <remove_dot_segments+0x1c3>
movb   $0x0,(%rax)
jmp    11f4 <remove_dot_segments+0x64>
movb   $0x0,(%r15)
jmp    11f4 <remove_dot_segments+0x64>
movb   $0x0,(%r14)
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"./\00"
@.str.1 = [4 x i8] c"../\00"
@.str.2 = [4 x i8] c"/./\00"
@.str.3 = [3 x i8] c"/.\00"
@.str.4 = [5 x i8] c"/../\00"
@.str.5 = [4 x i8] c"/..\00"
@.str.6 = [2 x i8] c".\00"
@.str.7 = [3 x i8] c"..\00"
define i8* @remove_dot_segments(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %2
%8 = load i8*, i8** %2
%9 = call i8* @ne_strdup(i8* %8)
store i8* %9, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i8* @ne_malloc(i64 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 0, i8* %15
br label %16
16: ; preds = %125, %1
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = icmp ne i8 %19, 0
br i1 %20, label %21, label %126
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8* %27, i8** %3
br label %125
28: ; preds = %21
%29 = load i8*, i8** %3
%30 = call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 3
store i8* %34, i8** %3
br label %124
35: ; preds = %28
%36 = load i8*, i8** %3
%37 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 2
store i8* %41, i8** %3
br label %123
42: ; preds = %35
%43 = load i8*, i8** %3
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 1
store i8 0, i8* %48
br label %122
49: ; preds = %42
%50 = load i8*, i8** %3
%51 = call i64 @strncmp(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%52 = icmp eq i64 %51, 0
br i1 %52, label %57, label %53
53: ; preds = %49
%54 = load i8*, i8** %3
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %82
57: ; preds = %53, %49
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i64 3
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %68
63: ; preds = %57
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i64 2
store i8* %65, i8** %3
%66 = load i8*, i8** %3
%67 = getelementptr inbounds i8, i8* %66, i64 0
store i8 47, i8* %67
br label %71
68: ; preds = %57
%69 = load i8*, i8** %3
%70 = getelementptr inbounds i8, i8* %69, i64 3
store i8* %70, i8** %3
br label %71
71: ; preds = %68, %63
%72 = load i8*, i8** %5
%73 = call i8* @strrchr(i8* %72, i8 signext 47)
store i8* %73, i8** %6
%74 = load i8*, i8** %6
%75 = icmp ne i8* %74, null
br i1 %75, label %76, label %78
76: ; preds = %71
%77 = load i8*, i8** %6
store i8 0, i8* %77
br label %81
78: ; preds = %71
%79 = load i8*, i8** %5
%80 = getelementptr inbounds i8, i8* %79, i64 0
store i8 0, i8* %80
br label %81
81: ; preds = %78, %76
br label %121
82: ; preds = %53
%83 = load i8*, i8** %3
%84 = call i64 @strcmp(i8* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %90, label %86
86: ; preds = %82
%87 = load i8*, i8** %3
%88 = call i64 @strcmp(i8* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %86, %82
%91 = load i8*, i8** %3
%92 = getelementptr inbounds i8, i8* %91, i64 0
store i8 0, i8* %92
br label %120
93: ; preds = %86
%94 = load i8*, i8** %3
%95 = load i8*, i8** %3
%96 = getelementptr inbounds i8, i8* %95, i64 0
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 47
%100 = zext i1 %99 to i32
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %94, i64 %101
%103 = call i8* @strchr(i8* %102, i8 signext 47)
store i8* %103, i8** %7
%104 = load i8*, i8** %7
%105 = icmp eq i8* %104, null
br i1 %105, label %106, label %109
106: ; preds = %93
%107 = load i8*, i8** %3
%108 = call i8* @strchr(i8* %107, i8 signext 0)
store i8* %108, i8** %7
br label %109
109: ; preds = %106, %93
%110 = load i8*, i8** %5
%111 = load i8*, i8** %3
%112 = load i8*, i8** %7
%113 = load i8*, i8** %3
%114 = ptrtoint i8* %112 to i64
%115 = ptrtoint i8* %113 to i64
%116 = sub i64 %114, %115
%117 = trunc i64 %116 to i32
%118 = call i32 @strncat(i8* %110, i8* %111, i32 %117)
%119 = load i8*, i8** %7
store i8* %119, i8** %3
br label %120
120: ; preds = %109, %90
br label %121
121: ; preds = %120, %81
br label %122
122: ; preds = %121, %46
br label %123
123: ; preds = %122, %39
br label %124
124: ; preds = %123, %32
br label %125
125: ; preds = %124, %25
br label %16
126: ; preds = %16
%127 = load i8*, i8** %4
%128 = call i32 @free(i8* %127)
%129 = load i8*, i8** %5
ret i8* %129
}

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
@.str.1 = [4 x i8] c"../\00"
@.str.2 = [4 x i8] c"/./\00"
@.str.3 = [3 x i8] c"/.\00"
@.str.4 = [5 x i8] c"/../\00"
@.str.5 = [4 x i8] c"/..\00"
@.str.6 = [2 x i8] c".\00"
@.str.7 = [3 x i8] c"..\00"
define i8* @remove_dot_segments(i8* %0) {
%2 = tail call i8* @ne_strdup(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @ne_malloc(i64 %4)
store i8 0, i8* %5
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %75, label %8
8: ; preds = %1, %71
%9 = phi i8* [ %72, %71 ], [ %2, %1 ]
%10 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %9, i64 2
br label %71
14: ; preds = %8
%15 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = getelementptr inbounds i8, i8* %9, i64 3
br label %71
19: ; preds = %14
%20 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = getelementptr inbounds i8, i8* %9, i64 2
br label %71
24: ; preds = %19
%25 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %28
br label %71
29: ; preds = %24
%30 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%31 = icmp eq i64 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %47
35: ; preds = %32, %29
%36 = getelementptr inbounds i8, i8* %9, i64 3
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = getelementptr inbounds i8, i8* %9, i64 2
store i8 47, i8* %40
br label %41
41: ; preds = %35, %39
%42 = phi i8* [ %40, %39 ], [ %36, %35 ]
%43 = tail call i8* @strrchr(i8* %5, i8 signext 47)
%44 = icmp eq i8* %43, null
br i1 %44, label %46, label %45
45: ; preds = %41
store i8 0, i8* %43
br label %71
46: ; preds = %41
store i8 0, i8* %5
br label %71
47: ; preds = %32
%48 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %47, %50
store i8 0, i8* %9
br label %75
54: ; preds = %50
%55 = load i8, i8* %9
%56 = icmp eq i8 %55, 47
%57 = zext i1 %56 to i64
%58 = getelementptr inbounds i8, i8* %9, i64 %57
%59 = tail call i8* @strchr(i8* %58, i8 signext 47)
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %64
61: ; preds = %54
%62 = tail call i64 @strlen(i8* %9)
%63 = getelementptr i8, i8* %9, i64 %62
br label %64
64: ; preds = %61, %54
%65 = phi i8* [ %63, %61 ], [ %59, %54 ]
%66 = ptrtoint i8* %65 to i64
%67 = ptrtoint i8* %9 to i64
%68 = sub i64 %66, %67
%69 = trunc i64 %68 to i32
%70 = tail call i32 @strncat(i8* %5, i8* %9, i32 %69)
br label %71
71: ; preds = %45, %46, %17, %27, %64, %22, %12
%72 = phi i8* [ %42, %45 ], [ %42, %46 ], [ %65, %64 ], [ %9, %27 ], [ %23, %22 ], [ %18, %17 ], [ %13, %12 ]
%73 = load i8, i8* %72
%74 = icmp eq i8 %73, 0
br i1 %74, label %75, label %8
75: ; preds = %71, %53, %1
%76 = tail call i32 @free(i8* %2)
ret i8* %5
}