#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 /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ F_OK;
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ S_ISLNK(int /*<<< orphan*/);
int /*<<< orphan*/ X_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ free(char *);
int lstat(char *, struct stat *);
int /*<<< orphan*/ perror(char *);
int readlink(char *, char *, int);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
char *strrchr(char *, char);
void diagnosePath(const char *path) {
  char *myPath;
  char *slash;
  int rv;
  struct stat sb;
  char buf[BUFSIZ];
  if (!path || !path[0])
    fail("Null pointer or empty string passed to mkdirs()");
  myPath = strdup(path);
  if (!myPath)
    fail("strdup() failed!");
  do {
    rv = lstat(myPath, &sb);
    if (rv < 0) {
      perror(myPath);
    } else if (S_ISLNK(sb.st_mode)) {
      rv = readlink(myPath, buf, sizeof(buf) - 1);
      if (rv < 0) {
        perror("readlink");
        buf[0] = 0;
      } else {
        buf[rv] = 0;
      }
      fprintf(stderr, "%s is a link to %s\n", myPath, buf);
    } else if (S_ISDIR(sb.st_mode)) {
      fprintf(stderr, "%s is a directory\n", myPath);
      rv = access(myPath, X_OK);
      if (rv < 0) {
        fprintf(stderr, "%s: no search permission\n", myPath);
      }
    } else {
      fprintf(stderr, "%s is a file !?!\n", myPath);
      rv = access(myPath, F_OK);
      if (rv < 0) {
        fprintf(stderr, "%s does not exist\n", myPath);
      }
    }
    slash = strrchr(myPath, '/');
    if (!slash)
      slash = strrchr(myPath, '\\');
    if (!slash)
      slash = myPath;
    *slash = 0;
  } while (myPath[0]);
  free(myPath);
}


