#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 atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
char *strrchr(char *, char);
int main(int argc, char **argv) {
  int cntargs;
  char *buffer1;
  char *buffer2;
  FILE *fp;
  char *ptokens[15];
  int i;
  int cnt;
  int max = 0;
  int nextarg;
  int args[15];
  char *appname = strrchr(argv[0], '/');
  if (appname) {
    appname++;
  } else {
    appname = argv[0];
  }
  if (argc < 3) {
    printf("syntax: %s <file> <column1> [column2] etc\n", appname);
    return 1;
  }
  for (cntargs = 2; cntargs < argc; ++cntargs) {
    args[cntargs] = atoi(argv[cntargs]);
    if (cntargs == 2) {
      max = args[cntargs];
    } else {
      max = args[cntargs] > max ? args[cntargs] : max;
    }
  }
  fp = fopen(argv[1], "r");
  if (!fp) {
    printf("%s: Error opening %s\n", appname, argv[1]);
    return 1;
  }
  buffer1 = malloc((1024 * 1024 * 1));
  buffer2 = malloc((1024 * 1024 * 1));
  while (fgets(buffer1, (1024 * 1024 * 1), fp) != NULL) {
    cnt = 1;
    ptokens[0] = buffer1;
    i = 0;
    while (buffer1[i] != '\0' && cnt <= max) {
      if (buffer1[i] == '|') {
        buffer1[i] = '\0';
        ptokens[cnt] = &buffer1[i + 1];
        ++cnt;
      }
      ++i;
    }
    for (cntargs = 2; cntargs < argc; ++cntargs) {
      nextarg = args[cntargs];
      if (nextarg >= cnt) {
        putc('|', stdout);
        continue;
      }
      fputs(ptokens[nextarg - 1], stdout);
      putc('|', stdout);
    }
    putc('\n', stdout);
  }
  fclose(fp);
  free(buffer2);
  free(buffer1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xbc(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x108(%rbp)
cmpq   $0x0,-0x108(%rbp)
je     1200 <main+0x60>
mov    -0x108(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x108(%rbp)
jmp    120e <main+0x6e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x108(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1239 <main+0x99>
mov    -0x108(%rbp),%rsi
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1502 <main+0x362>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e2 <main+0x142>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x100(%rbp,%rax,4)
cmpl   $0x2,-0x14(%rbp)
jne    128a <main+0xea>
movslq -0x14(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
mov    %eax,-0xbc(%rbp)
jmp    12cf <main+0x12f>
movslq -0x14(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
cmp    -0xbc(%rbp),%eax
jle    12b7 <main+0x117>
movslq -0x14(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
mov    %eax,-0x10c(%rbp)
jmp    12c3 <main+0x123>
mov    -0xbc(%rbp),%eax
mov    %eax,-0x10c(%rbp)
mov    -0x10c(%rbp),%eax
mov    %eax,-0xbc(%rbp)
jmp    12d4 <main+0x134>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1240 <main+0xa0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd3a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    132e <main+0x18e>
mov    -0x108(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1502 <main+0x362>
mov    $0x100000,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x100000,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    $0x100000,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     14e0 <main+0x340>
movl   $0x1,-0xb8(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10d(%rbp)
je     13ba <main+0x21a>
mov    -0xb8(%rbp),%eax
cmp    -0xbc(%rbp),%eax
setle  %al
mov    %al,-0x10d(%rbp)
mov    -0x10d(%rbp),%al
test   $0x1,%al
jne    13cd <main+0x22d>
jmp    1438 <main+0x298>
mov    -0x20(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7c,%eax
jne    1424 <main+0x284>
mov    -0x20(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rcx
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
cltq
add    %rax,%rcx
movslq -0xb8(%rbp),%rax
mov    %rcx,-0xb0(%rbp,%rax,8)
ff
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1385 <main+0x1e5>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14c8 <main+0x328>
movslq -0x14(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
mov    %eax,-0xc0(%rbp)
mov    -0xc0(%rbp),%eax
cmp    -0xb8(%rbp),%eax
jl     1486 <main+0x2e6>
mov    0x2b6b(%rip),%rax
mov    (%rax),%esi
mov    $0x7c,%edi
call   1090 <putc@plt>
jmp    14ba <main+0x31a>
mov    -0xc0(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    0x2b40(%rip),%rax
mov    (%rax),%esi
call   1070 <fputs@plt>
mov    0x2b32(%rip),%rax
mov    (%rax),%esi
mov    $0x7c,%edi
call   1090 <putc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    143f <main+0x29f>
mov    0x2b11(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1090 <putc@plt>
jmp    134a <main+0x1aa>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@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    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
mov    (%rsi),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
lea    0x1(%rax),%r15
test   %rax,%rax
cmove  %rbx,%r15
cmp    $0x3,%ebp
jge    11ec <main+0x4c>
lea    0xe23(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    13c6 <main+0x226>
mov    %ebp,0xc(%rsp)
mov    %ebp,%r13d
lea    -0x2(%r13),%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x10(%r14,%rbp,8),%rdi
call   10c0 <atoi@plt>
mov    %eax,0x28(%rsp,%rbp,4)
cmp    %ebx,%eax
cmovg  %eax,%ebx
test   %rbp,%rbp
cmove  %eax,%ebx
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1200 <main+0x60>
mov    0x8(%r14),%rdi
lea    0xdfe(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13b1 <main+0x211>
mov    %rax,%r12
mov    $0x100000,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    $0x100000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %rbp,%rdi
mov    $0x100000,%esi
mov    %r12,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1393 <main+0x1f3>
mov    0x2d66(%rip),%r15
mov    %r12,0x18(%rsp)
jmp    12bb <main+0x11b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15),%esi
mov    $0xa,%edi
call   1090 <putc@plt>
mov    %rbp,%rdi
mov    $0x100000,%esi
mov    0x18(%rsp),%r12
mov    %r12,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1393 <main+0x1f3>
mov    %rbp,0x60(%rsp)
mov    0x0(%rbp),%cl
mov    $0x1,%r14d
test   %cl,%cl
je     1340 <main+0x1a0>
test   %ebx,%ebx
mov    0xc(%rsp),%esi
jle    1326 <main+0x186>
mov    $0x1,%r14d
xor    %eax,%eax
mov    %rbp,%rdx
cmp    $0x7c,%cl
jne    1310 <main+0x170>
movb   $0x0,(%rdx)
lea    (%rax,%rbp,1),%rcx
add    $0x1,%rcx
add    $0x1,%rax
movslq %r14d,%r14
mov    %rcx,0x60(%rsp,%r14,8)
add    $0x1,%r14d
jmp    1314 <main+0x174>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
movzbl 0x0(%rbp,%rax,1),%ecx
test   %cl,%cl
je     1326 <main+0x186>
lea    (%rax,%rbp,1),%rdx
cmp    %ebx,%r14d
jle    12e0 <main+0x140>
cmp    $0x3,%esi
jl     1290 <main+0xf0>
jmp    134d <main+0x1ad>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
cmp    $0x3,%esi
jl     1290 <main+0xf0>
mov    $0x2,%r12d
jmp    137a <main+0x1da>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15),%esi
mov    $0x7c,%edi
call   1090 <putc@plt>
add    $0x1,%r12
cmp    %r12,%r13
je     1290 <main+0xf0>
movslq 0x20(%rsp,%r12,4),%rax
cmp    %r14d,%eax
jge    1360 <main+0x1c0>
mov    0x58(%rsp,%rax,8),%rdi
mov    (%r15),%esi
call   1070 <fputs@plt>
jmp    1360 <main+0x1c0>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
jmp    13cb <main+0x22b>
mov    0x8(%r14),%rdx
lea    0xc71(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"syntax: %s <file> <column1> [column2] etc\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [22 x i8] c"%s: Error opening %s\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca [15 x i8*]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [15 x i32]
%16 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %13
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i8* @strrchr(i8* %19, i8 signext 47)
store i8* %20, i8** %16
%21 = load i8*, i8** %16
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %26
23: ; preds = %2
%24 = load i8*, i8** %16
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %16
br label %30
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
store i8* %29, i8** %16
br label %30
30: ; preds = %26, %23
%31 = load i32, i32* %4
%32 = icmp slt i32 %31, 3
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i8*, i8** %16
%35 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %34)
store i32 1, i32* %3
br label %181
36: ; preds = %30
store i32 2, i32* %6
br label %37
37: ; preds = %75, %36
%38 = load i32, i32* %6
%39 = load i32, i32* %4
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %78
41: ; preds = %37
%42 = load i8**, i8*** %5
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @atoi(i8* %46)
%48 = load i32, i32* %6
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [15 x i32], [15 x i32]* %15, i64 0, i64 %49
store i32 %47, i32* %50
%51 = load i32, i32* %6
%52 = icmp eq i32 %51, 2
br i1 %52, label %53, label %58
53: ; preds = %41
%54 = load i32, i32* %6
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [15 x i32], [15 x i32]* %15, i64 0, i64 %55
%57 = load i32, i32* %56
store i32 %57, i32* %13
br label %74
58: ; preds = %41
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [15 x i32], [15 x i32]* %15, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = load i32, i32* %13
%64 = icmp sgt i32 %62, %63
br i1 %64, label %65, label %70
65: ; preds = %58
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [15 x i32], [15 x i32]* %15, i64 0, i64 %67
%69 = load i32, i32* %68
br label %72
70: ; preds = %58
%71 = load i32, i32* %13
br label %72
72: ; preds = %70, %65
%73 = phi i32 [ %69, %65 ], [ %71, %70 ]
store i32 %73, i32* %13
br label %74
74: ; preds = %72, %53
br label %75
75: ; preds = %74
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
br label %37
78: ; preds = %37
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 1
%81 = load i8*, i8** %80
%82 = call i32* @fopen(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %82, i32** %9
%83 = load i32*, i32** %9
%84 = icmp ne i32* %83, null
br i1 %84, label %91, label %85
85: ; preds = %78
%86 = load i8*, i8** %16
%87 = load i8**, i8*** %5
%88 = getelementptr inbounds i8*, i8** %87, i64 1
%89 = load i8*, i8** %88
%90 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %86, i8* %89)
store i32 1, i32* %3
br label %181
91: ; preds = %78
%92 = call i8* @malloc(i32 1048576)
store i8* %92, i8** %7
%93 = call i8* @malloc(i32 1048576)
store i8* %93, i8** %8
br label %94
94: ; preds = %171, %91
%95 = load i8*, i8** %7
%96 = load i32*, i32** %9
%97 = call i32* @fgets(i8* %95, i32 1048576, i32* %96)
%98 = icmp ne i32* %97, null
br i1 %98, label %99, label %174
99: ; preds = %94
store i32 1, i32* %12
%100 = load i8*, i8** %7
%101 = getelementptr inbounds [15 x i8*], [15 x i8*]* %10, i64 0, i64 0
store i8* %100, i8** %101
store i32 0, i32* %11
br label %102
102: ; preds = %139, %99
%103 = load i8*, i8** %7
%104 = load i32, i32* %11
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %103, i64 %105
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %114
110: ; preds = %102
%111 = load i32, i32* %12
%112 = load i32, i32* %13
%113 = icmp sle i32 %111, %112
br label %114
114: ; preds = %110, %102
%115 = phi i1 [ false, %102 ], [ %113, %110 ]
br i1 %115, label %116, label %142
116: ; preds = %114
%117 = load i8*, i8** %7
%118 = load i32, i32* %11
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8, i8* %117, i64 %119
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 124
br i1 %123, label %124, label %139
124: ; preds = %116
%125 = load i8*, i8** %7
%126 = load i32, i32* %11
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %125, i64 %127
store i8 0, i8* %128
%129 = load i8*, i8** %7
%130 = load i32, i32* %11
%131 = add nsw i32 %130, 1
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %129, i64 %132
%134 = load i32, i32* %12
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [15 x i8*], [15 x i8*]* %10, i64 0, i64 %135
store i8* %133, i8** %136
%137 = load i32, i32* %12
%138 = add nsw i32 %137, 1
store i32 %138, i32* %12
br label %139
139: ; preds = %124, %116
%140 = load i32, i32* %11
%141 = add nsw i32 %140, 1
store i32 %141, i32* %11
br label %102
142: ; preds = %114
store i32 2, i32* %6
br label %143
143: ; preds = %168, %142
%144 = load i32, i32* %6
%145 = load i32, i32* %4
%146 = icmp slt i32 %144, %145
br i1 %146, label %147, label %171
147: ; preds = %143
%148 = load i32, i32* %6
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [15 x i32], [15 x i32]* %15, i64 0, i64 %149
%151 = load i32, i32* %150
store i32 %151, i32* %14
%152 = load i32, i32* %14
%153 = load i32, i32* %12
%154 = icmp sge i32 %152, %153
br i1 %154, label %155, label %158
155: ; preds = %147
%156 = load i32, i32* @stdout
%157 = call i32 @putc(i8 signext 124, i32 %156)
br label %168
158: ; preds = %147
%159 = load i32, i32* %14
%160 = sub nsw i32 %159, 1
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [15 x i8*], [15 x i8*]* %10, i64 0, i64 %161
%163 = load i8*, i8** %162
%164 = load i32, i32* @stdout
%165 = call i32 @fputs(i8* %163, i32 %164)
%166 = load i32, i32* @stdout
%167 = call i32 @putc(i8 signext 124, i32 %166)
br label %168
168: ; preds = %158, %155
%169 = load i32, i32* %6
%170 = add nsw i32 %169, 1
store i32 %170, i32* %6
br label %143
171: ; preds = %143
%172 = load i32, i32* @stdout
%173 = call i32 @putc(i8 signext 10, i32 %172)
br label %94
174: ; preds = %94
%175 = load i32*, i32** %9
%176 = call i32 @fclose(i32* %175)
%177 = load i8*, i8** %8
%178 = call i32 @free(i8* %177)
%179 = load i8*, i8** %7
%180 = call i32 @free(i8* %179)
store i32 0, i32* %3
br label %181
181: ; preds = %174, %85, %33
%182 = load i32, i32* %3
ret i32 %182
}

LLVM IR (-O2):
@.str = [43 x i8] c"syntax: %s <file> <column1> [column2] etc\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [22 x i8] c"%s: Error opening %s\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [15 x i8*]
%4 = alloca [15 x i32]
%5 = bitcast [15 x i8*]* %3 to i8*
%6 = bitcast [15 x i32]* %4 to i8*
%7 = load i8*, i8** %1
%8 = tail call i8* @strrchr(i8* dereferenceable(1) %7, i8 signext 47)
%9 = icmp eq i8* %8, null
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = select i1 %9, i8* %7, i8* %10
%12 = icmp slt i32 %0, 3
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = zext i32 %0 to i64
br label %17
15: ; preds = %2
%16 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %102
17: ; preds = %13, %17
%18 = phi i64 [ 2, %13 ], [ %28, %17 ]
%19 = phi i32 [ 0, %13 ], [ %27, %17 ]
%20 = getelementptr inbounds i8*, i8** %1, i64 %18
%21 = load i8*, i8** %20
%22 = tail call i32 @atoi(i8* %21)
%23 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 %18
store i32 %22, i32* %23
%24 = icmp eq i64 %18, 2
%25 = icmp sgt i32 %22, %19
%26 = select i1 %24, i1 true, i1 %25
%27 = select i1 %26, i32 %22, i32 %19
%28 = add nuw nsw i64 %18, 1
%29 = icmp eq i64 %28, %14
br i1 %29, label %30, label %17
30: ; preds = %17
%31 = getelementptr inbounds i8*, i8** %1, i64 1
%32 = load i8*, i8** %31
%33 = tail call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %38
35: ; preds = %30
%36 = load i8*, i8** %31
%37 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %11, i8* %36)
br label %102
38: ; preds = %30
%39 = tail call dereferenceable_or_null(1048576) i8* @malloc(i32 1048576)
%40 = tail call dereferenceable_or_null(1048576) i8* @malloc(i32 1048576)
%41 = tail call i32* @fgets(i8* %39, i32 1048576, i32* %33)
%42 = icmp eq i32* %41, null
br i1 %42, label %98, label %43
43: ; preds = %38
%44 = getelementptr inbounds [15 x i8*], [15 x i8*]* %3, i64 0, i64 0
%45 = icmp sgt i32 %27, 0
%46 = icmp sgt i32 %0, 2
%47 = zext i32 %0 to i64
br label %48
48: ; preds = %43, %93
store i8* %39, i8** %44
%49 = load i8, i8* %39
%50 = icmp ne i8 %49, 0
%51 = select i1 %50, i1 %45, i1 false
br i1 %51, label %54, label %52
52: ; preds = %68, %48
%53 = phi i32 [ 1, %48 ], [ %70, %68 ]
br i1 %46, label %76, label %93
54: ; preds = %48, %68
%55 = phi i64 [ %69, %68 ], [ 0, %48 ]
%56 = phi i8 [ %72, %68 ], [ %49, %48 ]
%57 = phi i8* [ %71, %68 ], [ %39, %48 ]
%58 = phi i32 [ %70, %68 ], [ 1, %48 ]
%59 = icmp eq i8 %56, 124
br i1 %59, label %62, label %60
60: ; preds = %54
%61 = add nuw i64 %55, 1
br label %68
62: ; preds = %54
store i8 0, i8* %57
%63 = add nuw i64 %55, 1
%64 = getelementptr inbounds i8, i8* %39, i64 %63
%65 = sext i32 %58 to i64
%66 = getelementptr inbounds [15 x i8*], [15 x i8*]* %3, i64 0, i64 %65
store i8* %64, i8** %66
%67 = add nsw i32 %58, 1
br label %68
68: ; preds = %60, %62
%69 = phi i64 [ %61, %60 ], [ %63, %62 ]
%70 = phi i32 [ %58, %60 ], [ %67, %62 ]
%71 = getelementptr inbounds i8, i8* %39, i64 %69
%72 = load i8, i8* %71
%73 = icmp ne i8 %72, 0
%74 = icmp sle i32 %70, %27
%75 = select i1 %73, i1 %74, i1 false
br i1 %75, label %54, label %52
76: ; preds = %52, %88
%77 = phi i64 [ %91, %88 ], [ 2, %52 ]
%78 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = icmp slt i32 %79, %53
br i1 %80, label %81, label %88
81: ; preds = %76
%82 = add nsw i32 %79, -1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [15 x i8*], [15 x i8*]* %3, i64 0, i64 %83
%85 = load i8*, i8** %84
%86 = load i32, i32* @stdout
%87 = tail call i32 @fputs(i8* %85, i32 %86)
br label %88
88: ; preds = %76, %81
%89 = load i32, i32* @stdout
%90 = tail call i32 @putc(i8 signext 124, i32 %89)
%91 = add nuw nsw i64 %77, 1
%92 = icmp eq i64 %91, %47
br i1 %92, label %93, label %76
93: ; preds = %88, %52
%94 = load i32, i32* @stdout
%95 = tail call i32 @putc(i8 signext 10, i32 %94)
%96 = tail call i32* @fgets(i8* %39, i32 1048576, i32* %33)
%97 = icmp eq i32* %96, null
br i1 %97, label %98, label %48
98: ; preds = %93, %38
%99 = tail call i32 @fclose(i32* %33)
%100 = tail call i32 @free(i8* %40)
%101 = tail call i32 @free(i8* %39)
br label %102
102: ; preds = %98, %35, %15
%103 = phi i32 [ 1, %15 ], [ 0, %98 ], [ 1, %35 ]
ret i32 %103
}