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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, int, size_t, int /*<<< orphan*/ *);
int getopt(int, char **, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
scalar_t__ realloc(int *, int);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ *tmpfile();
int main(int argc, char *argv[]) {
  char buf[1024 * 1024];
  int *fields;
  int maximum_field_num = 0;
  int field_num = 20;
  int current_field_num = 0;
  int current_field_width = 0;
  FILE *input = stdin;
  FILE *output = stdout;
  char separetor[1024] = " | ";
  char inputseparetor = '\t';
  int ch;
  while ((ch = getopt(argc, argv, "?hs:e:")) != -1) {
    switch (ch) {
    case 'e':
      inputseparetor = optarg[0];
      break;
    case 's':
      strncpy(separetor, optarg, sizeof(separetor) - 1);
      break;
    case 'h':
    case '?':
      printf("Usage : %s [options] file\n", argv[0]);
      printf("Format text table\n"
             "   -h -? Show this help\n"
             "   -s    Output separator (string) default:\"%s\"\n"
             "   -e    Input separator (one char) default:TAB\n",
             separetor);
      return 0;
      break;
    default:
      printf("Unknown options %c\n"
             "Use -h option to show usages.",
             ch);
      return 1;
    }
  }
  argc -= optind;
  argv += optind;
  fields = (int *)malloc(sizeof(int) * field_num);
  memset(fields, 0, sizeof(int) * field_num);
  if (argc == 0) {
    input = tmpfile();
    if (!input) {
      perror("Cannot open tempolary file");
      return 1;
    }
    while (!feof(stdin) && !ferror(stdin)) {
      size_t length =
          fread(buf, sizeof(buf[0]), sizeof(buf) / sizeof(buf[0]), stdin);
      fwrite(buf, sizeof(buf[0]), length, input);
    }
    fseek(input, 0, SEEK_SET);
  } else {
    input = fopen(argv[0], "r");
  }
  if (input == NULL) {
    perror("Cannot open input file");
    return 1;
  }
  while (!feof(input) && !ferror(input)) {
    size_t length =
        fread(buf, sizeof(buf[0]), sizeof(buf) / sizeof(buf[0]), input);
    char *p = buf;
    while (p < buf + length) {
      if (*p == '\n' || *p == inputseparetor) {
        if (field_num < current_field_num) {
          field_num += 20;
          fields = (int *)realloc(fields, sizeof(int) * field_num);
        }
        if (maximum_field_num < current_field_num) {
          maximum_field_num = current_field_num;
        }
        if (fields[current_field_num] < current_field_width)
          fields[current_field_num] = current_field_width;
        current_field_num++;
        current_field_width = 0;
        if (*p == '\n') {
          current_field_num = 0;
          current_field_width = 0;
        }
      } else {
        current_field_width++;
      }
      p++;
    }
  }
  rewind(input);
  current_field_num = 0;
  current_field_width = 0;
  while (!feof(input) && !ferror(input)) {
    size_t length =
        fread(buf, sizeof(buf[0]), sizeof(buf) / sizeof(buf[0]), input);
    char *p = buf;
    while (p < buf + length) {
      if (*p == '\n') {
        current_field_width = 0;
        current_field_num = 0;
        fputc(*p, output);
      } else if (*p == inputseparetor) {
        while (current_field_width < fields[current_field_num]) {
          putchar(' ');
          current_field_width++;
        }
        fprintf(output, "%s", separetor);
        current_field_num++;
        current_field_width = 0;
        if (*p == '\n') {
          current_field_num = 0;
          current_field_width = 0;
        }
      } else {
        current_field_width++;
        fputc(*p, output);
      }
      p++;
    }
  }
  fclose(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x10001c(%rbp)
movl   $0x14,-0x100020(%rbp)
movl   $0x0,-0x100024(%rbp)
movl   $0x0,-0x100028(%rbp)
mov    0x2d68(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x100030(%rbp)
mov    0x2d37(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x100038(%rbp)
lea    -0x100440(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   10a0 <memset@plt>
movb   $0x20,-0x100440(%rbp)
movb   $0x7c,-0x10043f(%rbp)
movb   $0x20,-0x10043e(%rbp)
movb   $0x9,-0x100441(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xd30(%rip),%rdx
call   1140 <getopt@plt>
mov    %eax,-0x100448(%rbp)
cmp    $0xffffffff,%eax
je     13cc <main+0x19c>
mov    -0x100448(%rbp),%eax
mov    %eax,-0x100474(%rbp)
sub    $0x3f,%eax
je     1371 <main+0x141>
jmp    12fe <main+0xce>
mov    -0x100474(%rbp),%eax
sub    $0x65,%eax
je     133a <main+0x10a>
jmp    1312 <main+0xe2>
mov    -0x100474(%rbp),%eax
sub    $0x68,%eax
je     1371 <main+0x141>
jmp    1326 <main+0xf6>
mov    -0x100474(%rbp),%eax
sub    $0x73,%eax
je     1351 <main+0x121>
jmp    13a7 <main+0x177>
mov    0x2cb7(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x100441(%rbp)
jmp    13c7 <main+0x197>
lea    -0x100440(%rbp),%rdi
mov    0x2c99(%rip),%rax
mov    (%rax),%rsi
mov    $0x3ff,%edx
call   1040 <strncpy@plt>
jmp    13c7 <main+0x197>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x100440(%rbp),%rsi
lea    0xc8e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1949 <main+0x719>
mov    -0x100448(%rbp),%esi
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1949 <main+0x719>
jmp    12c2 <main+0x92>
mov    0x2c05(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2bf1(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x100020(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x100018(%rbp)
mov    -0x100018(%rbp),%rdi
movslq -0x100020(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   10a0 <memset@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1526 <main+0x2f6>
mov    $0x0,%al
call   10c0 <tmpfile@plt>
mov    %rax,-0x100030(%rbp)
cmpq   $0x0,-0x100030(%rbp)
jne    1468 <main+0x238>
lea    0xc87(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1949 <main+0x719>
jmp    146d <main+0x23d>
mov    0x2b6c(%rip),%rax
mov    (%rax),%rdi
call   10e0 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x100475(%rbp)
jne    14ac <main+0x27c>
mov    0x2b4a(%rip),%rax
mov    (%rax),%rdi
call   1050 <ferror@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x100475(%rbp)
mov    -0x100475(%rbp),%al
test   $0x1,%al
jne    14bf <main+0x28f>
jmp    150a <main+0x2da>
lea    -0x100010(%rbp),%rdi
mov    0x2b13(%rip),%rax
mov    (%rax),%rcx
mov    $0x1,%esi
mov    $0x100000,%edx
call   1060 <fread@plt>
mov    %rax,-0x100450(%rbp)
lea    -0x100010(%rbp),%rdi
mov    -0x100450(%rbp),%rdx
mov    -0x100030(%rbp),%rcx
mov    $0x1,%esi
call   1150 <fwrite@plt>
jmp    146d <main+0x23d>
mov    -0x100030(%rbp),%rdi
mov    0x2ab0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1100 <fseek@plt>
jmp    1540 <main+0x310>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xbc5(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x100030(%rbp)
cmpq   $0x0,-0x100030(%rbp)
jne    1566 <main+0x336>
lea    0xba6(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1949 <main+0x719>
jmp    156b <main+0x33b>
mov    -0x100030(%rbp),%rdi
call   10e0 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x100476(%rbp)
jne    15a4 <main+0x374>
mov    -0x100030(%rbp),%rdi
call   1050 <ferror@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x100476(%rbp)
mov    -0x100476(%rbp),%al
test   $0x1,%al
jne    15b7 <main+0x387>
jmp    1736 <main+0x506>
lea    -0x100010(%rbp),%rdi
mov    -0x100030(%rbp),%rcx
mov    $0x1,%esi
mov    $0x100000,%edx
call   1060 <fread@plt>
mov    %rax,-0x100458(%rbp)
lea    -0x100010(%rbp),%rax
mov    %rax,-0x100460(%rbp)
mov    -0x100460(%rbp),%rax
lea    -0x100010(%rbp),%rcx
add    -0x100458(%rbp),%rcx
cmp    %rcx,%rax
jae    1731 <main+0x501>
mov    -0x100460(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1633 <main+0x403>
mov    -0x100460(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x100441(%rbp),%ecx
cmp    %ecx,%eax
jne    170b <main+0x4db>
mov    -0x100020(%rbp),%eax
cmp    -0x100024(%rbp),%eax
jge    1674 <main+0x444>
mov    -0x100020(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x100020(%rbp)
mov    -0x100018(%rbp),%rdi
movslq -0x100020(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1110 <realloc@plt>
mov    %rax,-0x100018(%rbp)
mov    -0x10001c(%rbp),%eax
cmp    -0x100024(%rbp),%eax
jge    1692 <main+0x462>
mov    -0x100024(%rbp),%eax
mov    %eax,-0x10001c(%rbp)
mov    -0x100018(%rbp),%rax
movslq -0x100024(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x100028(%rbp),%eax
jge    16c6 <main+0x496>
mov    -0x100028(%rbp),%edx
mov    -0x100018(%rbp),%rax
movslq -0x100024(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x100024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100024(%rbp)
movl   $0x0,-0x100028(%rbp)
mov    -0x100460(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1706 <main+0x4d6>
movl   $0x0,-0x100024(%rbp)
movl   $0x0,-0x100028(%rbp)
jmp    171a <main+0x4ea>
mov    -0x100028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100028(%rbp)
mov    -0x100460(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x100460(%rbp)
jmp    15e9 <main+0x3b9>
jmp    156b <main+0x33b>
mov    -0x100030(%rbp),%rdi
call   1090 <rewind@plt>
movl   $0x0,-0x100024(%rbp)
movl   $0x0,-0x100028(%rbp)
mov    -0x100030(%rbp),%rdi
call   10e0 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x100477(%rbp)
jne    178f <main+0x55f>
mov    -0x100030(%rbp),%rdi
call   1050 <ferror@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x100477(%rbp)
mov    -0x100477(%rbp),%al
test   $0x1,%al
jne    17a2 <main+0x572>
jmp    1936 <main+0x706>
lea    -0x100010(%rbp),%rdi
mov    -0x100030(%rbp),%rcx
mov    $0x1,%esi
mov    $0x100000,%edx
call   1060 <fread@plt>
mov    %rax,-0x100468(%rbp)
lea    -0x100010(%rbp),%rax
mov    %rax,-0x100470(%rbp)
mov    -0x100470(%rbp),%rax
lea    -0x100010(%rbp),%rcx
add    -0x100468(%rbp),%rcx
cmp    %rcx,%rax
jae    1931 <main+0x701>
mov    -0x100470(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1836 <main+0x606>
movl   $0x0,-0x100028(%rbp)
movl   $0x0,-0x100024(%rbp)
mov    -0x100470(%rbp),%rax
mov    (%rax),%al
mov    -0x100038(%rbp),%rsi
movsbl %al,%edi
call   10b0 <fputc@plt>
jmp    191a <main+0x6ea>
mov    -0x100470(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x100441(%rbp),%ecx
cmp    %ecx,%eax
jne    18ee <main+0x6be>
jmp    1854 <main+0x624>
mov    -0x100028(%rbp),%eax
mov    -0x100018(%rbp),%rcx
movslq -0x100024(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    188f <main+0x65f>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x100028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100028(%rbp)
jmp    1854 <main+0x624>
mov    -0x100038(%rbp),%rdi
lea    -0x100440(%rbp),%rdx
lea    0x86e(%rip),%rsi
call   10d0 <fprintf@plt>
mov    -0x100024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100024(%rbp)
movl   $0x0,-0x100028(%rbp)
mov    -0x100470(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    18e9 <main+0x6b9>
movl   $0x0,-0x100024(%rbp)
movl   $0x0,-0x100028(%rbp)
jmp    1915 <main+0x6e5>
mov    -0x100028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100028(%rbp)
mov    -0x100470(%rbp),%rax
mov    (%rax),%al
mov    -0x100038(%rbp),%rsi
movsbl %al,%edi
call   10b0 <fputc@plt>
jmp    191a <main+0x6ea>
mov    -0x100470(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x100470(%rbp)
jmp    17d4 <main+0x5a4>
jmp    1756 <main+0x526>
mov    -0x100030(%rbp),%rdi
call   1070 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x100428,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x2d73(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
lea    0x20(%rsp),%r12
mov    $0x400,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10b0 <memset@plt>
movw   $0x7c20,0x20(%rsp)
movb   $0x20,0x22(%rsp)
movb   $0x9,0xf(%rsp)
lea    0xd7f(%rip),%rbx
mov    0x2d70(%rip),%r14
jmp    12a0 <main+0x70>
nopw   0x0(%rax,%rax,1)
mov    (%r14),%rsi
mov    %r12,%rdi
mov    $0x3ff,%edx
call   1040 <strncpy@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1140 <getopt@plt>
cmp    $0x73,%eax
je     1290 <main+0x60>
cmp    $0x64,%eax
jle    12d1 <main+0xa1>
cmp    $0x68,%eax
je     12df <main+0xaf>
cmp    $0x65,%eax
jne    13cb <main+0x19b>
mov    (%r14),%rax
movzbl (%rax),%eax
mov    %al,0xf(%rsp)
jmp    12a0 <main+0x70>
cmp    $0xffffffff,%eax
je     130a <main+0xda>
cmp    $0x3f,%eax
jne    13cb <main+0x19b>
mov    (%r15),%rsi
lea    0xd1e(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd29(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1436 <main+0x206>
mov    0x2cc7(%rip),%rax
mov    (%rax),%r14
mov    $0x50,%edi
call   10f0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   10b0 <memset@plt>
cmp    %ebp,%r14d
jne    13e2 <main+0x1b2>
xor    %eax,%eax
call   10d0 <tmpfile@plt>
test   %rax,%rax
je     162a <main+0x3fa>
mov    %rax,%r15
mov    0x2c8d(%rip),%r14
mov    (%r14),%rdi
call   10e0 <feof@plt>
test   %eax,%eax
jne    13b3 <main+0x183>
lea    0x420(%rsp),%r12
nopw   0x0(%rax,%rax,1)
mov    (%r14),%rbp
mov    %rbp,%rdi
call   1050 <ferror@plt>
test   %eax,%eax
jne    13b3 <main+0x183>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x100000,%edx
mov    %rbp,%rcx
call   1060 <fread@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
mov    %r15,%rcx
call   1150 <fwrite@plt>
mov    (%r14),%rdi
call   10e0 <feof@plt>
test   %eax,%eax
je     1370 <main+0x140>
mov    0x2c0e(%rip),%rax
mov    (%rax),%edx
mov    %r15,%r14
mov    %r15,%rdi
xor    %esi,%esi
call   1100 <fseek@plt>
jmp    13f5 <main+0x1c5>
lea    0xcdb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%ebx
jmp    1436 <main+0x206>
mov    (%r15,%r14,8),%rdi
lea    0xd0c(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,%r14
test   %r14,%r14
je     1621 <main+0x3f1>
mov    %r14,%rdi
call   10e0 <feof@plt>
test   %eax,%eax
mov    %r14,0x10(%rsp)
je     144a <main+0x21a>
mov    %r14,%rdi
call   1090 <rewind@plt>
mov    %r14,%rdi
call   10e0 <feof@plt>
test   %eax,%eax
mov    0x18(%rsp),%r15
je     151e <main+0x2ee>
mov    %r14,%rdi
call   1070 <fclose@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x100428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x14,%r12d
xor    %ebp,%ebp
lea    0x420(%rsp),%r13
xor    %r15d,%r15d
jmp    147f <main+0x24f>
nop
mov    %r12,%rcx
mov    %rcx,%r12
mov    0x10(%rsp),%r14
mov    %r14,%rdi
call   10e0 <feof@plt>
test   %eax,%eax
lea    0x420(%rsp),%r13
jne    140f <main+0x1df>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %eax,%eax
jne    140f <main+0x1df>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x100000,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
test   %rax,%rax
jle    1460 <main+0x230>
lea    (%rsp,%rax,1),%r14
add    $0x420,%r14
mov    %r12,%rcx
jmp    14d8 <main+0x2a8>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r15d
xor    %ebp,%ebp
cmpb   $0xa,0x0(%r13)
cmove  %ebp,%r15d
add    $0x1,%r13
cmp    %r14,%r13
jae    1463 <main+0x233>
movzbl 0x0(%r13),%eax
cmp    $0xa,%al
je     14f0 <main+0x2c0>
cmp    0xf(%rsp),%al
je     14f0 <main+0x2c0>
add    $0x1,%ebp
jmp    14cf <main+0x29f>
nopl   0x0(%rax)
cmp    %r15d,%ecx
jge    1511 <main+0x2e1>
mov    %ecx,%r12d
add    $0x14,%r12d
lea    0x50(,%rcx,4),%esi
mov    %rbx,%rdi
call   1110 <realloc@plt>
mov    %rax,%rbx
mov    %r12d,%ecx
movslq %r15d,%rax
cmp    %ebp,(%rbx,%rax,4)
jge    14c0 <main+0x290>
mov    %ebp,(%rbx,%rax,4)
jmp    14c0 <main+0x290>
xor    %r12d,%r12d
lea    0x420(%rsp),%rbp
xor    %r13d,%r13d
jmp    154d <main+0x31d>
xchg   %ax,%ax
mov    0x10(%rsp),%r14
mov    %r14,%rdi
call   10e0 <feof@plt>
test   %eax,%eax
lea    0x420(%rsp),%rbp
jne    142c <main+0x1fc>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %eax,%eax
jne    142c <main+0x1fc>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x100000,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
test   %rax,%rax
jle    1530 <main+0x300>
lea    (%rsp,%rax,1),%r14
add    $0x420,%r14
jmp    15ac <main+0x37c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
mov    %r15,%rsi
call   10c0 <fputc@plt>
xor    %r13d,%r13d
xor    %r12d,%r12d
add    $0x1,%rbp
cmp    %r14,%rbp
jae    1530 <main+0x300>
mov    0x0(%rbp),%al
cmp    $0xa,%al
je     1590 <main+0x360>
cmp    0xf(%rsp),%al
jne    1610 <main+0x3e0>
movslq %r13d,%r15
cmp    (%rbx,%r15,4),%r12d
jge    15e4 <main+0x3b4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    (%rbx,%r15,4),%r12d
jl     15d0 <main+0x3a0>
lea    0x20(%rsp),%rdi
mov    0x18(%rsp),%r15
mov    %r15,%rsi
call   10a0 <fputs@plt>
add    $0x1,%r13d
xor    %r12d,%r12d
cmpb   $0xa,0x0(%rbp)
cmove  %r12d,%r13d
jmp    15a3 <main+0x373>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12d
movsbl %al,%edi
mov    %r15,%rsi
call   10c0 <fputc@plt>
jmp    15a3 <main+0x373>
lea    0xad3(%rip),%rdi
jmp    1631 <main+0x401>
lea    0xaad(%rip),%rdi
call   1130 <perror@plt>
mov    $0x1,%ebx
jmp    1436 <main+0x206>

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
@.str = [7 x i8] c"?hs:e:\00"
@optarg = global i8* null
@.str.1 = [27 x i8] c"Usage : %s [options] file\0A\00"
@.str.2 = [139 x i8] c"Format text table\0A -h -? Show this help\0A -s Output separator (string) default:\22%s\22\0A -e Input separator (one char) default:TAB\0A\00"
@.str.3 = [49 x i8] c"Unknown options %c\0AUse -h option to show usages.\00"
@optind = global i64 0
@.str.4 = [27 x i8] c"Cannot open tempolary file\00"
@SEEK_SET = global i32 0
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [23 x i8] c"Cannot open input file\00"
@.str.7 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1048576 x i8]
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca [1024 x i8]
%15 = alloca i8
%16 = alloca i32
%17 = alloca i64
%18 = alloca i64
%19 = alloca i8*
%20 = alloca i64
%21 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 20, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%22 = load i32*, i32** @stdin
store i32* %22, i32** %12
%23 = load i32*, i32** @stdout
store i32* %23, i32** %13
%24 = bitcast [1024 x i8]* %14 to i8*
%25 = bitcast i8* %24 to [1024 x i8]*
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %25, i32 0, i32 0
store i8 32, i8* %26
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %25, i32 0, i32 1
store i8 124, i8* %27
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %25, i32 0, i32 2
store i8 32, i8* %28
store i8 9, i8* %15
br label %29
29: ; preds = %54, %2
%30 = load i32, i32* %4
%31 = load i8**, i8*** %5
%32 = call i32 @getopt(i32 %30, i8** %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %32, i32* %16
%33 = icmp ne i32 %32, -1
br i1 %33, label %34, label %55
34: ; preds = %29
%35 = load i32, i32* %16
switch i32 %35, label %51 [
i32 101, label %36
i32 115, label %40
i32 104, label %44
i32 63, label %44
]
36: ; preds = %34
%37 = load i8*, i8** @optarg
%38 = getelementptr inbounds i8, i8* %37, i64 0
%39 = load i8, i8* %38
store i8 %39, i8* %15
br label %54
40: ; preds = %34
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%42 = load i8*, i8** @optarg
%43 = call i32 @strncpy(i8* %41, i8* %42, i32 1023)
br label %54
44: ; preds = %34, %34
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %47)
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i8* %49)
store i32 0, i32* %3
br label %285
51: ; preds = %34
%52 = load i32, i32* %16
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 %52)
store i32 1, i32* %3
br label %285
54: ; preds = %40, %36
br label %29
55: ; preds = %29
%56 = load i64, i64* @optind
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = sub nsw i64 %58, %56
%60 = trunc i64 %59 to i32
store i32 %60, i32* %4
%61 = load i64, i64* @optind
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 %61
store i8** %63, i8*** %5
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = mul i64 4, %65
%67 = trunc i64 %66 to i32
%68 = call i64 @malloc(i32 %67)
%69 = inttoptr i64 %68 to i32*
store i32* %69, i32** %7
%70 = load i32*, i32** %7
%71 = load i32, i32* %9
%72 = sext i32 %71 to i64
%73 = mul i64 4, %72
%74 = trunc i64 %73 to i32
%75 = call i32 @memset(i32* %70, i32 0, i32 %74)
%76 = load i32, i32* %4
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %108
78: ; preds = %55
%79 = call i32* (...) @tmpfile()
store i32* %79, i32** %12
%80 = load i32*, i32** %12
%81 = icmp ne i32* %80, null
br i1 %81, label %84, label %82
82: ; preds = %78
%83 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %285
84: ; preds = %78
br label %85
85: ; preds = %96, %84
%86 = load i32*, i32** @stdin
%87 = call i32 @feof(i32* %86)
%88 = icmp ne i32 %87, 0
br i1 %88, label %94, label %89
89: ; preds = %85
%90 = load i32*, i32** @stdin
%91 = call i32 @ferror(i32* %90)
%92 = icmp ne i32 %91, 0
%93 = xor i1 %92, true
br label %94
94: ; preds = %89, %85
%95 = phi i1 [ false, %85 ], [ %93, %89 ]
br i1 %95, label %96, label %104
96: ; preds = %94
%97 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%98 = load i32*, i32** @stdin
%99 = call i64 @fread(i8* %97, i32 1, i32 1048576, i32* %98)
store i64 %99, i64* %17
%100 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%101 = load i64, i64* %17
%102 = load i32*, i32** %12
%103 = call i32 @fwrite(i8* %100, i32 1, i64 %101, i32* %102)
br label %85
104: ; preds = %94
%105 = load i32*, i32** %12
%106 = load i32, i32* @SEEK_SET
%107 = call i32 @fseek(i32* %105, i32 0, i32 %106)
br label %113
108: ; preds = %55
%109 = load i8**, i8*** %5
%110 = getelementptr inbounds i8*, i8** %109, i64 0
%111 = load i8*, i8** %110
%112 = call i32* @fopen(i8* %111, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %112, i32** %12
br label %113
113: ; preds = %108, %104
%114 = load i32*, i32** %12
%115 = icmp eq i32* %114, null
br i1 %115, label %116, label %118
116: ; preds = %113
%117 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %285
118: ; preds = %113
br label %119
119: ; preds = %202, %118
%120 = load i32*, i32** %12
%121 = call i32 @feof(i32* %120)
%122 = icmp ne i32 %121, 0
br i1 %122, label %128, label %123
123: ; preds = %119
%124 = load i32*, i32** %12
%125 = call i32 @ferror(i32* %124)
%126 = icmp ne i32 %125, 0
%127 = xor i1 %126, true
br label %128
128: ; preds = %123, %119
%129 = phi i1 [ false, %119 ], [ %127, %123 ]
br i1 %129, label %130, label %203
130: ; preds = %128
%131 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%132 = load i32*, i32** %12
%133 = call i64 @fread(i8* %131, i32 1, i32 1048576, i32* %132)
store i64 %133, i64* %18
%134 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
store i8* %134, i8** %19
br label %135
135: ; preds = %199, %130
%136 = load i8*, i8** %19
%137 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%138 = load i64, i64* %18
%139 = getelementptr inbounds i8, i8* %137, i64 %138
%140 = icmp ult i8* %136, %139
br i1 %140, label %141, label %202
141: ; preds = %135
%142 = load i8*, i8** %19
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = icmp eq i32 %144, 10
br i1 %145, label %153, label %146
146: ; preds = %141
%147 = load i8*, i8** %19
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = load i8, i8* %15
%151 = sext i8 %150 to i32
%152 = icmp eq i32 %149, %151
br i1 %152, label %153, label %196
153: ; preds = %146, %141
%154 = load i32, i32* %9
%155 = load i32, i32* %10
%156 = icmp slt i32 %154, %155
br i1 %156, label %157, label %167
157: ; preds = %153
%158 = load i32, i32* %9
%159 = add nsw i32 %158, 20
store i32 %159, i32* %9
%160 = load i32*, i32** %7
%161 = load i32, i32* %9
%162 = sext i32 %161 to i64
%163 = mul i64 4, %162
%164 = trunc i64 %163 to i32
%165 = call i64 @realloc(i32* %160, i32 %164)
%166 = inttoptr i64 %165 to i32*
store i32* %166, i32** %7
br label %167
167: ; preds = %157, %153
%168 = load i32, i32* %8
%169 = load i32, i32* %10
%170 = icmp slt i32 %168, %169
br i1 %170, label %171, label %173
171: ; preds = %167
%172 = load i32, i32* %10
store i32 %172, i32* %8
br label %173
173: ; preds = %171, %167
%174 = load i32*, i32** %7
%175 = load i32, i32* %10
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i32, i32* %174, i64 %176
%178 = load i32, i32* %177
%179 = load i32, i32* %11
%180 = icmp slt i32 %178, %179
br i1 %180, label %181, label %187
181: ; preds = %173
%182 = load i32, i32* %11
%183 = load i32*, i32** %7
%184 = load i32, i32* %10
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds i32, i32* %183, i64 %185
store i32 %182, i32* %186
br label %187
187: ; preds = %181, %173
%188 = load i32, i32* %10
%189 = add nsw i32 %188, 1
store i32 %189, i32* %10
store i32 0, i32* %11
%190 = load i8*, i8** %19
%191 = load i8, i8* %190
%192 = sext i8 %191 to i32
%193 = icmp eq i32 %192, 10
br i1 %193, label %194, label %195
194: ; preds = %187
store i32 0, i32* %10
store i32 0, i32* %11
br label %195
195: ; preds = %194, %187
br label %199
196: ; preds = %146
%197 = load i32, i32* %11
%198 = add nsw i32 %197, 1
store i32 %198, i32* %11
br label %199
199: ; preds = %196, %195
%200 = load i8*, i8** %19
%201 = getelementptr inbounds i8, i8* %200, i32 1
store i8* %201, i8** %19
br label %135
202: ; preds = %135
br label %119
203: ; preds = %128
%204 = load i32*, i32** %12
%205 = call i32 @rewind(i32* %204)
store i32 0, i32* %10
store i32 0, i32* %11
br label %206
206: ; preds = %281, %203
%207 = load i32*, i32** %12
%208 = call i32 @feof(i32* %207)
%209 = icmp ne i32 %208, 0
br i1 %209, label %215, label %210
210: ; preds = %206
%211 = load i32*, i32** %12
%212 = call i32 @ferror(i32* %211)
%213 = icmp ne i32 %212, 0
%214 = xor i1 %213, true
br label %215
215: ; preds = %210, %206
%216 = phi i1 [ false, %206 ], [ %214, %210 ]
br i1 %216, label %217, label %282
217: ; preds = %215
%218 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%219 = load i32*, i32** %12
%220 = call i64 @fread(i8* %218, i32 1, i32 1048576, i32* %219)
store i64 %220, i64* %20
%221 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
store i8* %221, i8** %21
br label %222
222: ; preds = %278, %217
%223 = load i8*, i8** %21
%224 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %6, i64 0, i64 0
%225 = load i64, i64* %20
%226 = getelementptr inbounds i8, i8* %224, i64 %225
%227 = icmp ult i8* %223, %226
br i1 %227, label %228, label %281
228: ; preds = %222
%229 = load i8*, i8** %21
%230 = load i8, i8* %229
%231 = sext i8 %230 to i32
%232 = icmp eq i32 %231, 10
br i1 %232, label %233, label %238
233: ; preds = %228
store i32 0, i32* %11
store i32 0, i32* %10
%234 = load i8*, i8** %21
%235 = load i8, i8* %234
%236 = load i32*, i32** %13
%237 = call i32 @fputc(i8 signext %235, i32* %236)
br label %278
238: ; preds = %228
%239 = load i8*, i8** %21
%240 = load i8, i8* %239
%241 = sext i8 %240 to i32
%242 = load i8, i8* %15
%243 = sext i8 %242 to i32
%244 = icmp eq i32 %241, %243
br i1 %244, label %245, label %270
245: ; preds = %238
br label %246
246: ; preds = %254, %245
%247 = load i32, i32* %11
%248 = load i32*, i32** %7
%249 = load i32, i32* %10
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds i32, i32* %248, i64 %250
%252 = load i32, i32* %251
%253 = icmp slt i32 %247, %252
br i1 %253, label %254, label %258
254: ; preds = %246
%255 = call i32 @putchar(i8 signext 32)
%256 = load i32, i32* %11
%257 = add nsw i32 %256, 1
store i32 %257, i32* %11
br label %246
258: ; preds = %246
%259 = load i32*, i32** %13
%260 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%261 = call i32 @fprintf(i32* %259, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %260)
%262 = load i32, i32* %10
%263 = add nsw i32 %262, 1
store i32 %263, i32* %10
store i32 0, i32* %11
%264 = load i8*, i8** %21
%265 = load i8, i8* %264
%266 = sext i8 %265 to i32
%267 = icmp eq i32 %266, 10
br i1 %267, label %268, label %269
268: ; preds = %258
store i32 0, i32* %10
store i32 0, i32* %11
br label %269
269: ; preds = %268, %258
br label %277
270: ; preds = %238
%271 = load i32, i32* %11
%272 = add nsw i32 %271, 1
store i32 %272, i32* %11
%273 = load i8*, i8** %21
%274 = load i8, i8* %273
%275 = load i32*, i32** %13
%276 = call i32 @fputc(i8 signext %274, i32* %275)
br label %277
277: ; preds = %270, %269
br label %278
278: ; preds = %277, %233
%279 = load i8*, i8** %21
%280 = getelementptr inbounds i8, i8* %279, i32 1
store i8* %280, i8** %21
br label %222
281: ; preds = %222
br label %206
282: ; preds = %215
%283 = load i32*, i32** %12
%284 = call i32 @fclose(i32* %283)
store i32 0, i32* %3
br label %285
285: ; preds = %282, %116, %82, %51, %44
%286 = load i32, i32* %3
ret i32 %286
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
@.str = [7 x i8] c"?hs:e:\00"
@optarg = global i8* null
@.str.1 = [27 x i8] c"Usage : %s [options] file\0A\00"
@.str.2 = [139 x i8] c"Format text table\0A -h -? Show this help\0A -s Output separator (string) default:\22%s\22\0A -e Input separator (one char) default:TAB\0A\00"
@.str.3 = [49 x i8] c"Unknown options %c\0AUse -h option to show usages.\00"
@optind = global i64 0
@.str.4 = [27 x i8] c"Cannot open tempolary file\00"
@SEEK_SET = global i32 0
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [23 x i8] c"Cannot open input file\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [1048576 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 0
%6 = load i32*, i32** @stdout
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
store i8 32, i8* %7
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 1
store i8 124, i8* %8
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 2
store i8 32, i8* %9
br label %10
10: ; preds = %14, %2
%11 = phi i8 [ %16, %14 ], [ 9, %2 ]
br label %12
12: ; preds = %10, %17
%13 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %13, label %24 [
i32 -1, label %26
i32 101, label %14
i32 115, label %17
i32 104, label %20
i32 63, label %20
]
14: ; preds = %12
%15 = load i8*, i8** @optarg
%16 = load i8, i8* %15
br label %10
17: ; preds = %12
%18 = load i8*, i8** @optarg
%19 = call i32 @strncpy(i8* %7, i8* %18, i32 1023)
br label %12
20: ; preds = %12, %12
%21 = load i8*, i8** %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %180
24: ; preds = %12
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 %13)
br label %180
26: ; preds = %12
%27 = load i64, i64* @optind
%28 = trunc i64 %27 to i32
%29 = call i64 @malloc(i32 80)
%30 = inttoptr i64 %29 to i32*
%31 = call i32 @memset(i32* %30, i32 0, i32 80)
%32 = icmp eq i32 %28, %0
br i1 %32, label %33, label %55
33: ; preds = %26
%34 = call i32* (...) @tmpfile()
%35 = icmp eq i32* %34, null
br i1 %35, label %40, label %36
36: ; preds = %33
%37 = load i32*, i32** @stdin
%38 = call i32 @feof(i32* %37)
%39 = icmp eq i32 %38, 0
br i1 %39, label %42, label %52
40: ; preds = %33
%41 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %180
42: ; preds = %36, %46
%43 = load i32*, i32** @stdin
%44 = call i32 @ferror(i32* %43)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %52
46: ; preds = %42
%47 = call i64 @fread(i8* %5, i32 1, i32 1048576, i32* %43)
%48 = call i32 @fwrite(i8* %5, i32 1, i64 %47, i32* %34)
%49 = load i32*, i32** @stdin
%50 = call i32 @feof(i32* %49)
%51 = icmp eq i32 %50, 0
br i1 %51, label %42, label %52
52: ; preds = %42, %46, %36
%53 = load i32, i32* @SEEK_SET
%54 = call i32 @fseek(i32* %34, i32 0, i32 %53)
br label %59
55: ; preds = %26
%56 = getelementptr inbounds i8*, i8** %1, i64 %27
%57 = load i8*, i8** %56
%58 = call i32* @fopen(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %59
59: ; preds = %55, %52
%60 = phi i32* [ %34, %52 ], [ %58, %55 ]
%61 = icmp eq i32* %60, null
br i1 %61, label %65, label %62
62: ; preds = %59
%63 = call i32 @feof(i32* %60)
%64 = icmp eq i32 %63, 0
br i1 %64, label %74, label %124
65: ; preds = %59
%66 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %180
67: ; preds = %117, %81
%68 = phi i32 [ %78, %81 ], [ %118, %117 ]
%69 = phi i32 [ %77, %81 ], [ %119, %117 ]
%70 = phi i32 [ %76, %81 ], [ %120, %117 ]
%71 = phi i32* [ %75, %81 ], [ %121, %117 ]
%72 = call i32 @feof(i32* %60)
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %124
74: ; preds = %62, %67
%75 = phi i32* [ %71, %67 ], [ %30, %62 ]
%76 = phi i32 [ %70, %67 ], [ 0, %62 ]
%77 = phi i32 [ %69, %67 ], [ 0, %62 ]
%78 = phi i32 [ %68, %67 ], [ 20, %62 ]
%79 = call i32 @ferror(i32* %60)
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %124
81: ; preds = %74
%82 = call i64 @fread(i8* %5, i32 1, i32 1048576, i32* %60)
%83 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %82
%84 = icmp sgt i64 %82, 0
br i1 %84, label %85, label %67
85: ; preds = %81, %117
%86 = phi i8* [ %122, %117 ], [ %5, %81 ]
%87 = phi i32* [ %121, %117 ], [ %75, %81 ]
%88 = phi i32 [ %120, %117 ], [ %76, %81 ]
%89 = phi i32 [ %119, %117 ], [ %77, %81 ]
%90 = phi i32 [ %118, %117 ], [ %78, %81 ]
%91 = load i8, i8* %86
%92 = icmp eq i8 %91, 10
%93 = icmp eq i8 %91, %11
%94 = select i1 %92, i1 true, i1 %93
br i1 %94, label %95, label %115
95: ; preds = %85
%96 = icmp slt i32 %90, %89
br i1 %96, label %97, label %102
97: ; preds = %95
%98 = add nsw i32 %90, 20
%99 = shl i32 %98, 2
%100 = call i64 @realloc(i32* %87, i32 %99)
%101 = inttoptr i64 %100 to i32*
br label %102
102: ; preds = %97, %95
%103 = phi i32 [ %98, %97 ], [ %90, %95 ]
%104 = phi i32* [ %101, %97 ], [ %87, %95 ]
%105 = sext i32 %89 to i64
%106 = getelementptr inbounds i32, i32* %104, i64 %105
%107 = load i32, i32* %106
%108 = icmp slt i32 %107, %88
br i1 %108, label %109, label %110
109: ; preds = %102
store i32 %88, i32* %106
br label %110
110: ; preds = %109, %102
%111 = add nsw i32 %89, 1
%112 = load i8, i8* %86
%113 = icmp eq i8 %112, 10
%114 = select i1 %113, i32 0, i32 %111
br label %117
115: ; preds = %85
%116 = add nsw i32 %88, 1
br label %117
117: ; preds = %110, %115
%118 = phi i32 [ %90, %115 ], [ %103, %110 ]
%119 = phi i32 [ %89, %115 ], [ %114, %110 ]
%120 = phi i32 [ %116, %115 ], [ 0, %110 ]
%121 = phi i32* [ %87, %115 ], [ %104, %110 ]
%122 = getelementptr inbounds i8, i8* %86, i64 1
%123 = icmp ult i8* %122, %83
br i1 %123, label %85, label %67
124: ; preds = %74, %67, %62
%125 = phi i32* [ %30, %62 ], [ %71, %67 ], [ %75, %74 ]
%126 = call i32 @rewind(i32* %60)
%127 = call i32 @feof(i32* %60)
%128 = icmp eq i32 %127, 0
br i1 %128, label %134, label %178
129: ; preds = %173, %139
%130 = phi i32 [ %136, %139 ], [ %174, %173 ]
%131 = phi i32 [ %135, %139 ], [ %175, %173 ]
%132 = call i32 @feof(i32* %60)
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %178
134: ; preds = %124, %129
%135 = phi i32 [ %131, %129 ], [ 0, %124 ]
%136 = phi i32 [ %130, %129 ], [ 0, %124 ]
%137 = call i32 @ferror(i32* %60)
%138 = icmp eq i32 %137, 0
br i1 %138, label %139, label %178
139: ; preds = %134
%140 = call i64 @fread(i8* %5, i32 1, i32 1048576, i32* %60)
%141 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %3, i64 0, i64 %140
%142 = icmp sgt i64 %140, 0
br i1 %142, label %143, label %129
143: ; preds = %139, %173
%144 = phi i8* [ %176, %173 ], [ %5, %139 ]
%145 = phi i32 [ %175, %173 ], [ %135, %139 ]
%146 = phi i32 [ %174, %173 ], [ %136, %139 ]
%147 = load i8, i8* %144
%148 = icmp eq i8 %147, 10
br i1 %148, label %149, label %151
149: ; preds = %143
%150 = call i32 @fputc(i8 signext 10, i32* %6)
br label %173
151: ; preds = %143
%152 = icmp eq i8 %147, %11
br i1 %152, label %153, label %170
153: ; preds = %151
%154 = sext i32 %146 to i64
%155 = getelementptr inbounds i32, i32* %125, i64 %154
%156 = load i32, i32* %155
%157 = icmp slt i32 %145, %156
br i1 %157, label %158, label %164
158: ; preds = %153, %158
%159 = phi i32 [ %161, %158 ], [ %145, %153 ]
%160 = call i32 @putchar(i8 signext 32)
%161 = add nsw i32 %159, 1
%162 = load i32, i32* %155
%163 = icmp slt i32 %161, %162
br i1 %163, label %158, label %164
164: ; preds = %158, %153
%165 = call i32 @fputs(i8* %7, i32* %6)
%166 = add nsw i32 %146, 1
%167 = load i8, i8* %144
%168 = icmp eq i8 %167, 10
%169 = select i1 %168, i32 0, i32 %166
br label %173
170: ; preds = %151
%171 = add nsw i32 %145, 1
%172 = call i32 @fputc(i8 signext %147, i32* %6)
br label %173
173: ; preds = %164, %170, %149
%174 = phi i32 [ 0, %149 ], [ %146, %170 ], [ %169, %164 ]
%175 = phi i32 [ 0, %149 ], [ %171, %170 ], [ 0, %164 ]
%176 = getelementptr inbounds i8, i8* %144, i64 1
%177 = icmp ult i8* %176, %141
br i1 %177, label %143, label %129
178: ; preds = %134, %129, %124
%179 = call i32 @fclose(i32* %60)
br label %180
180: ; preds = %178, %65, %40, %24, %20
%181 = phi i32 [ 1, %24 ], [ 0, %20 ], [ 1, %65 ], [ 0, %178 ], [ 1, %40 ]
ret i32 %181
}