#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 EOF;
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 /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *);
int readNDoubles(int /*<<< orphan*/ *, double *, int);
int readNInts(int /*<<< orphan*/ *, int *, int);
int /*<<< orphan*/ stderr;
int strlen(char *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void readPointParamsAndProjections(FILE *fp, double *params, int pnp,
                                   double *projs, double *covprojs, int havecov,
                                   int mnp, char *vmask, int ncams) {
  int nframes, ch, lineno, ptno, frameno, n;
  int ntord, covsz = mnp * mnp, tricovsz = mnp * (mnp + 1) / 2, nshift;
  register int i, ii, jj, k;
  lineno = ptno = 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);
    n = readNDoubles(fp, params, pnp);
    if (n == EOF)
      break;
    if (n != pnp) {
      fprintf(stderr,
              "readPointParamsAndProjections(): error reading input file, line "
              "%d:\n"
              "expecting %d parameters for 3D point, read %d\n",
              lineno, pnp, n);
      exit(1);
    }
    params += pnp;
    n = readNInts(fp, &nframes, 1);
    if (n != 1) {
      fprintf(stderr,
              "readPointParamsAndProjections(): error reading input file, line "
              "%d:\n"
              "expecting number of frames for 3D point\n",
              lineno);
      exit(1);
    }
    for (i = 0; i < nframes; ++i) {
      n = readNInts(fp, &frameno, 1);
      if (frameno >= ncams) {
        fprintf(stderr,
                "readPointParamsAndProjections(): line %d contains an image "
                "projection for frame %d "
                "but only %d cameras have been specified!\n",
                lineno + 1, frameno, ncams);
        exit(1);
      }
      n += readNDoubles(fp, projs, mnp);
      projs += mnp;
      if (n != mnp + 1) {
        fprintf(stderr,
                "readPointParamsAndProjections(): error reading image "
                "projections from line %d [n=%d].\n"
                "Perhaps line contains fewer than %d projections?\n",
                lineno + 1, n, nframes);
        exit(1);
      }
      if (covprojs != NULL) {
        if (havecov == 2) {
          ntord = tricovsz;
        } else {
          ntord = covsz;
        }
        n = readNDoubles(fp, covprojs, ntord);
        if (n != ntord) {
          fprintf(stderr,
                  "readPointParamsAndProjections(): error reading image "
                  "projection covariances from line %d [n=%d].\n"
                  "Perhaps line contains fewer than %d projections?\n",
                  lineno + 1, n, nframes);
          exit(1);
        }
        if (havecov == 2) {
          for (ii = mnp; --ii;) {
            k = mnp - 1 + ((ii * ((mnp << 1) - ii - 1)) >> 1);
            nshift = (ii * (ii + 1)) >> 1;
            for (jj = 0; jj < mnp - ii; ++jj) {
              covprojs[k - jj + nshift] = covprojs[k - jj];
            }
          }
          for (ii = mnp; ii--;)
            for (jj = ii; jj--;)
              covprojs[ii * mnp + jj] = covprojs[jj * mnp + ii];
        }
        covprojs += covsz;
      }
      vmask[ptno * ncams + frameno] = 1;
    }
    fscanf(fp, "\n");
    lineno++;
    ptno++;
  }
}


