#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 */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(int, char **);
int main(int argc, char *argv[]) {
  int bytes[] = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
  int n_files = 11;
  int8_t data[22];
  int domain_dimension = 4800 * 4800;
  int i, j;
  FILE *in_files[11];
  FILE *out_file;
  int seek;
  if (argc != (11 + 2)) {
    usage(argc, argv);
    return 1;
  }
  out_file = fopen(argv[11 + 1], "wb");
  if (out_file == NULL) {
    fprintf(stderr, "Was not possible to create output file '%s'\n",
            argv[11 + 1]);
    return 2;
  }
  for (i = 0; i < 11; ++i) {
    in_files[i] = fopen(argv[i + 1], "rb");
    if (in_files[i] == NULL) {
      fprintf(stderr, "Was not possible to open input file '%s'\n",
              argv[i + 1]);
      for (j = i - 1; j >= 0; --j) {
        fprintf(stderr, "Closing file #%d\n", j);
        fclose(in_files[j]);
      }
      return 3;
    }
  }
  for (i = 0; i < domain_dimension; ++i) {
    seek = 0;
    for (j = 0; j < 11; ++j) {
      if (fread(&data[seek], sizeof(int8_t), bytes[j], in_files[j]) !=
          bytes[j]) {
        fprintf(stderr, "Error while reading file %s. ", argv[j + 1]);
      }
      seek += bytes[j];
    }
    fwrite(&data[0], sizeof(int8_t), 22, out_file);
  }
  fclose(out_file);
  for (i = 0; i < n_files; ++i) {
    fclose(in_files[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe6c(%rip),%rsi
mov    $0x2c,%edx
call   1060 <memcpy@plt>
movl   $0xb,-0x44(%rbp)
movl   $0x15f9000,-0xa4(%rbp)
90 5f 01
cmpl   $0xd,-0x8(%rbp)
je     11d1 <main+0x61>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1497 <main+0x327>
mov    -0x10(%rbp),%rax
mov    0x60(%rax),%rdi
lea    0xe4c(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
jne    1225 <main+0xb5>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x60(%rax),%rdx
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1497 <main+0x327>
movl   $0x0,-0xa8(%rbp)
cmpl   $0xb,-0xa8(%rbp)
jge    1335 <main+0x1c5>
mov    -0x10(%rbp),%rax
mov    -0xa8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe05(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rcx
movslq -0xa8(%rbp),%rax
mov    %rcx,-0x110(%rbp,%rax,8)
ff
movslq -0xa8(%rbp),%rax
cmpq   $0x0,-0x110(%rbp,%rax,8)
jne    131c <main+0x1ac>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0xa8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xdb7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xa8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xac(%rbp)
cmpl   $0x0,-0xac(%rbp)
jl     1310 <main+0x1a0>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
mov    -0xac(%rbp),%edx
lea    0xda8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movslq -0xac(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rdi
ff
call   1040 <fclose@plt>
mov    -0xac(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xac(%rbp)
jmp    12be <main+0x14e>
movl   $0x3,-0x4(%rbp)
jmp    1497 <main+0x327>
jmp    1321 <main+0x1b1>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    122f <main+0xbf>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    1443 <main+0x2d3>
movl   $0x0,-0x11c(%rbp)
movl   $0x0,-0xac(%rbp)
cmpl   $0xb,-0xac(%rbp)
jge    1412 <main+0x2a2>
movslq -0x11c(%rbp),%rax
lea    -0xa0(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
movslq -0xac(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
movslq -0xac(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rcx
ff
mov    $0x4,%esi
call   1030 <fread@plt>
movslq -0xac(%rbp),%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
je     13e7 <main+0x277>
mov    0x2c1d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0xac(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcbb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movslq -0xac(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
add    -0x11c(%rbp),%eax
mov    %eax,-0x11c(%rbp)
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    1365 <main+0x1f5>
lea    -0xa0(%rbp),%rdi
mov    -0x118(%rbp),%rcx
mov    $0x4,%esi
mov    $0x16,%edx
call   1090 <fwrite@plt>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    133f <main+0x1cf>
mov    -0x118(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    1490 <main+0x320>
movslq -0xa8(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rdi
ff
call   1040 <fclose@plt>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    1459 <main+0x2e9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %rsi,%rbx
cmp    $0xd,%edi
jne    1333 <main+0x1d3>
mov    0x60(%rbx),%rdi
lea    0xea4(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1346 <main+0x1e6>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
lea    0xeb8(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
je     136c <main+0x20c>
mov    0x10(%rbx),%rdi
lea    0xe9a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x48(%rsp)
test   %rax,%rax
je     137b <main+0x21b>
mov    0x18(%rbx),%rdi
lea    0xe7c(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x50(%rsp)
test   %rax,%rax
je     1425 <main+0x2c5>
mov    0x20(%rbx),%rdi
lea    0xe5e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x58(%rsp)
test   %rax,%rax
je     1437 <main+0x2d7>
mov    0x28(%rbx),%rdi
lea    0xe40(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x60(%rsp)
test   %rax,%rax
je     1449 <main+0x2e9>
mov    0x30(%rbx),%rdi
lea    0xe22(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x68(%rsp)
test   %rax,%rax
je     145b <main+0x2fb>
mov    %rax,%rbp
mov    0x38(%rbx),%rdi
lea    0xe01(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x70(%rsp)
test   %rax,%rax
je     146d <main+0x30d>
mov    %rax,%r15
mov    0x40(%rbx),%rdi
lea    0xde0(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x78(%rsp)
test   %rax,%rax
je     147f <main+0x31f>
mov    %rax,%r13
mov    0x48(%rbx),%rdi
lea    0xdbf(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x80(%rsp)
test   %rax,%rax
je     1491 <main+0x331>
mov    %rax,%r12
mov    0x50(%rbx),%rdi
lea    0xd9b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x88(%rsp)
test   %rax,%rax
je     1521 <main+0x3c1>
mov    %rax,0x28(%rsp)
mov    %r12,0x30(%rsp)
mov    0x58(%rbx),%rdi
lea    0xd70(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x90(%rsp)
xor    %r12d,%r12d
test   %rax,%rax
je     1530 <main+0x3d0>
mov    %rax,0x8(%rsp)
mov    %r13,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %rbp,0x20(%rsp)
lea    0xce0(%rip),%rbp
lea    0xd74(%rip),%r13
xor    %eax,%eax
mov    %r14,0x38(%rsp)
jmp    13be <main+0x25e>
mov    %rbx,%rsi
call   1060 <usage@plt>
mov    $0x1,%r14d
jmp    159a <main+0x43a>
mov    0x2c93(%rip),%rax
mov    (%rax),%edi
mov    0x60(%rbx),%rdx
lea    0xcd5(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x2,%r14d
jmp    159a <main+0x43a>
mov    $0x1,%r12b
mov    $0x1,%eax
xor    %ebp,%ebp
jmp    153a <main+0x3da>
mov    $0x1,%ebp
mov    $0x2,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
lea    0xa0(%rsp),%rdi
mov    $0x4,%esi
mov    $0x16,%edx
mov    0x38(%rsp),%r14
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    0x4(%rsp),%eax
add    $0x1,%eax
cmp    $0x15f9000,%eax
je     14a3 <main+0x343>
mov    %eax,0x4(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    13f5 <main+0x295>
nopw   0x0(%rax,%rax,1)
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx,%r14,8),%rdx
add    $0x1,%r14
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    %r12d,%r15d
cmp    $0xb,%r14
je     138d <main+0x22d>
movslq %r15d,%rax
lea    (%rsp,%rax,4),%rdi
add    $0xa0,%rdi
mov    0x0(%rbp,%r14,4),%r12d
mov    0x40(%rsp,%r14,8),%rcx
mov    $0x4,%esi
mov    %r12d,%edx
call   1030 <fread@plt>
cmp    %r12d,%eax
jne    13d0 <main+0x270>
add    $0x1,%r14
jmp    13ec <main+0x28c>
mov    $0x2,%ebp
mov    $0x3,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    $0x3,%ebp
mov    $0x4,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    $0x4,%ebp
mov    $0x5,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    $0x5,%ebp
mov    $0x6,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    $0x6,%ebp
mov    $0x7,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    $0x7,%ebp
mov    $0x8,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    $0x8,%ebp
mov    $0x9,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x40(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x48(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x50(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x58(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x60(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x30(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x28(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1040 <fclose@plt>
xor    %r14d,%r14d
jmp    159a <main+0x43a>
mov    $0x9,%ebp
mov    $0xa,%eax
xor    %r12d,%r12d
jmp    153a <main+0x3da>
mov    $0xa,%ebp
mov    $0xb,%eax
mov    0x2a9f(%rip),%r15
mov    (%r15),%edi
mov    (%rbx,%rax,8),%rdx
lea    0xb10(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x3,%r14d
test   %r12b,%r12b
jne    159a <main+0x43a>
add    $0xffffffffffffffff,%rbp
lea    0xb1d(%rip),%rbx
nopl   0x0(%rax)
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x40(%rsp,%rbp,8),%rdi
call   1040 <fclose@plt>
lea    -0x1(%rbp),%rax
add    $0x1,%rbp
cmp    $0x1,%rbp
mov    %rax,%rbp
ja     1570 <main+0x410>
mov    %r14d,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.bytes = [11 x i32] [i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2]
@.str = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.1 = [45 x i8] c"Was not possible to create output file '%s'\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [42 x i8] c"Was not possible to open input file '%s'\0A\00"
@.str.4 = [18 x i8] c"Closing file #%d\0A\00"
@.str.5 = [30 x i8] c"Error while reading file %s. \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [11 x i32]
%7 = alloca i32
%8 = alloca [22 x i32]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [11 x i32*]
%13 = alloca i32*
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = bitcast [11 x i32]* %6 to i8*
store i32 11, i32* %7
store i32 23040000, i32* %9
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 13
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @usage(i32 %19, i8** %20)
store i32 1, i32* %3
br label %156
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 12
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %26, i32** %13
%27 = load i32*, i32** %13
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %35
29: ; preds = %22
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 12
%33 = load i8*, i8** %32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %33)
store i32 2, i32* %3
br label %156
35: ; preds = %22
store i32 0, i32* %10
br label %36
36: ; preds = %83, %35
%37 = load i32, i32* %10
%38 = icmp slt i32 %37, 11
br i1 %38, label %39, label %86
39: ; preds = %36
%40 = load i8**, i8*** %5
%41 = load i32, i32* %10
%42 = add nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %40, i64 %43
%45 = load i8*, i8** %44
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [11 x i32*], [11 x i32*]* %12, i64 0, i64 %48
store i32* %46, i32** %49
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [11 x i32*], [11 x i32*]* %12, i64 0, i64 %51
%53 = load i32*, i32** %52
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %82
55: ; preds = %39
%56 = load i32, i32* @stderr
%57 = load i8**, i8*** %5
%58 = load i32, i32* %10
%59 = add nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %57, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %62)
%64 = load i32, i32* %10
%65 = sub nsw i32 %64, 1
store i32 %65, i32* %11
br label %66
66: ; preds = %78, %55
%67 = load i32, i32* %11
%68 = icmp sge i32 %67, 0
br i1 %68, label %69, label %81
69: ; preds = %66
%70 = load i32, i32* @stderr
%71 = load i32, i32* %11
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %71)
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [11 x i32*], [11 x i32*]* %12, i64 0, i64 %74
%76 = load i32*, i32** %75
%77 = call i32 @fclose(i32* %76)
br label %78
78: ; preds = %69
%79 = load i32, i32* %11
%80 = add nsw i32 %79, -1
store i32 %80, i32* %11
br label %66
81: ; preds = %66
store i32 3, i32* %3
br label %156
82: ; preds = %39
br label %83
83: ; preds = %82
%84 = load i32, i32* %10
%85 = add nsw i32 %84, 1
store i32 %85, i32* %10
br label %36
86: ; preds = %36
store i32 0, i32* %10
br label %87
87: ; preds = %136, %86
%88 = load i32, i32* %10
%89 = load i32, i32* %9
%90 = icmp slt i32 %88, %89
br i1 %90, label %91, label %139
91: ; preds = %87
store i32 0, i32* %14
store i32 0, i32* %11
br label %92
92: ; preds = %129, %91
%93 = load i32, i32* %11
%94 = icmp slt i32 %93, 11
br i1 %94, label %95, label %132
95: ; preds = %92
%96 = load i32, i32* %14
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [22 x i32], [22 x i32]* %8, i64 0, i64 %97
%99 = load i32, i32* %11
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 %100
%102 = load i32, i32* %101
%103 = load i32, i32* %11
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [11 x i32*], [11 x i32*]* %12, i64 0, i64 %104
%106 = load i32*, i32** %105
%107 = call i32 @fread(i32* %98, i32 4, i32 %102, i32* %106)
%108 = load i32, i32* %11
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = icmp ne i32 %107, %111
br i1 %112, label %113, label %122
113: ; preds = %95
%114 = load i32, i32* @stderr
%115 = load i8**, i8*** %5
%116 = load i32, i32* %11
%117 = add nsw i32 %116, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8*, i8** %115, i64 %118
%120 = load i8*, i8** %119
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %120)
br label %122
122: ; preds = %113, %95
%123 = load i32, i32* %11
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = load i32, i32* %14
%128 = add nsw i32 %127, %126
store i32 %128, i32* %14
br label %129
129: ; preds = %122
%130 = load i32, i32* %11
%131 = add nsw i32 %130, 1
store i32 %131, i32* %11
br label %92
132: ; preds = %92
%133 = getelementptr inbounds [22 x i32], [22 x i32]* %8, i64 0, i64 0
%134 = load i32*, i32** %13
%135 = call i32 @fwrite(i32* %133, i32 4, i32 22, i32* %134)
br label %136
136: ; preds = %132
%137 = load i32, i32* %10
%138 = add nsw i32 %137, 1
store i32 %138, i32* %10
br label %87
139: ; preds = %87
%140 = load i32*, i32** %13
%141 = call i32 @fclose(i32* %140)
store i32 0, i32* %10
br label %142
142: ; preds = %152, %139
%143 = load i32, i32* %10
%144 = load i32, i32* %7
%145 = icmp slt i32 %143, %144
br i1 %145, label %146, label %155
146: ; preds = %142
%147 = load i32, i32* %10
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [11 x i32*], [11 x i32*]* %12, i64 0, i64 %148
%150 = load i32*, i32** %149
%151 = call i32 @fclose(i32* %150)
br label %152
152: ; preds = %146
%153 = load i32, i32* %10
%154 = add nsw i32 %153, 1
store i32 %154, i32* %10
br label %142
155: ; preds = %142
store i32 0, i32* %3
br label %156
156: ; preds = %155, %81, %29, %18
%157 = load i32, i32* %3
ret i32 %157
}

LLVM IR (-O2):
@__const.main.bytes = [11 x i32] [i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2]
@.str = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.1 = [45 x i8] c"Was not possible to create output file '%s'\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [42 x i8] c"Was not possible to open input file '%s'\0A\00"
@.str.4 = [18 x i8] c"Closing file #%d\0A\00"
@.str.5 = [30 x i8] c"Error while reading file %s. \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [22 x i32]
%4 = alloca [11 x i32*]
%5 = bitcast [22 x i32]* %3 to i8*
%6 = bitcast [11 x i32*]* %4 to i8*
%7 = icmp eq i32 %0, 13
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @usage(i32 %0, i8** %1)
br label %152
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 12
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %21, label %15
15: ; preds = %10
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 0
store i32* %18, i32** %19
%20 = icmp eq i32* %18, null
br i1 %20, label %87, label %27
21: ; preds = %10
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %11
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %152
25: ; preds = %81
%26 = getelementptr inbounds [22 x i32], [22 x i32]* %3, i64 0, i64 0
br label %105
27: ; preds = %15
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 1
store i32* %30, i32** %31
%32 = icmp eq i32* %30, null
br i1 %32, label %87, label %33
33: ; preds = %27
%34 = getelementptr inbounds i8*, i8** %1, i64 3
%35 = load i8*, i8** %34
%36 = tail call i32* @fopen(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%37 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 2
store i32* %36, i32** %37
%38 = icmp eq i32* %36, null
br i1 %38, label %87, label %39
39: ; preds = %33
%40 = getelementptr inbounds i8*, i8** %1, i64 4
%41 = load i8*, i8** %40
%42 = tail call i32* @fopen(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%43 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 3
store i32* %42, i32** %43
%44 = icmp eq i32* %42, null
br i1 %44, label %87, label %45
45: ; preds = %39
%46 = getelementptr inbounds i8*, i8** %1, i64 5
%47 = load i8*, i8** %46
%48 = tail call i32* @fopen(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%49 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 4
store i32* %48, i32** %49
%50 = icmp eq i32* %48, null
br i1 %50, label %87, label %51
51: ; preds = %45
%52 = getelementptr inbounds i8*, i8** %1, i64 6
%53 = load i8*, i8** %52
%54 = tail call i32* @fopen(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%55 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 5
store i32* %54, i32** %55
%56 = icmp eq i32* %54, null
br i1 %56, label %87, label %57
57: ; preds = %51
%58 = getelementptr inbounds i8*, i8** %1, i64 7
%59 = load i8*, i8** %58
%60 = tail call i32* @fopen(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%61 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 6
store i32* %60, i32** %61
%62 = icmp eq i32* %60, null
br i1 %62, label %87, label %63
63: ; preds = %57
%64 = getelementptr inbounds i8*, i8** %1, i64 8
%65 = load i8*, i8** %64
%66 = tail call i32* @fopen(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%67 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 7
store i32* %66, i32** %67
%68 = icmp eq i32* %66, null
br i1 %68, label %87, label %69
69: ; preds = %63
%70 = getelementptr inbounds i8*, i8** %1, i64 9
%71 = load i8*, i8** %70
%72 = tail call i32* @fopen(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%73 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 8
store i32* %72, i32** %73
%74 = icmp eq i32* %72, null
br i1 %74, label %87, label %75
75: ; preds = %69
%76 = getelementptr inbounds i8*, i8** %1, i64 10
%77 = load i8*, i8** %76
%78 = tail call i32* @fopen(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%79 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 9
store i32* %78, i32** %79
%80 = icmp eq i32* %78, null
br i1 %80, label %87, label %81
81: ; preds = %75
%82 = getelementptr inbounds i8*, i8** %1, i64 11
%83 = load i8*, i8** %82
%84 = tail call i32* @fopen(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%85 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 10
store i32* %84, i32** %85
%86 = icmp eq i32* %84, null
br i1 %86, label %87, label %25
87: ; preds = %81, %75, %69, %63, %57, %51, %45, %39, %33, %27, %15
%88 = phi i64 [ 1, %15 ], [ 2, %27 ], [ 3, %33 ], [ 4, %39 ], [ 5, %45 ], [ 6, %51 ], [ 7, %57 ], [ 8, %63 ], [ 9, %69 ], [ 10, %75 ], [ 11, %81 ]
%89 = phi i1 [ true, %15 ], [ false, %27 ], [ false, %33 ], [ false, %39 ], [ false, %45 ], [ false, %51 ], [ false, %57 ], [ false, %63 ], [ false, %69 ], [ false, %75 ], [ false, %81 ]
%90 = phi i64 [ 0, %15 ], [ 1, %27 ], [ 2, %33 ], [ 3, %39 ], [ 4, %45 ], [ 5, %51 ], [ 6, %57 ], [ 7, %63 ], [ 8, %69 ], [ 9, %75 ], [ 10, %81 ]
%91 = getelementptr inbounds i8*, i8** %1, i64 %88
%92 = load i32, i32* @stderr
%93 = load i8*, i8** %91
%94 = tail call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %93)
br i1 %89, label %152, label %95
95: ; preds = %87, %95
%96 = phi i64 [ %97, %95 ], [ %90, %87 ]
%97 = add nsw i64 %96, -1
%98 = load i32, i32* @stderr
%99 = trunc i64 %97 to i32
%100 = tail call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %99)
%101 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 %97
%102 = load i32*, i32** %101
%103 = tail call i32 @fclose(i32* %102)
%104 = icmp ugt i64 %96, 1
br i1 %104, label %95, label %152
105: ; preds = %25, %130
%106 = phi i32 [ 0, %25 ], [ %132, %130 ]
br label %107
107: ; preds = %105, %126
%108 = phi i64 [ 0, %105 ], [ %127, %126 ]
%109 = phi i32 [ 0, %105 ], [ %128, %126 ]
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [22 x i32], [22 x i32]* %3, i64 0, i64 %110
%112 = getelementptr inbounds [11 x i32], [11 x i32]* @__const.main.bytes, i64 0, i64 %108
%113 = load i32, i32* %112
%114 = getelementptr inbounds [11 x i32*], [11 x i32*]* %4, i64 0, i64 %108
%115 = load i32*, i32** %114
%116 = call i32 @fread(i32* %111, i32 4, i32 %113, i32* %115)
%117 = icmp eq i32 %116, %113
br i1 %117, label %118, label %120
118: ; preds = %107
%119 = add nuw nsw i64 %108, 1
br label %126
120: ; preds = %107
%121 = load i32, i32* @stderr
%122 = add nuw nsw i64 %108, 1
%123 = getelementptr inbounds i8*, i8** %1, i64 %122
%124 = load i8*, i8** %123
%125 = tail call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %124)
br label %126
126: ; preds = %118, %120
%127 = phi i64 [ %119, %118 ], [ %122, %120 ]
%128 = add nsw i32 %113, %109
%129 = icmp eq i64 %127, 11
br i1 %129, label %130, label %107
130: ; preds = %126
%131 = call i32 @fwrite(i32* %26, i32 4, i32 22, i32* %13)
%132 = add nuw nsw i32 %106, 1
%133 = icmp eq i32 %132, 23040000
br i1 %133, label %134, label %105
134: ; preds = %130
%135 = tail call i32 @fclose(i32* %13)
%136 = load i32*, i32** %19
%137 = tail call i32 @fclose(i32* %136)
%138 = load i32*, i32** %31
%139 = tail call i32 @fclose(i32* %138)
%140 = load i32*, i32** %37
%141 = tail call i32 @fclose(i32* %140)
%142 = load i32*, i32** %43
%143 = tail call i32 @fclose(i32* %142)
%144 = load i32*, i32** %49
%145 = tail call i32 @fclose(i32* %144)
%146 = tail call i32 @fclose(i32* %54)
%147 = tail call i32 @fclose(i32* %60)
%148 = tail call i32 @fclose(i32* %66)
%149 = tail call i32 @fclose(i32* %72)
%150 = tail call i32 @fclose(i32* %78)
%151 = tail call i32 @fclose(i32* %84)
br label %152
152: ; preds = %95, %134, %87, %21, %8
%153 = phi i32 [ 1, %8 ], [ 2, %21 ], [ 3, %87 ], [ 0, %134 ], [ 3, %95 ]
ret i32 %153
}