#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 */
struct stat {
  int st_mode;
};
typedef scalar_t__ pid_t;

/* Variables and functions */
int S_IFLNK;
int /*<<< orphan*/ chmod(char *, int);
scalar_t__ execl(char *, char *, char *, char *, int /*<<< orphan*/ *);
scalar_t__ fork();
int /*<<< orphan*/ lstat(char *, struct stat *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int readlink(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
scalar_t__ util_copy_file(char *, char *);
scalar_t__ util_mkdir(char *);
int /*<<< orphan*/ util_remove_dir(char *);
int yget_upgrade_self(char *package_path) {
  pid_t pid;
  struct stat sb;
  char lib_path[32];
  if (!package_path)
    return -1;
  if (util_mkdir("/tmp/ypkg2_backup") != 0)
    return -1;
  lstat("/usr/lib/libypk.so", &sb);
  if (sb.st_mode & S_IFLNK) {
    memset(lib_path, 0, 32);
    strncpy(lib_path, "/usr/lib/", 9);
    if (readlink("/usr/lib/libypk.so", lib_path + 9, 23) == -1)
      goto failed;
    if (util_copy_file(lib_path, "/tmp/ypkg2_backup/libypk.so") != 0)
      goto failed;
    else
      chmod("/tmp/ypkg2_backup/libypk.so", 0755);
  } else {
    if (util_copy_file("/usr/lib/libypk.so", "/tmp/ypkg2_backup/libypk.so") !=
        0)
      goto failed;
    else
      chmod("/tmp/ypkg2_backup/libypk.so", 0755);
  }
  if (util_copy_file("/usr/bin/ypkg2", "/tmp/ypkg2_backup/ypkg2") != 0)
    goto failed;
  else
    chmod("/tmp/ypkg2_backup/ypkg2", 0755);
  if (util_copy_file("/usr/bin/yget2", "/tmp/ypkg2_backup/yget2") != 0)
    goto failed;
  else
    chmod("/tmp/ypkg2_backup/yget2", 0755);
  if (util_copy_file("/usr/bin/ypkg2-upgrade",
                     "/tmp/ypkg2_backup/ypkg2-upgrade") != 0)
    goto failed;
  else
    chmod("/tmp/ypkg2_backup/ypkg2-upgrade", 0755);
  if ((pid = fork()) < 0) {
    goto failed;
  } else if (pid == 0) {
    if (execl("/tmp/ypkg2_backup/ypkg2-upgrade", "ypkg2-upgrade",
              "/tmp/ypkg2_backup", package_path, NULL) < 0)
      goto failed;
  }
  return 0;
failed:
  util_remove_dir("/tmp/ypkg2_backup");
  return -1;
}


x86 assembly (clang, -O0):
<yget_upgrade_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11c3 <yget_upgrade_self+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    13dc <yget_upgrade_self+0x23c>
lea    0xe36(%rip),%rdi
call   1080 <util_mkdir@plt>
cmp    $0x0,%rax
je     11e5 <yget_upgrade_self+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    13dc <yget_upgrade_self+0x23c>
lea    0xe26(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1070 <lstat@plt>
mov    -0x20(%rbp),%eax
mov    0x2de9(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     128b <yget_upgrade_self+0xeb>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    -0x40(%rbp),%rdi
lea    0xe00(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncpy@plt>
lea    -0x40(%rbp),%rsi
add    $0x9,%rsi
lea    0xdd4(%rip),%rdi
mov    $0x17,%edx
call   1050 <readlink@plt>
cmp    $0xffffffff,%eax
jne    1256 <yget_upgrade_self+0xb6>
jmp    13c9 <yget_upgrade_self+0x229>
lea    -0x40(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   10c0 <util_copy_file@plt>
cmp    $0x0,%rax
je     1275 <yget_upgrade_self+0xd5>
jmp    13c9 <yget_upgrade_self+0x229>
lea    0xdb3(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
jmp    12c3 <yget_upgrade_self+0x123>
lea    0xd80(%rip),%rdi
lea    0xd96(%rip),%rsi
call   10c0 <util_copy_file@plt>
cmp    $0x0,%rax
je     12ad <yget_upgrade_self+0x10d>
jmp    13c9 <yget_upgrade_self+0x229>
lea    0xd7b(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
jmp    12c3 <yget_upgrade_self+0x123>
lea    0xd81(%rip),%rdi
lea    0xd89(%rip),%rsi
call   10c0 <util_copy_file@plt>
cmp    $0x0,%rax
je     12e5 <yget_upgrade_self+0x145>
jmp    13c9 <yget_upgrade_self+0x229>
lea    0xd6e(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
lea    0xd75(%rip),%rdi
lea    0xd7d(%rip),%rsi
call   10c0 <util_copy_file@plt>
cmp    $0x0,%rax
je     1318 <yget_upgrade_self+0x178>
jmp    13c9 <yget_upgrade_self+0x229>
lea    0xd62(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
lea    0xd69(%rip),%rdi
lea    0xd79(%rip),%rsi
call   10c0 <util_copy_file@plt>
cmp    $0x0,%rax
je     134b <yget_upgrade_self+0x1ab>
jmp    13c9 <yget_upgrade_self+0x229>
lea    0xd5e(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
mov    $0x0,%al
call   10b0 <fork@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jge    1376 <yget_upgrade_self+0x1d6>
jmp    13c9 <yget_upgrade_self+0x229>
cmpq   $0x0,-0x18(%rbp)
jne    13b8 <yget_upgrade_self+0x218>
mov    -0x10(%rbp),%rcx
lea    0xd24(%rip),%rdi
lea    0xd0f(%rip),%rsi
lea    0xc66(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   10a0 <execl@plt>
cmp    $0x0,%rax
jge    13b3 <yget_upgrade_self+0x213>
jmp    13c9 <yget_upgrade_self+0x229>
jmp    13b8 <yget_upgrade_self+0x218>
jmp    13bd <yget_upgrade_self+0x21d>
movl   $0x0,-0x4(%rbp)
jmp    13dc <yget_upgrade_self+0x23c>
lea    0xc30(%rip),%rdi
call   1030 <util_remove_dir@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yget_upgrade_self>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    $0xffffffff,%ebx
test   %rdi,%rdi
je     12e6 <yget_upgrade_self+0x146>
mov    %rdi,%r14
lea    0xe41(%rip),%rdi
call   1080 <util_mkdir@plt>
test   %rax,%rax
jne    12e6 <yget_upgrade_self+0x146>
lea    0xe3e(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1070 <lstat@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
test   %eax,0x8(%rsp)
je     1242 <yget_upgrade_self+0xa2>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    0xe1d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x9,%edx
call   1040 <strncpy@plt>
lea    0x19(%rsp),%rsi
lea    0xdf1(%rip),%rdi
mov    $0x17,%edx
call   1050 <readlink@plt>
cmp    $0xffffffff,%eax
je     12d5 <yget_upgrade_self+0x135>
lea    0xdf4(%rip),%rsi
lea    0x10(%rsp),%rdi
jmp    1250 <yget_upgrade_self+0xb0>
lea    0xdc9(%rip),%rdi
lea    0xddf(%rip),%rsi
call   10c0 <util_copy_file@plt>
test   %rax,%rax
jne    12d5 <yget_upgrade_self+0x135>
lea    0xdce(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
lea    0xdd9(%rip),%rdi
lea    0xde1(%rip),%rsi
call   10c0 <util_copy_file@plt>
test   %rax,%rax
jne    12d5 <yget_upgrade_self+0x135>
lea    0xdd0(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
lea    0xdd7(%rip),%rdi
lea    0xddf(%rip),%rsi
call   10c0 <util_copy_file@plt>
test   %rax,%rax
jne    12d5 <yget_upgrade_self+0x135>
lea    0xdce(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
lea    0xdd5(%rip),%rdi
lea    0xde5(%rip),%rsi
call   10c0 <util_copy_file@plt>
test   %rax,%rax
je     12f0 <yget_upgrade_self+0x150>
lea    0xd24(%rip),%rdi
call   1030 <util_remove_dir@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret
lea    0xdb9(%rip),%rdi
mov    $0x1ed,%esi
call   1090 <chmod@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   10b0 <fork@plt>
test   %rax,%rax
js     12d5 <yget_upgrade_self+0x135>
jne    12e6 <yget_upgrade_self+0x146>
lea    0xd98(%rip),%rdi
lea    0xd83(%rip),%rsi
lea    0xcda(%rip),%rdx
xor    %ebx,%ebx
mov    %r14,%rcx
xor    %r8d,%r8d
call   10a0 <execl@plt>
test   %rax,%rax
jns    12e6 <yget_upgrade_self+0x146>
jmp    12d5 <yget_upgrade_self+0x135>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [18 x i8] c"/tmp/ypkg2_backup\00"
@.str.1 = [19 x i8] c"/usr/lib/libypk.so\00"
@S_IFLNK = global i32 0
@.str.2 = [10 x i8] c"/usr/lib/\00"
@.str.3 = [28 x i8] c"/tmp/ypkg2_backup/libypk.so\00"
@.str.4 = [15 x i8] c"/usr/bin/ypkg2\00"
@.str.5 = [24 x i8] c"/tmp/ypkg2_backup/ypkg2\00"
@.str.6 = [15 x i8] c"/usr/bin/yget2\00"
@.str.7 = [24 x i8] c"/tmp/ypkg2_backup/yget2\00"
@.str.8 = [23 x i8] c"/usr/bin/ypkg2-upgrade\00"
@.str.9 = [32 x i8] c"/tmp/ypkg2_backup/ypkg2-upgrade\00"
@.str.10 = [14 x i8] c"ypkg2-upgrade\00"
define i32 @yget_upgrade_self(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.stat
%6 = alloca [32 x i8]
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 -1, i32* %2
br label %81
10: ; preds = %1
%11 = call i64 @util_mkdir(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 -1, i32* %2
br label %81
14: ; preds = %10
%15 = call i32 @lstat(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %5)
%16 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%17 = load i32, i32* %16
%18 = load i32, i32* @S_IFLNK
%19 = and i32 %17, %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %39
21: ; preds = %14
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%23 = call i32 @memset(i8* %22, i32 0, i32 32)
%24 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%25 = call i32 @strncpy(i8* %24, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 9)
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%27 = getelementptr inbounds i8, i8* %26, i64 9
%28 = call i32 @readlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %27, i32 23)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %31
30: ; preds = %21
br label %79
31: ; preds = %21
%32 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%33 = call i64 @util_copy_file(i8* %32, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
br label %79
36: ; preds = %31
%37 = call i32 @chmod(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 493)
br label %38
38: ; preds = %36
br label %46
39: ; preds = %14
%40 = call i64 @util_copy_file(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %39
br label %79
43: ; preds = %39
%44 = call i32 @chmod(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 493)
br label %45
45: ; preds = %43
br label %46
46: ; preds = %45, %38
%47 = call i64 @util_copy_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %46
br label %79
50: ; preds = %46
%51 = call i32 @chmod(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 493)
br label %52
52: ; preds = %50
%53 = call i64 @util_copy_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %52
br label %79
56: ; preds = %52
%57 = call i32 @chmod(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 493)
br label %58
58: ; preds = %56
%59 = call i64 @util_copy_file(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %58
br label %79
62: ; preds = %58
%63 = call i32 @chmod(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 493)
br label %64
64: ; preds = %62
%65 = call i64 (...) @fork()
store i64 %65, i64* %4
%66 = icmp slt i64 %65, 0
br i1 %66, label %67, label %68
67: ; preds = %64
br label %79
68: ; preds = %64
%69 = load i64, i64* %4
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %68
%72 = load i8*, i8** %3
%73 = call i64 @execl(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %72, i32* null)
%74 = icmp slt i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %71
br label %79
76: ; preds = %71
br label %77
77: ; preds = %76, %68
br label %78
78: ; preds = %77
store i32 0, i32* %2
br label %81
79: ; preds = %75, %67, %61, %55, %49, %42, %35, %30
%80 = call i32 @util_remove_dir(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %81
81: ; preds = %79, %78, %13, %9
%82 = load i32, i32* %2
ret i32 %82
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [18 x i8] c"/tmp/ypkg2_backup\00"
@.str.1 = [19 x i8] c"/usr/lib/libypk.so\00"
@S_IFLNK = global i32 0
@.str.2 = [10 x i8] c"/usr/lib/\00"
@.str.3 = [28 x i8] c"/tmp/ypkg2_backup/libypk.so\00"
@.str.4 = [15 x i8] c"/usr/bin/ypkg2\00"
@.str.5 = [24 x i8] c"/tmp/ypkg2_backup/ypkg2\00"
@.str.6 = [15 x i8] c"/usr/bin/yget2\00"
@.str.7 = [24 x i8] c"/tmp/ypkg2_backup/yget2\00"
@.str.8 = [23 x i8] c"/usr/bin/ypkg2-upgrade\00"
@.str.9 = [32 x i8] c"/tmp/ypkg2_backup/ypkg2-upgrade\00"
@.str.10 = [14 x i8] c"ypkg2-upgrade\00"
define i32 @yget_upgrade_self(i8* %0) {
%2 = alloca %struct.stat
%3 = alloca [32 x i8]
%4 = bitcast %struct.stat* %2 to i8*
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = icmp eq i8* %0, null
br i1 %6, label %55, label %7
7: ; preds = %1
%8 = tail call i64 @util_mkdir(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %55
10: ; preds = %7
%11 = call i32 @lstat(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %2)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%13 = load i32, i32* %12
%14 = load i32, i32* @S_IFLNK
%15 = and i32 %14, %13
%16 = icmp eq i32 %15, 0
br i1 %16, label %28, label %17
17: ; preds = %10
%18 = call i32 @memset(i8* %5, i32 0, i32 32)
%19 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 9)
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 9
%21 = call i32 @readlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %20, i32 23)
%22 = icmp eq i32 %21, -1
br i1 %22, label %53, label %23
23: ; preds = %17
%24 = call i64 @util_copy_file(i8* %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %53
26: ; preds = %23
%27 = call i32 @chmod(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 493)
br label %33
28: ; preds = %10
%29 = tail call i64 @util_copy_file(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %53
31: ; preds = %28
%32 = tail call i32 @chmod(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 493)
br label %33
33: ; preds = %31, %26
%34 = call i64 @util_copy_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %53
36: ; preds = %33
%37 = call i32 @chmod(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 493)
%38 = call i64 @util_copy_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %53
40: ; preds = %36
%41 = call i32 @chmod(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 493)
%42 = call i64 @util_copy_file(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %40
%45 = call i32 @chmod(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 493)
%46 = call i64 (...) @fork()
%47 = icmp slt i64 %46, 0
br i1 %47, label %53, label %48
48: ; preds = %44
%49 = icmp eq i64 %46, 0
br i1 %49, label %50, label %55
50: ; preds = %48
%51 = call i64 @execl(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %50, %44, %40, %36, %33, %28, %23, %17
%54 = call i32 @util_remove_dir(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %55
55: ; preds = %50, %48, %7, %1, %53
%56 = phi i32 [ -1, %53 ], [ -1, %1 ], [ -1, %7 ], [ 0, %48 ], [ 0, %50 ]
ret i32 %56
}