x86 assembly (clang, -O0):
<readPointParamsAndProjections>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    0x10(%rbp),%eax
imul   0x10(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    0x10(%rbp),%eax
mov    0x10(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x50(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    121a <readPointParamsAndProjections+0x7a>
jmp    163b <readPointParamsAndProjections+0x49b>
mov    -0x8(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x34(%rbp)
cmp    $0x23,%eax
jne    12ab <readPointParamsAndProjections+0x10b>
jmp    1234 <readPointParamsAndProjections+0x94>
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1253 <readPointParamsAndProjections+0xb3>
jmp    129d <readPointParamsAndProjections+0xfd>
lea    -0x870(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x7ff,%esi
call   1070 <fgets@plt>
cmp    $0x0,%eax
je     1293 <readPointParamsAndProjections+0xf3>
lea    -0x870(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0x870(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1298 <readPointParamsAndProjections+0xf8>
jmp    129d <readPointParamsAndProjections+0xfd>
jmp    1234 <readPointParamsAndProjections+0x94>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11fb <readPointParamsAndProjections+0x5b>
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%rax
je     12c3 <readPointParamsAndProjections+0x123>
jmp    163b <readPointParamsAndProjections+0x49b>
mov    -0x34(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   10b0 <ungetc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <readNDoubles@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    0x2cfc(%rip),%rcx
cmp    (%rcx),%eax
jne    12f9 <readPointParamsAndProjections+0x159>
jmp    163b <readPointParamsAndProjections+0x49b>
mov    -0x44(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1330 <readPointParamsAndProjections+0x190>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x44(%rbp),%r8d
lea    0xce1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   10a0 <readNInts@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x1,-0x44(%rbp)
je     1388 <readPointParamsAndProjections+0x1e8>
mov    0x2c6d(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
lea    0xcfc(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1614 <readPointParamsAndProjections+0x474>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x1,%edx
call   10a0 <readNInts@plt>
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%eax
cmp    0x20(%rbp),%eax
jl     13ea <readPointParamsAndProjections+0x24a>
mov    0x2c15(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
add    $0x1,%edx
mov    -0x40(%rbp),%ecx
mov    0x20(%rbp),%r8d
lea    0xd07(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1030 <readNDoubles@plt>
add    -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    0x10(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x44(%rbp),%eax
mov    0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     1454 <readPointParamsAndProjections+0x2b4>
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
add    $0x1,%edx
mov    -0x44(%rbp),%ecx
mov    -0x30(%rbp),%r8d
lea    0xd1a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
cmpq   $0x0,-0x28(%rbp)
je     15f1 <readPointParamsAndProjections+0x451>
cmpl   $0x2,-0x2c(%rbp)
jne    1474 <readPointParamsAndProjections+0x2d4>
mov    -0x50(%rbp),%eax
mov    %eax,-0x48(%rbp)
jmp    147a <readPointParamsAndProjections+0x2da>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1030 <readNDoubles@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
je     14c7 <readPointParamsAndProjections+0x327>
mov    0x2b38(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
add    $0x1,%edx
mov    -0x44(%rbp),%ecx
mov    -0x30(%rbp),%r8d
lea    0xd2f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
cmpl   $0x2,-0x2c(%rbp)
jne    15dc <readPointParamsAndProjections+0x43c>
mov    0x10(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
cmp    $0x0,%eax
je     156d <readPointParamsAndProjections+0x3cd>
mov    0x10(%rbp),%eax
sub    $0x1,%eax
mov    -0x5c(%rbp),%ecx
mov    0x10(%rbp),%edx
shl    $0x1,%edx
sub    -0x5c(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
sar    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x64(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
sar    $0x1,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    0x10(%rbp),%ecx
sub    -0x5c(%rbp),%ecx
cmp    %ecx,%eax
jge    1568 <readPointParamsAndProjections+0x3c8>
mov    -0x28(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    -0x60(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    -0x60(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1522 <readPointParamsAndProjections+0x382>
jmp    14d7 <readPointParamsAndProjections+0x337>
mov    0x10(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x5c(%rbp)
cmp    $0x0,%eax
je     15d7 <readPointParamsAndProjections+0x437>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x60(%rbp)
cmp    $0x0,%eax
je     15d2 <readPointParamsAndProjections+0x432>
mov    -0x28(%rbp),%rax
mov    -0x60(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x5c(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    -0x60(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    158d <readPointParamsAndProjections+0x3ed>
jmp    1573 <readPointParamsAndProjections+0x3d3>
jmp    15dc <readPointParamsAndProjections+0x43c>
mov    -0x4c(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   0x20(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x1,(%rax,%rcx,1)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    138f <readPointParamsAndProjections+0x1ef>
mov    -0x8(%rbp),%rdi
lea    0xb3c(%rip),%rsi
call   1050 <fscanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11fb <readPointParamsAndProjections+0x5b>
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readPointParamsAndProjections>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8b8,%rsp
mov    %r9d,0x28(%rsp)
mov    %r8,%rbp
mov    %rcx,%r14
mov    %edx,0x14(%rsp)
mov    %rsi,0x38(%rsp)
mov    %rdi,%r15
call   1090 <feof@plt>
test   %rax,%rax
je     11e4 <readPointParamsAndProjections+0x44>
add    $0x8b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8f0(%rsp),%edx
mov    %edx,%eax
imul   %edx,%eax
lea    0x1(%rdx),%esi
movslq %edx,%rdi
mov    %eax,0x24(%rsp)
cmpl   $0x2,0x28(%rsp)
jne    1213 <readPointParamsAndProjections+0x73>
mov    %esi,%ecx
imul   %edx,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
mov    %edx,0x24(%rsp)
mov    %esi,0x20(%rsp)
movslq 0x14(%rsp),%rcx
mov    %rcx,0x60(%rsp)
lea    -0x1(%rdi),%ecx
mov    %rcx,0x48(%rsp)
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,0x5c(%rsp)
mov    %eax,%eax
mov    %rax,0x98(%rsp)
lea    -0x2(%rdi),%eax
mov    %eax,0x2c(%rsp)
lea    -0x5(%rdi),%eax
mov    %rax,0x70(%rsp)
mov    %rdi,%rax
shl    $0x4,%rax
mov    %rax,0x80(%rsp)
lea    -0x1(%rdi),%rax
imul   %rdi,%rax
mov    %rax,0x68(%rsp)
mov    %rdi,0x40(%rsp)
lea    0x0(,%rdi,8),%rax
neg    %rax
mov    %rax,0xa8(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
lea    0xb0(%rsp),%rbx
movl   $0x0,0x1c(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
call   1060 <fgetc@plt>
cmp    $0x23,%eax
jne    1301 <readPointParamsAndProjections+0x161>
nopl   (%rax)
mov    %r15,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    12e2 <readPointParamsAndProjections+0x142>
mov    %rbx,%rdi
mov    $0x7ff,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %eax,%eax
je     12e2 <readPointParamsAndProjections+0x142>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    12b0 <readPointParamsAndProjections+0x110>
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x8(%rsp)
mov    %r15,%rdi
call   1090 <feof@plt>
test   %rax,%rax
je     12a0 <readPointParamsAndProjections+0x100>
jmp    11d2 <readPointParamsAndProjections+0x32>
mov    %eax,%r12d
mov    %r15,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    11d2 <readPointParamsAndProjections+0x32>
mov    %r12d,%edi
mov    %r15,%rsi
call   10b0 <ungetc@plt>
mov    %r15,%rdi
mov    0x38(%rsp),%rsi
mov    0x14(%rsp),%edx
call   1030 <readNDoubles@plt>
mov    0x2cb0(%rip),%rcx
cmp    (%rcx),%eax
je     11d2 <readPointParamsAndProjections+0x32>
cmp    0x14(%rsp),%eax
jne    1911 <readPointParamsAndProjections+0x771>
mov    %r15,%rdi
lea    0x18(%rsp),%rsi
mov    $0x1,%edx
call   10a0 <readNInts@plt>
cmp    $0x1,%eax
jne    192f <readPointParamsAndProjections+0x78f>
cmpl   $0x0,0x18(%rsp)
mov    0x20(%rsp),%r12d
jle    1867 <readPointParamsAndProjections+0x6c7>
mov    0x1c(%rsp),%eax
imul   0x900(%rsp),%eax
mov    %eax,0x54(%rsp)
xor    %eax,%eax
mov    %r15,0x78(%rsp)
jmp    13d3 <readPointParamsAndProjections+0x233>
xchg   %ax,%ax
mov    0x98(%rsp),%rax
lea    0x0(%rbp,%rax,8),%rbp
lea    0xb0(%rsp),%rbx
lea    (%r14,%r10,8),%r14
movslq 0x34(%rsp),%rax
movslq 0x54(%rsp),%rcx
add    %rax,%rcx
mov    0x8f8(%rsp),%rax
movb   $0x1,(%rax,%rcx,1)
mov    0x58(%rsp),%eax
add    $0x1,%eax
cmp    0x18(%rsp),%eax
jge    1867 <readPointParamsAndProjections+0x6c7>
mov    %eax,0x58(%rsp)
mov    %r15,%rdi
lea    0x34(%rsp),%rsi
mov    $0x1,%edx
call   10a0 <readNInts@plt>
mov    0x34(%rsp),%ecx
cmp    0x900(%rsp),%ecx
jge    18a0 <readPointParamsAndProjections+0x700>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
mov    0x8f0(%rsp),%edx
call   1030 <readNDoubles@plt>
add    %ebx,%eax
cmp    %r12d,%eax
jne    18c2 <readPointParamsAndProjections+0x722>
test   %rbp,%rbp
je     1760 <readPointParamsAndProjections+0x5c0>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    0x24(%rsp),%ebx
mov    %ebx,%edx
call   1030 <readNDoubles@plt>
cmp    %ebx,%eax
jne    18e1 <readPointParamsAndProjections+0x741>
cmpl   $0x2,0x28(%rsp)
mov    0x40(%rsp),%r10
jne    1390 <readPointParamsAndProjections+0x1f0>
mov    %r14,0x90(%rsp)
cmpl   $0x0,0x48(%rsp)
mov    0x8f0(%rsp),%r8d
je     1770 <readPointParamsAndProjections+0x5d0>
lea    0x8(%rbp),%rax
mov    %rax,0xa0(%rsp)
mov    $0x1,%r12d
mov    $0xffffffffffffffff,%r10
xor    %r9d,%r9d
mov    0x48(%rsp),%rax
mov    %r8d,%ecx
jmp    14ab <readPointParamsAndProjections+0x30b>
nopl   0x0(%rax)
add    $0x1,%r12
add    $0x1,%r9
add    $0xffffffffffffffff,%r10
mov    0x30(%rsp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
je     1770 <readPointParamsAndProjections+0x5d0>
mov    %eax,0x30(%rsp)
cmp    %r8d,%eax
jge    1490 <readPointParamsAndProjections+0x2f0>
mov    %ecx,%esi
mov    0x5c(%rsp),%eax
mov    %eax,%ebx
sub    %ecx,%ebx
mov    0x30(%rsp),%ecx
imul   %ecx,%ebx
sar    %ebx
mov    0x48(%rsp),%rax
lea    (%rax,%rbx,1),%r15d
imul   %ecx,%esi
sar    %esi
cmp    $0x4,%r12
jb     15b0 <readPointParamsAndProjections+0x410>
lea    (%r15,%rsi,1),%r13d
mov    %r13d,%ecx
sub    %r9d,%ecx
mov    %r9,%rax
mov    $0x8,%edx
mul    %rdx
seto   %r8b
cmp    %r13d,%ecx
jg     15b7 <readPointParamsAndProjections+0x417>
mov    %r9,%rcx
shr    $0x20,%rcx
jne    15b7 <readPointParamsAndProjections+0x417>
mov    %r15d,%edx
sub    %r9d,%edx
cmp    %r15d,%edx
jg     15b7 <readPointParamsAndProjections+0x417>
test   %rcx,%rcx
jne    15b7 <readPointParamsAndProjections+0x417>
movslq %r13d,%r11
lea    0x0(,%r11,8),%rcx
add    %rbp,%rcx
mov    %rcx,%rdx
sub    %rax,%rdx
cmp    %rcx,%rdx
ja     15b7 <readPointParamsAndProjections+0x417>
test   %r8b,%r8b
jne    15b7 <readPointParamsAndProjections+0x417>
movslq %r15d,%r14
lea    0x0(,%r14,8),%rdx
add    %rbp,%rdx
mov    %rdx,%rcx
sub    %rax,%rcx
cmp    %rdx,%rcx
ja     15b7 <readPointParamsAndProjections+0x417>
mov    $0x0,%eax
test   %r8b,%r8b
mov    0x8f0(%rsp),%r8d
jne    16c0 <readPointParamsAndProjections+0x520>
lea    0x0(,%r9,8),%rcx
mov    %rbp,%rax
sub    %rcx,%rax
lea    (%rax,%r11,8),%rcx
mov    0xa0(%rsp),%rdi
lea    (%rdi,%r14,8),%rdx
cmp    %rdx,%rcx
jae    15c6 <readPointParamsAndProjections+0x426>
lea    (%rdi,%r11,8),%rcx
lea    (%rax,%r14,8),%rax
cmp    %rcx,%rax
jae    15c6 <readPointParamsAndProjections+0x426>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
jmp    16c0 <readPointParamsAndProjections+0x520>
xor    %eax,%eax
mov    0x8f0(%rsp),%r8d
jmp    16c0 <readPointParamsAndProjections+0x520>
mov    %r12,%rax
movabs $0x7ffffffffffffffc,%rcx
ff ff 7f
and    %rcx,%rax
lea    -0x4(%rax),%rcx
mov    %rcx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
test   %rcx,%rcx
je     174f <readPointParamsAndProjections+0x5af>
mov    %rdi,0x88(%rsp)
mov    %r12,%r11
and    $0xfffffffffffffffc,%r11
add    $0xfffffffffffffffc,%r11
shr    $0x2,%r11
add    $0x1,%r11
and    $0xfffffffffffffffe,%r11
mov    0x70(%rsp),%rcx
lea    (%rcx,%rbx,1),%edi
lea    (%rdi,%rsi,1),%r8d
mov    %r13d,%r13d
mov    %r15d,%r14d
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%r14,%rdx,1),%ecx
movslq %ecx,%rcx
movups -0x18(%rbp,%rcx,8),%xmm0
movups -0x8(%rbp,%rcx,8),%xmm1
lea    (%rdx,%r13,1),%ecx
movslq %ecx,%rcx
movups %xmm1,-0x8(%rbp,%rcx,8)
movups %xmm0,-0x18(%rbp,%rcx,8)
lea    (%rdi,%rdx,1),%ecx
movslq %ecx,%rcx
movups -0x18(%rbp,%rcx,8),%xmm0
movups -0x8(%rbp,%rcx,8),%xmm1
lea    (%r8,%rdx,1),%ecx
movslq %ecx,%rcx
movups %xmm1,-0x8(%rbp,%rcx,8)
movups %xmm0,-0x18(%rbp,%rcx,8)
add    $0xfffffffffffffff8,%rdx
add    $0xfffffffffffffffe,%r11
jne    1630 <readPointParamsAndProjections+0x490>
neg    %rdx
mov    0x8f0(%rsp),%r8d
mov    0x88(%rsp),%rdi
test   $0x1,%dil
je     16b7 <readPointParamsAndProjections+0x517>
mov    %r15d,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movups -0x18(%rbp,%rcx,8),%xmm0
movups -0x8(%rbp,%rcx,8),%xmm1
add    %esi,%ecx
movslq %ecx,%rcx
movups %xmm1,-0x8(%rbp,%rcx,8)
movups %xmm0,-0x18(%rbp,%rcx,8)
cmp    %rax,%r12
je     1490 <readPointParamsAndProjections+0x2f0>
mov    %rax,%rdx
test   $0x1,%r12b
je     16e9 <readPointParamsAndProjections+0x549>
mov    %r15d,%ecx
sub    %eax,%ecx
movslq %ecx,%rcx
movsd  0x0(%rbp,%rcx,8),%xmm0
add    %esi,%ecx
movslq %ecx,%rcx
movsd  %xmm0,0x0(%rbp,%rcx,8)
mov    %rax,%rdx
or     $0x1,%rdx
cmp    %rax,%r9
je     1490 <readPointParamsAndProjections+0x2f0>
add    0x2c(%rsp),%ebx
mov    %edx,%ecx
mov    %ebx,%eax
sub    %edx,%eax
add    %esi,%ebx
sub    %edx,%ebx
add    %r10,%rdx
add    %r15d,%esi
sub    %ecx,%esi
sub    %ecx,%r15d
xor    %ecx,%ecx
nopl   (%rax)
lea    (%r15,%rcx,1),%edi
movslq %edi,%rdi
movsd  0x0(%rbp,%rdi,8),%xmm0
lea    (%rsi,%rcx,1),%edi
movslq %edi,%rdi
movsd  %xmm0,0x0(%rbp,%rdi,8)
lea    (%rax,%rcx,1),%edi
movslq %edi,%rdi
movsd  0x0(%rbp,%rdi,8),%xmm0
lea    (%rbx,%rcx,1),%edi
movslq %edi,%rdi
movsd  %xmm0,0x0(%rbp,%rdi,8)
add    $0xfffffffffffffffe,%rcx
cmp    %rcx,%rdx
jne    1710 <readPointParamsAndProjections+0x570>
jmp    1490 <readPointParamsAndProjections+0x2f0>
xor    %edx,%edx
test   $0x1,%dil
jne    1696 <readPointParamsAndProjections+0x4f6>
jmp    16b7 <readPointParamsAndProjections+0x517>
xor    %ebp,%ebp
mov    0x40(%rsp),%r10
jmp    139d <readPointParamsAndProjections+0x1fd>
nopl   0x0(%rax)
test   %r8d,%r8d
mov    0x90(%rsp),%r14
mov    0x78(%rsp),%r15
mov    0x20(%rsp),%r12d
mov    0x40(%rsp),%r10
mov    0x80(%rsp),%rdx
je     1390 <readPointParamsAndProjections+0x1f0>
mov    0x68(%rsp),%rax
lea    0x0(,%rax,8),%rax
add    %rbp,%rax
mov    $0xfffffffffffffff8,%r9
mov    %r10,%r11
mov    0x2c(%rsp),%r8d
jmp    17d5 <readPointParamsAndProjections+0x635>
nopl   0x0(%rax)
add    $0xfffffffffffffff8,%r9
add    0xa8(%rsp),%rax
test   %r11d,%r11d
je     1390 <readPointParamsAndProjections+0x1f0>
add    $0xffffffffffffffff,%r11
test   %r11d,%r11d
je     1390 <readPointParamsAndProjections+0x1f0>
movslq %r8d,%rdi
test   $0x1,%dil
jne    180f <readPointParamsAndProjections+0x66f>
mov    %r11,%rcx
imul   %r10,%rcx
mov    %rdi,%rsi
imul   %r10,%rsi
add    %r11,%rsi
movsd  0x0(%rbp,%rsi,8),%xmm0
add    %rdi,%rcx
movsd  %xmm0,0x0(%rbp,%rcx,8)
add    $0xffffffffffffffff,%rdi
sub    $0x1,%r8d
jb     17c0 <readPointParamsAndProjections+0x620>
lea    0x8(,%rdi,8),%rbx
imul   %r10,%rbx
add    %rbp,%rbx
mov    %r10,%rcx
imul   %rdi,%rcx
lea    0x0(,%rcx,8),%rsi
add    %rbp,%rsi
mov    %r9,%rcx
nopl   0x0(%rax)
movsd  (%rbx,%rcx,1),%xmm0
movsd  %xmm0,(%rax,%rdi,8)
movsd  (%rsi,%rcx,1),%xmm0
movsd  %xmm0,-0x8(%rax,%rdi,8)
add    $0xfffffffffffffffe,%rdi
sub    %rdx,%rcx
cmp    $0xffffffffffffffff,%rdi
jne    1840 <readPointParamsAndProjections+0x6a0>
jmp    17c0 <readPointParamsAndProjections+0x620>
mov    0x38(%rsp),%rax
mov    0x60(%rsp),%rcx
lea    (%rax,%rcx,8),%rax
mov    %rax,0x38(%rsp)
mov    %r15,%rdi
lea    0x8d7(%rip),%rsi
call   1050 <fscanf@plt>
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x8(%rsp)
addl   $0x1,0x1c(%rsp)
jmp    12ef <readPointParamsAndProjections+0x14f>
mov    0x2731(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rdx
add    $0x1,%edx
lea    0x828(%rip),%rsi
mov    0x900(%rsp),%r8d
jmp    1900 <readPointParamsAndProjections+0x760>
mov    0x270f(%rip),%rcx
mov    (%rcx),%edi
mov    0x8(%rsp),%rdx
add    $0x1,%edx
mov    0x18(%rsp),%r8d
lea    0x87e(%rip),%rsi
jmp    18fe <readPointParamsAndProjections+0x75e>
mov    0x26f0(%rip),%rcx
mov    (%rcx),%edi
mov    0x8(%rsp),%rdx
add    $0x1,%edx
mov    0x18(%rsp),%r8d
lea    0x8e7(%rip),%rsi
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x26c0(%rip),%rcx
mov    (%rcx),%edi
lea    0x6df(%rip),%rsi
mov    0x8(%rsp),%rdx
mov    0x14(%rsp),%ecx
mov    %eax,%r8d
jmp    1900 <readPointParamsAndProjections+0x760>
mov    0x26a2(%rip),%rax
mov    (%rax),%edi
lea    0x734(%rip),%rsi
mov    0x8(%rsp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stderr = global i32 0
@.str = [115 x i8] c"readPointParamsAndProjections(): error reading input file, line %d:\0Aexpecting %d parameters for 3D point, read %d\0A\00"
@.str.1 = [109 x i8] c"readPointParamsAndProjections(): error reading input file, line %d:\0Aexpecting number of frames for 3D point\0A\00"
@.str.2 = [125 x i8] c"readPointParamsAndProjections(): line %d contains an image projection for frame %d but only %d cameras have been specified!\0A\00"
@.str.3 = [136 x i8] c"readPointParamsAndProjections(): error reading image projections from line %d [n=%d].\0APerhaps line contains fewer than %d projections?\0A\00"
@.str.4 = [147 x i8] c"readPointParamsAndProjections(): error reading image projection covariances from line %d [n=%d].\0APerhaps line contains fewer than %d projections?\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @readPointParamsAndProjections(i32* %0, double* %1, i32 %2, double* %3, double* %4, i32 %5, i32 %6, i8* %7, i32 %8) {
%10 = alloca i32*
%11 = alloca double*
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca [2048 x i8]
store i32* %0, i32** %10
store double* %1, double** %11
store i32 %2, i32* %12
store double* %3, double** %13
store double* %4, double** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i8* %7, i8** %17
store i32 %8, i32* %18
%34 = load i32, i32* %16
%35 = load i32, i32* %16
%36 = mul nsw i32 %34, %35
store i32 %36, i32* %26
%37 = load i32, i32* %16
%38 = load i32, i32* %16
%39 = add nsw i32 %38, 1
%40 = mul nsw i32 %37, %39
%41 = sdiv i32 %40, 2
store i32 %41, i32* %27
store i32 0, i32* %22
store i32 0, i32* %21
br label %42
42: ; preds = %287, %73, %9
%43 = load i32*, i32** %10
%44 = call i64 @feof(i32* %43)
%45 = icmp ne i64 %44, 0
%46 = xor i1 %45, true
br i1 %46, label %47, label %294
47: ; preds = %42
%48 = load i32*, i32** %10
%49 = call i32 @fgetc(i32* %48)
store i32 %49, i32* %20
%50 = icmp eq i32 %49, 35
br i1 %50, label %51, label %76
51: ; preds = %47
br label %52
52: ; preds = %72, %51
%53 = load i32*, i32** %10
%54 = call i64 @feof(i32* %53)
%55 = icmp ne i64 %54, 0
%56 = xor i1 %55, true
br i1 %56, label %57, label %73
57: ; preds = %52
%58 = getelementptr inbounds [2048 x i8], [2048 x i8]* %33, i64 0, i64 0
%59 = load i32*, i32** %10
%60 = call i32 @fgets(i8* %58, i32 2047, i32* %59)
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %71
62: ; preds = %57
%63 = getelementptr inbounds [2048 x i8], [2048 x i8]* %33, i64 0, i64 0
%64 = call i32 @strlen(i8* %63)
%65 = sub nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [2048 x i8], [2048 x i8]* %33, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 10
br i1 %70, label %71, label %72
71: ; preds = %62, %57
br label %73
72: ; preds = %62
br label %52
73: ; preds = %71, %52
%74 = load i32, i32* %21
%75 = add nsw i32 %74, 1
store i32 %75, i32* %21
br label %42
76: ; preds = %47
%77 = load i32*, i32** %10
%78 = call i64 @feof(i32* %77)
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %81
80: ; preds = %76
br label %294
81: ; preds = %76
%82 = load i32, i32* %20
%83 = load i32*, i32** %10
%84 = call i32 @ungetc(i32 %82, i32* %83)
%85 = load i32*, i32** %10
%86 = load double*, double** %11
%87 = load i32, i32* %12
%88 = call i32 @readNDoubles(i32* %85, double* %86, i32 %87)
store i32 %88, i32* %24
%89 = load i32, i32* %24
%90 = load i32, i32* @EOF
%91 = icmp eq i32 %89, %90
br i1 %91, label %92, label %93
92: ; preds = %81
br label %294
93: ; preds = %81
%94 = load i32, i32* %24
%95 = load i32, i32* %12
%96 = icmp ne i32 %94, %95
br i1 %96, label %97, label %104
97: ; preds = %93
%98 = load i32, i32* @stderr
%99 = load i32, i32* %21
%100 = load i32, i32* %12
%101 = load i32, i32* %24
%102 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i32 %99, i32 %100, i32 %101)
%103 = call i32 @exit(i32 1)
unreachable
104: ; preds = %93
%105 = load i32, i32* %12
%106 = load double*, double** %11
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds double, double* %106, i64 %107
store double* %108, double** %11
%109 = load i32*, i32** %10
%110 = call i32 @readNInts(i32* %109, i32* %19, i32 1)
store i32 %110, i32* %24
%111 = load i32, i32* %24
%112 = icmp ne i32 %111, 1
br i1 %112, label %113, label %118
113: ; preds = %104
%114 = load i32, i32* @stderr
%115 = load i32, i32* %21
%116 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.1, i64 0, i64 0), i32 %115)
%117 = call i32 @exit(i32 1)
unreachable
118: ; preds = %104
store i32 0, i32* %29
br label %119
119: ; preds = %284, %118
%120 = load i32, i32* %29
%121 = load i32, i32* %19
%122 = icmp slt i32 %120, %121
br i1 %122, label %123, label %287
123: ; preds = %119
%124 = load i32*, i32** %10
%125 = call i32 @readNInts(i32* %124, i32* %23, i32 1)
store i32 %125, i32* %24
%126 = load i32, i32* %23
%127 = load i32, i32* %18
%128 = icmp sge i32 %126, %127
br i1 %128, label %129, label %137
129: ; preds = %123
%130 = load i32, i32* @stderr
%131 = load i32, i32* %21
%132 = add nsw i32 %131, 1
%133 = load i32, i32* %23
%134 = load i32, i32* %18
%135 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str.2, i64 0, i64 0), i32 %132, i32 %133, i32 %134)
%136 = call i32 @exit(i32 1)
unreachable
137: ; preds = %123
%138 = load i32*, i32** %10
%139 = load double*, double** %13
%140 = load i32, i32* %16
%141 = call i32 @readNDoubles(i32* %138, double* %139, i32 %140)
%142 = load i32, i32* %24
%143 = add nsw i32 %142, %141
store i32 %143, i32* %24
%144 = load i32, i32* %16
%145 = load double*, double** %13
%146 = sext i32 %144 to i64
%147 = getelementptr inbounds double, double* %145, i64 %146
store double* %147, double** %13
%148 = load i32, i32* %24
%149 = load i32, i32* %16
%150 = add nsw i32 %149, 1
%151 = icmp ne i32 %148, %150
br i1 %151, label %152, label %160
152: ; preds = %137
%153 = load i32, i32* @stderr
%154 = load i32, i32* %21
%155 = add nsw i32 %154, 1
%156 = load i32, i32* %24
%157 = load i32, i32* %19
%158 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %153, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.3, i64 0, i64 0), i32 %155, i32 %156, i32 %157)
%159 = call i32 @exit(i32 1)
unreachable
160: ; preds = %137
%161 = load double*, double** %14
%162 = icmp ne double* %161, null
br i1 %162, label %163, label %275
163: ; preds = %160
%164 = load i32, i32* %15
%165 = icmp eq i32 %164, 2
br i1 %165, label %166, label %168
166: ; preds = %163
%167 = load i32, i32* %27
store i32 %167, i32* %25
br label %170
168: ; preds = %163
%169 = load i32, i32* %26
store i32 %169, i32* %25
br label %170
170: ; preds = %168, %166
%171 = load i32*, i32** %10
%172 = load double*, double** %14
%173 = load i32, i32* %25
%174 = call i32 @readNDoubles(i32* %171, double* %172, i32 %173)
store i32 %174, i32* %24
%175 = load i32, i32* %24
%176 = load i32, i32* %25
%177 = icmp ne i32 %175, %176
br i1 %177, label %178, label %186
178: ; preds = %170
%179 = load i32, i32* @stderr
%180 = load i32, i32* %21
%181 = add nsw i32 %180, 1
%182 = load i32, i32* %24
%183 = load i32, i32* %19
%184 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.4, i64 0, i64 0), i32 %181, i32 %182, i32 %183)
%185 = call i32 @exit(i32 1)
unreachable
186: ; preds = %170
%187 = load i32, i32* %15
%188 = icmp eq i32 %187, 2
br i1 %188, label %189, label %270
189: ; preds = %186
%190 = load i32, i32* %16
store i32 %190, i32* %30
br label %191
191: ; preds = %237, %189
%192 = load i32, i32* %30
%193 = add nsw i32 %192, -1
store i32 %193, i32* %30
%194 = icmp ne i32 %193, 0
br i1 %194, label %195, label %238
195: ; preds = %191
%196 = load i32, i32* %16
%197 = sub nsw i32 %196, 1
%198 = load i32, i32* %30
%199 = load i32, i32* %16
%200 = shl i32 %199, 1
%201 = load i32, i32* %30
%202 = sub nsw i32 %200, %201
%203 = sub nsw i32 %202, 1
%204 = mul nsw i32 %198, %203
%205 = ashr i32 %204, 1
%206 = add nsw i32 %197, %205
store i32 %206, i32* %32
%207 = load i32, i32* %30
%208 = load i32, i32* %30
%209 = add nsw i32 %208, 1
%210 = mul nsw i32 %207, %209
%211 = ashr i32 %210, 1
store i32 %211, i32* %28
store i32 0, i32* %31
br label %212
212: ; preds = %234, %195
%213 = load i32, i32* %31
%214 = load i32, i32* %16
%215 = load i32, i32* %30
%216 = sub nsw i32 %214, %215
%217 = icmp slt i32 %213, %216
br i1 %217, label %218, label %237
218: ; preds = %212
%219 = load double*, double** %14
%220 = load i32, i32* %32
%221 = load i32, i32* %31
%222 = sub nsw i32 %220, %221
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds double, double* %219, i64 %223
%225 = load double, double* %224
%226 = load double*, double** %14
%227 = load i32, i32* %32
%228 = load i32, i32* %31
%229 = sub nsw i32 %227, %228
%230 = load i32, i32* %28
%231 = add nsw i32 %229, %230
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %226, i64 %232
store double %225, double* %233
br label %234
234: ; preds = %218
%235 = load i32, i32* %31
%236 = add nsw i32 %235, 1
store i32 %236, i32* %31
br label %212
237: ; preds = %212
br label %191
238: ; preds = %191
%239 = load i32, i32* %16
store i32 %239, i32* %30
br label %240
240: ; preds = %268, %238
%241 = load i32, i32* %30
%242 = add nsw i32 %241, -1
store i32 %242, i32* %30
%243 = icmp ne i32 %241, 0
br i1 %243, label %244, label %269
244: ; preds = %240
%245 = load i32, i32* %30
store i32 %245, i32* %31
br label %246
246: ; preds = %250, %244
%247 = load i32, i32* %31
%248 = add nsw i32 %247, -1
store i32 %248, i32* %31
%249 = icmp ne i32 %247, 0
br i1 %249, label %250, label %268
250: ; preds = %246
%251 = load double*, double** %14
%252 = load i32, i32* %31
%253 = load i32, i32* %16
%254 = mul nsw i32 %252, %253
%255 = load i32, i32* %30
%256 = add nsw i32 %254, %255
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double, double* %251, i64 %257
%259 = load double, double* %258
%260 = load double*, double** %14
%261 = load i32, i32* %30
%262 = load i32, i32* %16
%263 = mul nsw i32 %261, %262
%264 = load i32, i32* %31
%265 = add nsw i32 %263, %264
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double, double* %260, i64 %266
store double %259, double* %267
br label %246
268: ; preds = %246
br label %240
269: ; preds = %240
br label %270
270: ; preds = %269, %186
%271 = load i32, i32* %26
%272 = load double*, double** %14
%273 = sext i32 %271 to i64
%274 = getelementptr inbounds double, double* %272, i64 %273
store double* %274, double** %14
br label %275
275: ; preds = %270, %160
%276 = load i8*, i8** %17
%277 = load i32, i32* %22
%278 = load i32, i32* %18
%279 = mul nsw i32 %277, %278
%280 = load i32, i32* %23
%281 = add nsw i32 %279, %280
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds i8, i8* %276, i64 %282
store i8 1, i8* %283
br label %284
284: ; preds = %275
%285 = load i32, i32* %29
%286 = add nsw i32 %285, 1
store i32 %286, i32* %29
br label %119
287: ; preds = %119
%288 = load i32*, i32** %10
%289 = call i32 @fscanf(i32* %288, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%290 = load i32, i32* %21
%291 = add nsw i32 %290, 1
store i32 %291, i32* %21
%292 = load i32, i32* %22
%293 = add nsw i32 %292, 1
store i32 %293, i32* %22
br label %42
294: ; preds = %92, %80, %42
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@stderr = global i32 0
@.str = [115 x i8] c"readPointParamsAndProjections(): error reading input file, line %d:\0Aexpecting %d parameters for 3D point, read %d\0A\00"
@.str.1 = [109 x i8] c"readPointParamsAndProjections(): error reading input file, line %d:\0Aexpecting number of frames for 3D point\0A\00"
@.str.2 = [125 x i8] c"readPointParamsAndProjections(): line %d contains an image projection for frame %d but only %d cameras have been specified!\0A\00"
@.str.3 = [136 x i8] c"readPointParamsAndProjections(): error reading image projections from line %d [n=%d].\0APerhaps line contains fewer than %d projections?\0A\00"
@.str.4 = [147 x i8] c"readPointParamsAndProjections(): error reading image projection covariances from line %d [n=%d].\0APerhaps line contains fewer than %d projections?\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @readPointParamsAndProjections(i32* %0, double* %1, i32 %2, double* %3, double* %4, i32 %5, i32 %6, i8* nocapture writeonly %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca [2048 x i8]
%13 = bitcast i32* %10 to i8*
%14 = bitcast i32* %11 to i8*
%15 = mul nsw i32 %6, %6
%16 = add nsw i32 %6, 1
%17 = call i64 @feof(i32* %0)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %377
19: ; preds = %9
%20 = mul nsw i32 %16, %6
%21 = sdiv i32 %20, 2
%22 = getelementptr inbounds [2048 x i8], [2048 x i8]* %12, i64 0, i64 0
%23 = sext i32 %2 to i64
%24 = sext i32 %6 to i64
%25 = icmp eq i32 %5, 2
%26 = select i1 %25, i32 %21, i32 %15
%27 = add nsw i32 %6, -1
%28 = icmp eq i32 %27, 0
%29 = shl i32 %6, 1
%30 = icmp eq i32 %6, 0
%31 = zext i32 %15 to i64
%32 = add i32 %6, -2
%33 = add i32 %6, -1
%34 = add i32 %6, -1
br label %35
35: ; preds = %19, %369
%36 = phi double* [ %1, %19 ], [ %78, %369 ]
%37 = phi double* [ %3, %19 ], [ %371, %369 ]
%38 = phi double* [ %4, %19 ], [ %370, %369 ]
%39 = phi i32 [ 0, %19 ], [ %373, %369 ]
%40 = phi i32 [ 0, %19 ], [ %374, %369 ]
br label %41
41: ; preds = %35, %59
%42 = phi i32 [ %39, %35 ], [ %60, %59 ]
%43 = call i32 @fgetc(i32* %0)
%44 = icmp eq i32 %43, 35
br i1 %44, label %45, label %63
45: ; preds = %41
br label %46
46: ; preds = %52, %45
%47 = call i64 @feof(i32* %0)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %59
49: ; preds = %46
%50 = call i32 @fgets(i8* %22, i32 2047, i32* %0)
%51 = icmp eq i32 %50, 0
br i1 %51, label %59, label %52
52: ; preds = %49
%53 = call i32 @strlen(i8* %22)
%54 = add nsw i32 %53, -1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [2048 x i8], [2048 x i8]* %12, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = icmp eq i8 %57, 10
br i1 %58, label %59, label %46
59: ; preds = %49, %52, %46
%60 = add nsw i32 %42, 1
%61 = call i64 @feof(i32* %0)
%62 = icmp eq i64 %61, 0
br i1 %62, label %41, label %377
63: ; preds = %41
%64 = call i64 @feof(i32* %0)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %377
66: ; preds = %63
%67 = call i32 @ungetc(i32 %43, i32* %0)
%68 = call i32 @readNDoubles(i32* %0, double* %36, i32 %2)
%69 = load i32, i32* @EOF
%70 = icmp eq i32 %68, %69
br i1 %70, label %377, label %71
71: ; preds = %66
%72 = icmp eq i32 %68, %2
br i1 %72, label %77, label %73
73: ; preds = %71
%74 = load i32, i32* @stderr
%75 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i32 %42, i32 %2, i32 %68)
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %71
%78 = getelementptr inbounds double, double* %36, i64 %23
%79 = call i32 @readNInts(i32* %0, i32* %10, i32 1)
%80 = icmp eq i32 %79, 1
br i1 %80, label %81, label %86
81: ; preds = %77
%82 = load i32, i32* %10
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %369
84: ; preds = %81
%85 = mul nsw i32 %40, %8
br label %90
86: ; preds = %77
%87 = load i32, i32* @stderr
%88 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%89 = call i32 @exit(i32 1)
unreachable
90: ; preds = %84, %360
%91 = phi i32 [ 0, %84 ], [ %366, %360 ]
%92 = phi double* [ %37, %84 ], [ %105, %360 ]
%93 = phi double* [ %38, %84 ], [ %361, %360 ]
%94 = call i32 @readNInts(i32* %0, i32* %11, i32 1)
%95 = load i32, i32* %11
%96 = icmp slt i32 %95, %8
br i1 %96, label %102, label %97
97: ; preds = %90
%98 = load i32, i32* @stderr
%99 = add nsw i32 %42, 1
%100 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str.2, i64 0, i64 0), i32 %99, i32 %95, i32 %8)
%101 = call i32 @exit(i32 1)
unreachable
102: ; preds = %90
%103 = call i32 @readNDoubles(i32* %0, double* %92, i32 %6)
%104 = add nsw i32 %103, %94
%105 = getelementptr inbounds double, double* %92, i64 %24
%106 = icmp eq i32 %104, %16
br i1 %106, label %113, label %107
107: ; preds = %102
%108 = load i32, i32* @stderr
%109 = add nsw i32 %42, 1
%110 = load i32, i32* %10
%111 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.3, i64 0, i64 0), i32 %109, i32 %104, i32 %110)
%112 = call i32 @exit(i32 1)
unreachable
113: ; preds = %102
%114 = icmp eq double* %93, null
br i1 %114, label %360, label %115
115: ; preds = %113
%116 = call i32 @readNDoubles(i32* %0, double* %93, i32 %26)
%117 = icmp eq i32 %116, %26
br i1 %117, label %124, label %118
118: ; preds = %115
%119 = load i32, i32* @stderr
%120 = add nsw i32 %42, 1
%121 = load i32, i32* %10
%122 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.4, i64 0, i64 0), i32 %120, i32 %116, i32 %121)
%123 = call i32 @exit(i32 1)
unreachable
124: ; preds = %115
br i1 %25, label %125, label %358
125: ; preds = %124
br i1 %28, label %134, label %126
126: ; preds = %125
%127 = getelementptr double, double* %93, i64 1
%128 = getelementptr double, double* %93, i64 1
br label %135
129: ; preds = %293, %296, %277, %135
%130 = add nsw i32 %138, -1
%131 = icmp eq i32 %130, 0
%132 = add nuw nsw i64 %137, 1
%133 = add i64 %136, 1
br i1 %131, label %134, label %135
134: ; preds = %129, %125
br i1 %30, label %358, label %319
135: ; preds = %126, %129
%136 = phi i64 [ 0, %126 ], [ %133, %129 ]
%137 = phi i64 [ 1, %126 ], [ %132, %129 ]
%138 = phi i32 [ %27, %126 ], [ %130, %129 ]
%139 = phi i32 [ %6, %126 ], [ %138, %129 ]
%140 = and i64 %137, 9223372036854775804
%141 = add nsw i64 %140, -4
%142 = lshr exact i64 %141, 2
%143 = add nuw nsw i64 %142, 1
%144 = sub nsw i64 0, %136
%145 = getelementptr double, double* %93, i64 %144
%146 = sub i32 %29, %139
%147 = mul nsw i32 %138, %146
%148 = ashr i32 %147, 1
%149 = add i32 %27, %148
%150 = mul nsw i32 %138, %139
%151 = ashr i32 %150, 1
%152 = icmp slt i32 %138, %6
br i1 %152, label %153, label %129
153: ; preds = %135
%154 = icmp ult i64 %137, 4
br i1 %154, label %279, label %155
155: ; preds = %153
%156 = add i32 %33, %148
%157 = add i32 %156, %151
%158 = trunc i64 %136 to i32
%159 = sub i32 %157, %158
%160 = icmp sgt i32 %159, %157
%161 = icmp ugt i64 %136, 4294967295
%162 = or i1 %160, %161
%163 = trunc i64 %136 to i32
%164 = sub i32 %149, %163
%165 = icmp sgt i32 %164, %149
%166 = icmp ugt i64 %136, 4294967295
%167 = or i1 %165, %166
%168 = sext i32 %157 to i64
%169 = getelementptr double, double* %93, i64 %168
%170 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %136, i64 8)
%171 = extractvalue { i64, i1 } %170, 0
%172 = extractvalue { i64, i1 } %170, 1
%173 = bitcast double* %169 to i8*
%174 = sub i64 0, %171
%175 = getelementptr i8, i8* %173, i64 %174
%176 = icmp ugt i8* %175, %173
%177 = or i1 %176, %172
%178 = sext i32 %149 to i64
%179 = getelementptr double, double* %93, i64 %178
%180 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %136, i64 8)
%181 = extractvalue { i64, i1 } %180, 0
%182 = extractvalue { i64, i1 } %180, 1
%183 = bitcast double* %179 to i8*
%184 = sub i64 0, %181
%185 = getelementptr i8, i8* %183, i64 %184
%186 = icmp ugt i8* %185, %183
%187 = or i1 %186, %182
%188 = or i1 %162, %167
%189 = or i1 %188, %177
%190 = or i1 %189, %187
br i1 %190, label %279, label %191
191: ; preds = %155
%192 = add i32 %34, %148
%193 = add i32 %192, %151
%194 = sext i32 %193 to i64
%195 = getelementptr double, double* %145, i64 %194
%196 = getelementptr double, double* %127, i64 %194
%197 = sext i32 %149 to i64
%198 = getelementptr double, double* %145, i64 %197
%199 = getelementptr double, double* %128, i64 %197
%200 = icmp ult double* %195, %199
%201 = icmp ult double* %198, %196
%202 = and i1 %200, %201
br i1 %202, label %279, label %203
203: ; preds = %191
%204 = and i64 %137, 9223372036854775804
%205 = and i64 %143, 1
%206 = icmp eq i64 %141, 0
br i1 %206, label %254, label %207
207: ; preds = %203
%208 = and i64 %143, 9223372036854775806
br label %209
209: ; preds = %209, %207
%210 = phi i64 [ 0, %207 ], [ %251, %209 ]
%211 = phi i64 [ 0, %207 ], [ %252, %209 ]
%212 = trunc i64 %210 to i32
%213 = sub i32 %149, %212
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds double, double* %93, i64 %214
%216 = getelementptr inbounds double, double* %215, i64 -1
%217 = bitcast double* %216 to <2 x double>*
%218 = load <2 x double>, <2 x double>* %217
%219 = getelementptr inbounds double, double* %215, i64 -2
%220 = getelementptr inbounds double, double* %219, i64 -1
%221 = bitcast double* %220 to <2 x double>*
%222 = load <2 x double>, <2 x double>* %221
%223 = add nsw i32 %213, %151
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %93, i64 %224
%226 = getelementptr inbounds double, double* %225, i64 -1
%227 = bitcast double* %226 to <2 x double>*
store <2 x double> %218, <2 x double>* %227
%228 = getelementptr inbounds double, double* %225, i64 -2
%229 = getelementptr inbounds double, double* %228, i64 -1
%230 = bitcast double* %229 to <2 x double>*
store <2 x double> %222, <2 x double>* %230
%231 = trunc i64 %210 to i32
%232 = or i32 %231, 4
%233 = sub i32 %149, %232
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds double, double* %93, i64 %234
%236 = getelementptr inbounds double, double* %235, i64 -1
%237 = bitcast double* %236 to <2 x double>*
%238 = load <2 x double>, <2 x double>* %237
%239 = getelementptr inbounds double, double* %235, i64 -2
%240 = getelementptr inbounds double, double* %239, i64 -1
%241 = bitcast double* %240 to <2 x double>*
%242 = load <2 x double>, <2 x double>* %241
%243 = add nsw i32 %233, %151
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds double, double* %93, i64 %244
%246 = getelementptr inbounds double, double* %245, i64 -1
%247 = bitcast double* %246 to <2 x double>*
store <2 x double> %238, <2 x double>* %247
%248 = getelementptr inbounds double, double* %245, i64 -2
%249 = getelementptr inbounds double, double* %248, i64 -1
%250 = bitcast double* %249 to <2 x double>*
store <2 x double> %242, <2 x double>* %250
%251 = add nuw i64 %210, 8
%252 = add i64 %211, 2
%253 = icmp eq i64 %252, %208
br i1 %253, label %254, label %209
254: ; preds = %209, %203
%255 = phi i64 [ 0, %203 ], [ %251, %209 ]
%256 = icmp eq i64 %205, 0
br i1 %256, label %277, label %257
257: ; preds = %254
%258 = trunc i64 %255 to i32
%259 = sub i32 %149, %258
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds double, double* %93, i64 %260
%262 = getelementptr inbounds double, double* %261, i64 -1
%263 = bitcast double* %262 to <2 x double>*
%264 = load <2 x double>, <2 x double>* %263
%265 = getelementptr inbounds double, double* %261, i64 -2
%266 = getelementptr inbounds double, double* %265, i64 -1
%267 = bitcast double* %266 to <2 x double>*
%268 = load <2 x double>, <2 x double>* %267
%269 = add nsw i32 %259, %151
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds double, double* %93, i64 %270
%272 = getelementptr inbounds double, double* %271, i64 -1
%273 = bitcast double* %272 to <2 x double>*
store <2 x double> %264, <2 x double>* %273
%274 = getelementptr inbounds double, double* %271, i64 -2
%275 = getelementptr inbounds double, double* %274, i64 -1
%276 = bitcast double* %275 to <2 x double>*
store <2 x double> %268, <2 x double>* %276
br label %277
277: ; preds = %254, %257
%278 = icmp eq i64 %137, %204
br i1 %278, label %129, label %279
279: ; preds = %191, %155, %153, %277
%280 = phi i64 [ 0, %191 ], [ 0, %155 ], [ 0, %153 ], [ %204, %277 ]
%281 = and i64 %137, 1
%282 = icmp eq i64 %281, 0
br i1 %282, label %293, label %283
283: ; preds = %279
%284 = trunc i64 %280 to i32
%285 = sub i32 %149, %284
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double, double* %93, i64 %286
%288 = load double, double* %287
%289 = add nsw i32 %285, %151
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds double, double* %93, i64 %290
store double %288, double* %291
%292 = or i64 %280, 1
br label %293
293: ; preds = %283, %279
%294 = phi i64 [ %280, %279 ], [ %292, %283 ]
%295 = icmp eq i64 %136, %280
br i1 %295, label %129, label %296
296: ; preds = %293, %296
%297 = phi i64 [ %315, %296 ], [ %294, %293 ]
%298 = trunc i64 %297 to i32
%299 = sub i32 %149, %298
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double, double* %93, i64 %300
%302 = load double, double* %301
%303 = add nsw i32 %299, %151
%304 = sext i32 %303 to i64
%305 = getelementptr inbounds double, double* %93, i64 %304
store double %302, double* %305
%306 = trunc i64 %297 to i32
%307 = xor i32 %306, -1
%308 = add i32 %149, %307
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds double, double* %93, i64 %309
%311 = load double, double* %310
%312 = add nsw i32 %308, %151
%313 = sext i32 %312 to i64
%314 = getelementptr inbounds double, double* %93, i64 %313
store double %311, double* %314
%315 = add nuw nsw i64 %297, 2
%316 = icmp eq i64 %315, %137
br i1 %316, label %129, label %296
317: ; preds = %341, %338
%318 = add i32 %321, -1
br i1 %324, label %358, label %319
319: ; preds = %134, %317
%320 = phi i64 [ %322, %317 ], [ %24, %134 ]
%321 = phi i32 [ %318, %317 ], [ %32, %134 ]
%322 = add nsw i64 %320, -1
%323 = trunc i64 %322 to i32
%324 = icmp eq i32 %323, 0
br i1 %324, label %358, label %325
325: ; preds = %319
%326 = sext i32 %321 to i64
%327 = mul nsw i64 %322, %24
%328 = and i32 %321, 1
%329 = icmp eq i32 %328, 0
br i1 %329, label %330, label %338
330: ; preds = %325
%331 = mul nsw i64 %326, %24
%332 = add nsw i64 %331, %322
%333 = getelementptr inbounds double, double* %93, i64 %332
%334 = load double, double* %333
%335 = add nsw i64 %327, %326
%336 = getelementptr inbounds double, double* %93, i64 %335
store double %334, double* %336
%337 = add nsw i64 %326, -1
br label %338
338: ; preds = %330, %325
%339 = phi i64 [ %326, %325 ], [ %337, %330 ]
%340 = icmp eq i32 %321, 0
br i1 %340, label %317, label %341
341: ; preds = %338, %341
%342 = phi i64 [ %356, %341 ], [ %339, %338 ]
%343 = mul nsw i64 %342, %24
%344 = add nsw i64 %343, %322
%345 = getelementptr inbounds double, double* %93, i64 %344
%346 = load double, double* %345
%347 = add nsw i64 %342, %327
%348 = getelementptr inbounds double, double* %93, i64 %347
store double %346, double* %348
%349 = add nsw i64 %342, -1
%350 = mul nsw i64 %349, %24
%351 = add nsw i64 %350, %322
%352 = getelementptr inbounds double, double* %93, i64 %351
%353 = load double, double* %352
%354 = add nsw i64 %349, %327
%355 = getelementptr inbounds double, double* %93, i64 %354
store double %353, double* %355
%356 = add nsw i64 %342, -2
%357 = icmp eq i64 %349, 0
br i1 %357, label %317, label %341
358: ; preds = %317, %319, %134, %124
%359 = getelementptr inbounds double, double* %93, i64 %31
br label %360
360: ; preds = %358, %113
%361 = phi double* [ %359, %358 ], [ null, %113 ]
%362 = load i32, i32* %11
%363 = add nsw i32 %362, %85
%364 = sext i32 %363 to i64
%365 = getelementptr inbounds i8, i8* %7, i64 %364
store i8 1, i8* %365
%366 = add nuw nsw i32 %91, 1
%367 = load i32, i32* %10
%368 = icmp slt i32 %366, %367
br i1 %368, label %90, label %369
369: ; preds = %360, %81
%370 = phi double* [ %38, %81 ], [ %361, %360 ]
%371 = phi double* [ %37, %81 ], [ %105, %360 ]
%372 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%373 = add nsw i32 %42, 1
%374 = add nuw nsw i32 %40, 1
%375 = call i64 @feof(i32* %0)
%376 = icmp eq i64 %375, 0
br i1 %376, label %35, label %377
377: ; preds = %66, %63, %369, %59, %9
ret void
}