#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 */
scalar_t__ EINVAL;
int MAXPATHLEN;
int MB_CUR_MAX;
scalar_t__ _DtHelpCeCompressPathname(char *);
int _DtHelpCeStrcspn(char *, char *, int, int *);
scalar_t__ errno;
scalar_t__ getcwd(char *, int);
int mblen(char *, int);
int readlink(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strdup(char *);
char *_DtHelpCeTracePathName(char *path) {
  int result;
  int len;
  char c;
  char *ptr;
  char *prev;
  char newPath[2 * MAXPATHLEN + 2];
  char linkPath[MAXPATHLEN + 2];
  char tempPath[MAXPATHLEN + 2];
  if (path == 0 || *path == '\0') {
    errno = EINVAL;
    return 0;
  }
  newPath[0] = '\0';
  if ((MB_CUR_MAX == 1 || mblen(path, MB_CUR_MAX) == 1) && *path != '/') {
    if (getcwd(newPath, MAXPATHLEN) == 0)
      return 0;
    strcat(newPath, "/");
  }
  strcat(newPath, path);
  if (_DtHelpCeCompressPathname(newPath) != 0)
    return 0;
  ptr = newPath;
  do {
    prev = ptr + 1;
    result = _DtHelpCeStrcspn(prev, "/", MB_CUR_MAX, &len);
    if (result == -1)
      return 0;
    ptr = prev + len;
    c = *ptr;
    *ptr = '\0';
    result = readlink(newPath, linkPath, MAXPATHLEN);
    *ptr = c;
    if (result == -1) {
      if (errno != EINVAL)
        return 0;
    } else {
      linkPath[result] = '\0';
      strcpy(tempPath, ptr);
      if (*linkPath == '/')
        strcpy(newPath, linkPath);
      else {
        strcpy(prev, linkPath);
      }
      strcat(newPath, tempPath);
      if (_DtHelpCeCompressPathname(newPath) != 0)
        return 0;
      ptr = newPath;
    }
  } while (*ptr != '\0');
  return (strdup(newPath));
}


x86 assembly (clang, -O0):
<_DtHelpCeTracePathName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2e4d(%rip),%rax
mov    (%rax),%edx
mov    %edx,%ecx
lea    0x2(%rcx,%rcx,1),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x38(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x70(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x40(%rbp)
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x48(%rbp)
mov    (%rax),%eax
add    $0x2,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     121b <_DtHelpCeTracePathName+0x9b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1243 <_DtHelpCeTracePathName+0xc3>
mov    0x2da6(%rip),%rax
mov    (%rax),%rcx
mov    0x2da4(%rip),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1476 <_DtHelpCeTracePathName+0x2f6>
mov    -0x70(%rbp),%rax
movb   $0x0,(%rax)
mov    0x2da7(%rip),%rax
cmpl   $0x1,(%rax)
je     1275 <_DtHelpCeTracePathName+0xf5>
mov    -0x10(%rbp),%rdi
mov    0x2d93(%rip),%rax
mov    (%rax),%esi
call   1030 <mblen@plt>
cmp    $0x1,%eax
jne    12c5 <_DtHelpCeTracePathName+0x145>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     12c5 <_DtHelpCeTracePathName+0x145>
mov    -0x70(%rbp),%rdi
mov    0x2d50(%rip),%rax
mov    (%rax),%esi
call   1060 <getcwd@plt>
cmp    $0x0,%rax
jne    12b5 <_DtHelpCeTracePathName+0x135>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1476 <_DtHelpCeTracePathName+0x2f6>
mov    -0x70(%rbp),%rdi
lea    0xd40(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1090 <strcat@plt>
mov    -0x70(%rbp),%rdi
call   1070 <_DtHelpCeCompressPathname@plt>
cmp    $0x0,%rax
je     12f9 <_DtHelpCeTracePathName+0x179>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1476 <_DtHelpCeTracePathName+0x2f6>
mov    -0x70(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    0x2ce0(%rip),%rax
mov    (%rax),%edx
lea    0xcdf(%rip),%rsi
lea    -0x18(%rbp),%rcx
call   1080 <_DtHelpCeStrcspn@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    134b <_DtHelpCeTracePathName+0x1cb>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1476 <_DtHelpCeTracePathName+0x2f6>
mov    -0x68(%rbp),%rsi
mov    -0x70(%rbp),%rdi
mov    -0x30(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    0x2c67(%rip),%rax
mov    (%rax),%edx
call   1050 <readlink@plt>
mov    %eax,-0x14(%rbp)
mov    -0x19(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
cmpl   $0xffffffff,-0x14(%rbp)
jne    13c9 <_DtHelpCeTracePathName+0x249>
mov    0x2c33(%rip),%rax
mov    (%rax),%rax
mov    0x2c21(%rip),%rcx
cmp    (%rcx),%rax
je     13c4 <_DtHelpCeTracePathName+0x244>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1476 <_DtHelpCeTracePathName+0x2f6>
jmp    144d <_DtHelpCeTracePathName+0x2cd>
mov    -0x68(%rbp),%rax
mov    -0x60(%rbp),%rdi
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x68(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1404 <_DtHelpCeTracePathName+0x284>
mov    -0x68(%rbp),%rsi
mov    -0x70(%rbp),%rdi
call   1040 <strcpy@plt>
jmp    1411 <_DtHelpCeTracePathName+0x291>
mov    -0x68(%rbp),%rsi
mov    -0x30(%rbp),%rdi
call   1040 <strcpy@plt>
mov    -0x70(%rbp),%rdi
mov    -0x60(%rbp),%rsi
call   1090 <strcat@plt>
mov    -0x70(%rbp),%rdi
call   1070 <_DtHelpCeCompressPathname@plt>
cmp    $0x0,%rax
je     1445 <_DtHelpCeTracePathName+0x2c5>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1476 <_DtHelpCeTracePathName+0x2f6>
mov    -0x70(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1452 <_DtHelpCeTracePathName+0x2d2>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1301 <_DtHelpCeTracePathName+0x181>
mov    -0x70(%rbp),%rdi
call   10a0 <strdup@plt>
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtHelpCeTracePathName>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsp,%rdx
mov    0x2e45(%rip),%rcx
mov    (%rcx),%eax
add    %eax,%eax
add    $0x2,%eax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
mov    (%rcx),%eax
add    $0x2,%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
test   %rdi,%rdi
je     1253 <_DtHelpCeTracePathName+0xd3>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1253 <_DtHelpCeTracePathName+0xd3>
mov    %rdx,-0x30(%rbp)
movb   $0x0,0x0(%r13)
mov    0x2e04(%rip),%rcx
mov    (%rcx),%esi
cmp    $0x1,%esi
je     120a <_DtHelpCeTracePathName+0x8a>
mov    %rbx,%rdi
call   1030 <mblen@plt>
cmp    $0x1,%eax
jne    1233 <_DtHelpCeTracePathName+0xb3>
mov    (%rbx),%al
cmp    $0x2f,%al
je     1233 <_DtHelpCeTracePathName+0xb3>
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
mov    %r13,%rdi
call   1060 <getcwd@plt>
test   %rax,%rax
je     124b <_DtHelpCeTracePathName+0xcb>
lea    0xdd5(%rip),%rsi
mov    %r13,%rdi
call   1090 <strcat@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1090 <strcat@plt>
mov    %r13,%rdi
call   1070 <_DtHelpCeCompressPathname@plt>
test   %rax,%rax
je     127b <_DtHelpCeTracePathName+0xfb>
xor    %eax,%eax
mov    -0x30(%rbp),%rdx
jmp    1269 <_DtHelpCeTracePathName+0xe9>
mov    0x2d6e(%rip),%rax
mov    (%rax),%rax
mov    0x2d6c(%rip),%rcx
mov    %rax,(%rcx)
xor    %eax,%eax
mov    %rdx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r13,%rbx
jmp    12a7 <_DtHelpCeTracePathName+0x127>
mov    0x2d49(%rip),%rax
mov    (%rax),%rax
mov    0x2d37(%rip),%rcx
cmp    (%rcx),%rax
mov    -0x40(%rbp),%rbx
jne    1368 <_DtHelpCeTracePathName+0x1e8>
test   %r15b,%r15b
je     135b <_DtHelpCeTracePathName+0x1db>
add    $0x1,%rbx
mov    0x2d46(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
lea    0xd42(%rip),%rsi
lea    -0x34(%rbp),%rcx
call   1080 <_DtHelpCeStrcspn@plt>
cmp    $0xffffffff,%eax
je     1368 <_DtHelpCeTracePathName+0x1e8>
movslq -0x34(%rbp),%r14
lea    (%rbx,%r14,1),%rax
mov    %rax,-0x40(%rbp)
movzbl (%rbx,%r14,1),%r15d
movb   $0x0,(%rbx,%r14,1)
mov    0x2cf3(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <readlink@plt>
mov    %r15b,(%rbx,%r14,1)
cmp    $0xffffffff,%eax
je     1280 <_DtHelpCeTracePathName+0x100>
cltq
movb   $0x0,(%r12,%rax,1)
mov    -0x48(%rbp),%r14
mov    %r14,%rdi
mov    -0x40(%rbp),%rsi
call   1040 <strcpy@plt>
cmpb   $0x2f,(%r12)
cmove  %r13,%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1090 <strcat@plt>
mov    %r13,%rdi
call   1070 <_DtHelpCeCompressPathname@plt>
test   %rax,%rax
jne    1368 <_DtHelpCeTracePathName+0x1e8>
movzbl 0x0(%r13),%r15d
mov    %r13,%rbx
test   %r15b,%r15b
jne    12a7 <_DtHelpCeTracePathName+0x127>
mov    %r13,%rdi
call   10a0 <strdup@plt>
jmp    124d <_DtHelpCeTracePathName+0xcd>
mov    -0x30(%rbp),%rdx
jmp    1267 <_DtHelpCeTracePathName+0xe7>

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

LLVM IR (-O2):
@MAXPATHLEN = global i32 0
@EINVAL = global i64 0
@errno = global i64 0
@MB_CUR_MAX = global i32 0
@.str = [2 x i8] c"/\00"
define noalias i8* @_DtHelpCeTracePathName(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @MAXPATHLEN
%5 = shl nsw i32 %4, 1
%6 = add nsw i32 %5, 2
%7 = zext i32 %6 to i64
%8 = tail call i8* @llvm.stacksave()
%9 = alloca i8, i64 %7
%10 = load i32, i32* @MAXPATHLEN
%11 = add nsw i32 %10, 2
%12 = zext i32 %11 to i64
%13 = alloca i8, i64 %12
%14 = alloca i8, i64 %12
%15 = icmp eq i8* %0, null
br i1 %15, label %19, label %16
16: ; preds = %1
%17 = load i8, i8* %0
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16, %1
%20 = load i64, i64* @EINVAL
store i64 %20, i64* @errno
br label %79
21: ; preds = %16
store i8 0, i8* %9
%22 = load i32, i32* @MB_CUR_MAX
%23 = icmp eq i32 %22, 1
br i1 %23, label %29, label %24
24: ; preds = %21
%25 = tail call i32 @mblen(i8* %0, i32 %22)
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %38
27: ; preds = %24
%28 = load i8, i8* %0
br label %29
29: ; preds = %27, %21
%30 = phi i8 [ %28, %27 ], [ %17, %21 ]
%31 = icmp eq i8 %30, 47
br i1 %31, label %38, label %32
32: ; preds = %29
%33 = load i32, i32* @MAXPATHLEN
%34 = call i64 @getcwd(i8* %9, i32 %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %79, label %36
36: ; preds = %32
%37 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %38
38: ; preds = %36, %29, %24
%39 = call i32 @strcat(i8* %9, i8* %0)
%40 = call i64 @_DtHelpCeCompressPathname(i8* %9)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %79
42: ; preds = %38, %73
%43 = phi i8* [ %75, %73 ], [ %9, %38 ]
%44 = getelementptr inbounds i8, i8* %43, i64 1
%45 = load i32, i32* @MB_CUR_MAX
%46 = call i32 @_DtHelpCeStrcspn(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %45, i32* %2)
%47 = icmp eq i32 %46, -1
br i1 %47, label %79, label %48
48: ; preds = %42
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %44, i64 %50
%52 = load i8, i8* %51
store i8 0, i8* %51
%53 = load i32, i32* @MAXPATHLEN
%54 = call i32 @readlink(i8* %9, i8* %13, i32 %53)
store i8 %52, i8* %51
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %60
56: ; preds = %48
%57 = load i64, i64* @errno
%58 = load i64, i64* @EINVAL
%59 = icmp eq i64 %57, %58
br i1 %59, label %73, label %79
60: ; preds = %48
%61 = sext i32 %54 to i64
%62 = getelementptr inbounds i8, i8* %13, i64 %61
store i8 0, i8* %62
%63 = call i32 @strcpy(i8* %14, i8* %51)
%64 = load i8, i8* %13
%65 = icmp eq i8 %64, 47
%66 = select i1 %65, i8* %9, i8* %44
%67 = call i32 @strcpy(i8* %66, i8* %13)
%68 = call i32 @strcat(i8* %9, i8* %14)
%69 = call i64 @_DtHelpCeCompressPathname(i8* %9)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %79
71: ; preds = %60
%72 = load i8, i8* %9
br label %73
73: ; preds = %71, %56
%74 = phi i8 [ %52, %56 ], [ %72, %71 ]
%75 = phi i8* [ %51, %56 ], [ %9, %71 ]
%76 = icmp eq i8 %74, 0
br i1 %76, label %77, label %42
77: ; preds = %73
%78 = call i8* @strdup(i8* %9)
br label %79
79: ; preds = %60, %56, %42, %38, %32, %77, %19
%80 = phi i8* [ null, %19 ], [ %78, %77 ], [ null, %32 ], [ null, %38 ], [ null, %42 ], [ null, %56 ], [ null, %60 ]
ret i8* %80
}