#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 */
scalar_t__ EOF;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  FILE *fp;
  int a, i, r[20];
  char c;
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "%d ", &r[0]) != EOF) {
    int n = 1;
    while ((c = getc(fp)) != '|') {
      fseek(fp, -1, SEEK_CUR);
      fscanf(fp, "%d ", &r[n++]);
    }
    do {
      fseek(fp, 1, SEEK_CUR);
      for (i = 0; i < n; i++) {
        fscanf(fp, " %d", &a);
        if (a > r[i])
          r[i] = a;
      }
    } while (getc(fp) == ' ');
    printf("%d", r[0]);
    for (i = 1; i < n; i++)
      printf(" %d", r[i]);
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11a4 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1338 <main+0x1d8>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe54(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xe3e(%rip),%rsi
call   1050 <fscanf@plt>
mov    0x2dfe(%rip),%rcx
cmp    (%rcx),%rax
je     1331 <main+0x1d1>
movl   $0x1,-0x78(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <getc@plt>
mov    %al,-0x71(%rbp)
movsbl %al,%eax
cmp    $0x7c,%eax
je     124e <main+0xee>
mov    -0x18(%rbp),%rdi
mov    0x2dd3(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1060 <fseek@plt>
mov    -0x18(%rbp),%rdi
mov    -0x78(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x78(%rbp)
cltq
lea    -0x70(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xdd0(%rip),%rsi
call   1050 <fscanf@plt>
jmp    11f2 <main+0x92>
jmp    1253 <main+0xf3>
mov    -0x18(%rbp),%rdi
mov    0x2d8a(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%esi
call   1060 <fseek@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    12c0 <main+0x160>
mov    -0x18(%rbp),%rdi
lea    0xd90(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x1c(%rbp),%eax
movslq -0x20(%rbp),%rcx
cmp    -0x70(%rbp,%rcx,4),%eax
jle    12ad <main+0x14d>
mov    -0x1c(%rbp),%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    12b2 <main+0x152>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1271 <main+0x111>
jmp    12c5 <main+0x165>
mov    -0x18(%rbp),%rdi
call   1080 <getc@plt>
movsbl %al,%eax
cmp    $0x20,%eax
je     1253 <main+0xf3>
mov    -0x70(%rbp),%esi
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    1322 <main+0x1c2>
movslq -0x20(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%esi
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12f2 <main+0x192>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11c7 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0x2,%edi
jne    131c <main+0x1bc>
mov    0x8(%rsi),%rdi
lea    0xe90(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r13
lea    0xe83(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rax,%rdi
call   1050 <fscanf@plt>
mov    %rax,%rcx
mov    0x2e38(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
je     1336 <main+0x1d6>
mov    0x2e2e(%rip),%r12
lea    0xe57(%rip),%r14
lea    0xc(%rsp),%r15
jmp    11fe <main+0x9e>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
lea    0xe30(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1050 <fscanf@plt>
mov    0x2deb(%rip),%rcx
cmp    (%rcx),%rax
je     1334 <main+0x1d4>
mov    %r13,%rdi
call   1080 <getc@plt>
mov    $0x1,%ecx
cmp    $0x7c,%al
mov    %r12,%rbx
je     1258 <main+0xf8>
mov    $0x1,%ecx
lea    0x14(%rsp),%r12
nopl   0x0(%rax)
mov    (%rbx),%edx
mov    %r13,%rdi
mov    $0xffffffff,%esi
mov    %ecx,%ebp
call   1060 <fseek@plt>
mov    %r13,%rdi
lea    0xdd9(%rip),%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    %r13,%rdi
call   1080 <getc@plt>
mov    %ebp,%ecx
add    $0x4,%r12
add    $0x1,%ecx
cmp    $0x7c,%al
jne    1220 <main+0xc0>
cmp    $0x2,%ecx
mov    $0x1,%ebp
mov    %ecx,0x8(%rsp)
cmovae %ecx,%ebp
mov    %rbx,%r12
jmp    127c <main+0x11c>
nopl   0x0(%rax)
mov    %r13,%rdi
call   1080 <getc@plt>
cmp    $0x20,%al
jne    12d0 <main+0x170>
mov    (%r12),%edx
mov    %r13,%rdi
mov    $0x1,%esi
call   1060 <fseek@plt>
xor    %ebx,%ebx
jmp    12a9 <main+0x149>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
je     1270 <main+0x110>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <fscanf@plt>
mov    0xc(%rsp),%eax
cmp    0x10(%rsp,%rbx,4),%eax
jle    12a0 <main+0x140>
mov    %eax,0x10(%rsp,%rbx,4)
jmp    12a0 <main+0x140>
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%esi
lea    0xd3e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
cmp    $0x2,%eax
jb     11d0 <main+0x70>
mov    %eax,%ebx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1300 <main+0x1a0>
jmp    11d0 <main+0x70>
mov    (%rsi),%rsi
lea    0xcda(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    1336 <main+0x1d6>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%d \00"
@EOF = global i64 0
@SEEK_CUR = global i32 0
@.str.3 = [4 x i8] c" %d\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [20 x i32]
%10 = alloca i8
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %99
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i32 1
store i8** %21, i8*** %5
%22 = load i8*, i8** %21
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %6
br label %24
24: ; preds = %96, %19
%25 = load i32*, i32** %6
%26 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%27 = call i64 @fscanf(i32* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %26)
%28 = load i64, i64* @EOF
%29 = icmp ne i64 %27, %28
br i1 %29, label %30, label %98
30: ; preds = %24
store i32 1, i32* %11
br label %31
31: ; preds = %36, %30
%32 = load i32*, i32** %6
%33 = call signext i8 @getc(i32* %32)
store i8 %33, i8* %10
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 124
br i1 %35, label %36, label %46
36: ; preds = %31
%37 = load i32*, i32** %6
%38 = load i32, i32* @SEEK_CUR
%39 = call i32 @fseek(i32* %37, i32 -1, i32 %38)
%40 = load i32*, i32** %6
%41 = load i32, i32* %11
%42 = add nsw i32 %41, 1
store i32 %42, i32* %11
%43 = sext i32 %41 to i64
%44 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %43
%45 = call i64 @fscanf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %44)
br label %31
46: ; preds = %31
br label %47
47: ; preds = %74, %46
%48 = load i32*, i32** %6
%49 = load i32, i32* @SEEK_CUR
%50 = call i32 @fseek(i32* %48, i32 1, i32 %49)
store i32 0, i32* %8
br label %51
51: ; preds = %70, %47
%52 = load i32, i32* %8
%53 = load i32, i32* %11
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %73
55: ; preds = %51
%56 = load i32*, i32** %6
%57 = call i64 @fscanf(i32* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%58 = load i32, i32* %7
%59 = load i32, i32* %8
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = icmp sgt i32 %58, %62
br i1 %63, label %64, label %69
64: ; preds = %55
%65 = load i32, i32* %7
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %67
store i32 %65, i32* %68
br label %69
69: ; preds = %64, %55
br label %70
70: ; preds = %69
%71 = load i32, i32* %8
%72 = add nsw i32 %71, 1
store i32 %72, i32* %8
br label %51
73: ; preds = %51
br label %74
74: ; preds = %73
%75 = load i32*, i32** %6
%76 = call signext i8 @getc(i32* %75)
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 32
br i1 %78, label %47, label %79
79: ; preds = %74
%80 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%81 = load i32, i32* %80
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %81)
store i32 1, i32* %8
br label %83
83: ; preds = %93, %79
%84 = load i32, i32* %8
%85 = load i32, i32* %11
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %96
87: ; preds = %83
%88 = load i32, i32* %8
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %89
%91 = load i32, i32* %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %91)
br label %93
93: ; preds = %87
%94 = load i32, i32* %8
%95 = add nsw i32 %94, 1
store i32 %95, i32* %8
br label %83
96: ; preds = %83
%97 = call i32 @putchar(i8 signext 10)
br label %24
98: ; preds = %24
store i32 0, i32* %3
br label %99
99: ; preds = %98, %14
%100 = load i32, i32* %3
ret i32 %100
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%d \00"
@EOF = global i64 0
@SEEK_CUR = global i32 0
@.str.3 = [4 x i8] c" %d\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [20 x i32]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [20 x i32]* %4 to i8*
%7 = icmp eq i32 %0, 2
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %72
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%16 = call i64 @fscanf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %15)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %72, label %19
19: ; preds = %11, %67
%20 = call signext i8 @getc(i32* %14)
%21 = icmp eq i8 %20, 124
br i1 %21, label %24, label %28
22: ; preds = %28
%23 = trunc i64 %32 to i32
br label %24
24: ; preds = %22, %19
%25 = phi i32 [ 1, %19 ], [ %23, %22 ]
%26 = call i32 @llvm.umax.i32(i32 %25, i32 1)
%27 = zext i32 %26 to i64
br label %37
28: ; preds = %19, %28
%29 = phi i64 [ %32, %28 ], [ 1, %19 ]
%30 = load i32, i32* @SEEK_CUR
%31 = call i32 @fseek(i32* %14, i32 -1, i32 %30)
%32 = add nuw i64 %29, 1
%33 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %29
%34 = call i64 @fscanf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %33)
%35 = call signext i8 @getc(i32* %14)
%36 = icmp eq i8 %35, 124
br i1 %36, label %22, label %28
37: ; preds = %24, %51
%38 = load i32, i32* @SEEK_CUR
%39 = call i32 @fseek(i32* %14, i32 1, i32 %38)
br label %40
40: ; preds = %37, %48
%41 = phi i64 [ 0, %37 ], [ %49, %48 ]
%42 = call i64 @fscanf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%43 = load i32, i32* %3
%44 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %41
%45 = load i32, i32* %44
%46 = icmp sgt i32 %43, %45
br i1 %46, label %47, label %48
47: ; preds = %40
store i32 %43, i32* %44
br label %48
48: ; preds = %40, %47
%49 = add nuw nsw i64 %41, 1
%50 = icmp eq i64 %49, %27
br i1 %50, label %51, label %40
51: ; preds = %48
%52 = call signext i8 @getc(i32* %14)
%53 = icmp eq i8 %52, 32
br i1 %53, label %37, label %54
54: ; preds = %51
%55 = load i32, i32* %15
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %55)
%57 = icmp ugt i32 %25, 1
br i1 %57, label %58, label %67
58: ; preds = %54
%59 = zext i32 %25 to i64
br label %60
60: ; preds = %58, %60
%61 = phi i64 [ 1, %58 ], [ %65, %60 ]
%62 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %63)
%65 = add nuw nsw i64 %61, 1
%66 = icmp eq i64 %65, %59
br i1 %66, label %67, label %60
67: ; preds = %60, %54
%68 = call i32 @putchar(i8 signext 10)
%69 = call i64 @fscanf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %15)
%70 = load i64, i64* @EOF
%71 = icmp eq i64 %69, %70
br i1 %71, label %72, label %19
72: ; preds = %67, %11, %8
%73 = phi i32 [ 1, %8 ], [ 0, %11 ], [ 0, %67 ]
ret i32 %73
}