#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;
};
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopendir(int);
scalar_t__ fstat(int, struct stat *);
int openat(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ path_add(char *, int, char const *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ readlinkat(int, char const *, char *, int);
int strlen(char *);
int /*<<< orphan*/ xerr(char *);
int /*<<< orphan*/ xerr2(char *, char *);
int /*<<< orphan*/ zip_file(int, char *, int, struct stat *);
void zip_path(int zip, int dirfd, const char *path) {
  static char zpath[2048] = "";
  struct stat st;
  struct dirent *dent;
  char *fname;
  int in, zpathlen;
  char islink;
  DIR *d;
  if (!path || !*path)
    xerr("invalid path.");
  islink = 0;
  readlinkat(dirfd, path, &islink, 1);
  if (islink)
    xerr("symlinks not supported.");
  in = openat(dirfd, path, O_RDONLY);
  zpathlen = strlen(zpath);
  path_add(zpath, 2048, path);
  if (in < 0 || fstat(in, &st)) {
    xerr2(zpath, "could not open");
  }
  if (S_ISREG(st.st_mode)) {
    zip_file(zip, zpath, in, &st);
    close(in);
    goto cleanup;
    zpath[zpathlen] = '\0';
  }
  if (!S_ISDIR(st.st_mode))
    xerr2(zpath, "unexpected file type");
  d = fdopendir(in);
  if (!d)
    xerr2(zpath, "could not open");
  while ((dent = readdir(d))) {
    fname = dent->d_name;
    if (!fname || !*fname)
      xerr2(zpath, "has bad file entry");
    if (fname[0] == '.' &&
        (fname[1] == '\0' || (fname[1] == '.' && fname[2] == '\0'))) {
      continue;
    }
    zip_path(zip, in, fname);
  }
  closedir(d);
cleanup:
  zpath[zpathlen] = '\0';
}


x86 assembly (clang, -O0):
<zip_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     121a <zip_path+0x2a>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1226 <zip_path+0x36>
lea    0xddf(%rip),%rdi
call   10d0 <xerr@plt>
movb   $0x0,-0x31(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x31(%rbp),%rdx
mov    $0x1,%ecx
call   1080 <readlinkat@plt>
cmpb   $0x0,-0x31(%rbp)
je     1255 <zip_path+0x65>
lea    0xdbe(%rip),%rdi
call   10d0 <xerr@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2d85(%rip),%rax
mov    (%rax),%edx
call   1040 <openat@plt>
mov    %eax,-0x2c(%rbp)
lea    0x2e3c(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdx
lea    0x2e29(%rip),%rdi
mov    $0x800,%esi
call   10b0 <path_add@plt>
cmpl   $0x0,-0x2c(%rbp)
jl     12b1 <zip_path+0xc1>
mov    -0x2c(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1110 <fstat@plt>
cmp    $0x0,%rax
je     12c4 <zip_path+0xd4>
lea    0x2df8(%rip),%rdi
lea    0xd67(%rip),%rsi
call   1100 <xerr2@plt>
mov    -0x18(%rbp),%edi
call   1090 <S_ISREG@plt>
cmp    $0x0,%rax
je     12f9 <zip_path+0x109>
mov    -0x4(%rbp),%edi
mov    -0x2c(%rbp),%edx
lea    0x2dcd(%rip),%rsi
lea    -0x18(%rbp),%rcx
call   10e0 <zip_file@plt>
mov    -0x2c(%rbp),%edi
call   1060 <close@plt>
jmp    13fe <zip_path+0x20e>
mov    -0x18(%rbp),%edi
call   1050 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    131d <zip_path+0x12d>
lea    0x2d9f(%rip),%rdi
lea    0xd1d(%rip),%rsi
call   1100 <xerr2@plt>
mov    -0x2c(%rbp),%edi
call   10f0 <fdopendir@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1347 <zip_path+0x157>
lea    0x2d75(%rip),%rdi
lea    0xce4(%rip),%rsi
call   1100 <xerr2@plt>
jmp    134c <zip_path+0x15c>
mov    -0x40(%rbp),%rdi
call   10a0 <readdir@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     13f5 <zip_path+0x205>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1386 <zip_path+0x196>
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1399 <zip_path+0x1a9>
lea    0x2d23(%rip),%rdi
lea    0xcb6(%rip),%rsi
call   1100 <xerr2@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    13e1 <zip_path+0x1f1>
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     13dc <zip_path+0x1ec>
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    13e1 <zip_path+0x1f1>
mov    -0x28(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    13e1 <zip_path+0x1f1>
jmp    134c <zip_path+0x15c>
mov    -0x4(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   10c0 <zip_path@plt>
jmp    134c <zip_path+0x15c>
mov    -0x40(%rbp),%rdi
call   1070 <closedir@plt>
movslq -0x30(%rbp),%rcx
lea    0x2ca7(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zip_path>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%r12d
test   %rdx,%rdx
je     1210 <zip_path+0x20>
cmpb   $0x0,(%rbx)
jne    121c <zip_path+0x2c>
lea    0xde9(%rip),%rdi
call   10d0 <xerr@plt>
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%ecx
call   1080 <readlinkat@plt>
cmpb   $0x0,0xf(%rsp)
je     1248 <zip_path+0x58>
lea    0xdcb(%rip),%rdi
call   10d0 <xerr@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <openat@plt>
mov    %eax,%ebp
lea    0x2e4c(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    $0x800,%esi
mov    %rbx,%rdx
call   10b0 <path_add@plt>
test   %ebp,%ebp
js     1294 <zip_path+0xa4>
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
call   1110 <fstat@plt>
test   %rax,%rax
je     12a7 <zip_path+0xb7>
lea    0x2e15(%rip),%rdi
lea    0xd84(%rip),%rsi
call   1100 <xerr2@plt>
mov    0x10(%rsp),%ebx
mov    %ebx,%edi
call   1090 <S_ISREG@plt>
test   %rax,%rax
je     12d9 <zip_path+0xe9>
lea    0x2df2(%rip),%rsi
lea    0x10(%rsp),%rcx
mov    %r12d,%edi
mov    %ebp,%edx
call   10e0 <zip_file@plt>
mov    %ebp,%edi
call   1060 <close@plt>
jmp    13a7 <zip_path+0x1b7>
mov    %ebx,%edi
call   1050 <S_ISDIR@plt>
test   %eax,%eax
jne    12f7 <zip_path+0x107>
lea    0x2dc5(%rip),%rdi
lea    0xd43(%rip),%rsi
call   1100 <xerr2@plt>
mov    %r15d,0x14(%rsp)
mov    %ebp,%edi
call   10f0 <fdopendir@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    131e <zip_path+0x12e>
lea    0x2d9e(%rip),%rdi
lea    0xd0d(%rip),%rsi
call   1100 <xerr2@plt>
mov    %rbx,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     1393 <zip_path+0x1a3>
lea    0x2d7e(%rip),%r13
lea    0xd11(%rip),%r14
jmp    135a <zip_path+0x16a>
nopl   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   10c0 <zip_path@plt>
mov    %rbx,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     1393 <zip_path+0x1a3>
mov    (%rax),%r15
test   %r15,%r15
je     136a <zip_path+0x17a>
movzbl (%r15),%eax
test   %al,%al
jne    1379 <zip_path+0x189>
mov    %r13,%rdi
mov    %r14,%rsi
call   1100 <xerr2@plt>
movzbl (%r15),%eax
cmp    $0x2e,%al
jne    1340 <zip_path+0x150>
movzbl 0x1(%r15),%eax
test   %al,%al
je     134d <zip_path+0x15d>
cmp    $0x2e,%al
jne    1340 <zip_path+0x150>
cmpb   $0x0,0x2(%r15)
jne    1340 <zip_path+0x150>
jmp    134d <zip_path+0x15d>
mov    %rbx,%rdi
call   1070 <closedir@plt>
lea    0x2d0e(%rip),%r14
mov    0x14(%rsp),%r15d
movslq %r15d,%rax
movb   $0x0,(%rax,%r14,1)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@zip_path.zpath = internal global [2048 x i8] zeroinitializer
@.str = [14 x i8] c"invalid path.\00"
@.str.1 = [24 x i8] c"symlinks not supported.\00"
@O_RDONLY = global i32 0
@.str.2 = [15 x i8] c"could not open\00"
@.str.3 = [21 x i8] c"unexpected file type\00"
@.str.4 = [19 x i8] c"has bad file entry\00"
define void @zip_path(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.stat
%8 = alloca %struct.dirent*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
%13 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %3
%17 = load i8*, i8** %6
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16, %3
%21 = call i32 @xerr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
store i8 0, i8* %12
%23 = load i32, i32* %5
%24 = load i8*, i8** %6
%25 = call i32 @readlinkat(i32 %23, i8* %24, i8* %12, i32 1)
%26 = load i8, i8* %12
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 @xerr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28, %22
%31 = load i32, i32* %5
%32 = load i8*, i8** %6
%33 = load i32, i32* @O_RDONLY
%34 = call i32 @openat(i32 %31, i8* %32, i32 %33)
store i32 %34, i32* %10
%35 = call i32 @strlen(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0))
store i32 %35, i32* %11
%36 = load i8*, i8** %6
%37 = call i32 @path_add(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i32 2048, i8* %36)
%38 = load i32, i32* %10
%39 = icmp slt i32 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %30
%41 = load i32, i32* %10
%42 = call i64 @fstat(i32 %41, %struct.stat* %7)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40, %30
%45 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
%47 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%48 = load i32, i32* %47
%49 = call i64 @S_ISREG(i32 %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %57
51: ; preds = %46
%52 = load i32, i32* %4
%53 = load i32, i32* %10
%54 = call i32 @zip_file(i32 %52, i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i32 %53, %struct.stat* %7)
%55 = load i32, i32* %10
%56 = call i32 @close(i32 %55)
br label %120
57: ; preds = %46
%58 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%59 = load i32, i32* %58
%60 = call i32 @S_ISDIR(i32 %59)
%61 = icmp ne i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %57
%63 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %64
64: ; preds = %62, %57
%65 = load i32, i32* %10
%66 = call i32* @fdopendir(i32 %65)
store i32* %66, i32** %13
%67 = load i32*, i32** %13
%68 = icmp ne i32* %67, null
br i1 %68, label %71, label %69
69: ; preds = %64
%70 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %71
71: ; preds = %69, %64
br label %72
72: ; preds = %113, %112, %71
%73 = load i32*, i32** %13
%74 = call %struct.dirent* @readdir(i32* %73)
store %struct.dirent* %74, %struct.dirent** %8
%75 = icmp ne %struct.dirent* %74, null
br i1 %75, label %76, label %117
76: ; preds = %72
%77 = load %struct.dirent*, %struct.dirent** %8
%78 = getelementptr inbounds %struct.dirent, %struct.dirent* %77, i32 0, i32 0
%79 = load i8*, i8** %78
store i8* %79, i8** %9
%80 = load i8*, i8** %9
%81 = icmp ne i8* %80, null
br i1 %81, label %82, label %86
82: ; preds = %76
%83 = load i8*, i8** %9
%84 = load i8, i8* %83
%85 = icmp ne i8 %84, 0
br i1 %85, label %88, label %86
86: ; preds = %82, %76
%87 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %88
88: ; preds = %86, %82
%89 = load i8*, i8** %9
%90 = getelementptr inbounds i8, i8* %89, i64 0
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 46
br i1 %93, label %94, label %113
94: ; preds = %88
%95 = load i8*, i8** %9
%96 = getelementptr inbounds i8, i8* %95, i64 1
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 0
br i1 %99, label %112, label %100
100: ; preds = %94
%101 = load i8*, i8** %9
%102 = getelementptr inbounds i8, i8* %101, i64 1
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = icmp eq i32 %104, 46
br i1 %105, label %106, label %113
106: ; preds = %100
%107 = load i8*, i8** %9
%108 = getelementptr inbounds i8, i8* %107, i64 2
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 0
br i1 %111, label %112, label %113
112: ; preds = %106, %94
br label %72
113: ; preds = %106, %100, %88
%114 = load i32, i32* %4
%115 = load i32, i32* %10
%116 = load i8*, i8** %9
br label %72
117: ; preds = %72
%118 = load i32*, i32** %13
%119 = call i32 @closedir(i32* %118)
br label %120
120: ; preds = %117, %51
%121 = load i32, i32* %11
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 %122
store i8 0, i8* %123
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@zip_path.zpath = internal global [2048 x i8] zeroinitializer
@.str = [14 x i8] c"invalid path.\00"
@.str.1 = [24 x i8] c"symlinks not supported.\00"
@O_RDONLY = global i32 0
@.str.2 = [15 x i8] c"could not open\00"
@.str.3 = [21 x i8] c"unexpected file type\00"
@.str.4 = [19 x i8] c"has bad file entry\00"
define void @zip_path(i32 %0, i32 %1, i8* %2) {
%4 = alloca %struct.stat
%5 = alloca i8
%6 = bitcast %struct.stat* %4 to i8*
%7 = icmp eq i8* %2, null
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = load i8, i8* %2
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8, %3
%12 = tail call i32 @xerr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
store i8 0, i8* %5
%14 = call i32 @readlinkat(i32 %1, i8* %2, i8* %5, i32 1)
%15 = load i8, i8* %5
%16 = icmp eq i8 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %13
%18 = call i32 @xerr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* @O_RDONLY
%21 = call i32 @openat(i32 %1, i8* %2, i32 %20)
%22 = call i32 @strlen(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0))
%23 = call i32 @path_add(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i32 2048, i8* %2)
%24 = icmp slt i32 %21, 0
br i1 %24, label %28, label %25
25: ; preds = %19
%26 = call i64 @fstat(i32 %21, %struct.stat* %4)
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25, %19
%29 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
%31 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%32 = load i32, i32* %31
%33 = call i64 @S_ISREG(i32 %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %30
%36 = call i32 @zip_file(i32 %0, i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i32 %21, %struct.stat* %4)
%37 = call i32 @close(i32 %21)
br label %78
38: ; preds = %30
%39 = call i32 @S_ISDIR(i32 %32)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %41, %38
%44 = call i32* @fdopendir(i32 %21)
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46, %43
%49 = call %struct.dirent* @readdir(i32* %44)
%50 = icmp eq %struct.dirent* %49, null
br i1 %50, label %76, label %51
51: ; preds = %48, %72
%52 = phi %struct.dirent* [ %73, %72 ], [ %49, %48 ]
%53 = getelementptr inbounds %struct.dirent, %struct.dirent* %52, i64 0, i32 0
%54 = load i8*, i8** %53
%55 = icmp eq i8* %54, null
br i1 %55, label %59, label %56
56: ; preds = %51
%57 = load i8, i8* %54
%58 = icmp eq i8 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %56, %51
%60 = call i32 @xerr2(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%61 = load i8, i8* %54
br label %62
62: ; preds = %59, %56
%63 = phi i8 [ %61, %59 ], [ %57, %56 ]
%64 = icmp eq i8 %63, 46
br i1 %64, label %65, label %75
65: ; preds = %62
%66 = getelementptr inbounds i8, i8* %54, i64 1
%67 = load i8, i8* %66
switch i8 %67, label %75 [
i8 0, label %72
i8 46, label %68
]
68: ; preds = %65
%69 = getelementptr inbounds i8, i8* %54, i64 2
%70 = load i8, i8* %69
%71 = icmp eq i8 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %68, %65, %75
%73 = call %struct.dirent* @readdir(i32* %44)
%74 = icmp eq %struct.dirent* %73, null
br i1 %74, label %76, label %51
75: ; preds = %65, %68, %62
br label %72
76: ; preds = %72, %48
%77 = call i32 @closedir(i32* %44)
br label %78
78: ; preds = %76, %35
%79 = sext i32 %22 to i64
%80 = getelementptr inbounds [2048 x i8], [2048 x i8]* @zip_path.zpath, i64 0, i64 %79
store i8 0, i8* %80
ret void
}