#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 EXIT_FAILURE;
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *fp;
  char c;
  int b[10] = {0};
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while (fscanf(fp, "%c", &c) != EOF) {
    int a = 0, n = 0, i;
    do {
      if (c < '0' || c > '9') {
        goto fail_nondigit;
      }
      a = 0;
      while (c >= '0' && c <= '9') {
        a = a * 10 + c - '0';
        if (fscanf(fp, "%c", &c) == EOF)
          goto fail_eof;
      }
      b[n++] = a;
      if (fscanf(fp, "%c", &c) == EOF)
        goto fail_eof;
    } while (c != '|');
    if (fscanf(fp, "%c", &c) == EOF)
      goto fail_eof;
    if (c != ' ')
      goto fail_nonspace;
    if (fscanf(fp, "%c", &c) == EOF)
      goto fail_eof;
    for (i = 0; i < n; i++) {
      if (c < '0' || c > '9') {
        goto fail_nondigit;
      }
      a = 0;
      while (c >= '0' && c <= '9') {
        a = a * 10 + c - '0';
        if (fscanf(fp, "%c", &c) == EOF) {
          if (i < n - 1)
            goto fail_eof;
          else
            break;
        }
      }
      if (i > 0)
        printf(" ");
      printf("%d", b[i] * a);
      if (i < n - 1 && fscanf(fp, "%c", &c) == EOF)
        goto fail_eof;
    }
    printf("\n");
  }
  return 0;
fail_nondigit:
  printf("unexpected non-digit input: \"%c\"\n", c);
  return EXIT_FAILURE;
fail_nonspace:
  printf("unexpected non-space input: \"%c\"\n", c);
  return EXIT_FAILURE;
