#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 *qfile_get_dir(char *);
int /*<<< orphan*/ qstrreplace(char *, char *, char *, char *);
int /*<<< orphan*/ qstrtrim(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *strstr(char *, char *);
char *qfile_correct_path(char *path) {
  if (path == NULL)
    return NULL;
  qstrtrim(path);
  while (true) {
    if (strstr(path, "//") != NULL) {
      qstrreplace("sr", path, "//", "/");
      continue;
    }
    if (strstr(path, "/./") != NULL) {
      qstrreplace("sr", path, "/./", "/");
      continue;
    }
    if (strstr(path, "/../") != NULL) {
      char *pszTmp = strstr(path, "/../");
      if (pszTmp == path) {
        strcpy(path, pszTmp + 3);
      } else {
        *pszTmp = '\0';
        char *pszNewPrefix = qfile_get_dir(path);
        strcpy(path, pszNewPrefix);
        strcat(path, pszTmp + 3);
        free(pszNewPrefix);
      }
      continue;
    }
    size_t nLen = strlen(path);
    if (nLen > 1) {
      if (path[nLen - 1] == '/') {
        path[nLen - 1] = '\0';
        continue;
      }
    }
    if (nLen > 2) {
      if (!strcmp(path + (nLen - 2), "/.")) {
        path[nLen - 2] = '\0';
        continue;
      }
    }
    if (nLen > 2) {
      if (!strcmp(path + (nLen - 2), "/.")) {
        path[nLen - 2] = '\0';
        continue;
      }
    }
    if (nLen > 3) {
      if (!strcmp(path + (nLen - 3), "/..")) {
        path[nLen - 3] = '\0';
        char *pszNewPath = qfile_get_dir(path);
        strcpy(path, pszNewPath);
        free(pszNewPath);
        continue;
      }
    }
    break;
  }
  return path;
}


x86 assembly (clang, -O0):
<qfile_correct_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11b4 <qfile_correct_path+0x24>
movq   $0x0,-0x8(%rbp)
jmp    141f <qfile_correct_path+0x28f>
mov    -0x10(%rbp),%rdi
call   1050 <qstrtrim@plt>
mov    -0x10(%rbp),%rdi
lea    0xe38(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     11fa <qfile_correct_path+0x6a>
mov    -0x10(%rbp),%rsi
lea    0xe21(%rip),%rdi
lea    0xe17(%rip),%rdx
lea    0xe1d(%rip),%rcx
call   1090 <qstrreplace@plt>
jmp    11bd <qfile_correct_path+0x2d>
mov    -0x10(%rbp),%rdi
lea    0xe01(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     1237 <qfile_correct_path+0xa7>
mov    -0x10(%rbp),%rsi
lea    0xde4(%rip),%rdi
lea    0xde0(%rip),%rdx
lea    0xde0(%rip),%rcx
call   1090 <qstrreplace@plt>
jmp    11bd <qfile_correct_path+0x2d>
mov    -0x10(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     12c9 <qfile_correct_path+0x139>
mov    -0x10(%rbp),%rdi
lea    0xdae(%rip),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1289 <qfile_correct_path+0xf9>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x3,%rsi
call   1040 <strcpy@plt>
jmp    12c4 <qfile_correct_path+0x134>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1070 <qfile_get_dir@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x3,%rsi
call   10a0 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
jmp    11bd <qfile_correct_path+0x2d>
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jbe    1314 <qfile_correct_path+0x184>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    130f <qfile_correct_path+0x17f>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    11bd <qfile_correct_path+0x2d>
jmp    1314 <qfile_correct_path+0x184>
cmpq   $0x2,-0x28(%rbp)
jbe    135d <qfile_correct_path+0x1cd>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rax
sub    $0x2,%rax
add    %rax,%rdi
lea    0xcda(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1358 <qfile_correct_path+0x1c8>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x2,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    11bd <qfile_correct_path+0x2d>
jmp    135d <qfile_correct_path+0x1cd>
cmpq   $0x2,-0x28(%rbp)
jbe    13a6 <qfile_correct_path+0x216>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rax
sub    $0x2,%rax
add    %rax,%rdi
lea    0xc91(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    13a1 <qfile_correct_path+0x211>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x2,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    11bd <qfile_correct_path+0x2d>
jmp    13a6 <qfile_correct_path+0x216>
cmpq   $0x3,-0x28(%rbp)
jbe    1412 <qfile_correct_path+0x282>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rax
sub    $0x3,%rax
add    %rax,%rdi
lea    0xc4b(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    140d <qfile_correct_path+0x27d>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x3,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
call   1070 <qfile_get_dir@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
jmp    11bd <qfile_correct_path+0x2d>
jmp    1412 <qfile_correct_path+0x282>
jmp    1417 <qfile_correct_path+0x287>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qfile_correct_path>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
je     1334 <qfile_correct_path+0x1a4>
mov    %rbx,%rdi
call   1050 <qstrtrim@plt>
lea    0x3(%rbx),%rax
mov    %rax,(%rsp)
lea    0xe42(%rip),%r15
lea    0xe41(%rip),%r13
lea    0xe37(%rip),%r12
lea    0xe3a(%rip),%r14
jmp    11f1 <qfile_correct_path+0x61>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1090 <qstrreplace@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
jne    11e0 <qfile_correct_path+0x50>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     121c <qfile_correct_path+0x8c>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
jmp    11e9 <qfile_correct_path+0x59>
mov    %rbx,%rdi
lea    0xde4(%rip),%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     1275 <qfile_correct_path+0xe5>
mov    %rax,%rbp
cmp    %rbx,%rax
je     12a3 <qfile_correct_path+0x113>
movb   $0x0,0x0(%rbp)
mov    %rbx,%rdi
call   1070 <qfile_get_dir@plt>
mov    %rax,%r13
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
add    $0x3,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <strcat@plt>
mov    %r13,%rdi
lea    0xd9b(%rip),%r13
call   1030 <free@plt>
jmp    11f1 <qfile_correct_path+0x61>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    $0x2,%rax
jb     1334 <qfile_correct_path+0x1a4>
mov    %rax,%r13
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    12b4 <qfile_correct_path+0x124>
movb   $0x0,-0x1(%rbx,%r13,1)
lea    0xd68(%rip),%r13
jmp    11f1 <qfile_correct_path+0x61>
mov    %rbx,%rdi
mov    (%rsp),%rsi
call   1040 <strcpy@plt>
jmp    11f1 <qfile_correct_path+0x61>
cmp    $0x3,%r13
jb     1334 <qfile_correct_path+0x1a4>
lea    (%rbx,%r13,1),%rbp
add    $0xfffffffffffffffe,%rbp
mov    %rbp,%rdi
lea    0xd43(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1324 <qfile_correct_path+0x194>
cmp    $0x4,%r13
jb     1334 <qfile_correct_path+0x1a4>
lea    (%rbx,%r13,1),%rbp
add    $0xfffffffffffffffd,%rbp
mov    %rbp,%rdi
lea    0xd25(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    1334 <qfile_correct_path+0x1a4>
movb   $0x0,0x0(%rbp)
mov    %rbx,%rdi
call   1070 <qfile_get_dir@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
lea    0xce7(%rip),%r13
jmp    11f1 <qfile_correct_path+0x61>
movb   $0x0,0x0(%rbp)
lea    0xcd7(%rip),%r13
jmp    11f1 <qfile_correct_path+0x61>
mov    %rbx,%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 = [3 x i8] c"sr\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [4 x i8] c"/./\00"
@.str.4 = [5 x i8] c"/../\00"
@.str.5 = [3 x i8] c"/.\00"
@.str.6 = [4 x i8] c"/..\00"
define i8* @qfile_correct_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %134
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @qstrtrim(i8* %12)
br label %14
14: ; preds = %11, %18, %25, %56, %70, %86, %102, %118
%15 = load i8*, i8** %3
%16 = call i8* @strstr(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = call i32 @qstrreplace(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %14
21: ; preds = %14
%22 = load i8*, i8** %3
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i8*, i8** %3
%27 = call i32 @qstrreplace(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %14
28: ; preds = %21
%29 = load i8*, i8** %3
%30 = call i8* @strstr(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp ne i8* %30, null
br i1 %31, label %32, label %57
32: ; preds = %28
%33 = load i8*, i8** %3
%34 = call i8* @strstr(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i8* %34, i8** %4
%35 = load i8*, i8** %4
%36 = load i8*, i8** %3
%37 = icmp eq i8* %35, %36
br i1 %37, label %38, label %43
38: ; preds = %32
%39 = load i8*, i8** %3
%40 = load i8*, i8** %4
%41 = getelementptr inbounds i8, i8* %40, i64 3
%42 = call i32 @strcpy(i8* %39, i8* %41)
br label %56
43: ; preds = %32
%44 = load i8*, i8** %4
store i8 0, i8* %44
%45 = load i8*, i8** %3
%46 = call i8* @qfile_get_dir(i8* %45)
store i8* %46, i8** %5
%47 = load i8*, i8** %3
%48 = load i8*, i8** %5
%49 = call i32 @strcpy(i8* %47, i8* %48)
%50 = load i8*, i8** %3
%51 = load i8*, i8** %4
%52 = getelementptr inbounds i8, i8* %51, i64 3
%53 = call i32 @strcat(i8* %50, i8* %52)
%54 = load i8*, i8** %5
%55 = call i32 @free(i8* %54)
br label %56
56: ; preds = %43, %38
br label %14
57: ; preds = %28
%58 = load i8*, i8** %3
%59 = call i64 @strlen(i8* %58)
store i64 %59, i64* %6
%60 = load i64, i64* %6
%61 = icmp ugt i64 %60, 1
br i1 %61, label %62, label %76
62: ; preds = %57
%63 = load i8*, i8** %3
%64 = load i64, i64* %6
%65 = sub i64 %64, 1
%66 = getelementptr inbounds i8, i8* %63, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 47
br i1 %69, label %70, label %75
70: ; preds = %62
%71 = load i8*, i8** %3
%72 = load i64, i64* %6
%73 = sub i64 %72, 1
%74 = getelementptr inbounds i8, i8* %71, i64 %73
store i8 0, i8* %74
br label %14
75: ; preds = %62
br label %76
76: ; preds = %75, %57
%77 = load i64, i64* %6
%78 = icmp ugt i64 %77, 2
br i1 %78, label %79, label %92
79: ; preds = %76
%80 = load i8*, i8** %3
%81 = load i64, i64* %6
%82 = sub i64 %81, 2
%83 = getelementptr inbounds i8, i8* %80, i64 %82
%84 = call i32 @strcmp(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%85 = icmp ne i32 %84, 0
br i1 %85, label %91, label %86
86: ; preds = %79
%87 = load i8*, i8** %3
%88 = load i64, i64* %6
%89 = sub i64 %88, 2
%90 = getelementptr inbounds i8, i8* %87, i64 %89
store i8 0, i8* %90
br label %14
91: ; preds = %79
br label %92
92: ; preds = %91, %76
%93 = load i64, i64* %6
%94 = icmp ugt i64 %93, 2
br i1 %94, label %95, label %108
95: ; preds = %92
%96 = load i8*, i8** %3
%97 = load i64, i64* %6
%98 = sub i64 %97, 2
%99 = getelementptr inbounds i8, i8* %96, i64 %98
%100 = call i32 @strcmp(i8* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%101 = icmp ne i32 %100, 0
br i1 %101, label %107, label %102
102: ; preds = %95
%103 = load i8*, i8** %3
%104 = load i64, i64* %6
%105 = sub i64 %104, 2
%106 = getelementptr inbounds i8, i8* %103, i64 %105
store i8 0, i8* %106
br label %14
107: ; preds = %95
br label %108
108: ; preds = %107, %92
%109 = load i64, i64* %6
%110 = icmp ugt i64 %109, 3
br i1 %110, label %111, label %131
111: ; preds = %108
%112 = load i8*, i8** %3
%113 = load i64, i64* %6
%114 = sub i64 %113, 3
%115 = getelementptr inbounds i8, i8* %112, i64 %114
%116 = call i32 @strcmp(i8* %115, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%117 = icmp ne i32 %116, 0
br i1 %117, label %130, label %118
118: ; preds = %111
%119 = load i8*, i8** %3
%120 = load i64, i64* %6
%121 = sub i64 %120, 3
%122 = getelementptr inbounds i8, i8* %119, i64 %121
store i8 0, i8* %122
%123 = load i8*, i8** %3
%124 = call i8* @qfile_get_dir(i8* %123)
store i8* %124, i8** %7
%125 = load i8*, i8** %3
%126 = load i8*, i8** %7
%127 = call i32 @strcpy(i8* %125, i8* %126)
%128 = load i8*, i8** %7
%129 = call i32 @free(i8* %128)
br label %14
130: ; preds = %111
br label %131
131: ; preds = %130, %108
br label %132
132: ; preds = %131
%133 = load i8*, i8** %3
store i8* %133, i8** %2
br label %134
134: ; preds = %132, %10
%135 = load i8*, i8** %2
ret i8* %135
}

LLVM IR (-O2):
@.str = [3 x i8] c"//\00"
@.str.1 = [3 x i8] c"sr\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [4 x i8] c"/./\00"
@.str.4 = [5 x i8] c"/../\00"
@.str.5 = [3 x i8] c"/.\00"
@.str.6 = [4 x i8] c"/..\00"
define i8* @qfile_correct_path(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %58, label %3
3: ; preds = %1
%4 = tail call i32 @qstrtrim(i8* %0)
%5 = getelementptr inbounds i8, i8* %0, i64 3
br label %6
6: ; preds = %38, %3
%7 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @qstrreplace(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %38
11: ; preds = %6
%12 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @qstrreplace(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %38
16: ; preds = %11
%17 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i8* %17, null
br i1 %18, label %29, label %19
19: ; preds = %16
%20 = icmp eq i8* %17, %0
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = tail call i32 @strcpy(i8* %0, i8* %5)
br label %38
23: ; preds = %19
store i8 0, i8* %17
%24 = tail call i8* @qfile_get_dir(i8* %0)
%25 = tail call i32 @strcpy(i8* %0, i8* %24)
%26 = getelementptr inbounds i8, i8* %17, i64 3
%27 = tail call i32 @strcat(i8* %0, i8* %26)
%28 = tail call i32 @free(i8* %24)
br label %38
29: ; preds = %16
%30 = tail call i64 @strlen(i8* %0)
%31 = icmp ugt i64 %30, 1
br i1 %31, label %32, label %58
32: ; preds = %29
%33 = add i64 %30, -1
%34 = getelementptr inbounds i8, i8* %0, i64 %33
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 47
br i1 %36, label %37, label %39
37: ; preds = %32
store i8 0, i8* %34
br label %38
38: ; preds = %37, %46, %54, %21, %23, %14, %9
br label %6
39: ; preds = %32
%40 = icmp ugt i64 %30, 2
br i1 %40, label %41, label %58
41: ; preds = %39
%42 = add i64 %30, -2
%43 = getelementptr inbounds i8, i8* %0, i64 %42
%44 = tail call i32 @strcmp(i8* %43, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %41
store i8 0, i8* %43
br label %38
47: ; preds = %41
%48 = icmp ugt i64 %30, 3
br i1 %48, label %49, label %58
49: ; preds = %47
%50 = add i64 %30, -3
%51 = getelementptr inbounds i8, i8* %0, i64 %50
%52 = tail call i32 @strcmp(i8* %51, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %49
store i8 0, i8* %51
%55 = tail call i8* @qfile_get_dir(i8* %0)
%56 = tail call i32 @strcpy(i8* %0, i8* %55)
%57 = tail call i32 @free(i8* %55)
br label %38
58: ; preds = %29, %39, %47, %49, %1
ret i8* %0
}