#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 passwd {
  char const *pw_dir;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *dctrl_get_current_dir_name();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ free(char *);
struct passwd *getpwnam(char *);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int /*<<< orphan*/ sprintf(char *, char *, char *, char const *);
char *strchr(char const *, char);
char *strdup(char const *);
int strlen(char const *);
char *fnqualify(char const *path) {
  size_t len, size;
  struct passwd *pwd;
  const char *p;
  assert(path != NULL);
  if (path[0] == '/') {
    return strdup(path);
  }
  if (path[0] != '~') {
    char *cwd = dctrl_get_current_dir_name();
    if (cwd == 0)
      return 0;
    len = strlen(cwd);
    size = len + 1 + strlen(path) + 1;
    char *res = malloc(size);
    if (res == 0) {
      free(cwd);
      return 0;
    }
    sprintf(res, "%s/%s", cwd, path);
    return res;
  }
  if (path[1] == '\0' || path[1] == '/') {
    pwd = getpwuid(getuid());
    if (path[1] == '\0')
      p = path + 1;
    else
      p = path + 2;
  } else {
    p = strchr(path, '/');
    if (p == NULL)
      p = strchr(path, '\0');
    size = (size_t)(p - path);
    char *username = malloc(size);
    if (username == 0) {
      errno = ENOMEM;
      return 0;
    }
    memcpy(username, path + 1, size);
    username[size - 1] = '\0';
    pwd = getpwnam(username);
    if (*p == '/')
      ++p;
    free(username);
  }
  if (pwd == NULL) {
    errno = ENOENT;
    return 0;
  }
  size = strlen(pwd->pw_dir) + 1 + strlen(p) + 1;
  char *result = malloc(size);
  if (result == 0)
    return 0;
  sprintf(result, "%s/%s", pwd->pw_dir, p);
  return result;
}