fail_eof:
  printf("unexpected end of input\n");
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
je     1191 <main+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14e6 <main+0x3a6>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe67(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe55(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1050 <fscanf@plt>
mov    0x2e19(%rip),%rcx
cmp    (%rcx),%rax
je     147a <main+0x33a>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x30,%eax
jl     1200 <main+0xc0>
movsbl -0x19(%rbp),%eax
cmp    $0x39,%eax
jle    1205 <main+0xc5>
jmp    1486 <main+0x346>
movl   $0x0,-0x54(%rbp)
movsbl -0x19(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x5d(%rbp)
jl     122b <main+0xeb>
movsbl -0x19(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x5d(%rbp)
mov    -0x5d(%rbp),%al
test   $0x1,%al
jne    123b <main+0xfb>
jmp    1279 <main+0x139>
imul   $0xa,-0x54(%rbp),%eax
movsbl -0x19(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xdbe(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1050 <fscanf@plt>
mov    0x2d82(%rip),%rcx
cmp    (%rcx),%rax
jne    1274 <main+0x134>
jmp    14cc <main+0x38c>
jmp    120c <main+0xcc>
mov    -0x54(%rbp),%ecx
mov    -0x58(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x58(%rbp)
cltq
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x18(%rbp),%rdi
lea    0xd7c(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1050 <fscanf@plt>
mov    0x2d40(%rip),%rcx
cmp    (%rcx),%rax
jne    12b6 <main+0x176>
jmp    14cc <main+0x38c>
jmp    12bb <main+0x17b>
movsbl -0x19(%rbp),%eax
cmp    $0x7c,%eax
jne    11e6 <main+0xa6>
mov    -0x18(%rbp),%rdi
lea    0xd41(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1050 <fscanf@plt>
mov    0x2d05(%rip),%rcx
cmp    (%rcx),%rax
jne    12f1 <main+0x1b1>
jmp    14cc <main+0x38c>
movsbl -0x19(%rbp),%eax
cmp    $0x20,%eax
je     1303 <main+0x1c3>
jmp    14a9 <main+0x369>
mov    -0x18(%rbp),%rdi
lea    0xd06(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1050 <fscanf@plt>
mov    0x2cca(%rip),%rcx
cmp    (%rcx),%rax
jne    132c <main+0x1ec>
jmp    14cc <main+0x38c>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x58(%rbp),%eax
jge    1467 <main+0x327>
movsbl -0x19(%rbp),%eax
cmp    $0x30,%eax
jl     1359 <main+0x219>
movsbl -0x19(%rbp),%eax
cmp    $0x39,%eax
jle    135e <main+0x21e>
jmp    1486 <main+0x346>
movl   $0x0,-0x54(%rbp)
movsbl -0x19(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x5e(%rbp)
jl     1384 <main+0x244>
movsbl -0x19(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x5e(%rbp)
mov    -0x5e(%rbp),%al
test   $0x1,%al
jne    1394 <main+0x254>
jmp    13e8 <main+0x2a8>
imul   $0xa,-0x54(%rbp),%eax
movsbl -0x19(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xc65(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1050 <fscanf@plt>
mov    0x2c29(%rip),%rcx
cmp    (%rcx),%rax
jne    13e3 <main+0x2a3>
mov    -0x5c(%rbp),%eax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13de <main+0x29e>
jmp    14cc <main+0x38c>
jmp    13e8 <main+0x2a8>
jmp    1365 <main+0x225>
cmpl   $0x0,-0x5c(%rbp)
jle    1400 <main+0x2c0>
lea    0xc1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
imul   -0x54(%rbp),%esi
lea    0xc06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5c(%rbp),%eax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1454 <main+0x314>
mov    -0x18(%rbp),%rdi
lea    0xbde(%rip),%rsi
lea    -0x19(%rbp),%rdx
call   1050 <fscanf@plt>
mov    0x2ba2(%rip),%rcx
cmp    (%rcx),%rax
jne    1454 <main+0x314>
jmp    14cc <main+0x38c>
jmp    1459 <main+0x319>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1333 <main+0x1f3>
lea    0xbf0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b4 <main+0x74>
movl   $0x0,-0x4(%rbp)
jmp    14e6 <main+0x3a6>
movsbl -0x19(%rbp),%esi
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2b39(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e6 <main+0x3a6>
movsbl -0x19(%rbp),%esi
lea    0xb8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2b16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e6 <main+0x3a6>
lea    0xb8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2af7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x40(%rsp)
cmp    $0x2,%edi
jne    13bd <main+0x26d>
mov    0x8(%rsi),%rdi
lea    0xe8a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r13
lea    0xe7d(%rip),%rsi
lea    0x7(%rsp),%rdx
mov    %rax,%rdi
call   1060 <fscanf@plt>
mov    %rax,%rcx
mov    0x2e3a(%rip),%rbp
xor    %eax,%eax
cmp    0x0(%rbp),%rcx
je     13ea <main+0x29a>
lea    0xe53(%rip),%r14
lea    0x7(%rsp),%r15
mov    0x7(%rsp),%r12b
xor    %eax,%eax
mov    %rax,%rcx
lea    -0x3a(%r12),%eax
cmp    $0xf6,%al
jb     13f9 <main+0x2a9>
mov    %rcx,0x10(%rsp)
lea    -0x30(%r12),%eax
xor    %ebx,%ebx
cmp    $0x9,%al
ja     1224 <main+0xd4>
xor    %ebx,%ebx
nop
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%rbp),%rax
je     13d5 <main+0x285>
lea    (%rbx,%rbx,4),%eax
movzbl %r12b,%ecx
lea    (%rcx,%rax,2),%ebx
add    $0xffffffd0,%ebx
movzbl 0x7(%rsp),%r12d
lea    -0x30(%r12),%eax
cmp    $0xa,%al
jb     11f0 <main+0xa0>
mov    0x10(%rsp),%rax
mov    %ebx,0x20(%rsp,%rax,4)
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%rbp),%rax
je     13d5 <main+0x285>
mov    0x10(%rsp),%rax
add    $0x1,%rax
mov    0x7(%rsp),%r12b
cmp    $0x7c,%r12b
jne    11cd <main+0x7d>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%rbp),%rax
je     13d5 <main+0x285>
movsbl 0x7(%rsp),%esi
cmp    $0x20,%esi
jne    140d <main+0x2bd>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%rbp),%rax
je     13d5 <main+0x285>
mov    0x10(%rsp),%rcx
mov    %ecx,%eax
mov    %rax,0x18(%rsp)
add    $0x1,%ecx
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    %rcx,0x10(%rsp)
jmp    12d7 <main+0x187>
mov    0x8(%rsp),%rdx
add    $0x1,%rdx
mov    0x10(%rsp),%rcx
mov    %rdx,%rax
mov    %rdx,0x8(%rsp)
cmp    %rcx,%rdx
je     1394 <main+0x244>
mov    0x7(%rsp),%r12b
lea    -0x3a(%r12),%eax
cmp    $0xf6,%al
jb     13f9 <main+0x2a9>
lea    -0x30(%r12),%eax
xor    %ebx,%ebx
cmp    $0x9,%al
ja     1342 <main+0x1f2>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movzbl %r12b,%eax
lea    (%rbx,%rbx,4),%ecx
lea    (%rax,%rcx,2),%ebx
add    $0xffffffd0,%ebx
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%rbp),%rax
je     1332 <main+0x1e2>
movzbl 0x7(%rsp),%r12d
lea    -0x30(%r12),%eax
cmp    $0xa,%al
jb     1300 <main+0x1b0>
jmp    1342 <main+0x1f2>
mov    0x8(%rsp),%rax
cmp    0x18(%rsp),%rax
jb     13d5 <main+0x285>
cmpq   $0x0,0x8(%rsp)
je     1354 <main+0x204>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%r12
imul   0x20(%rsp,%r12,4),%ebx
lea    0xcb1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    0x18(%rsp),%r12
jae    12b8 <main+0x168>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%rbp),%rax
jne    12b8 <main+0x168>
jmp    13d5 <main+0x285>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    0x0(%rbp),%rcx
jne    11c6 <main+0x76>
jmp    13ea <main+0x29a>
mov    (%rsi),%rsi
lea    0xc39(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%eax
jmp    13ea <main+0x29a>
lea    0xc82(%rip),%rdi
call   1040 <puts@plt>
mov    0x2bf0(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movsbl %r12b,%esi
lea    0xc16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    13e1 <main+0x291>
lea    0xc28(%rip),%rdi
jmp    1404 <main+0x2b4>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.4 = [3 x i8] c"%d\00"
@.str.6 = [34 x i8] c"unexpected non-digit input: \22%c\22\0A\00"
@EXIT_FAILURE = global i32 0
@.str.7 = [34 x i8] c"unexpected non-space input: \22%c\22\0A\00"
@str = [24 x i8] c"unexpected end of input\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8
%4 = alloca [10 x i32]
%5 = bitcast [10 x i32]* %4 to i8*
%6 = icmp eq i32 %0, 2
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %125
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
br i1 %16, label %125, label %17
17: ; preds = %10, %108
%18 = load i8, i8* %3
br label %19
19: ; preds = %17, %47
%20 = phi i8 [ %18, %17 ], [ %49, %47 ]
%21 = phi i64 [ 0, %17 ], [ %48, %47 ]
%22 = add i8 %20, -58
%23 = icmp ult i8 %22, -10
br i1 %23, label %113, label %24
24: ; preds = %19
%25 = add i8 %20, -48
%26 = icmp ult i8 %25, 10
br i1 %26, label %27, label %41
27: ; preds = %24, %33
%28 = phi i32 [ %37, %33 ], [ 0, %24 ]
%29 = phi i8 [ %38, %33 ], [ %20, %24 ]
%30 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%31 = load i64, i64* @EOF
%32 = icmp eq i64 %30, %31
br i1 %32, label %122, label %33
33: ; preds = %27
%34 = mul nsw i32 %28, 10
%35 = add i32 %34, -48
%36 = zext i8 %29 to i32
%37 = add i32 %35, %36
%38 = load i8, i8* %3
%39 = add i8 %38, -48
%40 = icmp ult i8 %39, 10
br i1 %40, label %27, label %41
41: ; preds = %33, %24
%42 = phi i32 [ 0, %24 ], [ %37, %33 ]
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %21
store i32 %42, i32* %43
%44 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%45 = load i64, i64* @EOF
%46 = icmp eq i64 %44, %45
br i1 %46, label %122, label %47
47: ; preds = %41
%48 = add nuw i64 %21, 1
%49 = load i8, i8* %3
%50 = icmp eq i8 %49, 124
br i1 %50, label %51, label %19
51: ; preds = %47
%52 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%53 = load i64, i64* @EOF
%54 = icmp eq i64 %52, %53
br i1 %54, label %122, label %55
55: ; preds = %51
%56 = load i8, i8* %3
%57 = icmp eq i8 %56, 32
br i1 %57, label %58, label %118
58: ; preds = %55
%59 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%60 = load i64, i64* @EOF
%61 = icmp eq i64 %59, %60
br i1 %61, label %122, label %62
62: ; preds = %58
%63 = and i64 %21, 4294967295
%64 = add i64 %21, 1
%65 = and i64 %64, 4294967295
br label %66
66: ; preds = %62, %105
%67 = phi i64 [ 0, %62 ], [ %106, %105 ]
%68 = load i8, i8* %3
%69 = add i8 %68, -58
%70 = icmp ult i8 %69, -10
br i1 %70, label %113, label %71
71: ; preds = %66
%72 = add i8 %68, -48
%73 = icmp ult i8 %72, 10
br i1 %73, label %74, label %90
74: ; preds = %71, %84
%75 = phi i32 [ %80, %84 ], [ 0, %71 ]
%76 = phi i8 [ %85, %84 ], [ %68, %71 ]
%77 = zext i8 %76 to i32
%78 = mul nsw i32 %75, 10
%79 = add i32 %78, -48
%80 = add i32 %79, %77
%81 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%82 = load i64, i64* @EOF
%83 = icmp eq i64 %81, %82
br i1 %83, label %88, label %84
84: ; preds = %74
%85 = load i8, i8* %3
%86 = add i8 %85, -48
%87 = icmp ult i8 %86, 10
br i1 %87, label %74, label %90
88: ; preds = %74
%89 = icmp ult i64 %67, %63
br i1 %89, label %122, label %90
90: ; preds = %84, %71, %88
%91 = phi i32 [ %80, %88 ], [ 0, %71 ], [ %80, %84 ]
%92 = icmp eq i64 %67, 0
br i1 %92, label %95, label %93
93: ; preds = %90
%94 = call i32 @putchar(i32 32)
br label %95
95: ; preds = %93, %90
%96 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %67
%97 = load i32, i32* %96
%98 = mul nsw i32 %97, %91
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %98)
%100 = icmp ult i64 %67, %63
br i1 %100, label %101, label %105
101: ; preds = %95
%102 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%103 = load i64, i64* @EOF
%104 = icmp eq i64 %102, %103
br i1 %104, label %122, label %105
105: ; preds = %95, %101
%106 = add nuw nsw i64 %67, 1
%107 = icmp eq i64 %106, %65
br i1 %107, label %108, label %66
108: ; preds = %105
%109 = call i32 @putchar(i32 10)
%110 = call i64 @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%111 = load i64, i64* @EOF
%112 = icmp eq i64 %110, %111
br i1 %112, label %125, label %17
113: ; preds = %19, %66
%114 = phi i8 [ %68, %66 ], [ %20, %19 ]
%115 = sext i8 %114 to i32
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %115)
%117 = load i32, i32* @EXIT_FAILURE
br label %125
118: ; preds = %55
%119 = sext i8 %56 to i32
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %119)
%121 = load i32, i32* @EXIT_FAILURE
br label %125
122: ; preds = %51, %58, %41, %88, %101, %27
%123 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%124 = load i32, i32* @EXIT_FAILURE
br label %125
125: ; preds = %108, %10, %122, %118, %113, %7
%126 = phi i32 [ 1, %7 ], [ %124, %122 ], [ %121, %118 ], [ %117, %113 ], [ 0, %10 ], [ 0, %108 ]
ret i32 %126
}