x86 assembly (clang, -O0):
<diagnosePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x40(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1204 <diagnosePath+0x54>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1210 <diagnosePath+0x60>
lea    0xdf5(%rip),%rdi
call   1060 <fail@plt>
mov    -0x8(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1234 <diagnosePath+0x84>
lea    0xe01(%rip),%rdi
call   1060 <fail@plt>
jmp    1239 <diagnosePath+0x89>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1090 <lstat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1261 <diagnosePath+0xb1>
mov    -0x10(%rbp),%rdi
call   10c0 <perror@plt>
jmp    13af <diagnosePath+0x1ff>
mov    -0x20(%rbp),%edi
call   1040 <S_ISLNK@plt>
cmp    $0x0,%rax
je     12df <diagnosePath+0x12f>
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rdi
sub    $0x1,%rax
mov    %eax,%edx
call   1050 <readlink@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    12af <diagnosePath+0xff>
lea    0xda3(%rip),%rdi
call   10c0 <perror@plt>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
jmp    12bb <diagnosePath+0x10b>
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%rcx
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd77(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    13aa <diagnosePath+0x1fa>
mov    -0x20(%rbp),%edi
call   1070 <S_ISDIR@plt>
cmp    $0x0,%rax
je     134b <diagnosePath+0x19b>
mov    0x2ce0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd59(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2cd1(%rip),%rax
mov    (%rax),%esi
call   10b0 <access@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1346 <diagnosePath+0x196>
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd32(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    13a5 <diagnosePath+0x1f5>
mov    0x2c86(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd2c(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2c4f(%rip),%rax
mov    (%rax),%esi
call   10b0 <access@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    13a0 <diagnosePath+0x1f0>
mov    0x2c4c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd04(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    13a5 <diagnosePath+0x1f5>
jmp    13aa <diagnosePath+0x1fa>
jmp    13af <diagnosePath+0x1ff>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13de <diagnosePath+0x22e>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1080 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13f1 <diagnosePath+0x241>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1239 <diagnosePath+0x89>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diagnosePath>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,-0x38(%rbp)
mov    0x2e01(%rip),%rax
mov    (%rax),%r14d
mov    %rsp,%r15
lea    0xf(%r14),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
test   %rdi,%rdi
je     11ed <diagnosePath+0x3d>
cmpb   $0x0,(%rbx)
jne    11f9 <diagnosePath+0x49>
lea    0xe0c(%rip),%rdi
call   1060 <fail@plt>
mov    %rbx,%rdi
call   10d0 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1215 <diagnosePath+0x65>
lea    0xe20(%rip),%rdi
call   1060 <fail@plt>
add    $0xffffffff,%r14d
mov    0x2db8(%rip),%r12
jmp    1243 <diagnosePath+0x93>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %rax,%rax
cmove  %rbx,%rax
movb   $0x0,(%rax)
cmpb   $0x0,(%rbx)
je     137a <diagnosePath+0x1ca>
mov    %rbx,%rdi
lea    -0x30(%rbp),%rsi
call   1090 <lstat@plt>
test   %eax,%eax
js     1358 <diagnosePath+0x1a8>
mov    -0x30(%rbp),%r13d
mov    %r13d,%edi
call   1040 <S_ISLNK@plt>
test   %rax,%rax
je     12d0 <diagnosePath+0x120>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1050 <readlink@plt>
test   %eax,%eax
js     1365 <diagnosePath+0x1b5>
mov    %eax,%eax
movb   $0x0,(%r15,%rax,1)
mov    (%r12),%edi
lea    0xdba(%rip),%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
test   %rax,%rax
jne    1230 <diagnosePath+0x80>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1080 <strrchr@plt>
jmp    1230 <diagnosePath+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13d,%edi
call   1070 <S_ISDIR@plt>
mov    (%r12),%edi
test   %rax,%rax
je     1314 <diagnosePath+0x164>
lea    0xd76(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2cef(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10b0 <access@plt>
test   %eax,%eax
jns    129d <diagnosePath+0xed>
mov    (%r12),%edi
lea    0xd5f(%rip),%rsi
jmp    1349 <diagnosePath+0x199>
lea    0xd70(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2c94(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10b0 <access@plt>
test   %eax,%eax
jns    129d <diagnosePath+0xed>
mov    (%r12),%edi
lea    0xd54(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    129d <diagnosePath+0xed>
mov    %rbx,%rdi
call   10c0 <perror@plt>
jmp    129d <diagnosePath+0xed>
lea    0xcd5(%rip),%rdi
call   10c0 <perror@plt>
movb   $0x0,(%r15)
jmp    1285 <diagnosePath+0xd5>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@BUFSIZ = global i32 0
@.str = [48 x i8] c"Null pointer or empty string passed to mkdirs()\00"
@.str.1 = [17 x i8] c"strdup() failed!\00"
@.str.2 = [9 x i8] c"readlink\00"
@stderr = global i32 0
@.str.3 = [20 x i8] c"%s is a link to %s\0A\00"
@.str.4 = [19 x i8] c"%s is a directory\0A\00"
@X_OK = global i32 0
@.str.5 = [26 x i8] c"%s: no search permission\0A\00"
@.str.6 = [18 x i8] c"%s is a file !?!\0A\00"
@F_OK = global i32 0
@.str.7 = [19 x i8] c"%s does not exist\0A\00"
define void @diagnosePath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.stat
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %2
%9 = load i32, i32* @BUFSIZ
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %7
%12 = alloca i8, i64 %10
store i64 %10, i64* %8
%13 = load i8*, i8** %2
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %20
15: ; preds = %1
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %15, %1
%21 = call i32 @fail(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %15
%23 = load i8*, i8** %2
%24 = call i8* @strdup(i8* %23)
store i8* %24, i8** %3
%25 = load i8*, i8** %3
%26 = icmp ne i8* %25, null
br i1 %26, label %29, label %27
27: ; preds = %22
%28 = call i32 @fail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %27, %22
br label %30
30: ; preds = %111, %29
%31 = load i8*, i8** %3
%32 = call i32 @lstat(i8* %31, %struct.stat* %6)
store i32 %32, i32* %5
%33 = load i32, i32* %5
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %30
%36 = load i8*, i8** %3
%37 = call i32 @perror(i8* %36)
br label %96
38: ; preds = %30
%39 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%40 = load i32, i32* %39
%41 = call i64 @S_ISLNK(i32 %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %61
43: ; preds = %38
%44 = load i8*, i8** %3
%45 = sub i64 %10, 1
%46 = trunc i64 %45 to i32
%47 = call i32 @readlink(i8* %44, i8* %12, i32 %46)
store i32 %47, i32* %5
%48 = load i32, i32* %5
%49 = icmp slt i32 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %43
%51 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%52 = getelementptr inbounds i8, i8* %12, i64 0
store i8 0, i8* %52
br label %57
53: ; preds = %43
%54 = load i32, i32* %5
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %12, i64 %55
store i8 0, i8* %56
br label %57
57: ; preds = %53, %50
%58 = load i32, i32* @stderr
%59 = load i8*, i8** %3
%60 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %59, i8* %12)
br label %95
61: ; preds = %38
%62 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%63 = load i32, i32* %62
%64 = call i64 @S_ISDIR(i32 %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %80
66: ; preds = %61
%67 = load i32, i32* @stderr
%68 = load i8*, i8** %3
%69 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %68)
%70 = load i8*, i8** %3
%71 = load i32, i32* @X_OK
%72 = call i32 @access(i8* %70, i32 %71)
store i32 %72, i32* %5
%73 = load i32, i32* %5
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %66
%76 = load i32, i32* @stderr
%77 = load i8*, i8** %3
%78 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %77)
br label %79
79: ; preds = %75, %66
br label %94
80: ; preds = %61
%81 = load i32, i32* @stderr
%82 = load i8*, i8** %3
%83 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %82)
%84 = load i8*, i8** %3
%85 = load i32, i32* @F_OK
%86 = call i32 @access(i8* %84, i32 %85)
store i32 %86, i32* %5
%87 = load i32, i32* %5
%88 = icmp slt i32 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %80
%90 = load i32, i32* @stderr
%91 = load i8*, i8** %3
%92 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %91)
br label %93
93: ; preds = %89, %80
br label %94
94: ; preds = %93, %79
br label %95
95: ; preds = %94, %57
br label %96
96: ; preds = %95, %35
%97 = load i8*, i8** %3
%98 = call i8* @strrchr(i8* %97, i8 signext 47)
store i8* %98, i8** %4
%99 = load i8*, i8** %4
%100 = icmp ne i8* %99, null
br i1 %100, label %104, label %101
101: ; preds = %96
%102 = load i8*, i8** %3
%103 = call i8* @strrchr(i8* %102, i8 signext 92)
store i8* %103, i8** %4
br label %104
104: ; preds = %101, %96
%105 = load i8*, i8** %4
%106 = icmp ne i8* %105, null
br i1 %106, label %109, label %107
107: ; preds = %104
%108 = load i8*, i8** %3
store i8* %108, i8** %4
br label %109
109: ; preds = %107, %104
%110 = load i8*, i8** %4
store i8 0, i8* %110
br label %111
111: ; preds = %109
%112 = load i8*, i8** %3
%113 = getelementptr inbounds i8, i8* %112, i64 0
%114 = load i8, i8* %113
%115 = icmp ne i8 %114, 0
br i1 %115, label %30, label %116
116: ; preds = %111
%117 = load i8*, i8** %3
%118 = call i32 @free(i8* %117)
%119 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@BUFSIZ = global i32 0
@.str = [48 x i8] c"Null pointer or empty string passed to mkdirs()\00"
@.str.1 = [17 x i8] c"strdup() failed!\00"
@.str.2 = [9 x i8] c"readlink\00"
@stderr = global i32 0
@.str.3 = [20 x i8] c"%s is a link to %s\0A\00"
@.str.4 = [19 x i8] c"%s is a directory\0A\00"
@X_OK = global i32 0
@.str.5 = [26 x i8] c"%s: no search permission\0A\00"
@.str.6 = [18 x i8] c"%s is a file !?!\0A\00"
@F_OK = global i32 0
@.str.7 = [19 x i8] c"%s does not exist\0A\00"
define void @diagnosePath(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = load i32, i32* @BUFSIZ
%5 = zext i32 %4 to i64
%6 = tail call i8* @llvm.stacksave()
%7 = alloca i8, i64 %5
%8 = icmp eq i8* %0, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9, %1
%13 = tail call i32 @fail(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = tail call i8* @strdup(i8* %0)
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = tail call i32 @fail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%21 = add i32 %4, -1
br label %22
22: ; preds = %67, %19
%23 = call i32 @lstat(i8* %15, %struct.stat* %2)
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @perror(i8* %15)
br label %62
27: ; preds = %22
%28 = load i32, i32* %20
%29 = call i64 @S_ISLNK(i32 %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %42, label %31
31: ; preds = %27
%32 = call i32 @readlink(i8* %15, i8* %7, i32 %21)
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i8 0, i8* %7
br label %39
36: ; preds = %31
%37 = zext i32 %32 to i64
%38 = getelementptr inbounds i8, i8* %7, i64 %37
store i8 0, i8* %38
br label %39
39: ; preds = %36, %34
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %15, i8* %7)
br label %62
42: ; preds = %27
%43 = call i64 @S_ISDIR(i32 %28)
%44 = icmp eq i64 %43, 0
%45 = load i32, i32* @stderr
br i1 %44, label %54, label %46
46: ; preds = %42
%47 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%48 = load i32, i32* @X_OK
%49 = call i32 @access(i8* %15, i32 %48)
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %62
51: ; preds = %46
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %15)
br label %62
54: ; preds = %42
%55 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %15)
%56 = load i32, i32* @F_OK
%57 = call i32 @access(i8* %15, i32 %56)
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %54
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %15)
br label %62
62: ; preds = %39, %54, %59, %46, %51, %25
%63 = call i8* @strrchr(i8* dereferenceable(1) %15, i8 signext 47)
%64 = icmp eq i8* %63, null
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i8* @strrchr(i8* dereferenceable(1) %15, i8 signext 92)
br label %67
67: ; preds = %65, %62
%68 = phi i8* [ %63, %62 ], [ %66, %65 ]
%69 = icmp eq i8* %68, null
%70 = select i1 %69, i8* %15, i8* %68
store i8 0, i8* %70
%71 = load i8, i8* %15
%72 = icmp eq i8 %71, 0
br i1 %72, label %73, label %22
73: ; preds = %67
%74 = call i32 @free(i8* %15)
ret void
}