#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_gid;
  int /*<<< orphan*/ st_uid;
  int /*<<< orphan*/ st_mode;
  scalar_t__ st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ W_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ **calloc(int, int);
int /*<<< orphan*/ chmod(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ chown(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
char *dirname(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
scalar_t__ fwrite(char *, int, int, int /*<<< orphan*/ *);
int getBlockSize(char const *);
char *malloc(int);
int /*<<< orphan*/ stat(char const *, struct stat *);
char *strdup(char const *);
int execMultiCopy(const char *src, const char **dst, int tot,
                  int force_blocksize) {
  int blocksize = -1;
  int size;
  int i, j;
  FILE **fdst;
  FILE *fsrc;
  char *buffer;
  unsigned long fileSize;
  struct stat srcStat;
  if (force_blocksize >= 512 && force_blocksize <= (1024 * 1024 * 16)) {
    size = blocksize = force_blocksize;
  } else {
    for (i = 0; i < tot; i++) {
      size = getBlockSize(dst[i]);
      if (blocksize < 0 || size < blocksize) {
        blocksize = size;
      }
    }
  }
  buffer = malloc(blocksize);
  if (buffer == NULL) {
    return -1;
  }
  fsrc = fopen(src, "rb");
  if (fsrc == NULL) {
    free(buffer);
    return -2;
  }
  stat(src, &srcStat);
  fileSize = (unsigned long)srcStat.st_size;
  for (i = 0; i < tot; i++) {
    if (access(dst[i], W_OK) != 0) {
      char *newPath = strdup(dst[i]);
      char *dirName = dirname(newPath);
      if (access(dirName, W_OK) != 0) {
        dirName = NULL;
        free(newPath);
        fclose(fsrc);
        free(buffer);
        return -3;
      }
      dirName = NULL;
      free(newPath);
    }
  }
  fdst = calloc(sizeof(FILE *), tot);
  if (fdst == NULL) {
    fclose(fsrc);
    free(buffer);
    return -1;
  }
  for (i = 0; i < tot; i++) {
    fdst[i] = fopen(dst[i], "wb");
    if (fdst[i] == NULL) {
      for (j = 0; j < i; j++) {
        fclose(fdst[j]);
      }
      fclose(fsrc);
      free(fdst);
      free(buffer);
      return -4;
    }
  }
  int countBytes;
  while (countBytes = fread(buffer, 1, blocksize, fsrc)) {
    fileSize -= countBytes;
    if (ferror(fsrc)) {
      break;
    }
    if (countBytes == 0 && fileSize > 0) {
      countBytes = fileSize;
    }
    for (i = 0; i < tot; i++) {
      if (fwrite(buffer, countBytes, 1, fdst[i]) == 0) {
        for (i = 0; i < tot; i++) {
          fclose(fdst[i]);
        }
        free(fdst);
        fclose(fsrc);
        free(buffer);
        return -5;
      }
    }
    if (feof(fsrc)) {
      break;
    }
  }
  if (!feof(fsrc)) {
    for (i = 0; i < tot; i++) {
      fclose(fdst[i]);
    }
    free(fdst);
    fclose(fsrc);
    free(buffer);
    return -2;
  }
  for (i = 0; i < tot; i++) {
    fclose(fdst[i]);
    chmod(dst[i], srcStat.st_mode);
    chown(dst[i], srcStat.st_uid, srcStat.st_gid);
  }
  free(fdst);
  fclose(fsrc);
  free(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<execMultiCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
cmpl   $0x200,-0x20(%rbp)
jl     1248 <execMultiCopy+0x48>
cmpl   $0x1000000,-0x20(%rbp)
jg     1248 <execMultiCopy+0x48>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    %eax,-0x28(%rbp)
jmp    12a3 <execMultiCopy+0xa3>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    129e <execMultiCopy+0x9e>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <getBlockSize@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1285 <execMultiCopy+0x85>
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    128b <execMultiCopy+0x8b>
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1290 <execMultiCopy+0x90>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    124f <execMultiCopy+0x4f>
jmp    12a3 <execMultiCopy+0xa3>
mov    -0x24(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    12c6 <execMultiCopy+0xc6>
movl   $0xffffffff,-0x4(%rbp)
jmp    16e1 <execMultiCopy+0x4e1>
mov    -0x10(%rbp),%rdi
lea    0xd2f(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    12fa <execMultiCopy+0xfa>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    16e1 <execMultiCopy+0x4e1>
mov    -0x10(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   10b0 <stat@plt>
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13d7 <execMultiCopy+0x1d7>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2cb3(%rip),%rax
mov    (%rax),%esi
call   10f0 <access@plt>
cmp    $0x0,%rax
je     13c4 <execMultiCopy+0x1c4>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1120 <strdup@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rdi
call   1080 <dirname@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
mov    0x2c75(%rip),%rax
mov    (%rax),%esi
call   10f0 <access@plt>
cmp    $0x0,%rax
je     13b3 <execMultiCopy+0x1b3>
movq   $0x0,-0x78(%rbp)
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    16e1 <execMultiCopy+0x4e1>
movq   $0x0,-0x78(%rbp)
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
jmp    13c9 <execMultiCopy+0x1c9>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1316 <execMultiCopy+0x116>
mov    -0x1c(%rbp),%esi
mov    $0x8,%edi
call   1090 <calloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1411 <execMultiCopy+0x211>
mov    -0x40(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    16e1 <execMultiCopy+0x4e1>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14ca <execMultiCopy+0x2ca>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbcc(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,%rdx
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    14b7 <execMultiCopy+0x2b7>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1490 <execMultiCopy+0x290>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <fclose@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1465 <execMultiCopy+0x265>
mov    -0x40(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0xfffffffc,-0x4(%rbp)
jmp    16e1 <execMultiCopy+0x4e1>
jmp    14bc <execMultiCopy+0x2bc>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1418 <execMultiCopy+0x218>
jmp    14cf <execMultiCopy+0x2cf>
mov    -0x48(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x40(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fread@plt>
mov    %eax,-0x7c(%rbp)
cmp    $0x0,%eax
je     15f6 <execMultiCopy+0x3f6>
movslq -0x7c(%rbp),%rcx
mov    -0x50(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     1517 <execMultiCopy+0x317>
jmp    15f6 <execMultiCopy+0x3f6>
cmpl   $0x0,-0x7c(%rbp)
jne    1533 <execMultiCopy+0x333>
cmpq   $0x0,-0x50(%rbp)
jbe    1533 <execMultiCopy+0x333>
mov    -0x50(%rbp),%rax
mov    %eax,-0x7c(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    15d9 <execMultiCopy+0x3d9>
mov    -0x48(%rbp),%rdi
mov    -0x7c(%rbp),%esi
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    $0x1,%edx
call   1110 <fwrite@plt>
cmp    $0x0,%rax
jne    15c6 <execMultiCopy+0x3c6>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    159f <execMultiCopy+0x39f>
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <fclose@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1574 <execMultiCopy+0x374>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0xfffffffb,-0x4(%rbp)
jmp    16e1 <execMultiCopy+0x4e1>
jmp    15cb <execMultiCopy+0x3cb>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    153a <execMultiCopy+0x33a>
mov    -0x40(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%rax
je     15f1 <execMultiCopy+0x3f1>
jmp    15f6 <execMultiCopy+0x3f6>
jmp    14cf <execMultiCopy+0x2cf>
mov    -0x40(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%rax
jne    1662 <execMultiCopy+0x462>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    163b <execMultiCopy+0x43b>
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <fclose@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1610 <execMultiCopy+0x410>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    16e1 <execMultiCopy+0x4e1>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    16bf <execMultiCopy+0x4bf>
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <fclose@plt>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x60(%rbp),%esi
call   10e0 <chmod@plt>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x64(%rbp),%esi
mov    -0x68(%rbp),%edx
call   10d0 <chown@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1669 <execMultiCopy+0x469>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execMultiCopy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,%r13d
mov    %edx,0x4(%rsp)
mov    %rsi,%r12
mov    %rdi,%r14
lea    -0x200(%r13),%eax
cmp    $0xfffe01,%eax
jb     126c <execMultiCopy+0x6c>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1266 <execMultiCopy+0x66>
mov    %eax,%r15d
mov    $0xffffffff,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rdi
call   1060 <getBlockSize@plt>
cmp    %ebp,%eax
mov    %ebp,%r13d
cmovl  %eax,%r13d
test   %ebp,%ebp
cmovs  %eax,%r13d
add    $0x1,%rbx
mov    %r13d,%ebp
cmp    %rbx,%r15
jne    1240 <execMultiCopy+0x40>
jmp    126c <execMultiCopy+0x6c>
mov    $0xffffffff,%r13d
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     1345 <execMultiCopy+0x145>
mov    %r12,%rbp
lea    0xd74(%rip),%rsi
mov    %r14,%rdi
call   1100 <fopen@plt>
mov    $0xfffffffe,%ebx
test   %rax,%rax
je     1577 <execMultiCopy+0x377>
mov    %rax,%r12
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
call   10b0 <stat@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
mov    %r12,0x8(%rsp)
jle    13ab <execMultiCopy+0x1ab>
mov    %ebx,%eax
mov    %rax,0x10(%rsp)
xor    %r15d,%r15d
mov    0x2d14(%rip),%r12
jmp    12eb <execMultiCopy+0xeb>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,0x10(%rsp)
je     134f <execMultiCopy+0x14f>
mov    %rbp,%rbx
mov    0x0(%rbp,%r15,8),%rdi
mov    (%r12),%esi
call   10f0 <access@plt>
test   %rax,%rax
je     12e0 <execMultiCopy+0xe0>
mov    (%rbx,%r15,8),%rdi
call   1120 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1080 <dirname@plt>
mov    (%r12),%esi
mov    %rax,%rdi
call   10f0 <access@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r14,%r14
je     12e0 <execMultiCopy+0xe0>
mov    0x8(%rsp),%rdi
call   1070 <fclose@plt>
mov    $0xfffffffd,%ebx
jmp    1577 <execMultiCopy+0x377>
mov    $0xffffffff,%ebx
jmp    1581 <execMultiCopy+0x381>
mov    $0x8,%edi
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
call   1090 <calloc@plt>
test   %rax,%rax
mov    0x8(%rsp),%r12
je     147e <execMultiCopy+0x27e>
mov    %rax,%r14
test   %ebx,%ebx
jle    13c3 <execMultiCopy+0x1c3>
xor    %ebx,%ebx
lea    0xc86(%rip),%r15
nopl   (%rax)
mov    0x0(%rbp,%rbx,8),%rdi
mov    %r15,%rsi
call   1100 <fopen@plt>
mov    %rax,(%r14,%rbx,8)
test   %rax,%rax
je     1505 <execMultiCopy+0x305>
add    $0x1,%rbx
cmp    %rbx,0x10(%rsp)
jne    1380 <execMultiCopy+0x180>
mov    0x4(%rsp),%ebx
jmp    13c3 <execMultiCopy+0x1c3>
mov    $0x8,%edi
mov    %ebx,%esi
call   1090 <calloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     147e <execMultiCopy+0x27e>
mov    %ebx,%r15d
mov    %r12,%rbx
jmp    13e6 <execMultiCopy+0x1e6>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   10a0 <feof@plt>
test   %rax,%rax
jne    1490 <execMultiCopy+0x290>
mov    0x18(%rsp),%rdi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
test   %eax,%eax
je     1490 <execMultiCopy+0x290>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1040 <ferror@plt>
test   %rax,%rax
jne    1490 <execMultiCopy+0x290>
cmpl   $0x0,0x4(%rsp)
jle    13d0 <execMultiCopy+0x1d0>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rcx
mov    0x18(%rsp),%rdi
mov    %r12d,%esi
mov    $0x1,%edx
call   1110 <fwrite@plt>
test   %rax,%rax
je     1446 <execMultiCopy+0x246>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1420 <execMultiCopy+0x220>
jmp    13d0 <execMultiCopy+0x1d0>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1070 <fclose@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1450 <execMultiCopy+0x250>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1070 <fclose@plt>
mov    $0xfffffffb,%ebx
jmp    1577 <execMultiCopy+0x377>
mov    %r12,%rdi
call   1070 <fclose@plt>
mov    $0xffffffff,%ebx
jmp    1577 <execMultiCopy+0x377>
mov    %rbx,%rdi
call   10a0 <feof@plt>
test   %rax,%rax
je     1539 <execMultiCopy+0x339>
cmpl   $0x0,0x4(%rsp)
jle    14ef <execMultiCopy+0x2ef>
mov    %rbp,%r13
mov    0x28(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x20(%rsp),%r12d
mov    0x24(%rsp),%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
mov    (%r14,%rbp,8),%rdi
call   1070 <fclose@plt>
mov    0x0(%r13,%rbp,8),%rdi
mov    0x10(%rsp),%esi
call   10e0 <chmod@plt>
mov    0x0(%r13,%rbp,8),%rdi
mov    %ebx,%esi
mov    %r12d,%edx
call   10d0 <chown@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    14c0 <execMultiCopy+0x2c0>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1070 <fclose@plt>
xor    %ebx,%ebx
jmp    1577 <execMultiCopy+0x377>
test   %ebx,%ebx
je     1522 <execMultiCopy+0x322>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%rdi
call   1070 <fclose@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1510 <execMultiCopy+0x310>
mov    %r12,%rdi
call   1070 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0xfffffffc,%ebx
jmp    1577 <execMultiCopy+0x377>
mov    %rbx,%r13
cmpl   $0x0,0x4(%rsp)
jle    1562 <execMultiCopy+0x362>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1070 <fclose@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1550 <execMultiCopy+0x350>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1070 <fclose@plt>
mov    $0xfffffffe,%ebx
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i64 }
@.str = [3 x i8] c"rb\00"
@W_OK = global i32 0
@.str.1 = [3 x i8] c"wb\00"
define i32 @execMultiCopy(i8* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32**
%15 = alloca i32*
%16 = alloca i8*
%17 = alloca i64
%18 = alloca %struct.stat
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i32
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 -1, i32* %10
%22 = load i32, i32* %9
%23 = icmp sge i32 %22, 512
br i1 %23, label %24, label %29
24: ; preds = %4
%25 = load i32, i32* %9
%26 = icmp sle i32 %25, 16777216
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = load i32, i32* %9
store i32 %28, i32* %10
store i32 %28, i32* %11
br label %54
29: ; preds = %24, %4
store i32 0, i32* %12
br label %30
30: ; preds = %50, %29
%31 = load i32, i32* %12
%32 = load i32, i32* %8
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %53
34: ; preds = %30
%35 = load i8**, i8*** %7
%36 = load i32, i32* %12
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i32 @getBlockSize(i8* %39)
store i32 %40, i32* %11
%41 = load i32, i32* %10
%42 = icmp slt i32 %41, 0
br i1 %42, label %47, label %43
43: ; preds = %34
%44 = load i32, i32* %11
%45 = load i32, i32* %10
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %49
47: ; preds = %43, %34
%48 = load i32, i32* %11
store i32 %48, i32* %10
br label %49
49: ; preds = %47, %43
br label %50
50: ; preds = %49
%51 = load i32, i32* %12
%52 = add nsw i32 %51, 1
store i32 %52, i32* %12
br label %30
53: ; preds = %30
br label %54
54: ; preds = %53, %27
%55 = load i32, i32* %10
%56 = call i8* @malloc(i32 %55)
store i8* %56, i8** %16
%57 = load i8*, i8** %16
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %60
59: ; preds = %54
store i32 -1, i32* %5
br label %313
60: ; preds = %54
%61 = load i8*, i8** %6
%62 = call i32* @fopen(i8* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %62, i32** %15
%63 = load i32*, i32** %15
%64 = icmp eq i32* %63, null
br i1 %64, label %65, label %68
65: ; preds = %60
%66 = load i8*, i8** %16
%67 = call i32 @free(i8* %66)
store i32 -2, i32* %5
br label %313
68: ; preds = %60
%69 = load i8*, i8** %6
%70 = call i32 @stat(i8* %69, %struct.stat* %18)
%71 = getelementptr inbounds %struct.stat, %struct.stat* %18, i32 0, i32 3
%72 = load i64, i64* %71
store i64 %72, i64* %17
store i32 0, i32* %12
br label %73
73: ; preds = %110, %68
%74 = load i32, i32* %12
%75 = load i32, i32* %8
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %113
77: ; preds = %73
%78 = load i8**, i8*** %7
%79 = load i32, i32* %12
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8*, i8** %78, i64 %80
%82 = load i8*, i8** %81
%83 = load i32, i32* @W_OK
%84 = call i64 @access(i8* %82, i32 %83)
%85 = icmp ne i64 %84, 0
br i1 %85, label %86, label %109
86: ; preds = %77
%87 = load i8**, i8*** %7
%88 = load i32, i32* %12
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8*, i8** %87, i64 %89
%91 = load i8*, i8** %90
%92 = call i8* @strdup(i8* %91)
store i8* %92, i8** %19
%93 = load i8*, i8** %19
%94 = call i8* @dirname(i8* %93)
store i8* %94, i8** %20
%95 = load i8*, i8** %20
%96 = load i32, i32* @W_OK
%97 = call i64 @access(i8* %95, i32 %96)
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %106
99: ; preds = %86
store i8* null, i8** %20
%100 = load i8*, i8** %19
%101 = call i32 @free(i8* %100)
%102 = load i32*, i32** %15
%103 = call i32 @fclose(i32* %102)
%104 = load i8*, i8** %16
%105 = call i32 @free(i8* %104)
store i32 -3, i32* %5
br label %313
106: ; preds = %86
store i8* null, i8** %20
%107 = load i8*, i8** %19
%108 = call i32 @free(i8* %107)
br label %109
109: ; preds = %106, %77
br label %110
110: ; preds = %109
%111 = load i32, i32* %12
%112 = add nsw i32 %111, 1
store i32 %112, i32* %12
br label %73
113: ; preds = %73
%114 = load i32, i32* %8
%115 = call i32** @calloc(i32 8, i32 %114)
store i32** %115, i32*** %14
%116 = load i32**, i32*** %14
%117 = icmp eq i32** %116, null
br i1 %117, label %118, label %123
118: ; preds = %113
%119 = load i32*, i32** %15
%120 = call i32 @fclose(i32* %119)
%121 = load i8*, i8** %16
%122 = call i32 @free(i8* %121)
store i32 -1, i32* %5
br label %313
123: ; preds = %113
store i32 0, i32* %12
br label %124
124: ; preds = %169, %123
%125 = load i32, i32* %12
%126 = load i32, i32* %8
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %172
128: ; preds = %124
%129 = load i8**, i8*** %7
%130 = load i32, i32* %12
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8*, i8** %129, i64 %131
%133 = load i8*, i8** %132
%134 = call i32* @fopen(i8* %133, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%135 = load i32**, i32*** %14
%136 = load i32, i32* %12
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32*, i32** %135, i64 %137
store i32* %134, i32** %138
%139 = load i32**, i32*** %14
%140 = load i32, i32* %12
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i32*, i32** %139, i64 %141
%143 = load i32*, i32** %142
%144 = icmp eq i32* %143, null
br i1 %144, label %145, label %168
145: ; preds = %128
store i32 0, i32* %13
br label %146
146: ; preds = %157, %145
%147 = load i32, i32* %13
%148 = load i32, i32* %12
%149 = icmp slt i32 %147, %148
br i1 %149, label %150, label %160
150: ; preds = %146
%151 = load i32**, i32*** %14
%152 = load i32, i32* %13
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i32*, i32** %151, i64 %153
%155 = load i32*, i32** %154
%156 = call i32 @fclose(i32* %155)
br label %157
157: ; preds = %150
%158 = load i32, i32* %13
%159 = add nsw i32 %158, 1
store i32 %159, i32* %13
br label %146
160: ; preds = %146
%161 = load i32*, i32** %15
%162 = call i32 @fclose(i32* %161)
%163 = load i32**, i32*** %14
%164 = bitcast i32** %163 to i8*
%165 = call i32 @free(i8* %164)
%166 = load i8*, i8** %16
%167 = call i32 @free(i8* %166)
store i32 -4, i32* %5
br label %313
168: ; preds = %128
br label %169
169: ; preds = %168
%170 = load i32, i32* %12
%171 = add nsw i32 %170, 1
store i32 %171, i32* %12
br label %124
172: ; preds = %124
br label %173
173: ; preds = %244, %172
%174 = load i8*, i8** %16
%175 = load i32, i32* %10
%176 = load i32*, i32** %15
%177 = call i32 @fread(i8* %174, i32 1, i32 %175, i32* %176)
store i32 %177, i32* %21
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %245
179: ; preds = %173
%180 = load i32, i32* %21
%181 = sext i32 %180 to i64
%182 = load i64, i64* %17
%183 = sub i64 %182, %181
store i64 %183, i64* %17
%184 = load i32*, i32** %15
%185 = call i64 @ferror(i32* %184)
%186 = icmp ne i64 %185, 0
br i1 %186, label %187, label %188
187: ; preds = %179
br label %245
188: ; preds = %179
%189 = load i32, i32* %21
%190 = icmp eq i32 %189, 0
br i1 %190, label %191, label %197
191: ; preds = %188
%192 = load i64, i64* %17
%193 = icmp ugt i64 %192, 0
br i1 %193, label %194, label %197
194: ; preds = %191
%195 = load i64, i64* %17
%196 = trunc i64 %195 to i32
store i32 %196, i32* %21
br label %197
197: ; preds = %194, %191, %188
store i32 0, i32* %12
br label %198
198: ; preds = %236, %197
%199 = load i32, i32* %12
%200 = load i32, i32* %8
%201 = icmp slt i32 %199, %200
br i1 %201, label %202, label %239
202: ; preds = %198
%203 = load i8*, i8** %16
%204 = load i32, i32* %21
%205 = load i32**, i32*** %14
%206 = load i32, i32* %12
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i32*, i32** %205, i64 %207
%209 = load i32*, i32** %208
%210 = call i64 @fwrite(i8* %203, i32 %204, i32 1, i32* %209)
%211 = icmp eq i64 %210, 0
br i1 %211, label %212, label %235
212: ; preds = %202
store i32 0, i32* %12
br label %213
213: ; preds = %224, %212
%214 = load i32, i32* %12
%215 = load i32, i32* %8
%216 = icmp slt i32 %214, %215
br i1 %216, label %217, label %227
217: ; preds = %213
%218 = load i32**, i32*** %14
%219 = load i32, i32* %12
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i32*, i32** %218, i64 %220
%222 = load i32*, i32** %221
%223 = call i32 @fclose(i32* %222)
br label %224
224: ; preds = %217
%225 = load i32, i32* %12
%226 = add nsw i32 %225, 1
store i32 %226, i32* %12
br label %213
227: ; preds = %213
%228 = load i32**, i32*** %14
%229 = bitcast i32** %228 to i8*
%230 = call i32 @free(i8* %229)
%231 = load i32*, i32** %15
%232 = call i32 @fclose(i32* %231)
%233 = load i8*, i8** %16
%234 = call i32 @free(i8* %233)
store i32 -5, i32* %5
br label %313
235: ; preds = %202
br label %236
236: ; preds = %235
%237 = load i32, i32* %12
%238 = add nsw i32 %237, 1
store i32 %238, i32* %12
br label %198
239: ; preds = %198
%240 = load i32*, i32** %15
%241 = call i64 @feof(i32* %240)
%242 = icmp ne i64 %241, 0
br i1 %242, label %243, label %244
243: ; preds = %239
br label %245
244: ; preds = %239
br label %173
245: ; preds = %243, %187, %173
%246 = load i32*, i32** %15
%247 = call i64 @feof(i32* %246)
%248 = icmp ne i64 %247, 0
br i1 %248, label %272, label %249
249: ; preds = %245
store i32 0, i32* %12
br label %250
250: ; preds = %261, %249
%251 = load i32, i32* %12
%252 = load i32, i32* %8
%253 = icmp slt i32 %251, %252
br i1 %253, label %254, label %264
254: ; preds = %250
%255 = load i32**, i32*** %14
%256 = load i32, i32* %12
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds i32*, i32** %255, i64 %257
%259 = load i32*, i32** %258
%260 = call i32 @fclose(i32* %259)
br label %261
261: ; preds = %254
%262 = load i32, i32* %12
%263 = add nsw i32 %262, 1
store i32 %263, i32* %12
br label %250
264: ; preds = %250
%265 = load i32**, i32*** %14
%266 = bitcast i32** %265 to i8*
%267 = call i32 @free(i8* %266)
%268 = load i32*, i32** %15
%269 = call i32 @fclose(i32* %268)
%270 = load i8*, i8** %16
%271 = call i32 @free(i8* %270)
store i32 -2, i32* %5
br label %313
272: ; preds = %245
store i32 0, i32* %12
br label %273
273: ; preds = %302, %272
%274 = load i32, i32* %12
%275 = load i32, i32* %8
%276 = icmp slt i32 %274, %275
br i1 %276, label %277, label %305
277: ; preds = %273
%278 = load i32**, i32*** %14
%279 = load i32, i32* %12
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds i32*, i32** %278, i64 %280
%282 = load i32*, i32** %281
%283 = call i32 @fclose(i32* %282)
%284 = load i8**, i8*** %7
%285 = load i32, i32* %12
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds i8*, i8** %284, i64 %286
%288 = load i8*, i8** %287
%289 = getelementptr inbounds %struct.stat, %struct.stat* %18, i32 0, i32 2
%290 = load i32, i32* %289
%291 = call i32 @chmod(i8* %288, i32 %290)
%292 = load i8**, i8*** %7
%293 = load i32, i32* %12
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds i8*, i8** %292, i64 %294
%296 = load i8*, i8** %295
%297 = getelementptr inbounds %struct.stat, %struct.stat* %18, i32 0, i32 1
%298 = load i32, i32* %297
%299 = getelementptr inbounds %struct.stat, %struct.stat* %18, i32 0, i32 0
%300 = load i32, i32* %299
%301 = call i32 @chown(i8* %296, i32 %298, i32 %300)
br label %302
302: ; preds = %277
%303 = load i32, i32* %12
%304 = add nsw i32 %303, 1
store i32 %304, i32* %12
br label %273
305: ; preds = %273
%306 = load i32**, i32*** %14
%307 = bitcast i32** %306 to i8*
%308 = call i32 @free(i8* %307)
%309 = load i32*, i32** %15
%310 = call i32 @fclose(i32* %309)
%311 = load i8*, i8** %16
%312 = call i32 @free(i8* %311)
store i32 0, i32* %5
br label %313
313: ; preds = %305, %264, %227, %160, %118, %99, %65, %59
%314 = load i32, i32* %5
ret i32 %314
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i64 }
@.str = [3 x i8] c"rb\00"
@W_OK = global i32 0
@.str.1 = [3 x i8] c"wb\00"
define i32 @execMultiCopy(i8* nocapture %0, i8** nocapture %1, i32 %2, i32 %3) {
%5 = alloca %struct.stat
%6 = bitcast %struct.stat* %5 to i8*
%7 = add i32 %3, -512
%8 = icmp ult i32 %7, 16776705
br i1 %8, label %25, label %9
9: ; preds = %4
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %25
11: ; preds = %9
%12 = zext i32 %2 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %23, %13 ]
%15 = phi i32 [ -1, %11 ], [ %22, %13 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 %14
%17 = load i8*, i8** %16
%18 = tail call i32 @getBlockSize(i8* %17)
%19 = icmp slt i32 %15, 0
%20 = icmp slt i32 %18, %15
%21 = select i1 %19, i1 true, i1 %20
%22 = select i1 %21, i32 %18, i32 %15
%23 = add nuw nsw i64 %14, 1
%24 = icmp eq i64 %23, %12
br i1 %24, label %25, label %13
25: ; preds = %13, %9, %4
%26 = phi i32 [ %3, %4 ], [ -1, %9 ], [ %22, %13 ]
%27 = tail call i8* @malloc(i32 %26)
%28 = icmp eq i8* %27, null
br i1 %28, label %174, label %29
29: ; preds = %25
%30 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %171, label %32
32: ; preds = %29
%33 = call i32 @stat(i8* %0, %struct.stat* %5)
%34 = icmp sgt i32 %2, 0
br i1 %34, label %35, label %60
35: ; preds = %32
%36 = zext i32 %2 to i64
br label %37
37: ; preds = %35, %54
%38 = phi i64 [ 0, %35 ], [ %55, %54 ]
%39 = getelementptr inbounds i8*, i8** %1, i64 %38
%40 = load i8*, i8** %39
%41 = load i32, i32* @W_OK
%42 = tail call i64 @access(i8* %40, i32 %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %54, label %44
44: ; preds = %37
%45 = load i8*, i8** %39
%46 = tail call i8* @strdup(i8* %45)
%47 = tail call i8* @dirname(i8* %46)
%48 = load i32, i32* @W_OK
%49 = tail call i64 @access(i8* %47, i32 %48)
%50 = icmp eq i64 %49, 0
%51 = tail call i32 @free(i8* %46)
br i1 %50, label %54, label %52
52: ; preds = %44
%53 = tail call i32 @fclose(i32* %30)
br label %171
54: ; preds = %44, %37
%55 = add nuw nsw i64 %38, 1
%56 = icmp eq i64 %55, %36
br i1 %56, label %57, label %37
57: ; preds = %54
%58 = tail call i32** @calloc(i32 8, i32 %2)
%59 = icmp eq i32** %58, null
br i1 %59, label %66, label %63
60: ; preds = %32
%61 = tail call i32** @calloc(i32 8, i32 %2)
%62 = icmp eq i32** %61, null
br i1 %62, label %66, label %68
63: ; preds = %57
br i1 %34, label %64, label %68
64: ; preds = %63
%65 = zext i32 %2 to i64
br label %71
66: ; preds = %60, %57
%67 = tail call i32 @fclose(i32* %30)
br label %171
68: ; preds = %94, %60, %63
%69 = phi i32** [ %58, %63 ], [ %61, %60 ], [ %58, %94 ]
%70 = zext i32 %2 to i64
br label %97
71: ; preds = %64, %94
%72 = phi i64 [ 0, %64 ], [ %95, %94 ]
%73 = getelementptr inbounds i8*, i8** %1, i64 %72
%74 = load i8*, i8** %73
%75 = tail call i32* @fopen(i8* %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%76 = getelementptr inbounds i32*, i32** %58, i64 %72
store i32* %75, i32** %76
%77 = icmp eq i32* %75, null
br i1 %77, label %78, label %94
78: ; preds = %71
%79 = trunc i64 %72 to i32
%80 = icmp eq i32 %79, 0
br i1 %80, label %90, label %81
81: ; preds = %78
%82 = and i64 %72, 4294967295
br label %83
83: ; preds = %81, %83
%84 = phi i64 [ 0, %81 ], [ %88, %83 ]
%85 = getelementptr inbounds i32*, i32** %58, i64 %84
%86 = load i32*, i32** %85
%87 = tail call i32 @fclose(i32* %86)
%88 = add nuw nsw i64 %84, 1
%89 = icmp eq i64 %88, %82
br i1 %89, label %90, label %83
90: ; preds = %83, %78
%91 = tail call i32 @fclose(i32* %30)
%92 = bitcast i32** %58 to i8*
%93 = tail call i32 @free(i8* %92)
br label %171
94: ; preds = %71
%95 = add nuw nsw i64 %72, 1
%96 = icmp eq i64 %95, %65
br i1 %96, label %68, label %71
97: ; preds = %68, %126
%98 = tail call i32 @fread(i8* %27, i32 1, i32 %26, i32* %30)
%99 = icmp eq i32 %98, 0
br i1 %99, label %129, label %100
100: ; preds = %97
%101 = tail call i64 @ferror(i32* %30)
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %129
103: ; preds = %100
br i1 %34, label %106, label %126
104: ; preds = %106
%105 = icmp eq i64 %112, %70
br i1 %105, label %126, label %106
106: ; preds = %103, %104
%107 = phi i64 [ %112, %104 ], [ 0, %103 ]
%108 = getelementptr inbounds i32*, i32** %69, i64 %107
%109 = load i32*, i32** %108
%110 = tail call i64 @fwrite(i8* %27, i32 %98, i32 1, i32* %109)
%111 = icmp eq i64 %110, 0
%112 = add nuw nsw i64 %107, 1
br i1 %111, label %113, label %104
113: ; preds = %106
%114 = zext i32 %2 to i64
br label %115
115: ; preds = %113, %115
%116 = phi i64 [ 0, %113 ], [ %120, %115 ]
%117 = getelementptr inbounds i32*, i32** %69, i64 %116
%118 = load i32*, i32** %117
%119 = tail call i32 @fclose(i32* %118)
%120 = add nuw nsw i64 %116, 1
%121 = icmp eq i64 %120, %114
br i1 %121, label %122, label %115
122: ; preds = %115
%123 = bitcast i32** %69 to i8*
%124 = tail call i32 @free(i8* %123)
%125 = tail call i32 @fclose(i32* %30)
br label %171
126: ; preds = %104, %103
%127 = tail call i64 @feof(i32* %30)
%128 = icmp eq i64 %127, 0
br i1 %128, label %97, label %129
129: ; preds = %126, %100, %97
%130 = tail call i64 @feof(i32* %30)
%131 = icmp eq i64 %130, 0
br i1 %131, label %141, label %132
132: ; preds = %129
br i1 %34, label %133, label %167
133: ; preds = %132
%134 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 2
%135 = load i32, i32* %134
%136 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 1
%137 = load i32, i32* %136
%138 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
%139 = load i32, i32* %138
%140 = zext i32 %2 to i64
br label %155
141: ; preds = %129
br i1 %34, label %142, label %151
142: ; preds = %141
%143 = zext i32 %2 to i64
br label %144
144: ; preds = %142, %144
%145 = phi i64 [ 0, %142 ], [ %149, %144 ]
%146 = getelementptr inbounds i32*, i32** %69, i64 %145
%147 = load i32*, i32** %146
%148 = tail call i32 @fclose(i32* %147)
%149 = add nuw nsw i64 %145, 1
%150 = icmp eq i64 %149, %143
br i1 %150, label %151, label %144
151: ; preds = %144, %141
%152 = bitcast i32** %69 to i8*
%153 = tail call i32 @free(i8* %152)
%154 = tail call i32 @fclose(i32* %30)
br label %171
155: ; preds = %133, %155
%156 = phi i64 [ 0, %133 ], [ %165, %155 ]
%157 = getelementptr inbounds i32*, i32** %69, i64 %156
%158 = load i32*, i32** %157
%159 = tail call i32 @fclose(i32* %158)
%160 = getelementptr inbounds i8*, i8** %1, i64 %156
%161 = load i8*, i8** %160
%162 = tail call i32 @chmod(i8* %161, i32 %135)
%163 = load i8*, i8** %160
%164 = tail call i32 @chown(i8* %163, i32 %137, i32 %139)
%165 = add nuw nsw i64 %156, 1
%166 = icmp eq i64 %165, %140
br i1 %166, label %167, label %155
167: ; preds = %155, %132
%168 = bitcast i32** %69 to i8*
%169 = tail call i32 @free(i8* %168)
%170 = tail call i32 @fclose(i32* %30)
br label %171
171: ; preds = %29, %66, %90, %167, %151, %122, %52
%172 = phi i32 [ -5, %122 ], [ -2, %151 ], [ 0, %167 ], [ -4, %90 ], [ -1, %66 ], [ -3, %52 ], [ -2, %29 ]
%173 = tail call i32 @free(i8* %27)
br label %174
174: ; preds = %171, %25
%175 = phi i32 [ -1, %25 ], [ %172, %171 ]
ret i32 %175
}