x86 assembly (clang, -O0):
<fnqualify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1200 <fnqualify+0x40>
mov    -0x10(%rbp),%rdi
call   10e0 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    148b <fnqualify+0x2cb>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
je     12be <fnqualify+0xfe>
mov    $0x0,%al
call   10d0 <dctrl_get_current_dir_name@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1233 <fnqualify+0x73>
movq   $0x0,-0x8(%rbp)
jmp    148b <fnqualify+0x2cb>
mov    -0x38(%rbp),%rdi
call   1050 <strlen@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1299 <fnqualify+0xd9>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    148b <fnqualify+0x2cb>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xd54(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    148b <fnqualify+0x2cb>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     12e0 <fnqualify+0x120>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    1325 <fnqualify+0x165>
mov    $0x0,%al
call   1060 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1314 <fnqualify+0x154>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1320 <fnqualify+0x160>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
jmp    13ee <fnqualify+0x22e>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1070 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1351 <fnqualify+0x191>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1070 <strchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1397 <fnqualify+0x1d7>
mov    0x2c61(%rip),%rax
mov    (%rax),%ecx
mov    0x2c50(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    148b <fnqualify+0x2cb>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x20(%rbp),%rdx
call   10a0 <memcpy@plt>
mov    -0x48(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x48(%rbp),%rdi
call   1080 <getpwnam@plt>
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    13e5 <fnqualify+0x225>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x28(%rbp)
jne    1418 <fnqualify+0x258>
mov    0x2bc8(%rip),%rax
mov    (%rax),%ecx
mov    0x2bcf(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    148b <fnqualify+0x2cb>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1468 <fnqualify+0x2a8>
movq   $0x0,-0x8(%rbp)
jmp    148b <fnqualify+0x2cb>
mov    -0x50(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
mov    -0x30(%rbp),%rcx
lea    0xb82(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnqualify>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1090 <assert@plt>
mov    (%rbx),%al
cmp    $0x7e,%al
je     11f9 <fnqualify+0x39>
cmp    $0x2f,%al
jne    1271 <fnqualify+0xb1>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    10e0 <strdup@plt>
lea    0x1(%rbx),%r14
mov    0x1(%rbx),%al
cmp    $0x2f,%al
je     120c <fnqualify+0x4c>
test   %al,%al
jne    12cf <fnqualify+0x10f>
xor    %eax,%eax
call   1060 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,%r12
lea    0x2(%rbx),%r15
cmpb   $0x0,0x1(%rbx)
cmove  %r14,%r15
test   %r12,%r12
je     1347 <fnqualify+0x187>
mov    (%r12),%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
add    $0x2,%eax
movslq %eax,%rdi
call   10b0 <malloc@plt>
test   %rax,%rax
je     136c <fnqualify+0x1ac>
mov    %rax,%r14
mov    (%r12),%rdx
lea    0xd97(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rcx
jmp    12c5 <fnqualify+0x105>
xor    %r14d,%r14d
xor    %eax,%eax
call   10d0 <dctrl_get_current_dir_name@plt>
test   %rax,%rax
je     136f <fnqualify+0x1af>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <strlen@plt>
movslq %eax,%r14
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
lea    (%r14,%rax,1),%rdi
add    $0x2,%rdi
call   10b0 <malloc@plt>
test   %rax,%rax
je     1350 <fnqualify+0x190>
mov    %rax,%r14
lea    0xd44(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
mov    %rbx,%rcx
call   10c0 <sprintf@plt>
jmp    136f <fnqualify+0x1af>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1070 <strchr@plt>
mov    %rax,%r13
test   %rax,%rax
jne    12f2 <fnqualify+0x132>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rax,%r13
add    %rbx,%r13
mov    %r13,%r15
sub    %rbx,%r15
mov    %r15,%rdi
call   10b0 <malloc@plt>
test   %rax,%rax
je     135a <fnqualify+0x19a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10a0 <memcpy@plt>
movb   $0x0,-0x1(%r15,%rbx,1)
mov    %rbx,%rdi
call   1080 <getpwnam@plt>
mov    %rax,%r12
xor    %r15d,%r15d
cmpb   $0x2f,0x0(%r13)
sete   %r15b
add    %r13,%r15
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r12,%r12
jne    1232 <fnqualify+0x72>
mov    0x2c7a(%rip),%rax
jmp    1361 <fnqualify+0x1a1>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    136c <fnqualify+0x1ac>
mov    0x2c7f(%rip),%rax
mov    (%rax),%eax
mov    0x2c6e(%rip),%rcx
mov    %eax,(%rcx)
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [6 x i8] c"%s/%s\00"
@ENOMEM = global i32 0
@errno = global i32 0
@ENOENT = global i32 0
define i8* @fnqualify(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca %struct.passwd*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i8* %0, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 47
br i1 %20, label %21, label %24
21: ; preds = %1
%22 = load i8*, i8** %3
%23 = call i8* @strdup(i8* %22)
store i8* %23, i8** %2
br label %157
24: ; preds = %1
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 0
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 126
br i1 %29, label %30, label %59
30: ; preds = %24
%31 = call i8* (...) @dctrl_get_current_dir_name()
store i8* %31, i8** %8
%32 = load i8*, i8** %8
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %35
34: ; preds = %30
store i8* null, i8** %2
br label %157
35: ; preds = %30
%36 = load i8*, i8** %8
%37 = call i32 @strlen(i8* %36)
%38 = sext i32 %37 to i64
store i64 %38, i64* %4
%39 = load i64, i64* %4
%40 = add i64 %39, 1
%41 = load i8*, i8** %3
%42 = call i32 @strlen(i8* %41)
%43 = sext i32 %42 to i64
%44 = add i64 %40, %43
%45 = add i64 %44, 1
store i64 %45, i64* %5
%46 = load i64, i64* %5
%47 = call i8* @malloc(i64 %46)
store i8* %47, i8** %9
%48 = load i8*, i8** %9
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %53
50: ; preds = %35
%51 = load i8*, i8** %8
%52 = call i32 @free(i8* %51)
store i8* null, i8** %2
br label %157
53: ; preds = %35
%54 = load i8*, i8** %9
%55 = load i8*, i8** %8
%56 = load i8*, i8** %3
%57 = call i32 @sprintf(i8* %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %55, i8* %56)
%58 = load i8*, i8** %9
store i8* %58, i8** %2
br label %157
59: ; preds = %24
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 1
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 0
br i1 %64, label %71, label %65
65: ; preds = %59
%66 = load i8*, i8** %3
%67 = getelementptr inbounds i8, i8* %66, i64 1
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 47
br i1 %70, label %71, label %86
71: ; preds = %65, %59
%72 = call i32 (...) @getuid()
%73 = call %struct.passwd* @getpwuid(i32 %72)
store %struct.passwd* %73, %struct.passwd** %6
%74 = load i8*, i8** %3
%75 = getelementptr inbounds i8, i8* %74, i64 1
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %71
%80 = load i8*, i8** %3
%81 = getelementptr inbounds i8, i8* %80, i64 1
store i8* %81, i8** %7
br label %85
82: ; preds = %71
%83 = load i8*, i8** %3
%84 = getelementptr inbounds i8, i8* %83, i64 2
store i8* %84, i8** %7
br label %85
85: ; preds = %82, %79
br label %128
86: ; preds = %65
%87 = load i8*, i8** %3
%88 = call i8* @strchr(i8* %87, i8 signext 47)
store i8* %88, i8** %7
%89 = load i8*, i8** %7
%90 = icmp eq i8* %89, null
br i1 %90, label %91, label %94
91: ; preds = %86
%92 = load i8*, i8** %3
%93 = call i8* @strchr(i8* %92, i8 signext 0)
store i8* %93, i8** %7
br label %94
94: ; preds = %91, %86
%95 = load i8*, i8** %7
%96 = load i8*, i8** %3
%97 = ptrtoint i8* %95 to i64
%98 = ptrtoint i8* %96 to i64
%99 = sub i64 %97, %98
store i64 %99, i64* %5
%100 = load i64, i64* %5
%101 = call i8* @malloc(i64 %100)
store i8* %101, i8** %10
%102 = load i8*, i8** %10
%103 = icmp eq i8* %102, null
br i1 %103, label %104, label %106
104: ; preds = %94
%105 = load i32, i32* @ENOMEM
store i32 %105, i32* @errno
store i8* null, i8** %2
br label %157
106: ; preds = %94
%107 = load i8*, i8** %10
%108 = load i8*, i8** %3
%109 = getelementptr inbounds i8, i8* %108, i64 1
%110 = load i64, i64* %5
%111 = call i32 @memcpy(i8* %107, i8* %109, i64 %110)
%112 = load i8*, i8** %10
%113 = load i64, i64* %5
%114 = sub i64 %113, 1
%115 = getelementptr inbounds i8, i8* %112, i64 %114
store i8 0, i8* %115
%116 = load i8*, i8** %10
%117 = call %struct.passwd* @getpwnam(i8* %116)
store %struct.passwd* %117, %struct.passwd** %6
%118 = load i8*, i8** %7
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = icmp eq i32 %120, 47
br i1 %121, label %122, label %125
122: ; preds = %106
%123 = load i8*, i8** %7
%124 = getelementptr inbounds i8, i8* %123, i32 1
store i8* %124, i8** %7
br label %125
125: ; preds = %122, %106
%126 = load i8*, i8** %10
%127 = call i32 @free(i8* %126)
br label %128
128: ; preds = %125, %85
%129 = load %struct.passwd*, %struct.passwd** %6
%130 = icmp eq %struct.passwd* %129, null
br i1 %130, label %131, label %133
131: ; preds = %128
%132 = load i32, i32* @ENOENT
store i32 %132, i32* @errno
store i8* null, i8** %2
br label %157
133: ; preds = %128
%134 = load %struct.passwd*, %struct.passwd** %6
%135 = getelementptr inbounds %struct.passwd, %struct.passwd* %134, i32 0, i32 0
%136 = load i8*, i8** %135
%137 = call i32 @strlen(i8* %136)
%138 = add nsw i32 %137, 1
%139 = load i8*, i8** %7
%140 = call i32 @strlen(i8* %139)
%141 = add nsw i32 %138, %140
%142 = add nsw i32 %141, 1
%143 = sext i32 %142 to i64
store i64 %143, i64* %5
%144 = load i64, i64* %5
%145 = call i8* @malloc(i64 %144)
store i8* %145, i8** %11
%146 = load i8*, i8** %11
%147 = icmp eq i8* %146, null
br i1 %147, label %148, label %149
148: ; preds = %133
store i8* null, i8** %2
br label %157
149: ; preds = %133
%150 = load i8*, i8** %11
%151 = load %struct.passwd*, %struct.passwd** %6
%152 = getelementptr inbounds %struct.passwd, %struct.passwd* %151, i32 0, i32 0
%153 = load i8*, i8** %152
%154 = load i8*, i8** %7
%155 = call i32 @sprintf(i8* %150, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %153, i8* %154)
%156 = load i8*, i8** %11
store i8* %156, i8** %2
br label %157
157: ; preds = %149, %148, %131, %104, %53, %50, %34, %21
%158 = load i8*, i8** %2
ret i8* %158
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [6 x i8] c"%s/%s\00"
@ENOMEM = global i32 0
@errno = global i32 0
@ENOENT = global i32 0
define i8* @fnqualify(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
switch i8 %5, label %8 [
i8 47, label %6
i8 126, label %24
]
6: ; preds = %1
%7 = tail call i8* @strdup(i8* %0)
br label %78
8: ; preds = %1
%9 = tail call i8* (...) @dctrl_get_current_dir_name()
%10 = icmp eq i8* %9, null
br i1 %10, label %78, label %11
11: ; preds = %8
%12 = tail call i32 @strlen(i8* %9)
%13 = sext i32 %12 to i64
%14 = tail call i32 @strlen(i8* %0)
%15 = sext i32 %14 to i64
%16 = add nsw i64 %13, 2
%17 = add nsw i64 %16, %15
%18 = tail call i8* @malloc(i64 %17)
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %22
20: ; preds = %11
%21 = tail call i32 @free(i8* %9)
br label %78
22: ; preds = %11
%23 = tail call i32 @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %0)
br label %78
24: ; preds = %1
%25 = getelementptr inbounds i8, i8* %0, i64 1
%26 = load i8, i8* %25
switch i8 %26, label %34 [
i8 0, label %27
i8 47, label %27
]
27: ; preds = %24, %24
%28 = tail call i32 (...) @getuid()
%29 = tail call %struct.passwd* @getpwuid(i32 %28)
%30 = load i8, i8* %25
%31 = icmp eq i8 %30, 0
%32 = getelementptr inbounds i8, i8* %0, i64 2
%33 = select i1 %31, i8* %25, i8* %32
br label %59
34: ; preds = %24
%35 = tail call i8* @strchr(i8* %0, i8 signext 47)
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = tail call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %0)
%39 = getelementptr i8, i8* %0, i64 %38
br label %40
40: ; preds = %37, %34
%41 = phi i8* [ %39, %37 ], [ %35, %34 ]
%42 = ptrtoint i8* %41 to i64
%43 = ptrtoint i8* %0 to i64
%44 = sub i64 %42, %43
%45 = tail call i8* @malloc(i64 %44)
%46 = icmp eq i8* %45, null
br i1 %46, label %47, label %49
47: ; preds = %40
%48 = load i32, i32* @ENOMEM
store i32 %48, i32* @errno
br label %78
49: ; preds = %40
%50 = tail call i32 @memcpy(i8* %45, i8* %25, i64 %44)
%51 = add i64 %44, -1
%52 = getelementptr inbounds i8, i8* %45, i64 %51
store i8 0, i8* %52
%53 = tail call %struct.passwd* @getpwnam(i8* %45)
%54 = load i8, i8* %41
%55 = icmp eq i8 %54, 47
%56 = zext i1 %55 to i64
%57 = getelementptr i8, i8* %41, i64 %56
%58 = tail call i32 @free(i8* %45)
br label %59
59: ; preds = %49, %27
%60 = phi i8* [ %57, %49 ], [ %33, %27 ]
%61 = phi %struct.passwd* [ %53, %49 ], [ %29, %27 ]
%62 = icmp eq %struct.passwd* %61, null
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = load i32, i32* @ENOENT
store i32 %64, i32* @errno
br label %78
65: ; preds = %59
%66 = getelementptr inbounds %struct.passwd, %struct.passwd* %61, i64 0, i32 0
%67 = load i8*, i8** %66
%68 = tail call i32 @strlen(i8* %67)
%69 = tail call i32 @strlen(i8* %60)
%70 = add i32 %68, 2
%71 = add i32 %70, %69
%72 = sext i32 %71 to i64
%73 = tail call i8* @malloc(i64 %72)
%74 = icmp eq i8* %73, null
br i1 %74, label %78, label %75
75: ; preds = %65
%76 = load i8*, i8** %66
%77 = tail call i32 @sprintf(i8* %73, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %76, i8* %60)
br label %78
78: ; preds = %47, %75, %65, %8, %22, %20, %63, %6
%79 = phi i8* [ %7, %6 ], [ null, %63 ], [ null, %8 ], [ null, %20 ], [ %18, %22 ], [ %73, %75 ], [ null, %65 ], [ null, %47 ]
ret i8* %79
}