#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ add(char *, char *, size_t, char *, size_t, char *, size_t);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fwrite(char *, int, size_t, int /*<<< orphan*/);
size_t get_line_len(char *, char *);
scalar_t__ malloc(size_t);
size_t read_segment(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc != 4) {
    fprintf(stderr, "usage: %s file1 file2 file3\n", argv[0]);
    return (-1);
  }
  size_t sz_buf = (32 * 1024 * 1024) + (8 * 1024);
  char *buf_in1 = (char *)malloc(sz_buf);
  char *buf_in2 = (char *)malloc(sz_buf);
  char *buf_in3 = (char *)malloc(sz_buf);
  char *buf_out = (char *)malloc(sz_buf);
  char *ptr_out = buf_out;
  FILE *fd1;
  FILE *fd2;
  FILE *fd3;
  if ((fd1 = fopen(argv[1], "rb")) == NULL) {
    fprintf(stderr, "%s: %s\n", argv[1], strerror(errno));
    free(buf_in1);
    free(buf_in2);
    free(buf_in3);
    free(buf_out);
    return (-1);
  }
  if ((fd2 = fopen(argv[2], "rb")) == NULL) {
    fprintf(stderr, "%s: %s\n", argv[2], strerror(errno));
    free(buf_in1);
    free(buf_in2);
    free(buf_in3);
    free(buf_out);
    fclose(fd1);
    return (-1);
  }
  if ((fd3 = fopen(argv[3], "rb")) == NULL) {
    fprintf(stderr, "%s: %s\n", argv[3], strerror(errno));
    free(buf_in1);
    free(buf_in2);
    free(buf_in3);
    free(buf_out);
    fclose(fd1);
    fclose(fd2);
    return (-1);
  }
  while (!feof(fd1)) {
    size_t real_sz1 = read_segment(buf_in1, fd1);
    char *max_in1 = buf_in1 + real_sz1;
    char *ptr_in1;
    size_t len_in1;
    for (ptr_in1 = buf_in1; ptr_in1 < max_in1; ptr_in1 += len_in1 + 1) {
      len_in1 = get_line_len(ptr_in1, max_in1);
      size_t vir_in1 = len_in1;
      while (vir_in1) {
        if (ptr_in1[vir_in1 - 1] != '\r')
          break;
        vir_in1--;
      }
      if (vir_in1 > 32)
        continue;
      while (!feof(fd2)) {
        size_t real_sz2 = read_segment(buf_in2, fd2);
        char *max_in2 = buf_in2 + real_sz2;
        char *ptr_in2;
        size_t len_in2;
        for (ptr_in2 = buf_in2; ptr_in2 < max_in2; ptr_in2 += len_in2 + 1) {
          len_in2 = get_line_len(ptr_in2, max_in2);
          size_t vir_in2 = len_in2;
          while (vir_in2) {
            if (ptr_in2[vir_in2 - 1] != '\r')
              break;
            vir_in2--;
          }
          if (vir_in2 > 32)
            continue;
          while (!feof(fd3)) {
            size_t real_sz3 = read_segment(buf_in3, fd3);
            char *max_in3 = buf_in3 + real_sz3;
            char *ptr_in3;
            size_t len_in3;
            for (ptr_in3 = buf_in3; ptr_in3 < max_in3; ptr_in3 += len_in3 + 1) {
              len_in3 = get_line_len(ptr_in3, max_in3);
              size_t vir_in3 = len_in3;
              while (vir_in3) {
                if (ptr_in3[vir_in3 - 1] != '\r')
                  break;
                vir_in3--;
              }
              if (vir_in3 > 32)
                continue;
              size_t len_out = ptr_out - buf_out;
              size_t len_add = vir_in1 + vir_in2 + vir_in3 + 1;
              if ((len_out + len_add) < (32 * 1024 * 1024)) {
                add(ptr_out, ptr_in1, vir_in1, ptr_in2, vir_in2, ptr_in3,
                    vir_in3);
                ptr_out += len_add;
              } else {
                size_t len_out = ptr_out - buf_out;
                fwrite(buf_out, 1, len_out, stdout);
                ptr_out = buf_out;
                add(ptr_out, ptr_in1, vir_in1, ptr_in2, vir_in2, ptr_in3,
                    vir_in3);
                ptr_out += len_add;
              }
            }
          }
          rewind(fd3);
        }
      }
      rewind(fd2);
    }
  }
  size_t len_out = ptr_out - buf_out;
  fwrite(buf_out, 1, len_out, stdout);
  fclose(fd3);
  fclose(fd2);
  fclose(fd1);
  free(buf_out);
  free(buf_in3);
  free(buf_in2);
  free(buf_in1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     120d <main+0x4d>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18c4 <main+0x704>
movq   $0x2002000,-0x18(%rbp)
02
mov    -0x18(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdbd(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    12ed <main+0x12d>
mov    0x2d66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xf8(%rbp)
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0xfc(%rbp),%edi
mov    -0xf8(%rbp),%rdx
mov    %rax,%rcx
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18c4 <main+0x704>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd21(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    1392 <main+0x1d2>
mov    0x2cca(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x108(%rbp)
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x10c(%rbp),%edi
mov    -0x108(%rbp),%rdx
mov    %rax,%rcx
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18c4 <main+0x704>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xc7c(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    1440 <main+0x280>
mov    0x2c25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x11c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x118(%rbp)
mov    0x2bff(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x11c(%rbp),%edi
mov    -0x118(%rbp),%rdx
mov    %rax,%rcx
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x50(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18c4 <main+0x704>
jmp    1445 <main+0x285>
mov    -0x48(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1463 <main+0x2a3>
jmp    184e <main+0x68e>
mov    -0x20(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1090 <read_segment@plt>
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rax
add    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
cmp    -0x68(%rbp),%rax
jae    1849 <main+0x689>
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rsi
call   10b0 <get_line_len@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
je     14e9 <main+0x329>
mov    -0x70(%rbp),%rax
mov    -0x80(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
je     14d8 <main+0x318>
jmp    14e9 <main+0x329>
mov    -0x80(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x80(%rbp)
jmp    14af <main+0x2ef>
cmpq   $0x20,-0x80(%rbp)
jbe    14f9 <main+0x339>
jmp    1834 <main+0x674>
jmp    14fe <main+0x33e>
mov    -0x50(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    151c <main+0x35c>
jmp    182b <main+0x66b>
mov    -0x28(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1090 <read_segment@plt>
mov    %rax,-0x88(%rbp)
mov    -0x28(%rbp),%rax
add    -0x88(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
cmp    -0x90(%rbp),%rax
jae    1826 <main+0x666>
mov    -0x98(%rbp),%rdi
mov    -0x90(%rbp),%rsi
call   10b0 <get_line_len@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
cmpq   $0x0,-0xa8(%rbp)
je     15d2 <main+0x412>
mov    -0x98(%rbp),%rax
mov    -0xa8(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
je     15bb <main+0x3fb>
jmp    15d2 <main+0x412>
mov    -0xa8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0xa8(%rbp)
jmp    1589 <main+0x3c9>
cmpq   $0x20,-0xa8(%rbp)
20
jbe    15e5 <main+0x425>
jmp    1808 <main+0x648>
jmp    15ea <main+0x42a>
mov    -0x58(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1608 <main+0x448>
jmp    17ff <main+0x63f>
mov    -0x30(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1090 <read_segment@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x30(%rbp),%rax
add    -0xb0(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
cmp    -0xb8(%rbp),%rax
jae    17fa <main+0x63a>
mov    -0xc0(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
call   10b0 <get_line_len@plt>
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
cmpq   $0x0,-0xd0(%rbp)
je     16be <main+0x4fe>
mov    -0xc0(%rbp),%rax
mov    -0xd0(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
je     16a7 <main+0x4e7>
jmp    16be <main+0x4fe>
mov    -0xd0(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0xd0(%rbp)
jmp    1675 <main+0x4b5>
cmpq   $0x20,-0xd0(%rbp)
20
jbe    16d1 <main+0x511>
jmp    17dc <main+0x61c>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xd8(%rbp)
mov    -0x80(%rbp),%rax
add    -0xa8(%rbp),%rax
add    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xe0(%rbp)
mov    -0xd8(%rbp),%rax
add    -0xe0(%rbp),%rax
cmp    $0x2000000,%rax
jae    175f <main+0x59f>
mov    -0x40(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x98(%rbp),%rcx
mov    -0xa8(%rbp),%r8
mov    -0xc0(%rbp),%r9
mov    -0xd0(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <add@plt>
mov    -0xe0(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    17d7 <main+0x617>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xe8(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0xe8(%rbp),%rdx
mov    0x284d(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   10d0 <fwrite@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x98(%rbp),%rcx
mov    -0xa8(%rbp),%r8
mov    -0xc0(%rbp),%r9
mov    -0xd0(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <add@plt>
mov    -0xe0(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    17dc <main+0x61c>
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
add    -0xc0(%rbp),%rax
mov    %rax,-0xc0(%rbp)
jmp    1639 <main+0x479>
jmp    15ea <main+0x42a>
mov    -0x58(%rbp),%rdi
call   1060 <rewind@plt>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
add    -0x98(%rbp),%rax
mov    %rax,-0x98(%rbp)
jmp    154d <main+0x38d>
jmp    14fe <main+0x33e>
mov    -0x50(%rbp),%rdi
call   1060 <rewind@plt>
mov    -0x78(%rbp),%rax
add    $0x1,%rax
add    -0x70(%rbp),%rax
mov    %rax,-0x70(%rbp)
jmp    1488 <main+0x2c8>
jmp    1445 <main+0x285>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xf0(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0xf0(%rbp),%rdx
mov    0x275e(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   10d0 <fwrite@plt>
mov    -0x58(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x50(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    12f3 <main+0x133>
mov    $0x2002000,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    $0x2002000,%edi
call   10a0 <malloc@plt>
mov    %rax,%r13
mov    $0x2002000,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
mov    $0x2002000,%edi
call   10a0 <malloc@plt>
mov    %rax,%r12
mov    0x8(%rbx),%rdi
lea    0xe01(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1312 <main+0x152>
mov    %rax,0x8(%rsp)
mov    0x10(%rbx),%rdi
lea    0xde3(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     136a <main+0x1aa>
mov    0x18(%rbx),%rdi
lea    0xdc5(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     13c4 <main+0x204>
mov    %rax,0x28(%rsp)
mov    %rbp,0x38(%rsp)
mov    %r13,0x40(%rsp)
mov    0x8(%rsp),%r14
mov    %r14,%rdi
call   1080 <feof@plt>
mov    %r12,%rbx
test   %eax,%eax
mov    0x20(%rsp),%r13
je     1442 <main+0x282>
sub    %r12,%rbx
mov    0x2d34(%rip),%rax
mov    (%rax),%ecx
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   10d0 <fwrite@plt>
mov    0x28(%rsp),%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
jmp    1430 <main+0x270>
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xcfa(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    142b <main+0x26b>
mov    0x2cc7(%rip),%rax
mov    (%rax),%r14d
mov    0x8(%rbx),%rbx
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xceb(%rip),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
jmp    142b <main+0x26b>
mov    0x2c6f(%rip),%rax
mov    (%rax),%r14d
mov    0x10(%rbx),%rbx
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xc93(%rip),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
jmp    1426 <main+0x266>
mov    0x2c15(%rip),%rax
mov    (%rax),%r14d
mov    0x18(%rbx),%rbx
mov    0x2bff(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xc39(%rip),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1050 <fclose@plt>
mov    $0xffffffff,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    -0x1(%r12),%rax
mov    %rax,0x58(%rsp)
mov    %r12,%rbx
mov    %r15,0x90(%rsp)
mov    %r12,0x48(%rsp)
jmp    1475 <main+0x2b5>
xchg   %ax,%ax
mov    0x8(%rsp),%r14
mov    %r14,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1292 <main+0xd2>
mov    0x38(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1090 <read_segment@plt>
test   %rax,%rax
jle    1460 <main+0x2a0>
add    %rbp,%rax
mov    %rbp,%rdi
mov    0x28(%rsp),%rbp
mov    %rax,0x60(%rsp)
jmp    14c3 <main+0x303>
nopl   0x0(%rax)
mov    %r13,%rdi
call   1060 <rewind@plt>
mov    0x68(%rsp),%rax
mov    0x10(%rsp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
mov    0x60(%rsp),%rax
cmp    %rax,%rdi
jae    1460 <main+0x2a0>
mov    %rdi,0x10(%rsp)
mov    %rax,%rsi
call   10b0 <get_line_len@plt>
lea    0x1(%rax),%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x1,%rdx
je     1510 <main+0x350>
lea    -0x1(%rdx),%rsi
mov    0x10(%rsp),%rcx
cmpb   $0xd,-0x2(%rcx,%rdx,1)
mov    %rsi,%rdx
je     14e0 <main+0x320>
cmp    $0x20,%rsi
ja     14ad <main+0x2ed>
jmp    1512 <main+0x352>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %esi,%esi
mov    %rsi,0x50(%rsp)
mov    %rax,0x68(%rsp)
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    14a0 <main+0x2e0>
mov    0x50(%rsp),%rax
mov    %rax,%rcx
not    %rcx
mov    %rcx,0x78(%rsp)
mov    0x58(%rsp),%rcx
sub    %rax,%rcx
mov    %rcx,0x70(%rsp)
jmp    1560 <main+0x3a0>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    14a0 <main+0x2e0>
mov    0x40(%rsp),%r14
mov    %r14,%rdi
mov    %r13,%rsi
call   1090 <read_segment@plt>
test   %rax,%rax
jle    1550 <main+0x390>
add    %r14,%rax
mov    %r14,%rdi
mov    %rax,%r14
mov    %rax,0x80(%rsp)
jmp    15c3 <main+0x403>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1060 <rewind@plt>
mov    0x48(%rsp),%r12
mov    0x20(%rsp),%r13
mov    0x80(%rsp),%r14
mov    0x18(%rsp),%rdi
mov    0x88(%rsp),%rax
add    %rax,%rdi
add    $0x1,%rdi
cmp    %r14,%rdi
jae    1550 <main+0x390>
mov    %rdi,0x18(%rsp)
mov    %r14,%rsi
call   10b0 <get_line_len@plt>
mov    0x18(%rsp),%rdi
lea    0x1(%rax),%rcx
nopl   0x0(%rax)
cmp    $0x1,%rcx
je     1600 <main+0x440>
lea    -0x1(%rcx),%rdx
cmpb   $0xd,-0x2(%rdi,%rcx,1)
mov    %rdx,%rcx
je     15e0 <main+0x420>
cmp    $0x20,%rdx
ja     15b7 <main+0x3f7>
jmp    1602 <main+0x442>
nopl   0x0(%rax)
xor    %edx,%edx
mov    %rdx,0x30(%rsp)
mov    %rax,0x88(%rsp)
mov    %rbp,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1590 <main+0x3d0>
mov    0x78(%rsp),%rcx
mov    0x30(%rsp),%rax
sub    %rax,%rcx
mov    %rcx,0xa0(%rsp)
mov    0x70(%rsp),%rcx
sub    %rax,%rcx
mov    %rcx,0x98(%rsp)
jmp    166d <main+0x4ad>
cs nopw 0x0(%rax,%rax,1)
mov    0x28(%rsp),%rbp
mov    %rbp,%rdi
call   1080 <feof@plt>
test   %eax,%eax
mov    0x90(%rsp),%r15
jne    1590 <main+0x3d0>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1090 <read_segment@plt>
test   %rax,%rax
jle    1650 <main+0x490>
add    %r15,%rax
jmp    16ed <main+0x52d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x48(%rsp),%rbx
mov    %r9,%rdx
sub    %rbx,%rdx
mov    0x292e(%rip),%rax
mov    (%rax),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
call   10d0 <fwrite@plt>
mov    0x10(%rsp),%rsi
mov    0x18(%rsp),%rcx
mov    0x30(%rsp),%r8
mov    %rbp,(%rsp)
mov    %rbx,%rdi
mov    0x50(%rsp),%rdx
mov    %r15,%r9
call   1040 <add@plt>
add    %r12,%rbx
sub    %r14,%rbx
add    %r12,%r15
add    $0x1,%r15
mov    %r13,%rax
cmp    %r13,%r15
jae    1650 <main+0x490>
mov    %r15,%rdi
mov    %rax,%r13
mov    %rax,%rsi
call   10b0 <get_line_len@plt>
mov    %rax,%r12
mov    0x98(%rsp),%rsi
mov    %rbx,%r9
sub    %rbx,%rsi
lea    -0x1(%r15),%rcx
xor    %edx,%edx
mov    0xa0(%rsp),%rdi
nopw   0x0(%rax,%rax,1)
mov    %rdi,%r14
mov    %rsi,%rax
mov    %r12,%rbp
sub    %rdx,%rbp
je     1760 <main+0x5a0>
lea    0x1(%r14),%rdi
lea    0x1(%rax),%rsi
add    $0x1,%rdx
cmpb   $0xd,(%rcx,%r12,1)
lea    -0x1(%rcx),%rcx
je     1720 <main+0x560>
mov    %r12,%rcx
sub    %rdx,%rcx
add    $0x1,%rcx
cmp    $0x20,%rcx
jbe    1760 <main+0x5a0>
mov    %r9,%rbx
jmp    16da <main+0x51a>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rcx
sub    %rax,%rcx
cmp    $0x2000000,%rcx
jae    1690 <main+0x4d0>
mov    0x18(%rsp),%rcx
mov    0x30(%rsp),%r8
mov    %r9,%rbx
mov    0x10(%rsp),%rsi
jmp    16c0 <main+0x500>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"usage: %s file1 file2 file3\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %195
8: ; preds = %2
%9 = tail call i64 @malloc(i64 33562624)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i64 @malloc(i64 33562624)
%12 = inttoptr i64 %11 to i8*
%13 = tail call i64 @malloc(i64 33562624)
%14 = inttoptr i64 %13 to i8*
%15 = tail call i64 @malloc(i64 33562624)
%16 = inttoptr i64 %15 to i8*
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %31
21: ; preds = %8
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %17
%24 = load i32, i32* @errno
%25 = tail call i8* @strerror(i32 %24)
%26 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %23, i8* %25)
%27 = tail call i32 @free(i8* %10)
%28 = tail call i32 @free(i8* %12)
%29 = tail call i32 @free(i8* %14)
%30 = tail call i32 @free(i8* %16)
br label %195
31: ; preds = %8
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = tail call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %47
36: ; preds = %31
%37 = load i32, i32* @stderr
%38 = load i8*, i8** %32
%39 = load i32, i32* @errno
%40 = tail call i8* @strerror(i32 %39)
%41 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %38, i8* %40)
%42 = tail call i32 @free(i8* %10)
%43 = tail call i32 @free(i8* %12)
%44 = tail call i32 @free(i8* %14)
%45 = tail call i32 @free(i8* %16)
%46 = tail call i32 @fclose(i32* %19)
br label %195
47: ; preds = %31
%48 = getelementptr inbounds i8*, i8** %1, i64 3
%49 = load i8*, i8** %48
%50 = tail call i32* @fopen(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %55, label %52
52: ; preds = %47
%53 = tail call i32 @feof(i32* %19)
%54 = icmp eq i32 %53, 0
br i1 %54, label %71, label %182
55: ; preds = %47
%56 = load i32, i32* @stderr
%57 = load i8*, i8** %48
%58 = load i32, i32* @errno
%59 = tail call i8* @strerror(i32 %58)
%60 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %57, i8* %59)
%61 = tail call i32 @free(i8* %10)
%62 = tail call i32 @free(i8* %12)
%63 = tail call i32 @free(i8* %14)
%64 = tail call i32 @free(i8* %16)
%65 = tail call i32 @fclose(i32* %19)
%66 = tail call i32 @fclose(i32* %34)
br label %195
67: ; preds = %177, %71
%68 = phi i8* [ %72, %71 ], [ %178, %177 ]
%69 = tail call i32 @feof(i32* %19)
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %182
71: ; preds = %52, %67
%72 = phi i8* [ %68, %67 ], [ %16, %52 ]
%73 = tail call i64 @read_segment(i8* %10, i32* %19)
%74 = getelementptr inbounds i8, i8* %10, i64 %73
%75 = icmp sgt i64 %73, 0
br i1 %75, label %76, label %67
76: ; preds = %71, %177
%77 = phi i8* [ %178, %177 ], [ %72, %71 ]
%78 = phi i8* [ %180, %177 ], [ %10, %71 ]
%79 = tail call i64 @get_line_len(i8* %78, i8* %74)
br label %80
80: ; preds = %83, %76
%81 = phi i64 [ %79, %76 ], [ %84, %83 ]
%82 = icmp eq i64 %81, 0
br i1 %82, label %90, label %83
83: ; preds = %80
%84 = add i64 %81, -1
%85 = getelementptr inbounds i8, i8* %78, i64 %84
%86 = load i8, i8* %85
%87 = icmp eq i8 %86, 13
br i1 %87, label %80, label %88
88: ; preds = %83
%89 = icmp ugt i64 %81, 32
br i1 %89, label %177, label %90
90: ; preds = %80, %88
%91 = phi i64 [ %81, %88 ], [ 0, %80 ]
%92 = tail call i32 @feof(i32* %34)
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %174
94: ; preds = %90
%95 = add nuw nsw i64 %91, 1
br label %100
96: ; preds = %169, %100
%97 = phi i8* [ %101, %100 ], [ %170, %169 ]
%98 = tail call i32 @feof(i32* %34)
%99 = icmp eq i32 %98, 0
br i1 %99, label %100, label %174
100: ; preds = %94, %96
%101 = phi i8* [ %77, %94 ], [ %97, %96 ]
%102 = tail call i64 @read_segment(i8* %12, i32* %34)
%103 = getelementptr inbounds i8, i8* %12, i64 %102
%104 = icmp sgt i64 %102, 0
br i1 %104, label %105, label %96
105: ; preds = %100, %169
%106 = phi i8* [ %170, %169 ], [ %101, %100 ]
%107 = phi i8* [ %172, %169 ], [ %12, %100 ]
%108 = tail call i64 @get_line_len(i8* %107, i8* %103)
br label %109
109: ; preds = %112, %105
%110 = phi i64 [ %108, %105 ], [ %113, %112 ]
%111 = icmp eq i64 %110, 0
br i1 %111, label %119, label %112
112: ; preds = %109
%113 = add i64 %110, -1
%114 = getelementptr inbounds i8, i8* %107, i64 %113
%115 = load i8, i8* %114
%116 = icmp eq i8 %115, 13
br i1 %116, label %109, label %117
117: ; preds = %112
%118 = icmp ugt i64 %110, 32
br i1 %118, label %169, label %119
119: ; preds = %109, %117
%120 = phi i64 [ %110, %117 ], [ 0, %109 ]
%121 = tail call i32 @feof(i32* %50)
%122 = icmp eq i32 %121, 0
br i1 %122, label %123, label %166
123: ; preds = %119
%124 = add i64 %95, %120
br label %129
125: ; preds = %161, %129
%126 = phi i8* [ %130, %129 ], [ %162, %161 ]
%127 = tail call i32 @feof(i32* %50)
%128 = icmp eq i32 %127, 0
br i1 %128, label %129, label %166
129: ; preds = %123, %125
%130 = phi i8* [ %106, %123 ], [ %126, %125 ]
%131 = tail call i64 @read_segment(i8* %14, i32* %50)
%132 = getelementptr inbounds i8, i8* %14, i64 %131
%133 = icmp sgt i64 %131, 0
br i1 %133, label %134, label %125
134: ; preds = %129, %161
%135 = phi i8* [ %162, %161 ], [ %130, %129 ]
%136 = phi i8* [ %164, %161 ], [ %14, %129 ]
%137 = tail call i64 @get_line_len(i8* %136, i8* %132)
br label %138
138: ; preds = %141, %134
%139 = phi i64 [ %137, %134 ], [ %142, %141 ]
%140 = icmp eq i64 %139, 0
br i1 %140, label %148, label %141
141: ; preds = %138
%142 = add i64 %139, -1
%143 = getelementptr inbounds i8, i8* %136, i64 %142
%144 = load i8, i8* %143
%145 = icmp eq i8 %144, 13
br i1 %145, label %138, label %146
146: ; preds = %141
%147 = icmp ugt i64 %139, 32
br i1 %147, label %161, label %148
148: ; preds = %138, %146
%149 = ptrtoint i8* %135 to i64
%150 = sub i64 %149, %15
%151 = add i64 %124, %139
%152 = add i64 %151, %150
%153 = icmp ult i64 %152, 33554432
br i1 %153, label %157, label %154
154: ; preds = %148
%155 = load i32, i32* @stdout
%156 = tail call i32 @fwrite(i8* %16, i32 1, i64 %150, i32 %155)
br label %157
157: ; preds = %148, %154
%158 = phi i8* [ %16, %154 ], [ %135, %148 ]
%159 = tail call i32 @add(i8* %158, i8* %78, i64 %91, i8* %107, i64 %120, i8* %136, i64 %139)
%160 = getelementptr inbounds i8, i8* %158, i64 %151
br label %161
161: ; preds = %146, %157
%162 = phi i8* [ %160, %157 ], [ %135, %146 ]
%163 = add i64 %137, 1
%164 = getelementptr inbounds i8, i8* %136, i64 %163
%165 = icmp ult i8* %164, %132
br i1 %165, label %134, label %125
166: ; preds = %125, %119
%167 = phi i8* [ %106, %119 ], [ %126, %125 ]
%168 = tail call i32 @rewind(i32* %50)
br label %169
169: ; preds = %117, %166
%170 = phi i8* [ %167, %166 ], [ %106, %117 ]
%171 = add i64 %108, 1
%172 = getelementptr inbounds i8, i8* %107, i64 %171
%173 = icmp ult i8* %172, %103
br i1 %173, label %105, label %96
174: ; preds = %96, %90
%175 = phi i8* [ %77, %90 ], [ %97, %96 ]
%176 = tail call i32 @rewind(i32* %34)
br label %177
177: ; preds = %88, %174
%178 = phi i8* [ %175, %174 ], [ %77, %88 ]
%179 = add i64 %79, 1
%180 = getelementptr inbounds i8, i8* %78, i64 %179
%181 = icmp ult i8* %180, %74
br i1 %181, label %76, label %67
182: ; preds = %67, %52
%183 = phi i8* [ %16, %52 ], [ %68, %67 ]
%184 = ptrtoint i8* %183 to i64
%185 = sub i64 %184, %15
%186 = load i32, i32* @stdout
%187 = tail call i32 @fwrite(i8* %16, i32 1, i64 %185, i32 %186)
%188 = tail call i32 @fclose(i32* %50)
%189 = tail call i32 @fclose(i32* %34)
%190 = tail call i32 @fclose(i32* %19)
%191 = tail call i32 @free(i8* %16)
%192 = tail call i32 @free(i8* %14)
%193 = tail call i32 @free(i8* %12)
%194 = tail call i32 @free(i8* %10)
br label %195
195: ; preds = %21, %36, %55, %182, %4
%196 = phi i32 [ -1, %4 ], [ -1, %21 ], [ -1, %36 ], [ -1, %55 ], [ 0, %182 ]
ret i32 %196
}