#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*/ O_RDONLY;
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ mkdir(char *, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, char *, int);
int read_entry(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strrchr(char *, char);
int main(int argc, char *argv[]) {
  int fd_in;
  char buf[16];
  int size, pos = 0, counter = 0;
  if (argc < 2) {
    printf("Usage: %s input.slv [destination]\n", argv[0]);
    exit(1);
  }
  fd_in = open(argv[1], O_RDONLY);
  if (fd_in < 0) {
    perror("error opening file");
    exit(1);
  }
  read(fd_in, buf, 12);
  if ((buf[0] != 'D') && (buf[1] != 'A') && (buf[2] != 'T') &&
      (buf[3] != 'A')) {
    printf("Invalid file\n");
    close(fd_in);
    exit(1);
  }
  size = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7];
  printf("size: %d\n", size);
  if (argc > 2) {
    mkdir(argv[2], 0777);
    chdir(argv[2]);
    printf("directory: %s\n", argv[2]);
  } else {
    if (strrchr(argv[1], '/'))
      strncpy(buf, strrchr(argv[1], '/') + 1, 16);
    else
      strncpy(buf, argv[1], 16);
    if (strrchr(buf, '.')) {
      char *loc = strrchr(buf, '.');
      *loc = 0;
    }
    mkdir(buf, 0777);
    chdir(buf);
    printf("directory: %s\n", buf);
  }
  while (pos < size) {
    int tmp = read_entry(fd_in);
    if (tmp == -1)
      break;
    pos += tmp;
    counter++;
  }
  printf("extracted %d items\n", counter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11fd <main+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2ddc(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1236 <main+0x86>
lea    0xdfc(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xc,%edx
call   10a0 <read@plt>
movsbl -0x30(%rbp),%eax
cmp    $0x44,%eax
je     129b <main+0xeb>
movsbl -0x2f(%rbp),%eax
cmp    $0x41,%eax
je     129b <main+0xeb>
movsbl -0x2e(%rbp),%eax
cmp    $0x54,%eax
je     129b <main+0xeb>
movsbl -0x2d(%rbp),%eax
cmp    $0x41,%eax
je     129b <main+0xeb>
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movsbl -0x2c(%rbp),%eax
shl    $0x18,%eax
movsbl -0x2b(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movsbl -0x2a(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movsbl -0x29(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jle    1312 <main+0x162>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x1ff,%esi
call   1040 <mkdir@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <chdir@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    13d2 <main+0x222>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
cmp    $0x0,%rax
je     1362 <main+0x1b2>
lea    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    -0x58(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
jmp    1378 <main+0x1c8>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
cmp    $0x0,%rax
je     13a9 <main+0x1f9>
lea    -0x30(%rbp),%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x30(%rbp),%rdi
mov    $0x1ff,%esi
call   1040 <mkdir@plt>
lea    -0x30(%rbp),%rdi
call   1050 <chdir@plt>
lea    -0x30(%rbp),%rsi
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    13d7 <main+0x227>
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1414 <main+0x264>
mov    -0x14(%rbp),%edi
call   1060 <read_entry@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0xffffffff,-0x4c(%rbp)
jne    13fd <main+0x24d>
jmp    1414 <main+0x264>
mov    -0x4c(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13d7 <main+0x227>
mov    -0x3c(%rbp),%esi
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
cmp    $0x1,%edi
jle    133a <main+0x17a>
mov    %edi,%r15d
mov    0x8(%r14),%rdi
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
test   %eax,%eax
js     1355 <main+0x195>
mov    %eax,%r12d
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0xc,%edx
call   10b0 <read@plt>
movdqa (%rsp),%xmm0
pcmpeqb 0xdea(%rip),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%eax
test   %eax,%eax
je     136b <main+0x1ab>
mov    0x4(%rsp),%eax
shl    $0x18,%eax
movsbl 0x5(%rsp),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movsbl 0x6(%rsp),%eax
shl    $0x8,%eax
movsbl 0x7(%rsp),%r13d
or     %eax,%r13d
or     %ecx,%r13d
lea    0xdf1(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
cmp    $0x3,%r15d
jb     1289 <main+0xc9>
mov    0x10(%r14),%rdi
mov    $0x1ff,%esi
call   1040 <mkdir@plt>
mov    0x10(%r14),%rdi
call   1060 <chdir@plt>
mov    0x10(%r14),%rsi
lea    0xdc9(%rip),%rdi
jmp    12f2 <main+0x132>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
test   %rax,%rax
je     12ab <main+0xeb>
add    $0x1,%rax
mov    %rsp,%rdi
mov    %rax,%rsi
jmp    12b1 <main+0xf1>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    %rsp,%rdi
mov    $0x2e,%esi
call   1090 <strrchr@plt>
test   %rax,%rax
je     12d0 <main+0x110>
movb   $0x0,(%rax)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1ff,%esi
call   1040 <mkdir@plt>
mov    %rbx,%rdi
call   1060 <chdir@plt>
lea    0xd61(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %ecx,%ecx
xor    %ebp,%ebp
nopl   (%rax)
mov    %ecx,%ebx
cmp    %r13d,%ebp
jge    1319 <main+0x159>
mov    %r12d,%edi
call   1070 <read_entry@plt>
add    %eax,%ebp
lea    0x1(%rbx),%ecx
cmp    $0xffffffff,%eax
jne    1300 <main+0x140>
lea    0xd3f(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r14),%rsi
lea    0xccc(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xcd7(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xd01(%rip),%rdi
call   1050 <puts@plt>
mov    %r12d,%edi
call   10a0 <close@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: %s input.slv [destination]\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [19 x i8] c"error opening file\00"
@.str.2 = [14 x i8] c"Invalid file\0A\00"
@.str.3 = [10 x i8] c"size: %d\0A\00"
@.str.4 = [15 x i8] c"directory: %s\0A\00"
@.str.5 = [20 x i8] c"extracted %d items\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [16 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %10
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i32, i32* @O_RDONLY
%26 = call i32 @open(i8* %24, i32 %25)
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %21
%30 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %21
%33 = load i32, i32* %6
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%35 = call i32 @read(i32 %33, i8* %34, i32 12)
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 68
br i1 %39, label %40, label %60
40: ; preds = %32
%41 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 1
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 65
br i1 %44, label %45, label %60
45: ; preds = %40
%46 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 2
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 84
br i1 %49, label %50, label %60
50: ; preds = %45
%51 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 3
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 65
br i1 %54, label %55, label %60
55: ; preds = %50
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%57 = load i32, i32* %6
%58 = call i32 @close(i32 %57)
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %50, %45, %40, %32
%61 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 4
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = shl i32 %63, 24
%65 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 5
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = shl i32 %67, 16
%69 = or i32 %64, %68
%70 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 6
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = shl i32 %72, 8
%74 = or i32 %69, %73
%75 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 7
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = or i32 %74, %77
store i32 %78, i32* %8
%79 = load i32, i32* %8
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %79)
%81 = load i32, i32* %4
%82 = icmp sgt i32 %81, 2
br i1 %82, label %83, label %96
83: ; preds = %60
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 2
%86 = load i8*, i8** %85
%87 = call i32 @mkdir(i8* %86, i32 511)
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 2
%90 = load i8*, i8** %89
%91 = call i32 @chdir(i8* %90)
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 2
%94 = load i8*, i8** %93
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %94)
br label %131
96: ; preds = %60
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 1
%99 = load i8*, i8** %98
%100 = call i8* @strrchr(i8* %99, i8 signext 47)
%101 = icmp ne i8* %100, null
br i1 %101, label %102, label %110
102: ; preds = %96
%103 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%104 = load i8**, i8*** %5
%105 = getelementptr inbounds i8*, i8** %104, i64 1
%106 = load i8*, i8** %105
%107 = call i8* @strrchr(i8* %106, i8 signext 47)
%108 = getelementptr inbounds i8, i8* %107, i64 1
%109 = call i32 @strncpy(i8* %103, i8* %108, i32 16)
br label %116
110: ; preds = %96
%111 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%112 = load i8**, i8*** %5
%113 = getelementptr inbounds i8*, i8** %112, i64 1
%114 = load i8*, i8** %113
%115 = call i32 @strncpy(i8* %111, i8* %114, i32 16)
br label %116
116: ; preds = %110, %102
%117 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%118 = call i8* @strrchr(i8* %117, i8 signext 46)
%119 = icmp ne i8* %118, null
br i1 %119, label %120, label %124
120: ; preds = %116
%121 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%122 = call i8* @strrchr(i8* %121, i8 signext 46)
store i8* %122, i8** %11
%123 = load i8*, i8** %11
store i8 0, i8* %123
br label %124
124: ; preds = %120, %116
%125 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%126 = call i32 @mkdir(i8* %125, i32 511)
%127 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%128 = call i32 @chdir(i8* %127)
%129 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %129)
br label %131
131: ; preds = %124, %83
br label %132
132: ; preds = %142, %131
%133 = load i32, i32* %9
%134 = load i32, i32* %8
%135 = icmp slt i32 %133, %134
br i1 %135, label %136, label %148
136: ; preds = %132
%137 = load i32, i32* %6
%138 = call i32 @read_entry(i32 %137)
store i32 %138, i32* %12
%139 = load i32, i32* %12
%140 = icmp eq i32 %139, -1
br i1 %140, label %141, label %142
141: ; preds = %136
br label %148
142: ; preds = %136
%143 = load i32, i32* %12
%144 = load i32, i32* %9
%145 = add nsw i32 %144, %143
store i32 %145, i32* %9
%146 = load i32, i32* %10
%147 = add nsw i32 %146, 1
store i32 %147, i32* %10
br label %132
148: ; preds = %141, %132
%149 = load i32, i32* %10
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %149)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: %s input.slv [destination]\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [19 x i8] c"error opening file\00"
@.str.3 = [10 x i8] c"size: %d\0A\00"
@.str.4 = [15 x i8] c"directory: %s\0A\00"
@.str.5 = [20 x i8] c"extracted %d items\0A\00"
@str = [13 x i8] c"Invalid file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i32, i32* @O_RDONLY
%14 = tail call i32 @open(i8* %12, i32 %13)
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %10
%20 = call i32 @read(i32 %14, i8* %4, i32 12)
%21 = bitcast [16 x i8]* %3 to <4 x i8>*
%22 = load <4 x i8>, <4 x i8>* %21
%23 = freeze <4 x i8> %22
%24 = icmp eq <4 x i8> %23, <i8 68, i8 65, i8 84, i8 65>
%25 = bitcast <4 x i1> %24 to i4
%26 = icmp eq i4 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %19
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%29 = tail call i32 @close(i32 %14)
%30 = tail call i32 @exit(i32 1)
unreachable
31: ; preds = %19
%32 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = shl nuw i32 %34, 24
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 5
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = shl nsw i32 %38, 16
%40 = or i32 %39, %35
%41 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 6
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = shl nsw i32 %43, 8
%45 = or i32 %40, %44
%46 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 7
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = or i32 %45, %48
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %49)
%51 = icmp ugt i32 %0, 2
br i1 %51, label %52, label %60
52: ; preds = %31
%53 = getelementptr inbounds i8*, i8** %1, i64 2
%54 = load i8*, i8** %53
%55 = tail call i32 @mkdir(i8* %54, i32 511)
%56 = load i8*, i8** %53
%57 = tail call i32 @chdir(i8* %56)
%58 = load i8*, i8** %53
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %58)
br label %77
60: ; preds = %31
%61 = load i8*, i8** %11
%62 = tail call i8* @strrchr(i8* dereferenceable(1) %61, i8 signext 47)
%63 = icmp eq i8* %62, null
br i1 %63, label %67, label %64
64: ; preds = %60
%65 = getelementptr inbounds i8, i8* %62, i64 1
%66 = call i32 @strncpy(i8* %4, i8* %65, i32 16)
br label %69
67: ; preds = %60
%68 = call i32 @strncpy(i8* %4, i8* %61, i32 16)
br label %69
69: ; preds = %67, %64
%70 = call i8* @strrchr(i8* %4, i8 signext 46)
%71 = icmp eq i8* %70, null
br i1 %71, label %73, label %72
72: ; preds = %69
store i8 0, i8* %70
br label %73
73: ; preds = %72, %69
%74 = call i32 @mkdir(i8* %4, i32 511)
%75 = call i32 @chdir(i8* %4)
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %4)
br label %77
77: ; preds = %73, %52
br label %78
78: ; preds = %77, %82
%79 = phi i32 [ %86, %82 ], [ 0, %77 ]
%80 = phi i32 [ %85, %82 ], [ 0, %77 ]
%81 = icmp slt i32 %80, %49
br i1 %81, label %82, label %87
82: ; preds = %78
%83 = call i32 @read_entry(i32 %14)
%84 = icmp eq i32 %83, -1
%85 = add nsw i32 %83, %80
%86 = add nuw nsw i32 %79, 1
br i1 %84, label %87, label %78
87: ; preds = %82, %78
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %79)
ret i32 0
}