#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 countNDoubles(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
scalar_t__ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int readNInts(int /*<<< orphan*/ *, int *, int);
int /*<<< orphan*/ skipNDoubles(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
int strlen(char *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void readNpointsAndNprojections(FILE *fp, int *n3Dpts, int pnp, int *nprojs,
                                int mnp, int *havecov) {
  int nfirst, lineno, npts, nframes, ch, n;
  nfirst = countNDoubles(fp);
  *havecov = 0;
  *n3Dpts = *nprojs = lineno = npts = 0;
  while (!feof(fp)) {
    if ((ch = fgetc(fp)) == '#') {
      {
        char buf[2048];
        while (!feof(fp))
          if (!fgets(buf, 2048 - 1, fp) || buf[strlen(buf) - 1] == '\n')
            break;
      };
      ++lineno;
      continue;
    }
    if (feof(fp))
      break;
    ungetc(ch, fp);
    ++lineno;
    skipNDoubles(fp, pnp);
    n = readNInts(fp, &nframes, 1);
    if (n != 1) {
      fprintf(
          stderr,
          "readNpointsAndNprojections(): error reading input file, line %d: "
          "expecting number of frames for 3D point\n",
          lineno);
      exit(1);
    }
    if (npts == 0) {
      nfirst -= (pnp + 1);
      if (nfirst == nframes * (mnp + 1 + mnp * mnp)) {
        *havecov = 1;
      } else if (nfirst == nframes * (mnp + 1 + mnp * (mnp + 1) / 2)) {
        *havecov = 2;
      } else {
        *havecov = 0;
      }
    }
    {
      char buf[2048];
      while (!feof(fp))
        if (!fgets(buf, 2048 - 1, fp) || buf[strlen(buf) - 1] == '\n')
          break;
    };
    *nprojs += nframes;
    ++npts;
  }
  *n3Dpts = npts;
}


x86 assembly (clang, -O0):
<readNpointsAndNprojections>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <countNDoubles@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1219 <readNpointsAndNprojections+0x79>
jmp    145c <readNpointsAndNprojections+0x2bc>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x44(%rbp)
cmp    $0x23,%eax
jne    12aa <readNpointsAndNprojections+0x10a>
jmp    1233 <readNpointsAndNprojections+0x93>
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1252 <readNpointsAndNprojections+0xb2>
jmp    129c <readNpointsAndNprojections+0xfc>
lea    -0x850(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x7ff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%eax
je     1292 <readNpointsAndNprojections+0xf2>
lea    -0x850(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0x850(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1297 <readNpointsAndNprojections+0xf7>
jmp    129c <readNpointsAndNprojections+0xfc>
jmp    1233 <readNpointsAndNprojections+0x93>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11fa <readNpointsAndNprojections+0x5a>
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
je     12c2 <readNpointsAndNprojections+0x122>
jmp    145c <readNpointsAndNprojections+0x2bc>
mov    -0x44(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   10b0 <ungetc@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <skipNDoubles@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x1,%edx
call   10a0 <readNInts@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x1,-0x48(%rbp)
je     1324 <readNpointsAndNprojections+0x184>
mov    0x2cd7(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
lea    0xceb(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
cmpl   $0x0,-0x3c(%rbp)
jne    13d5 <readNpointsAndNprojections+0x235>
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x40(%rbp),%ecx
mov    -0x24(%rbp),%edx
add    $0x1,%edx
mov    -0x24(%rbp),%esi
imul   -0x24(%rbp),%esi
add    %esi,%edx
imul   %edx,%ecx
cmp    %ecx,%eax
jne    136b <readNpointsAndNprojections+0x1cb>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
jmp    13d0 <readNpointsAndNprojections+0x230>
mov    -0x34(%rbp),%eax
mov    %eax,-0x1054(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1058(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x24(%rbp),%edx
add    $0x1,%edx
imul   %edx,%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    -0x1058(%rbp),%edx
mov    %eax,%esi
mov    -0x1054(%rbp),%eax
add    %esi,%edx
imul   %edx,%ecx
cmp    %ecx,%eax
jne    13c1 <readNpointsAndNprojections+0x221>
mov    -0x30(%rbp),%rax
movl   $0x2,(%rax)
jmp    13cb <readNpointsAndNprojections+0x22b>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
jmp    13d0 <readNpointsAndNprojections+0x230>
jmp    13d5 <readNpointsAndNprojections+0x235>
jmp    13da <readNpointsAndNprojections+0x23a>
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13f9 <readNpointsAndNprojections+0x259>
jmp    1443 <readNpointsAndNprojections+0x2a3>
lea    -0x1050(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x7ff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%eax
je     1439 <readNpointsAndNprojections+0x299>
lea    -0x1050(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0x1050(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    143e <readNpointsAndNprojections+0x29e>
jmp    1443 <readNpointsAndNprojections+0x2a3>
jmp    13da <readNpointsAndNprojections+0x23a>
mov    -0x40(%rbp),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11fa <readNpointsAndNprojections+0x5a>
mov    -0x3c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNpointsAndNprojections>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x838,%rsp
mov    %r9,%r15
mov    %r8d,%r12d
mov    %rcx,%rbx
mov    %edx,0xc(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbp
call   1070 <countNDoubles@plt>
mov    %eax,0x8(%rsp)
mov    %r15,0x20(%rsp)
movl   $0x0,(%r15)
mov    %rbx,0x28(%rsp)
movl   $0x0,(%rbx)
movl   $0x0,(%r14)
mov    %rbp,%rdi
call   1090 <feof@plt>
xor    %r15d,%r15d
test   %rax,%rax
je     1210 <readNpointsAndNprojections+0x70>
mov    %r15d,(%r14)
add    $0x838,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0xc(%rsp),%eax
not    %eax
mov    %eax,0x1c(%rsp)
lea    0x1(%r12),%eax
mov    %r12d,%ecx
imul   %ecx,%ecx
add    %r12d,%ecx
add    $0x1,%ecx
mov    %ecx,0x18(%rsp)
imul   %r12d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
lea    (%rcx,%r12,1),%eax
add    $0x1,%eax
mov    %eax,0x14(%rsp)
xor    %r13d,%r13d
lea    0x30(%rsp),%r12
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1050 <fgetc@plt>
cmp    $0x23,%eax
jne    12b9 <readNpointsAndNprojections+0x119>
nopl   (%rax)
mov    %rbp,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    12a3 <readNpointsAndNprojections+0x103>
mov    %r12,%rdi
mov    $0x7ff,%esi
mov    %rbp,%rdx
call   1060 <fgets@plt>
test   %eax,%eax
je     12a3 <readNpointsAndNprojections+0x103>
mov    %r12,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%r12,1)
jne    1270 <readNpointsAndNprojections+0xd0>
add    $0x1,%r13d
mov    %rbp,%rdi
call   1090 <feof@plt>
test   %rax,%rax
je     1260 <readNpointsAndNprojections+0xc0>
jmp    11fb <readNpointsAndNprojections+0x5b>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    11fb <readNpointsAndNprojections+0x5b>
mov    %ebx,%edi
mov    %rbp,%rsi
call   10b0 <ungetc@plt>
add    $0x1,%r13d
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
call   1030 <skipNDoubles@plt>
mov    %rbp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x1,%edx
call   10a0 <readNInts@plt>
cmp    $0x1,%eax
jne    1387 <readNpointsAndNprojections+0x1e7>
test   %r15d,%r15d
jne    1340 <readNpointsAndNprojections+0x1a0>
mov    0x8(%rsp),%esi
add    0x1c(%rsp),%esi
mov    0x10(%rsp),%eax
mov    %eax,%ecx
imul   0x18(%rsp),%ecx
imul   0x14(%rsp),%eax
xor    %edx,%edx
cmp    %eax,%esi
sete   %dl
add    %edx,%edx
mov    %esi,0x8(%rsp)
cmp    %ecx,%esi
mov    $0x1,%eax
cmove  %eax,%edx
mov    0x20(%rsp),%rax
mov    %edx,(%rax)
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    1373 <readNpointsAndNprojections+0x1d3>
mov    %r12,%rdi
mov    $0x7ff,%esi
mov    %rbp,%rdx
call   1060 <fgets@plt>
test   %eax,%eax
je     1373 <readNpointsAndNprojections+0x1d3>
mov    %r12,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%r12,1)
jne    1340 <readNpointsAndNprojections+0x1a0>
mov    0x10(%rsp),%eax
mov    0x28(%rsp),%rcx
add    %eax,(%rcx)
add    $0x1,%r15d
jmp    12a7 <readNpointsAndNprojections+0x107>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
lea    0xc69(%rip),%rsi
mov    %r13d,%edx
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [106 x i8] c"readNpointsAndNprojections(): error reading input file, line %d: expecting number of frames for 3D point\0A\00"
define void @readNpointsAndNprojections(i32* %0, i32* %1, i32 %2, i32* %3, i32 %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca [2048 x i8]
%20 = alloca [2048 x i8]
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store i32* %5, i32** %12
%21 = load i32*, i32** %7
%22 = call i32 @countNDoubles(i32* %21)
store i32 %22, i32* %13
%23 = load i32*, i32** %12
store i32 0, i32* %23
store i32 0, i32* %15
store i32 0, i32* %14
%24 = load i32*, i32** %10
store i32 0, i32* %24
%25 = load i32*, i32** %8
store i32 0, i32* %25
br label %26
26: ; preds = %144, %57, %6
%27 = load i32*, i32** %7
%28 = call i64 @feof(i32* %27)
%29 = icmp ne i64 %28, 0
%30 = xor i1 %29, true
br i1 %30, label %31, label %151
31: ; preds = %26
%32 = load i32*, i32** %7
%33 = call i32 @fgetc(i32* %32)
store i32 %33, i32* %17
%34 = icmp eq i32 %33, 35
br i1 %34, label %35, label %60
35: ; preds = %31
br label %36
36: ; preds = %56, %35
%37 = load i32*, i32** %7
%38 = call i64 @feof(i32* %37)
%39 = icmp ne i64 %38, 0
%40 = xor i1 %39, true
br i1 %40, label %41, label %57
41: ; preds = %36
%42 = getelementptr inbounds [2048 x i8], [2048 x i8]* %19, i64 0, i64 0
%43 = load i32*, i32** %7
%44 = call i32 @fgets(i8* %42, i32 2047, i32* %43)
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %55
46: ; preds = %41
%47 = getelementptr inbounds [2048 x i8], [2048 x i8]* %19, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [2048 x i8], [2048 x i8]* %19, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 10
br i1 %54, label %55, label %56
55: ; preds = %46, %41
br label %57
56: ; preds = %46
br label %36
57: ; preds = %55, %36
%58 = load i32, i32* %14
%59 = add nsw i32 %58, 1
store i32 %59, i32* %14
br label %26
60: ; preds = %31
%61 = load i32*, i32** %7
%62 = call i64 @feof(i32* %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %60
br label %151
65: ; preds = %60
%66 = load i32, i32* %17
%67 = load i32*, i32** %7
%68 = call i32 @ungetc(i32 %66, i32* %67)
%69 = load i32, i32* %14
%70 = add nsw i32 %69, 1
store i32 %70, i32* %14
%71 = load i32*, i32** %7
%72 = load i32, i32* %9
%73 = call i32 @skipNDoubles(i32* %71, i32 %72)
%74 = load i32*, i32** %7
%75 = call i32 @readNInts(i32* %74, i32* %16, i32 1)
store i32 %75, i32* %18
%76 = load i32, i32* %18
%77 = icmp ne i32 %76, 1
br i1 %77, label %78, label %83
78: ; preds = %65
%79 = load i32, i32* @stderr
%80 = load i32, i32* %14
%81 = call i32 @fprintf(i32 %79, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 %80)
%82 = call i32 @exit(i32 1)
unreachable
83: ; preds = %65
%84 = load i32, i32* %15
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %122
86: ; preds = %83
%87 = load i32, i32* %9
%88 = add nsw i32 %87, 1
%89 = load i32, i32* %13
%90 = sub nsw i32 %89, %88
store i32 %90, i32* %13
%91 = load i32, i32* %13
%92 = load i32, i32* %16
%93 = load i32, i32* %11
%94 = add nsw i32 %93, 1
%95 = load i32, i32* %11
%96 = load i32, i32* %11
%97 = mul nsw i32 %95, %96
%98 = add nsw i32 %94, %97
%99 = mul nsw i32 %92, %98
%100 = icmp eq i32 %91, %99
br i1 %100, label %101, label %103
101: ; preds = %86
%102 = load i32*, i32** %12
store i32 1, i32* %102
br label %121
103: ; preds = %86
%104 = load i32, i32* %13
%105 = load i32, i32* %16
%106 = load i32, i32* %11
%107 = add nsw i32 %106, 1
%108 = load i32, i32* %11
%109 = load i32, i32* %11
%110 = add nsw i32 %109, 1
%111 = mul nsw i32 %108, %110
%112 = sdiv i32 %111, 2
%113 = add nsw i32 %107, %112
%114 = mul nsw i32 %105, %113
%115 = icmp eq i32 %104, %114
br i1 %115, label %116, label %118
116: ; preds = %103
%117 = load i32*, i32** %12
store i32 2, i32* %117
br label %120
118: ; preds = %103
%119 = load i32*, i32** %12
store i32 0, i32* %119
br label %120
120: ; preds = %118, %116
br label %121
121: ; preds = %120, %101
br label %122
122: ; preds = %121, %83
br label %123
123: ; preds = %143, %122
%124 = load i32*, i32** %7
%125 = call i64 @feof(i32* %124)
%126 = icmp ne i64 %125, 0
%127 = xor i1 %126, true
br i1 %127, label %128, label %144
128: ; preds = %123
%129 = getelementptr inbounds [2048 x i8], [2048 x i8]* %20, i64 0, i64 0
%130 = load i32*, i32** %7
%131 = call i32 @fgets(i8* %129, i32 2047, i32* %130)
%132 = icmp ne i32 %131, 0
br i1 %132, label %133, label %142
133: ; preds = %128
%134 = getelementptr inbounds [2048 x i8], [2048 x i8]* %20, i64 0, i64 0
%135 = call i32 @strlen(i8* %134)
%136 = sub nsw i32 %135, 1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [2048 x i8], [2048 x i8]* %20, i64 0, i64 %137
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
%141 = icmp eq i32 %140, 10
br i1 %141, label %142, label %143
142: ; preds = %133, %128
br label %144
143: ; preds = %133
br label %123
144: ; preds = %142, %123
%145 = load i32, i32* %16
%146 = load i32*, i32** %10
%147 = load i32, i32* %146
%148 = add nsw i32 %147, %145
store i32 %148, i32* %146
%149 = load i32, i32* %15
%150 = add nsw i32 %149, 1
store i32 %150, i32* %15
br label %26
151: ; preds = %64, %26
%152 = load i32, i32* %15
%153 = load i32*, i32** %8
store i32 %152, i32* %153
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [106 x i8] c"readNpointsAndNprojections(): error reading input file, line %d: expecting number of frames for 3D point\0A\00"
define void @readNpointsAndNprojections(i32* %0, i32* nocapture writeonly %1, i32 %2, i32* nocapture %3, i32 %4, i32* nocapture writeonly %5) {
%7 = alloca i32
%8 = alloca [2048 x i8]
%9 = alloca [2048 x i8]
%10 = bitcast i32* %7 to i8*
%11 = tail call i32 @countNDoubles(i32* %0)
store i32 0, i32* %5
store i32 0, i32* %3
store i32 0, i32* %1
%12 = call i64 @feof(i32* %0)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %96
14: ; preds = %6
%15 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 0
%16 = xor i32 %2, -1
%17 = add nsw i32 %4, 1
%18 = mul nsw i32 %4, %4
%19 = add nsw i32 %17, %18
%20 = mul nsw i32 %17, %4
%21 = sdiv i32 %20, 2
%22 = add nsw i32 %21, %17
%23 = getelementptr inbounds [2048 x i8], [2048 x i8]* %9, i64 0, i64 0
br label %24
24: ; preds = %14, %89
%25 = phi i32 [ %11, %14 ], [ %75, %89 ]
%26 = phi i32 [ 0, %14 ], [ %55, %89 ]
%27 = phi i32 [ 0, %14 ], [ %93, %89 ]
br label %28
28: ; preds = %24, %46
%29 = phi i32 [ %26, %24 ], [ %47, %46 ]
%30 = call i32 @fgetc(i32* %0)
%31 = icmp eq i32 %30, 35
br i1 %31, label %32, label %50
32: ; preds = %28
br label %33
33: ; preds = %39, %32
%34 = call i64 @feof(i32* %0)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %33
%37 = call i32 @fgets(i8* %15, i32 2047, i32* %0)
%38 = icmp eq i32 %37, 0
br i1 %38, label %46, label %39
39: ; preds = %36
%40 = call i32 @strlen(i8* %15)
%41 = add nsw i32 %40, -1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 10
br i1 %45, label %46, label %33
46: ; preds = %36, %39, %33
%47 = add nsw i32 %29, 1
%48 = call i64 @feof(i32* %0)
%49 = icmp eq i64 %48, 0
br i1 %49, label %28, label %96
50: ; preds = %28
%51 = call i64 @feof(i32* %0)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %96
53: ; preds = %50
%54 = call i32 @ungetc(i32 %30, i32* %0)
%55 = add nsw i32 %29, 1
%56 = call i32 @skipNDoubles(i32* %0, i32 %2)
%57 = call i32 @readNInts(i32* %0, i32* %7, i32 1)
%58 = icmp eq i32 %57, 1
br i1 %58, label %63, label %59
59: ; preds = %53
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 %55)
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %53
%64 = icmp eq i32 %27, 0
br i1 %64, label %65, label %74
65: ; preds = %63
%66 = add i32 %25, %16
%67 = load i32, i32* %7
%68 = mul nsw i32 %67, %19
%69 = icmp eq i32 %66, %68
%70 = mul nsw i32 %67, %22
%71 = icmp eq i32 %66, %70
%72 = select i1 %71, i32 2, i32 0
%73 = select i1 %69, i32 1, i32 %72
store i32 %73, i32* %5
br label %74
74: ; preds = %65, %63
%75 = phi i32 [ %25, %63 ], [ %66, %65 ]
br label %76
76: ; preds = %82, %74
%77 = call i64 @feof(i32* %0)
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %89
79: ; preds = %76
%80 = call i32 @fgets(i8* %23, i32 2047, i32* %0)
%81 = icmp eq i32 %80, 0
br i1 %81, label %89, label %82
82: ; preds = %79
%83 = call i32 @strlen(i8* %23)
%84 = add nsw i32 %83, -1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [2048 x i8], [2048 x i8]* %9, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = icmp eq i8 %87, 10
br i1 %88, label %89, label %76
89: ; preds = %79, %82, %76
%90 = load i32, i32* %7
%91 = load i32, i32* %3
%92 = add nsw i32 %91, %90
store i32 %92, i32* %3
%93 = add nuw nsw i32 %27, 1
%94 = call i64 @feof(i32* %0)
%95 = icmp eq i64 %94, 0
br i1 %95, label %24, label %96
96: ; preds = %50, %89, %46, %6
%97 = phi i32 [ 0, %6 ], [ %27, %46 ], [ %93, %89 ], [ %27, %50 ]
store i32 %97, i32* %1
ret void
}