#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fread(char *, int, int, int /*<<< orphan*/ *);
int *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int sscanf(char *, char *, int *, ...);
scalar_t__ strcmp(char *, char *);
char *strstr(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int *red_xcp, *grn_xcp, *bl_xcp;
  int *red_ycp, *grn_ycp, *bl_ycp;
  int nrcp, ngcp, nbcp;
  char buf[1024 * 5];
  int n;
  if (strcmp(argv[1], "-h") == 0 || argc < 1)
    usage();
  FILE *fp_ppm, *fp_cp;
  snprintf(buf, 256, "%s.ppm", argv[1]);
  fp_ppm = fopen(buf, "w");
  snprintf(buf, 256, "%s.control_points", argv[1]);
  fp_cp = fopen(buf, "w");
  FILE *fp = fopen(argv[1], "r");
  if (fp == NULL)
    usage();
  n = fread(buf, 1, 1024 * 5, fp);
  fclose(fp);
  char *p;
  p = buf;
  p = strstr(p, "Control Points");
  sscanf(p, "Control Points: %d", &nbcp);
  p++;
  p = strstr(p, "Control Points");
  sscanf(p, "Control Points: %d", &ngcp);
  p++;
  p = strstr(p, "Control Points");
  sscanf(p, "Control Points: %d", &nrcp);
  bl_xcp = malloc(sizeof(int) * nbcp);
  bl_ycp = malloc(sizeof(int) * nbcp);
  grn_xcp = malloc(sizeof(int) * ngcp);
  grn_ycp = malloc(sizeof(int) * ngcp);
  red_xcp = malloc(sizeof(int) * nrcp);
  red_ycp = malloc(sizeof(int) * nrcp);
  int pntnum;
  p = strstr(buf, "[Blue Info]");
  for (n = 0; n < nbcp; n++) {
    p = strstr(p, "Control Point");
    sscanf(p, "Control Point %d", &pntnum);
    if (sscanf(p, "Control Point %*d: (%d , %d)", &bl_xcp[pntnum],
               &bl_ycp[pntnum]) != 2) {
      fprintf(fp_cp, "error reading blue point %d\n", n);
      exit(-1);
    }
    bl_ycp[pntnum] = 255 - bl_ycp[pntnum];
    p++;
  }
  p = strstr(buf, "[Green Info]");
  for (n = 0; n < ngcp; n++) {
    p = strstr(p, "Control Point");
    sscanf(p, "Control Point %d", &pntnum);
    if (sscanf(p, "Control Point %*d: (%d , %d)", &grn_xcp[pntnum],
               &grn_ycp[pntnum]) != 2) {
      fprintf(fp_cp, "error reading green point %d\n", n);
      exit(-1);
    }
    grn_ycp[pntnum] = 255 - grn_ycp[pntnum];
    p++;
  }
  p = strstr(buf, "[Red Info]");
  for (n = 0; n < nrcp; n++) {
    p = strstr(p, "Control Point");
    sscanf(p, "Control Point %d", &pntnum);
    if (sscanf(p, "Control Point %*d: (%d , %d)", &red_xcp[pntnum],
               &red_ycp[pntnum]) != 2) {
      fprintf(fp_cp, "error reading red point %d\n", n);
      exit(-1);
    }
    red_ycp[pntnum] = 255 - red_ycp[pntnum];
    p++;
  }
  int r[256];
  int g[256];
  int b[256];
  double slope;
  for (n = 0; n < nrcp - 1; n++) {
    slope = (double)(red_ycp[n + 1] - red_ycp[n]) /
            (double)(red_xcp[n + 1] - red_xcp[n]);
    for (int i = red_xcp[n]; i <= red_xcp[n + 1]; i++)
      r[i] = red_ycp[n] + slope * (double)(i - red_xcp[n]);
    fprintf(fp_cp, "%d %d \n", red_xcp[n], red_ycp[n]);
  }
  fprintf(fp_cp, "%d %d \n", red_xcp[n], red_ycp[n]);
  fprintf(fp_cp, "\n\n");
  for (n = 0; n < ngcp - 1; n++) {
    slope = (double)(grn_ycp[n + 1] - grn_ycp[n]) /
            (double)(grn_xcp[n + 1] - grn_xcp[n]);
    for (int i = grn_xcp[n]; i <= grn_xcp[n + 1]; i++)
      g[i] = grn_ycp[n] + slope * (double)(i - grn_xcp[n]);
    fprintf(fp_cp, "%d %d \n", grn_xcp[n], grn_ycp[n]);
  }
  fprintf(fp_cp, "%d %d \n", grn_xcp[n], grn_ycp[n]);
  fprintf(fp_cp, "\n\n");
  for (n = 0; n < nbcp - 1; n++) {
    slope = (double)(bl_ycp[n + 1] - bl_ycp[n]) /
            (double)(bl_xcp[n + 1] - bl_xcp[n]);
    for (int i = bl_xcp[n]; i <= bl_xcp[n + 1]; i++)
      b[i] = bl_ycp[n] + slope * (double)(i - bl_xcp[n]);
    fprintf(fp_cp, "%d %d\n", bl_xcp[n], bl_ycp[n]);
  }
  fprintf(fp_cp, "%d %d\n", bl_xcp[n], bl_ycp[n]);
  fprintf(fp_ppm, "P3 1 256 255\n");
  for (int i = 0; i < 256; i++)
    fprintf(fp_ppm, "%d %d %d\n", r[i], g[i], b[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe28(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11f1 <main+0x41>
cmpl   $0x1,-0x8(%rbp)
jge    11f8 <main+0x48>
mov    $0x0,%al
call   10a0 <usage@plt>
lea    -0x1450(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    $0x100,%esi
lea    0xdf0(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x1450(%rbp),%rdi
lea    0xde4(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x1460(%rbp)
lea    -0x1450(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    $0x100,%esi
lea    0xdbf(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x1450(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x1468(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda3(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x1470(%rbp)
cmpq   $0x0,-0x1470(%rbp)
jne    129c <main+0xec>
mov    $0x0,%al
call   10a0 <usage@plt>
lea    -0x1450(%rbp),%rdi
mov    -0x1470(%rbp),%rcx
mov    $0x1,%esi
mov    $0x1400,%edx
call   1030 <fread@plt>
mov    %eax,-0x1454(%rbp)
mov    -0x1470(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x1450(%rbp),%rax
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xd39(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xd2e(%rip),%rsi
lea    -0x4c(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x1478(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xcf4(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xce9(%rip),%rsi
lea    -0x48(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x1478(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xcaf(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xca4(%rip),%rsi
lea    -0x44(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
movslq -0x4c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
movslq -0x4c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x48(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x48(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
movslq -0x44(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
movslq -0x44(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
lea    -0x1450(%rbp),%rdi
lea    0xc2c(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
movl   $0x0,-0x1454(%rbp)
mov    -0x1454(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    151f <main+0x36f>
mov    -0x1478(%rbp),%rdi
lea    0xc05(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xbf9(%rip),%rsi
lea    -0x147c(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x1478(%rbp),%rdi
mov    -0x28(%rbp),%rdx
movslq -0x147c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x40(%rbp),%rcx
movslq -0x147c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xbca(%rip),%rsi
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x2,%eax
je     14d8 <main+0x328>
mov    -0x1468(%rbp),%rdi
mov    -0x1454(%rbp),%edx
lea    0xbc3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rax
movslq -0x147c(%rbp),%rcx
mov    $0xff,%edx
sub    (%rax,%rcx,4),%edx
mov    -0x40(%rbp),%rax
movslq -0x147c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1478(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1478(%rbp)
mov    -0x1454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1454(%rbp)
jmp    142c <main+0x27c>
lea    -0x1450(%rbp),%rdi
lea    0xb7a(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
movl   $0x0,-0x1454(%rbp)
mov    -0x1454(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1636 <main+0x486>
mov    -0x1478(%rbp),%rdi
lea    0xaee(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0xae2(%rip),%rsi
lea    -0x147c(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x1478(%rbp),%rdi
mov    -0x20(%rbp),%rdx
movslq -0x147c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x38(%rbp),%rcx
movslq -0x147c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xab3(%rip),%rsi
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x2,%eax
je     15ef <main+0x43f>
mov    -0x1468(%rbp),%rdi
mov    -0x1454(%rbp),%edx
lea    0xad6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x38(%rbp),%rax
movslq -0x147c(%rbp),%rcx
mov    $0xff,%edx
sub    (%rax,%rcx,4),%edx
mov    -0x38(%rbp),%rax
movslq -0x147c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1478(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1478(%rbp)
mov    -0x1454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1454(%rbp)
jmp    1543 <main+0x393>
lea    -0x1450(%rbp),%rdi
lea    0xa8e(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
movl   $0x0,-0x1454(%rbp)
mov    -0x1454(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    174d <main+0x59d>
mov    -0x1478(%rbp),%rdi
lea    0x9d7(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x1478(%rbp)
mov    -0x1478(%rbp),%rdi
lea    0x9cb(%rip),%rsi
lea    -0x147c(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x1478(%rbp),%rdi
mov    -0x18(%rbp),%rdx
movslq -0x147c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x30(%rbp),%rcx
movslq -0x147c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0x99c(%rip),%rsi
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x2,%eax
je     1706 <main+0x556>
mov    -0x1468(%rbp),%rdi
mov    -0x1454(%rbp),%edx
lea    0x9e8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x30(%rbp),%rax
movslq -0x147c(%rbp),%rcx
mov    $0xff,%edx
sub    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
movslq -0x147c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1478(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1478(%rbp)
mov    -0x1454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1454(%rbp)
jmp    165a <main+0x4aa>
movl   $0x0,-0x1454(%rbp)
mov    -0x1454(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1897 <main+0x6e7>
mov    -0x30(%rbp),%rax
mov    -0x1454(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1454(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x2088(%rbp)
ff
mov    -0x18(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x208c(%rbp)
mov    -0x208c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    -0x1454(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     1852 <main+0x6a2>
mov    -0x30(%rbp),%rax
movslq -0x1454(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
movsd  -0x2088(%rbp),%xmm0
ff
mov    -0x208c(%rbp),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
movslq -0x208c(%rbp),%rax
mov    %ecx,-0x1880(%rbp,%rax,4)
mov    -0x208c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x208c(%rbp)
jmp    17d5 <main+0x625>
mov    -0x1468(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0x87d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1454(%rbp)
jmp    1757 <main+0x5a7>
mov    -0x1468(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0x838(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1468(%rbp),%rdi
lea    0x82b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x1454(%rbp)
mov    -0x1454(%rbp),%eax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1a27 <main+0x877>
mov    -0x38(%rbp),%rax
mov    -0x1454(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x38(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x1454(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x20(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x2088(%rbp)
ff
mov    -0x20(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2090(%rbp)
mov    -0x2090(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x1454(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     19e2 <main+0x832>
mov    -0x38(%rbp),%rax
movslq -0x1454(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
movsd  -0x2088(%rbp),%xmm0
ff
mov    -0x2090(%rbp),%eax
mov    -0x20(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
movslq -0x2090(%rbp),%rax
mov    %ecx,-0x1c80(%rbp,%rax,4)
mov    -0x2090(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2090(%rbp)
jmp    1965 <main+0x7b5>
mov    -0x1468(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x38(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0x6ed(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1454(%rbp)
jmp    18e7 <main+0x737>
mov    -0x1468(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x38(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0x6a8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1468(%rbp),%rdi
lea    0x69b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x1454(%rbp)
mov    -0x1454(%rbp),%eax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1bb7 <main+0xa07>
mov    -0x40(%rbp),%rax
mov    -0x1454(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x40(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x1454(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x2088(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2094(%rbp)
mov    -0x2094(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    -0x1454(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     1b72 <main+0x9c2>
mov    -0x40(%rbp),%rax
movslq -0x1454(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
movsd  -0x2088(%rbp),%xmm0
ff
mov    -0x2094(%rbp),%eax
mov    -0x28(%rbp),%rcx
movslq -0x1454(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
movslq -0x2094(%rbp),%rax
mov    %ecx,-0x2080(%rbp,%rax,4)
mov    -0x2094(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2094(%rbp)
jmp    1af5 <main+0x945>
mov    -0x1468(%rbp),%rdi
mov    -0x28(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x40(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0x579(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1454(%rbp)
jmp    1a77 <main+0x8c7>
mov    -0x1468(%rbp),%rdi
mov    -0x28(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x40(%rbp),%rax
movslq -0x1454(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0x534(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1460(%rbp),%rdi
lea    0x50e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x2098(%rbp)
cmpl   $0x100,-0x2098(%rbp)
jge    1c6b <main+0xabb>
mov    -0x1460(%rbp),%rdi
movslq -0x2098(%rbp),%rax
mov    -0x1880(%rbp,%rax,4),%edx
movslq -0x2098(%rbp),%rax
mov    -0x1c80(%rbp,%rax,4),%ecx
movslq -0x2098(%rbp),%rax
mov    -0x2080(%rbp,%rax,4),%r8d
ff
lea    0x4c2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x2098(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2098(%rbp)
jmp    1c07 <main+0xa57>
xor    %eax,%eax
add    $0x20a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2058,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe4f(%rip),%rsi
call   1060 <strcmp@plt>
test   %ebp,%ebp
jle    11ef <main+0x2f>
test   %rax,%rax
jne    11f6 <main+0x36>
xor    %eax,%eax
call   10a0 <usage@plt>
mov    0x8(%rbx),%rcx
lea    0xe32(%rip),%rdx
lea    0xc50(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
call   1050 <snprintf@plt>
lea    0xe1d(%rip),%r14
mov    %rbp,%rdi
mov    %r14,%rsi
call   10b0 <fopen@plt>
mov    %rax,0x48(%rsp)
mov    0x8(%rbx),%rcx
lea    0xe04(%rip),%rdx
mov    %rbp,%rdi
mov    $0x100,%esi
call   1050 <snprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   10b0 <fopen@plt>
mov    %rax,0x18(%rsp)
mov    0x8(%rbx),%rdi
lea    0xdee(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1274 <main+0xb4>
xor    %eax,%eax
call   10a0 <usage@plt>
lea    0xc50(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1400,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xdb0(%rip),%r14
mov    %rbp,%rdi
mov    %r14,%rsi
call   10e0 <strstr@plt>
mov    %rax,%rbx
lea    0xdaa(%rip),%rbp
lea    0x10(%rsp),%rdx
mov    %rax,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <sscanf@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strstr@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <sscanf@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strstr@plt>
lea    0x14(%rsp),%rdx
mov    %rax,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    0x10(%rsp),%r14d
lea    0x0(,%r14,4),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    0xc(%rsp),%ebp
lea    0x0(,%rbp,4),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    0x14(%rsp),%ebx
shl    $0x2,%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
test   %r14d,%r14d
jle    1421 <main+0x261>
lea    0xcf1(%rip),%rsi
lea    0xc50(%rsp),%rdi
call   10e0 <strstr@plt>
mov    %rax,%rbp
lea    0x8(%rsp),%r13
lea    0xd00(%rip),%r14
xor    %ebx,%ebx
mov    0x20(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
lea    0xcc4(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,%rbp
mov    %rax,%rdi
lea    0xcc0(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
movslq 0x8(%rsp),%rax
mov    0x40(%rsp),%rcx
lea    (%rcx,%rax,4),%rdx
lea    (%r12,%rax,4),%rcx
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    1d21 <main+0xb61>
movslq 0x8(%rsp),%rax
mov    $0xff,%ecx
sub    (%r12,%rax,4),%ecx
mov    %ecx,(%r12,%rax,4)
add    $0x1,%rbp
add    $0x1,%ebx
cmp    0x10(%rsp),%ebx
jl     13b0 <main+0x1f0>
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
mov    0x28(%rsp),%r12
jle    14cd <main+0x30d>
lea    0xca2(%rip),%rsi
lea    0xc50(%rsp),%rdi
call   10e0 <strstr@plt>
mov    %rax,%rbp
lea    0x8(%rsp),%r13
lea    0xc4c(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
lea    0xc14(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,%rbp
mov    %rax,%rdi
lea    0xc10(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
movslq 0x8(%rsp),%rax
mov    0x38(%rsp),%rcx
lea    (%rcx,%rax,4),%rdx
lea    (%r12,%rax,4),%rcx
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    1d2a <main+0xb6a>
movslq 0x8(%rsp),%rax
mov    $0xff,%ecx
sub    (%r12,%rax,4),%ecx
mov    %ecx,(%r12,%rax,4)
add    $0x1,%rbp
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     1460 <main+0x2a0>
cmpl   $0x0,0x14(%rsp)
jle    17a8 <main+0x5e8>
lea    0xc23(%rip),%rsi
lea    0xc50(%rsp),%rdi
call   10e0 <strstr@plt>
mov    %rax,%r14
lea    0xb96(%rip),%rbp
lea    0x8(%rsp),%r13
lea    0xb9b(%rip),%rbx
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
lea    0xb64(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
movslq 0x8(%rsp),%rax
mov    0x30(%rsp),%rcx
lea    (%rcx,%rax,4),%rdx
lea    (%r15,%rax,4),%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jne    1d3a <main+0xb7a>
movslq 0x8(%rsp),%rax
mov    $0xff,%ecx
sub    (%r15,%rax,4),%ecx
mov    %ecx,(%r15,%rax,4)
add    $0x1,%r14
add    $0x1,%r12d
mov    0x14(%rsp),%eax
cmp    %eax,%r12d
jl     1510 <main+0x350>
cmp    $0x2,%eax
mov    0x18(%rsp),%r13
jl     17b1 <main+0x5f1>
lea    0x860(%rsp),%r14
lea    0xb8f(%rip),%rbx
xor    %r12d,%r12d
jmp    15bf <main+0x3ff>
nop
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
movslq 0x14(%rsp),%rax
add    $0xffffffffffffffff,%rax
cmp    %rax,%r12
jge    17b5 <main+0x5f5>
mov    %r12,%rax
add    $0x1,%r12
mov    (%r15,%rax,4),%ecx
mov    0x30(%rsp),%rdx
mov    0x4(%rdx,%rax,4),%r9d
movslq (%rdx,%rax,4),%rdx
mov    %r9d,%esi
sub    %edx,%esi
jl     15a0 <main+0x3e0>
mov    0x4(%r15,%rax,4),%eax
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mov    %r9d,%edi
sub    %edx,%edi
mov    %rdx,%rax
cmp    $0x3,%edi
jb     1759 <main+0x599>
mov    %rbx,%r10
add    $0x1,%rdi
mov    %rdi,%rax
movabs $0x1fffffffc,%rsi
and    %rsi,%rax
movd   %edx,%xmm2
pshufd $0x0,%xmm2,%xmm8
movdqa %xmm8,%xmm4
paddd  0x9c2(%rip),%xmm4
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
lea    -0x4(%rax),%rsi
mov    %rsi,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rsi,%rsi
je     179a <main+0x5da>
mov    %r8,%rbp
movabs $0x7ffffffffffffffe,%rsi
ff ff 7f
and    %rsi,%rbp
lea    (%r14,%rdx,4),%rsi
xor    %ebx,%ebx
movdqa 0x98b(%rip),%xmm9
movdqa 0x992(%rip),%xmm10
xchg   %ax,%ax
movdqa %xmm4,%xmm6
psubd  %xmm8,%xmm6
cvtdq2pd %xmm6,%xmm7
pshufd $0xee,%xmm6,%xmm5
cvtdq2pd %xmm5,%xmm5
mulpd  %xmm2,%xmm5
mulpd  %xmm2,%xmm7
addpd  %xmm3,%xmm7
cvttpd2dq %xmm7,%xmm7
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm5
unpcklpd %xmm5,%xmm7
movupd %xmm7,-0x10(%rsi,%rbx,4)
paddd  %xmm9,%xmm6
cvtdq2pd %xmm6,%xmm5
pshufd $0xee,%xmm6,%xmm6
cvtdq2pd %xmm6,%xmm6
mulpd  %xmm2,%xmm6
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm5
addpd  %xmm3,%xmm6
cvttpd2dq %xmm6,%xmm6
unpcklpd %xmm6,%xmm5
movupd %xmm5,(%rsi,%rbx,4)
add    $0x8,%rbx
paddd  %xmm10,%xmm4
add    $0xfffffffffffffffe,%rbp
jne    1690 <main+0x4d0>
test   $0x1,%r8b
je     174a <main+0x58a>
add    %rdx,%rbx
psubd  %xmm8,%xmm4
cvtdq2pd %xmm4,%xmm5
pshufd $0xee,%xmm4,%xmm4
cvtdq2pd %xmm4,%xmm4
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm2
cvttpd2dq %xmm4,%xmm3
unpcklpd %xmm3,%xmm2
movupd %xmm2,0x850(%rsp,%rbx,4)
cmp    %rax,%rdi
mov    %r10,%rbx
je     15a0 <main+0x3e0>
add    %rdx,%rax
add    $0x1,%r9d
mov    %edx,%esi
neg    %esi
mov    %r9d,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rsi,%rax,1),%ebp
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%ebp
mov    %ebp,0x850(%rsp,%rax,4)
add    $0x1,%rax
cmp    %eax,%edi
jne    1770 <main+0x5b0>
jmp    15a0 <main+0x3e0>
xor    %ebx,%ebx
test   $0x1,%r8b
jne    1710 <main+0x550>
jmp    174a <main+0x58a>
xor    %eax,%eax
mov    0x18(%rsp),%r13
jmp    17b8 <main+0x5f8>
xor    %eax,%eax
jmp    17b8 <main+0x5f8>
mov    %r12d,%eax
mov    0x30(%rsp),%rcx
mov    (%rcx,%rax,4),%edx
mov    (%r15,%rax,4),%ecx
lea    0x95e(%rip),%rsi
xor    %ebx,%ebx
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x953(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10d0 <fwrite@plt>
cmpl   $0x2,0xc(%rsp)
jl     1a2b <main+0x86b>
lea    0x460(%rsp),%r15
lea    0x91f(%rip),%r14
xor    %r12d,%r12d
mov    0x28(%rsp),%rbx
jmp    183f <main+0x67f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
movslq 0xc(%rsp),%rax
add    $0xffffffffffffffff,%rax
cmp    %rax,%r12
jge    1a28 <main+0x868>
mov    %r12,%rax
add    $0x1,%r12
mov    (%rbx,%rax,4),%ecx
mov    0x38(%rsp),%rdx
mov    0x4(%rdx,%rax,4),%r9d
movslq (%rdx,%rax,4),%rdx
mov    %r9d,%esi
sub    %edx,%esi
jl     1820 <main+0x660>
mov    0x4(%rbx,%rax,4),%eax
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mov    %r9d,%edi
sub    %edx,%edi
mov    %rdx,%rax
cmp    $0x3,%edi
jb     19db <main+0x81b>
add    $0x1,%rdi
mov    %rdi,%rax
movabs $0x1fffffffc,%rsi
and    %rsi,%rax
movd   %edx,%xmm2
pshufd $0x0,%xmm2,%xmm8
movdqa %xmm8,%xmm4
paddd  0x747(%rip),%xmm4
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
lea    -0x4(%rax),%rsi
mov    %rsi,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rsi,%rsi
je     1a1a <main+0x85a>
mov    %r8,%rbp
movabs $0x7ffffffffffffffe,%rsi
ff ff 7f
and    %rsi,%rbp
lea    (%r15,%rdx,4),%rsi
xor    %ebx,%ebx
movdqa 0x710(%rip),%xmm9
movdqa 0x717(%rip),%xmm10
nopl   0x0(%rax)
movdqa %xmm4,%xmm6
psubd  %xmm8,%xmm6
cvtdq2pd %xmm6,%xmm7
pshufd $0xee,%xmm6,%xmm5
cvtdq2pd %xmm5,%xmm5
mulpd  %xmm2,%xmm5
mulpd  %xmm2,%xmm7
addpd  %xmm3,%xmm7
cvttpd2dq %xmm7,%xmm7
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm5
unpcklpd %xmm5,%xmm7
movupd %xmm7,-0x10(%rsi,%rbx,4)
paddd  %xmm9,%xmm6
cvtdq2pd %xmm6,%xmm5
pshufd $0xee,%xmm6,%xmm6
cvtdq2pd %xmm6,%xmm6
mulpd  %xmm2,%xmm6
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm5
addpd  %xmm3,%xmm6
cvttpd2dq %xmm6,%xmm6
unpcklpd %xmm6,%xmm5
movupd %xmm5,(%rsi,%rbx,4)
add    $0x8,%rbx
paddd  %xmm10,%xmm4
add    $0xfffffffffffffffe,%rbp
jne    1910 <main+0x750>
test   $0x1,%r8b
je     19ca <main+0x80a>
add    %rdx,%rbx
psubd  %xmm8,%xmm4
cvtdq2pd %xmm4,%xmm5
pshufd $0xee,%xmm4,%xmm4
cvtdq2pd %xmm4,%xmm4
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm2
cvttpd2dq %xmm4,%xmm3
unpcklpd %xmm3,%xmm2
movupd %xmm2,0x450(%rsp,%rbx,4)
cmp    %rax,%rdi
mov    0x28(%rsp),%rbx
je     1820 <main+0x660>
add    %rdx,%rax
add    $0x1,%r9d
mov    %edx,%esi
neg    %esi
mov    %r9d,%edi
cs nopw 0x0(%rax,%rax,1)
lea    (%rsi,%rax,1),%ebp
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%ebp
mov    %ebp,0x450(%rsp,%rax,4)
add    $0x1,%rax
cmp    %eax,%edi
jne    19f0 <main+0x830>
jmp    1820 <main+0x660>
xor    %ebx,%ebx
test   $0x1,%r8b
jne    1990 <main+0x7d0>
jmp    19ca <main+0x80a>
mov    %r12d,%ebx
mov    0x38(%rsp),%rax
mov    (%rax,%rbx,4),%edx
mov    0x28(%rsp),%rax
mov    (%rax,%rbx,4),%ecx
lea    0x6e7(%rip),%rsi
xor    %ebp,%ebp
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x6dc(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10d0 <fwrite@plt>
cmpl   $0x2,0x10(%rsp)
jl     1c8a <main+0xaca>
lea    0x60(%rsp),%r14
lea    0x6c7(%rip),%r15
xor    %r12d,%r12d
mov    0x20(%rsp),%rbx
jmp    1aaf <main+0x8ef>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
movslq 0x10(%rsp),%rax
add    $0xffffffffffffffff,%rax
cmp    %rax,%r12
jge    1c87 <main+0xac7>
mov    %r12,%rax
add    $0x1,%r12
mov    (%rbx,%rax,4),%ecx
mov    0x40(%rsp),%rdx
mov    0x4(%rdx,%rax,4),%r9d
movslq (%rdx,%rax,4),%rdx
mov    %r9d,%esi
sub    %edx,%esi
jl     1a90 <main+0x8d0>
mov    0x4(%rbx,%rax,4),%eax
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mov    %r9d,%edi
sub    %edx,%edi
mov    %rdx,%rax
cmp    $0x3,%edi
jb     1c4c <main+0xa8c>
add    $0x1,%rdi
mov    %rdi,%rax
movabs $0x1fffffffc,%rsi
and    %rsi,%rax
movd   %edx,%xmm2
pshufd $0x0,%xmm2,%xmm8
movdqa %xmm8,%xmm4
paddd  0x4d7(%rip),%xmm4
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
lea    -0x4(%rax),%rsi
mov    %rsi,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rsi,%rsi
je     1bfc <main+0xa3c>
mov    %r8,%rbx
movabs $0x7ffffffffffffffe,%rsi
ff ff 7f
and    %rsi,%rbx
lea    (%r14,%rdx,4),%rsi
xor    %ebp,%ebp
movdqa 0x4a0(%rip),%xmm9
movdqa 0x4a7(%rip),%xmm10
nopl   0x0(%rax)
movdqa %xmm4,%xmm6
psubd  %xmm8,%xmm6
cvtdq2pd %xmm6,%xmm7
pshufd $0xee,%xmm6,%xmm5
cvtdq2pd %xmm5,%xmm5
mulpd  %xmm2,%xmm5
mulpd  %xmm2,%xmm7
addpd  %xmm3,%xmm7
cvttpd2dq %xmm7,%xmm7
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm5
unpcklpd %xmm5,%xmm7
movupd %xmm7,-0x10(%rsi,%rbp,4)
paddd  %xmm9,%xmm6
cvtdq2pd %xmm6,%xmm5
pshufd $0xee,%xmm6,%xmm6
cvtdq2pd %xmm6,%xmm6
mulpd  %xmm2,%xmm6
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm5
addpd  %xmm3,%xmm6
cvttpd2dq %xmm6,%xmm6
unpcklpd %xmm6,%xmm5
movupd %xmm5,(%rsi,%rbp,4)
add    $0x8,%rbp
paddd  %xmm10,%xmm4
add    $0xfffffffffffffffe,%rbx
jne    1b80 <main+0x9c0>
jmp    1bfe <main+0xa3e>
xor    %ebp,%ebp
test   $0x1,%r8b
mov    0x20(%rsp),%rbx
je     1c40 <main+0xa80>
add    %rdx,%rbp
psubd  %xmm8,%xmm4
cvtdq2pd %xmm4,%xmm5
pshufd $0xee,%xmm4,%xmm4
cvtdq2pd %xmm4,%xmm4
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm2
cvttpd2dq %xmm4,%xmm3
unpcklpd %xmm3,%xmm2
movupd %xmm2,0x50(%rsp,%rbp,4)
cmp    %rax,%rdi
je     1a90 <main+0x8d0>
add    %rdx,%rax
add    $0x1,%r9d
mov    %edx,%esi
neg    %esi
mov    %r9d,%edi
nopw   0x0(%rax,%rax,1)
lea    (%rsi,%rax,1),%ebp
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%ebp
mov    %ebp,0x50(%rsp,%rax,4)
add    $0x1,%rax
cmp    %eax,%edi
jne    1c60 <main+0xaa0>
jmp    1a90 <main+0x8d0>
mov    %r12d,%ebp
mov    0x48(%rsp),%rbx
mov    0x40(%rsp),%rax
mov    (%rax,%rbp,4),%edx
mov    0x20(%rsp),%rax
mov    (%rax,%rbp,4),%ecx
lea    0x49f(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x47d(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0x472(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x850(%rsp,%rbp,4),%edx
mov    0x450(%rsp,%rbp,4),%ecx
mov    0x50(%rsp,%rbp,4),%r8d
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%rbp
cmp    $0x100,%rbp
jne    1ce0 <main+0xb20>
xor    %eax,%eax
add    $0x2058,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x392(%rip),%rsi
jmp    1d31 <main+0xb71>
lea    0x3b3(%rip),%rsi
mov    0x18(%rsp),%rdi
mov    %ebx,%edx
jmp    1d49 <main+0xb89>
lea    0x3cc(%rip),%rsi
mov    0x18(%rsp),%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"%s.ppm\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [18 x i8] c"%s.control_points\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [15 x i8] c"Control Points\00"
@.str.6 = [19 x i8] c"Control Points: %d\00"
@.str.7 = [12 x i8] c"[Blue Info]\00"
@.str.8 = [14 x i8] c"Control Point\00"
@.str.9 = [17 x i8] c"Control Point %d\00"
@.str.10 = [29 x i8] c"Control Point %*d: (%d , %d)\00"
@.str.11 = [29 x i8] c"error reading blue point %d\0A\00"
@.str.12 = [13 x i8] c"[Green Info]\00"
@.str.13 = [30 x i8] c"error reading green point %d\0A\00"
@.str.14 = [11 x i8] c"[Red Info]\00"
@.str.15 = [28 x i8] c"error reading red point %d\0A\00"
@.str.16 = [8 x i8] c"%d %d \0A\00"
@.str.17 = [3 x i8] c"\0A\0A\00"
@.str.18 = [7 x i8] c"%d %d\0A\00"
@.str.19 = [14 x i8] c"P3 1 256 255\0A\00"
@.str.20 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [5120 x i8]
%16 = alloca i32
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i8*
%21 = alloca i32
%22 = alloca [256 x i32]
%23 = alloca [256 x i32]
%24 = alloca [256 x i32]
%25 = alloca double
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %2
%36 = load i32, i32* %4
%37 = icmp slt i32 %36, 1
br i1 %37, label %38, label %40
38: ; preds = %35, %2
%39 = call i32 (...) @usage()
br label %40
40: ; preds = %38, %35
%41 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32 @snprintf(i8* %41, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %44)
%46 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%47 = call i32* @fopen(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %47, i32** %17
%48 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 @snprintf(i8* %48, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %51)
%53 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%54 = call i32* @fopen(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %54, i32** %18
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = call i32* @fopen(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %58, i32** %19
%59 = load i32*, i32** %19
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %63
61: ; preds = %40
%62 = call i32 (...) @usage()
br label %63
63: ; preds = %61, %40
%64 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%65 = load i32*, i32** %19
%66 = call i32 @fread(i8* %64, i32 1, i32 5120, i32* %65)
store i32 %66, i32* %16
%67 = load i32*, i32** %19
%68 = call i32 @fclose(i32* %67)
%69 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
store i8* %69, i8** %20
%70 = load i8*, i8** %20
%71 = call i8* @strstr(i8* %70, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i8* %71, i8** %20
%72 = load i8*, i8** %20
%73 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %72, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32* %14)
%74 = load i8*, i8** %20
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %20
%76 = load i8*, i8** %20
%77 = call i8* @strstr(i8* %76, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i8* %77, i8** %20
%78 = load i8*, i8** %20
%79 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %78, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32* %13)
%80 = load i8*, i8** %20
%81 = getelementptr inbounds i8, i8* %80, i32 1
store i8* %81, i8** %20
%82 = load i8*, i8** %20
%83 = call i8* @strstr(i8* %82, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i8* %83, i8** %20
%84 = load i8*, i8** %20
%85 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %84, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32* %12)
%86 = load i32, i32* %14
%87 = sext i32 %86 to i64
%88 = mul i64 4, %87
%89 = trunc i64 %88 to i32
%90 = call i32* @malloc(i32 %89)
store i32* %90, i32** %8
%91 = load i32, i32* %14
%92 = sext i32 %91 to i64
%93 = mul i64 4, %92
%94 = trunc i64 %93 to i32
%95 = call i32* @malloc(i32 %94)
store i32* %95, i32** %11
%96 = load i32, i32* %13
%97 = sext i32 %96 to i64
%98 = mul i64 4, %97
%99 = trunc i64 %98 to i32
%100 = call i32* @malloc(i32 %99)
store i32* %100, i32** %7
%101 = load i32, i32* %13
%102 = sext i32 %101 to i64
%103 = mul i64 4, %102
%104 = trunc i64 %103 to i32
%105 = call i32* @malloc(i32 %104)
store i32* %105, i32** %10
%106 = load i32, i32* %12
%107 = sext i32 %106 to i64
%108 = mul i64 4, %107
%109 = trunc i64 %108 to i32
%110 = call i32* @malloc(i32 %109)
store i32* %110, i32** %6
%111 = load i32, i32* %12
%112 = sext i32 %111 to i64
%113 = mul i64 4, %112
%114 = trunc i64 %113 to i32
%115 = call i32* @malloc(i32 %114)
store i32* %115, i32** %9
%116 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%117 = call i8* @strstr(i8* %116, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
store i8* %117, i8** %20
store i32 0, i32* %16
br label %118
118: ; preds = %156, %63
%119 = load i32, i32* %16
%120 = load i32, i32* %14
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %159
122: ; preds = %118
%123 = load i8*, i8** %20
%124 = call i8* @strstr(i8* %123, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
store i8* %124, i8** %20
%125 = load i8*, i8** %20
%126 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %125, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %21)
%127 = load i8*, i8** %20
%128 = load i32*, i32** %8
%129 = load i32, i32* %21
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i32, i32* %128, i64 %130
%132 = load i32*, i32** %11
%133 = load i32, i32* %21
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i32, i32* %132, i64 %134
%136 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %127, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32* %131, i32* %135)
%137 = icmp ne i32 %136, 2
br i1 %137, label %138, label %143
138: ; preds = %122
%139 = load i32*, i32** %18
%140 = load i32, i32* %16
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 %140)
%142 = call i32 @exit(i32 -1)
unreachable
143: ; preds = %122
%144 = load i32*, i32** %11
%145 = load i32, i32* %21
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i32, i32* %144, i64 %146
%148 = load i32, i32* %147
%149 = sub nsw i32 255, %148
%150 = load i32*, i32** %11
%151 = load i32, i32* %21
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i32, i32* %150, i64 %152
store i32 %149, i32* %153
%154 = load i8*, i8** %20
%155 = getelementptr inbounds i8, i8* %154, i32 1
store i8* %155, i8** %20
br label %156
156: ; preds = %143
%157 = load i32, i32* %16
%158 = add nsw i32 %157, 1
store i32 %158, i32* %16
br label %118
159: ; preds = %118
%160 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%161 = call i8* @strstr(i8* %160, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
store i8* %161, i8** %20
store i32 0, i32* %16
br label %162
162: ; preds = %200, %159
%163 = load i32, i32* %16
%164 = load i32, i32* %13
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %203
166: ; preds = %162
%167 = load i8*, i8** %20
%168 = call i8* @strstr(i8* %167, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
store i8* %168, i8** %20
%169 = load i8*, i8** %20
%170 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %169, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %21)
%171 = load i8*, i8** %20
%172 = load i32*, i32** %7
%173 = load i32, i32* %21
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i32, i32* %172, i64 %174
%176 = load i32*, i32** %10
%177 = load i32, i32* %21
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i32, i32* %176, i64 %178
%180 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %171, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32* %175, i32* %179)
%181 = icmp ne i32 %180, 2
br i1 %181, label %182, label %187
182: ; preds = %166
%183 = load i32*, i32** %18
%184 = load i32, i32* %16
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %183, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i32 %184)
%186 = call i32 @exit(i32 -1)
unreachable
187: ; preds = %166
%188 = load i32*, i32** %10
%189 = load i32, i32* %21
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i32, i32* %188, i64 %190
%192 = load i32, i32* %191
%193 = sub nsw i32 255, %192
%194 = load i32*, i32** %10
%195 = load i32, i32* %21
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i32, i32* %194, i64 %196
store i32 %193, i32* %197
%198 = load i8*, i8** %20
%199 = getelementptr inbounds i8, i8* %198, i32 1
store i8* %199, i8** %20
br label %200
200: ; preds = %187
%201 = load i32, i32* %16
%202 = add nsw i32 %201, 1
store i32 %202, i32* %16
br label %162
203: ; preds = %162
%204 = getelementptr inbounds [5120 x i8], [5120 x i8]* %15, i64 0, i64 0
%205 = call i8* @strstr(i8* %204, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
store i8* %205, i8** %20
store i32 0, i32* %16
br label %206
206: ; preds = %244, %203
%207 = load i32, i32* %16
%208 = load i32, i32* %12
%209 = icmp slt i32 %207, %208
br i1 %209, label %210, label %247
210: ; preds = %206
%211 = load i8*, i8** %20
%212 = call i8* @strstr(i8* %211, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
store i8* %212, i8** %20
%213 = load i8*, i8** %20
%214 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %213, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %21)
%215 = load i8*, i8** %20
%216 = load i32*, i32** %6
%217 = load i32, i32* %21
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds i32, i32* %216, i64 %218
%220 = load i32*, i32** %9
%221 = load i32, i32* %21
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i32, i32* %220, i64 %222
%224 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %215, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32* %219, i32* %223)
%225 = icmp ne i32 %224, 2
br i1 %225, label %226, label %231
226: ; preds = %210
%227 = load i32*, i32** %18
%228 = load i32, i32* %16
%229 = call i32 (i32*, i8*, ...) @fprintf(i32* %227, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %228)
%230 = call i32 @exit(i32 -1)
unreachable
231: ; preds = %210
%232 = load i32*, i32** %9
%233 = load i32, i32* %21
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i32, i32* %232, i64 %234
%236 = load i32, i32* %235
%237 = sub nsw i32 255, %236
%238 = load i32*, i32** %9
%239 = load i32, i32* %21
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds i32, i32* %238, i64 %240
store i32 %237, i32* %241
%242 = load i8*, i8** %20
%243 = getelementptr inbounds i8, i8* %242, i32 1
store i8* %243, i8** %20
br label %244
244: ; preds = %231
%245 = load i32, i32* %16
%246 = add nsw i32 %245, 1
store i32 %246, i32* %16
br label %206
247: ; preds = %206
store i32 0, i32* %16
br label %248
248: ; preds = %332, %247
%249 = load i32, i32* %16
%250 = load i32, i32* %12
%251 = sub nsw i32 %250, 1
%252 = icmp slt i32 %249, %251
br i1 %252, label %253, label %335
253: ; preds = %248
%254 = load i32*, i32** %9
%255 = load i32, i32* %16
%256 = add nsw i32 %255, 1
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds i32, i32* %254, i64 %257
%259 = load i32, i32* %258
%260 = load i32*, i32** %9
%261 = load i32, i32* %16
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds i32, i32* %260, i64 %262
%264 = load i32, i32* %263
%265 = sub nsw i32 %259, %264
%266 = sitofp i32 %265 to double
%267 = load i32*, i32** %6
%268 = load i32, i32* %16
%269 = add nsw i32 %268, 1
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds i32, i32* %267, i64 %270
%272 = load i32, i32* %271
%273 = load i32*, i32** %6
%274 = load i32, i32* %16
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds i32, i32* %273, i64 %275
%277 = load i32, i32* %276
%278 = sub nsw i32 %272, %277
%279 = sitofp i32 %278 to double
%280 = fdiv double %266, %279
store double %280, double* %25
%281 = load i32*, i32** %6
%282 = load i32, i32* %16
%283 = sext i32 %282 to i64
%284 = getelementptr inbounds i32, i32* %281, i64 %283
%285 = load i32, i32* %284
store i32 %285, i32* %26
br label %286
286: ; preds = %316, %253
%287 = load i32, i32* %26
%288 = load i32*, i32** %6
%289 = load i32, i32* %16
%290 = add nsw i32 %289, 1
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds i32, i32* %288, i64 %291
%293 = load i32, i32* %292
%294 = icmp sle i32 %287, %293
br i1 %294, label %295, label %319
295: ; preds = %286
%296 = load i32*, i32** %9
%297 = load i32, i32* %16
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds i32, i32* %296, i64 %298
%300 = load i32, i32* %299
%301 = sitofp i32 %300 to double
%302 = load double, double* %25
%303 = load i32, i32* %26
%304 = load i32*, i32** %6
%305 = load i32, i32* %16
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds i32, i32* %304, i64 %306
%308 = load i32, i32* %307
%309 = sub nsw i32 %303, %308
%310 = sitofp i32 %309 to double
%311 = call double @llvm.fmuladd.f64(double %302, double %310, double %301)
%312 = fptosi double %311 to i32
%313 = load i32, i32* %26
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds [256 x i32], [256 x i32]* %22, i64 0, i64 %314
store i32 %312, i32* %315
br label %316
316: ; preds = %295
%317 = load i32, i32* %26
%318 = add nsw i32 %317, 1
store i32 %318, i32* %26
br label %286
319: ; preds = %286
%320 = load i32*, i32** %18
%321 = load i32*, i32** %6
%322 = load i32, i32* %16
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds i32, i32* %321, i64 %323
%325 = load i32, i32* %324
%326 = load i32*, i32** %9
%327 = load i32, i32* %16
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds i32, i32* %326, i64 %328
%330 = load i32, i32* %329
%331 = call i32 (i32*, i8*, ...) @fprintf(i32* %320, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %325, i32 %330)
br label %332
332: ; preds = %319
%333 = load i32, i32* %16
%334 = add nsw i32 %333, 1
store i32 %334, i32* %16
br label %248
335: ; preds = %248
%336 = load i32*, i32** %18
%337 = load i32*, i32** %6
%338 = load i32, i32* %16
%339 = sext i32 %338 to i64
%340 = getelementptr inbounds i32, i32* %337, i64 %339
%341 = load i32, i32* %340
%342 = load i32*, i32** %9
%343 = load i32, i32* %16
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds i32, i32* %342, i64 %344
%346 = load i32, i32* %345
%347 = call i32 (i32*, i8*, ...) @fprintf(i32* %336, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %341, i32 %346)
%348 = load i32*, i32** %18
%349 = call i32 (i32*, i8*, ...) @fprintf(i32* %348, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %16
br label %350
350: ; preds = %434, %335
%351 = load i32, i32* %16
%352 = load i32, i32* %13
%353 = sub nsw i32 %352, 1
%354 = icmp slt i32 %351, %353
br i1 %354, label %355, label %437
355: ; preds = %350
%356 = load i32*, i32** %10
%357 = load i32, i32* %16
%358 = add nsw i32 %357, 1
%359 = sext i32 %358 to i64
%360 = getelementptr inbounds i32, i32* %356, i64 %359
%361 = load i32, i32* %360
%362 = load i32*, i32** %10
%363 = load i32, i32* %16
%364 = sext i32 %363 to i64
%365 = getelementptr inbounds i32, i32* %362, i64 %364
%366 = load i32, i32* %365
%367 = sub nsw i32 %361, %366
%368 = sitofp i32 %367 to double
%369 = load i32*, i32** %7
%370 = load i32, i32* %16
%371 = add nsw i32 %370, 1
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds i32, i32* %369, i64 %372
%374 = load i32, i32* %373
%375 = load i32*, i32** %7
%376 = load i32, i32* %16
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds i32, i32* %375, i64 %377
%379 = load i32, i32* %378
%380 = sub nsw i32 %374, %379
%381 = sitofp i32 %380 to double
%382 = fdiv double %368, %381
store double %382, double* %25
%383 = load i32*, i32** %7
%384 = load i32, i32* %16
%385 = sext i32 %384 to i64
%386 = getelementptr inbounds i32, i32* %383, i64 %385
%387 = load i32, i32* %386
store i32 %387, i32* %27
br label %388
388: ; preds = %418, %355
%389 = load i32, i32* %27
%390 = load i32*, i32** %7
%391 = load i32, i32* %16
%392 = add nsw i32 %391, 1
%393 = sext i32 %392 to i64
%394 = getelementptr inbounds i32, i32* %390, i64 %393
%395 = load i32, i32* %394
%396 = icmp sle i32 %389, %395
br i1 %396, label %397, label %421
397: ; preds = %388
%398 = load i32*, i32** %10
%399 = load i32, i32* %16
%400 = sext i32 %399 to i64
%401 = getelementptr inbounds i32, i32* %398, i64 %400
%402 = load i32, i32* %401
%403 = sitofp i32 %402 to double
%404 = load double, double* %25
%405 = load i32, i32* %27
%406 = load i32*, i32** %7
%407 = load i32, i32* %16
%408 = sext i32 %407 to i64
%409 = getelementptr inbounds i32, i32* %406, i64 %408
%410 = load i32, i32* %409
%411 = sub nsw i32 %405, %410
%412 = sitofp i32 %411 to double
%413 = call double @llvm.fmuladd.f64(double %404, double %412, double %403)
%414 = fptosi double %413 to i32
%415 = load i32, i32* %27
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds [256 x i32], [256 x i32]* %23, i64 0, i64 %416
store i32 %414, i32* %417
br label %418
418: ; preds = %397
%419 = load i32, i32* %27
%420 = add nsw i32 %419, 1
store i32 %420, i32* %27
br label %388
421: ; preds = %388
%422 = load i32*, i32** %18
%423 = load i32*, i32** %7
%424 = load i32, i32* %16
%425 = sext i32 %424 to i64
%426 = getelementptr inbounds i32, i32* %423, i64 %425
%427 = load i32, i32* %426
%428 = load i32*, i32** %10
%429 = load i32, i32* %16
%430 = sext i32 %429 to i64
%431 = getelementptr inbounds i32, i32* %428, i64 %430
%432 = load i32, i32* %431
%433 = call i32 (i32*, i8*, ...) @fprintf(i32* %422, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %427, i32 %432)
br label %434
434: ; preds = %421
%435 = load i32, i32* %16
%436 = add nsw i32 %435, 1
store i32 %436, i32* %16
br label %350
437: ; preds = %350
%438 = load i32*, i32** %18
%439 = load i32*, i32** %7
%440 = load i32, i32* %16
%441 = sext i32 %440 to i64
%442 = getelementptr inbounds i32, i32* %439, i64 %441
%443 = load i32, i32* %442
%444 = load i32*, i32** %10
%445 = load i32, i32* %16
%446 = sext i32 %445 to i64
%447 = getelementptr inbounds i32, i32* %444, i64 %446
%448 = load i32, i32* %447
%449 = call i32 (i32*, i8*, ...) @fprintf(i32* %438, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %443, i32 %448)
%450 = load i32*, i32** %18
%451 = call i32 (i32*, i8*, ...) @fprintf(i32* %450, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %16
br label %452
452: ; preds = %536, %437
%453 = load i32, i32* %16
%454 = load i32, i32* %14
%455 = sub nsw i32 %454, 1
%456 = icmp slt i32 %453, %455
br i1 %456, label %457, label %539
457: ; preds = %452
%458 = load i32*, i32** %11
%459 = load i32, i32* %16
%460 = add nsw i32 %459, 1
%461 = sext i32 %460 to i64
%462 = getelementptr inbounds i32, i32* %458, i64 %461
%463 = load i32, i32* %462
%464 = load i32*, i32** %11
%465 = load i32, i32* %16
%466 = sext i32 %465 to i64
%467 = getelementptr inbounds i32, i32* %464, i64 %466
%468 = load i32, i32* %467
%469 = sub nsw i32 %463, %468
%470 = sitofp i32 %469 to double
%471 = load i32*, i32** %8
%472 = load i32, i32* %16
%473 = add nsw i32 %472, 1
%474 = sext i32 %473 to i64
%475 = getelementptr inbounds i32, i32* %471, i64 %474
%476 = load i32, i32* %475
%477 = load i32*, i32** %8
%478 = load i32, i32* %16
%479 = sext i32 %478 to i64
%480 = getelementptr inbounds i32, i32* %477, i64 %479
%481 = load i32, i32* %480
%482 = sub nsw i32 %476, %481
%483 = sitofp i32 %482 to double
%484 = fdiv double %470, %483
store double %484, double* %25
%485 = load i32*, i32** %8
%486 = load i32, i32* %16
%487 = sext i32 %486 to i64
%488 = getelementptr inbounds i32, i32* %485, i64 %487
%489 = load i32, i32* %488
store i32 %489, i32* %28
br label %490
490: ; preds = %520, %457
%491 = load i32, i32* %28
%492 = load i32*, i32** %8
%493 = load i32, i32* %16
%494 = add nsw i32 %493, 1
%495 = sext i32 %494 to i64
%496 = getelementptr inbounds i32, i32* %492, i64 %495
%497 = load i32, i32* %496
%498 = icmp sle i32 %491, %497
br i1 %498, label %499, label %523
499: ; preds = %490
%500 = load i32*, i32** %11
%501 = load i32, i32* %16
%502 = sext i32 %501 to i64
%503 = getelementptr inbounds i32, i32* %500, i64 %502
%504 = load i32, i32* %503
%505 = sitofp i32 %504 to double
%506 = load double, double* %25
%507 = load i32, i32* %28
%508 = load i32*, i32** %8
%509 = load i32, i32* %16
%510 = sext i32 %509 to i64
%511 = getelementptr inbounds i32, i32* %508, i64 %510
%512 = load i32, i32* %511
%513 = sub nsw i32 %507, %512
%514 = sitofp i32 %513 to double
%515 = call double @llvm.fmuladd.f64(double %506, double %514, double %505)
%516 = fptosi double %515 to i32
%517 = load i32, i32* %28
%518 = sext i32 %517 to i64
%519 = getelementptr inbounds [256 x i32], [256 x i32]* %24, i64 0, i64 %518
store i32 %516, i32* %519
br label %520
520: ; preds = %499
%521 = load i32, i32* %28
%522 = add nsw i32 %521, 1
store i32 %522, i32* %28
br label %490
523: ; preds = %490
%524 = load i32*, i32** %18
%525 = load i32*, i32** %8
%526 = load i32, i32* %16
%527 = sext i32 %526 to i64
%528 = getelementptr inbounds i32, i32* %525, i64 %527
%529 = load i32, i32* %528
%530 = load i32*, i32** %11
%531 = load i32, i32* %16
%532 = sext i32 %531 to i64
%533 = getelementptr inbounds i32, i32* %530, i64 %532
%534 = load i32, i32* %533
%535 = call i32 (i32*, i8*, ...) @fprintf(i32* %524, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 %529, i32 %534)
br label %536
536: ; preds = %523
%537 = load i32, i32* %16
%538 = add nsw i32 %537, 1
store i32 %538, i32* %16
br label %452
539: ; preds = %452
%540 = load i32*, i32** %18
%541 = load i32*, i32** %8
%542 = load i32, i32* %16
%543 = sext i32 %542 to i64
%544 = getelementptr inbounds i32, i32* %541, i64 %543
%545 = load i32, i32* %544
%546 = load i32*, i32** %11
%547 = load i32, i32* %16
%548 = sext i32 %547 to i64
%549 = getelementptr inbounds i32, i32* %546, i64 %548
%550 = load i32, i32* %549
%551 = call i32 (i32*, i8*, ...) @fprintf(i32* %540, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 %545, i32 %550)
%552 = load i32*, i32** %17
%553 = call i32 (i32*, i8*, ...) @fprintf(i32* %552, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %29
br label %554
554: ; preds = %572, %539
%555 = load i32, i32* %29
%556 = icmp slt i32 %555, 256
br i1 %556, label %557, label %575
557: ; preds = %554
%558 = load i32*, i32** %17
%559 = load i32, i32* %29
%560 = sext i32 %559 to i64
%561 = getelementptr inbounds [256 x i32], [256 x i32]* %22, i64 0, i64 %560
%562 = load i32, i32* %561
%563 = load i32, i32* %29
%564 = sext i32 %563 to i64
%565 = getelementptr inbounds [256 x i32], [256 x i32]* %23, i64 0, i64 %564
%566 = load i32, i32* %565
%567 = load i32, i32* %29
%568 = sext i32 %567 to i64
%569 = getelementptr inbounds [256 x i32], [256 x i32]* %24, i64 0, i64 %568
%570 = load i32, i32* %569
%571 = call i32 (i32*, i8*, ...) @fprintf(i32* %558, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i32 %562, i32 %566, i32 %570)
br label %572
572: ; preds = %557
%573 = load i32, i32* %29
%574 = add nsw i32 %573, 1
store i32 %574, i32* %29
br label %554
575: ; preds = %554
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"%s.ppm\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [18 x i8] c"%s.control_points\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [15 x i8] c"Control Points\00"
@.str.6 = [19 x i8] c"Control Points: %d\00"
@.str.7 = [12 x i8] c"[Blue Info]\00"
@.str.8 = [14 x i8] c"Control Point\00"
@.str.9 = [17 x i8] c"Control Point %d\00"
@.str.10 = [29 x i8] c"Control Point %*d: (%d , %d)\00"
@.str.11 = [29 x i8] c"error reading blue point %d\0A\00"
@.str.12 = [13 x i8] c"[Green Info]\00"
@.str.13 = [30 x i8] c"error reading green point %d\0A\00"
@.str.14 = [11 x i8] c"[Red Info]\00"
@.str.15 = [28 x i8] c"error reading red point %d\0A\00"
@.str.16 = [8 x i8] c"%d %d \0A\00"
@.str.17 = [3 x i8] c"\0A\0A\00"
@.str.18 = [7 x i8] c"%d %d\0A\00"
@.str.19 = [14 x i8] c"P3 1 256 255\0A\00"
@.str.20 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [5120 x i8]
%7 = alloca i32
%8 = alloca [256 x i32]
%9 = alloca [256 x i32]
%10 = alloca [256 x i32]
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = getelementptr inbounds [5120 x i8], [5120 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = icmp slt i32 %0, 1
%20 = or i1 %19, %18
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = tail call i32 (...) @usage()
br label %23
23: ; preds = %2, %21
%24 = load i8*, i8** %15
%25 = call i32 @snprintf(i8* %14, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = load i8*, i8** %15
%28 = call i32 @snprintf(i8* %14, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%29 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%30 = load i8*, i8** %15
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %35
33: ; preds = %23
%34 = call i32 (...) @usage()
br label %35
35: ; preds = %33, %23
%36 = call i32 @fread(i8* %14, i32 1, i32 5120, i32* %31)
%37 = call i32 @fclose(i32* %31)
%38 = call i8* @strstr(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%39 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %38, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%40 = getelementptr inbounds i8, i8* %38, i64 1
%41 = call i8* @strstr(i8* %40, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%42 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %41, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%43 = getelementptr inbounds i8, i8* %41, i64 1
%44 = call i8* @strstr(i8* %43, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%45 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %44, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%46 = load i32, i32* %5
%47 = shl i32 %46, 2
%48 = call i32* @malloc(i32 %47)
%49 = call i32* @malloc(i32 %47)
%50 = load i32, i32* %4
%51 = shl i32 %50, 2
%52 = call i32* @malloc(i32 %51)
%53 = call i32* @malloc(i32 %51)
%54 = load i32, i32* %3
%55 = shl i32 %54, 2
%56 = call i32* @malloc(i32 %55)
%57 = call i32* @malloc(i32 %55)
%58 = bitcast i32* %7 to i8*
%59 = icmp sgt i32 %46, 0
br i1 %59, label %60, label %88
60: ; preds = %35
%61 = call i8* @strstr(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %62
62: ; preds = %60, %76
%63 = phi i8* [ %82, %76 ], [ %61, %60 ]
%64 = phi i32 [ %83, %76 ], [ 0, %60 ]
%65 = call i8* @strstr(i8* dereferenceable(1) %63, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%66 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %65, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %7)
%67 = load i32, i32* %7
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %48, i64 %68
%70 = getelementptr inbounds i32, i32* %49, i64 %68
%71 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32* %69, i32* %70)
%72 = icmp eq i32 %71, 2
br i1 %72, label %76, label %73
73: ; preds = %62
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 %64)
%75 = call i32 @exit(i32 -1)
unreachable
76: ; preds = %62
%77 = load i32, i32* %7
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %49, i64 %78
%80 = load i32, i32* %79
%81 = sub nsw i32 255, %80
store i32 %81, i32* %79
%82 = getelementptr inbounds i8, i8* %65, i64 1
%83 = add nuw nsw i32 %64, 1
%84 = load i32, i32* %5
%85 = icmp slt i32 %83, %84
br i1 %85, label %62, label %86
86: ; preds = %76
%87 = load i32, i32* %4
br label %88
88: ; preds = %86, %35
%89 = phi i32 [ %87, %86 ], [ %50, %35 ]
%90 = icmp sgt i32 %89, 0
br i1 %90, label %91, label %117
91: ; preds = %88
%92 = call i8* @strstr(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
br label %93
93: ; preds = %91, %107
%94 = phi i8* [ %113, %107 ], [ %92, %91 ]
%95 = phi i32 [ %114, %107 ], [ 0, %91 ]
%96 = call i8* @strstr(i8* dereferenceable(1) %94, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%97 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %96, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %7)
%98 = load i32, i32* %7
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %52, i64 %99
%101 = getelementptr inbounds i32, i32* %53, i64 %99
%102 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %96, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32* %100, i32* %101)
%103 = icmp eq i32 %102, 2
br i1 %103, label %107, label %104
104: ; preds = %93
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i32 %95)
%106 = call i32 @exit(i32 -1)
unreachable
107: ; preds = %93
%108 = load i32, i32* %7
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i32, i32* %53, i64 %109
%111 = load i32, i32* %110
%112 = sub nsw i32 255, %111
store i32 %112, i32* %110
%113 = getelementptr inbounds i8, i8* %96, i64 1
%114 = add nuw nsw i32 %95, 1
%115 = load i32, i32* %4
%116 = icmp slt i32 %114, %115
br i1 %116, label %93, label %117
117: ; preds = %107, %88
%118 = load i32, i32* %3
%119 = icmp sgt i32 %118, 0
br i1 %119, label %124, label %120
120: ; preds = %117
%121 = bitcast [256 x i32]* %8 to i8*
%122 = bitcast [256 x i32]* %9 to i8*
%123 = bitcast [256 x i32]* %10 to i8*
br label %258
124: ; preds = %117
%125 = call i8* @strstr(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
br label %126
126: ; preds = %124, %140
%127 = phi i8* [ %146, %140 ], [ %125, %124 ]
%128 = phi i32 [ %147, %140 ], [ 0, %124 ]
%129 = call i8* @strstr(i8* dereferenceable(1) %127, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%130 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %129, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32* %7)
%131 = load i32, i32* %7
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i32, i32* %56, i64 %132
%134 = getelementptr inbounds i32, i32* %57, i64 %132
%135 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %129, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32* %133, i32* %134)
%136 = icmp eq i32 %135, 2
br i1 %136, label %140, label %137
137: ; preds = %126
%138 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %128)
%139 = call i32 @exit(i32 -1)
unreachable
140: ; preds = %126
%141 = load i32, i32* %7
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i32, i32* %57, i64 %142
%144 = load i32, i32* %143
%145 = sub nsw i32 255, %144
store i32 %145, i32* %143
%146 = getelementptr inbounds i8, i8* %129, i64 1
%147 = add nuw nsw i32 %128, 1
%148 = load i32, i32* %3
%149 = icmp slt i32 %147, %148
br i1 %149, label %126, label %150
150: ; preds = %140
%151 = bitcast [256 x i32]* %8 to i8*
%152 = bitcast [256 x i32]* %9 to i8*
%153 = bitcast [256 x i32]* %10 to i8*
%154 = icmp sgt i32 %148, 1
br i1 %154, label %155, label %258
155: ; preds = %150, %239
%156 = phi i64 [ %157, %239 ], [ 0, %150 ]
%157 = add nuw nsw i64 %156, 1
%158 = getelementptr inbounds i32, i32* %57, i64 %157
%159 = load i32, i32* %158
%160 = getelementptr inbounds i32, i32* %57, i64 %156
%161 = load i32, i32* %160
%162 = sub nsw i32 %159, %161
%163 = sitofp i32 %162 to double
%164 = getelementptr inbounds i32, i32* %56, i64 %157
%165 = load i32, i32* %164
%166 = getelementptr inbounds i32, i32* %56, i64 %156
%167 = load i32, i32* %166
%168 = sub nsw i32 %165, %167
%169 = sitofp i32 %168 to double
%170 = fdiv double %163, %169
%171 = icmp slt i32 %165, %167
br i1 %171, label %239, label %172
172: ; preds = %155
%173 = sitofp i32 %161 to double
%174 = sext i32 %167 to i64
%175 = add i32 %165, 1
%176 = sub i32 %165, %167
%177 = zext i32 %176 to i64
%178 = add nuw nsw i64 %177, 1
%179 = icmp ult i32 %176, 3
br i1 %179, label %237, label %180
180: ; preds = %172
%181 = and i64 %178, 8589934588
%182 = add nsw i64 %181, %174
%183 = insertelement <4 x i32> poison, i32 %167, i64 0
%184 = shufflevector <4 x i32> %183, <4 x i32> poison, <4 x i32> zeroinitializer
%185 = add <4 x i32> %184, <i32 0, i32 1, i32 2, i32 3>
%186 = insertelement <4 x i32> poison, i32 %167, i64 0
%187 = shufflevector <4 x i32> %186, <4 x i32> poison, <4 x i32> zeroinitializer
%188 = insertelement <4 x double> poison, double %170, i64 0
%189 = shufflevector <4 x double> %188, <4 x double> poison, <4 x i32> zeroinitializer
%190 = insertelement <4 x double> poison, double %173, i64 0
%191 = shufflevector <4 x double> %190, <4 x double> poison, <4 x i32> zeroinitializer
%192 = add nsw i64 %181, -4
%193 = lshr exact i64 %192, 2
%194 = add nuw nsw i64 %193, 1
%195 = and i64 %194, 1
%196 = icmp eq i64 %192, 0
br i1 %196, label %223, label %197
197: ; preds = %180
%198 = and i64 %194, 9223372036854775806
br label %199
199: ; preds = %199, %197
%200 = phi i64 [ 0, %197 ], [ %219, %199 ]
%201 = phi <4 x i32> [ %185, %197 ], [ %220, %199 ]
%202 = phi i64 [ 0, %197 ], [ %221, %199 ]
%203 = add i64 %200, %174
%204 = sub <4 x i32> %201, %187
%205 = sitofp <4 x i32> %204 to <4 x double>
%206 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %189, <4 x double> %205, <4 x double> %191)
%207 = fptosi <4 x double> %206 to <4 x i32>
%208 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %203
%209 = bitcast i32* %208 to <4 x i32>*
store <4 x i32> %207, <4 x i32>* %209
%210 = or i64 %200, 4
%211 = add <4 x i32> %201, <i32 4, i32 4, i32 4, i32 4>
%212 = add i64 %210, %174
%213 = sub <4 x i32> %211, %187
%214 = sitofp <4 x i32> %213 to <4 x double>
%215 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %189, <4 x double> %214, <4 x double> %191)
%216 = fptosi <4 x double> %215 to <4 x i32>
%217 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %212
%218 = bitcast i32* %217 to <4 x i32>*
store <4 x i32> %216, <4 x i32>* %218
%219 = add nuw i64 %200, 8
%220 = add <4 x i32> %201, <i32 8, i32 8, i32 8, i32 8>
%221 = add i64 %202, 2
%222 = icmp eq i64 %221, %198
br i1 %222, label %223, label %199
223: ; preds = %199, %180
%224 = phi i64 [ 0, %180 ], [ %219, %199 ]
%225 = phi <4 x i32> [ %185, %180 ], [ %220, %199 ]
%226 = icmp eq i64 %195, 0
br i1 %226, label %235, label %227
227: ; preds = %223
%228 = add i64 %224, %174
%229 = sub <4 x i32> %225, %187
%230 = sitofp <4 x i32> %229 to <4 x double>
%231 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %189, <4 x double> %230, <4 x double> %191)
%232 = fptosi <4 x double> %231 to <4 x i32>
%233 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %228
%234 = bitcast i32* %233 to <4 x i32>*
store <4 x i32> %232, <4 x i32>* %234
br label %235
235: ; preds = %223, %227
%236 = icmp eq i64 %178, %181
br i1 %236, label %239, label %237
237: ; preds = %172, %235
%238 = phi i64 [ %174, %172 ], [ %182, %235 ]
br label %245
239: ; preds = %245, %235, %155
%240 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %167, i32 %161)
%241 = load i32, i32* %3
%242 = add nsw i32 %241, -1
%243 = sext i32 %242 to i64
%244 = icmp slt i64 %157, %243
br i1 %244, label %155, label %256
245: ; preds = %237, %245
%246 = phi i64 [ %253, %245 ], [ %238, %237 ]
%247 = trunc i64 %246 to i32
%248 = sub i32 %247, %167
%249 = sitofp i32 %248 to double
%250 = call double @llvm.fmuladd.f64(double %170, double %249, double %173)
%251 = fptosi double %250 to i32
%252 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %246
store i32 %251, i32* %252
%253 = add nsw i64 %246, 1
%254 = trunc i64 %253 to i32
%255 = icmp eq i32 %175, %254
br i1 %255, label %239, label %245
256: ; preds = %239
%257 = and i64 %157, 4294967295
br label %258
258: ; preds = %120, %256, %150
%259 = phi i64 [ 0, %150 ], [ %257, %256 ], [ 0, %120 ]
%260 = getelementptr inbounds i32, i32* %56, i64 %259
%261 = load i32, i32* %260
%262 = getelementptr inbounds i32, i32* %57, i64 %259
%263 = load i32, i32* %262
%264 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %261, i32 %263)
%265 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i64 2, i64 1, i32* %29)
%266 = load i32, i32* %4
%267 = icmp sgt i32 %266, 1
br i1 %267, label %268, label %371
268: ; preds = %258, %352
%269 = phi i64 [ %270, %352 ], [ 0, %258 ]
%270 = add nuw nsw i64 %269, 1
%271 = getelementptr inbounds i32, i32* %53, i64 %270
%272 = load i32, i32* %271
%273 = getelementptr inbounds i32, i32* %53, i64 %269
%274 = load i32, i32* %273
%275 = sub nsw i32 %272, %274
%276 = sitofp i32 %275 to double
%277 = getelementptr inbounds i32, i32* %52, i64 %270
%278 = load i32, i32* %277
%279 = getelementptr inbounds i32, i32* %52, i64 %269
%280 = load i32, i32* %279
%281 = sub nsw i32 %278, %280
%282 = sitofp i32 %281 to double
%283 = fdiv double %276, %282
%284 = icmp slt i32 %278, %280
br i1 %284, label %352, label %285
285: ; preds = %268
%286 = sitofp i32 %274 to double
%287 = sext i32 %280 to i64
%288 = add i32 %278, 1
%289 = sub i32 %278, %280
%290 = zext i32 %289 to i64
%291 = add nuw nsw i64 %290, 1
%292 = icmp ult i32 %289, 3
br i1 %292, label %350, label %293
293: ; preds = %285
%294 = and i64 %291, 8589934588
%295 = add nsw i64 %294, %287
%296 = insertelement <4 x i32> poison, i32 %280, i64 0
%297 = shufflevector <4 x i32> %296, <4 x i32> poison, <4 x i32> zeroinitializer
%298 = add <4 x i32> %297, <i32 0, i32 1, i32 2, i32 3>
%299 = insertelement <4 x i32> poison, i32 %280, i64 0
%300 = shufflevector <4 x i32> %299, <4 x i32> poison, <4 x i32> zeroinitializer
%301 = insertelement <4 x double> poison, double %283, i64 0
%302 = shufflevector <4 x double> %301, <4 x double> poison, <4 x i32> zeroinitializer
%303 = insertelement <4 x double> poison, double %286, i64 0
%304 = shufflevector <4 x double> %303, <4 x double> poison, <4 x i32> zeroinitializer
%305 = add nsw i64 %294, -4
%306 = lshr exact i64 %305, 2
%307 = add nuw nsw i64 %306, 1
%308 = and i64 %307, 1
%309 = icmp eq i64 %305, 0
br i1 %309, label %336, label %310
310: ; preds = %293
%311 = and i64 %307, 9223372036854775806
br label %312
312: ; preds = %312, %310
%313 = phi i64 [ 0, %310 ], [ %332, %312 ]
%314 = phi <4 x i32> [ %298, %310 ], [ %333, %312 ]
%315 = phi i64 [ 0, %310 ], [ %334, %312 ]
%316 = add i64 %313, %287
%317 = sub <4 x i32> %314, %300
%318 = sitofp <4 x i32> %317 to <4 x double>
%319 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %302, <4 x double> %318, <4 x double> %304)
%320 = fptosi <4 x double> %319 to <4 x i32>
%321 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 %316
%322 = bitcast i32* %321 to <4 x i32>*
store <4 x i32> %320, <4 x i32>* %322
%323 = or i64 %313, 4
%324 = add <4 x i32> %314, <i32 4, i32 4, i32 4, i32 4>
%325 = add i64 %323, %287
%326 = sub <4 x i32> %324, %300
%327 = sitofp <4 x i32> %326 to <4 x double>
%328 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %302, <4 x double> %327, <4 x double> %304)
%329 = fptosi <4 x double> %328 to <4 x i32>
%330 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 %325
%331 = bitcast i32* %330 to <4 x i32>*
store <4 x i32> %329, <4 x i32>* %331
%332 = add nuw i64 %313, 8
%333 = add <4 x i32> %314, <i32 8, i32 8, i32 8, i32 8>
%334 = add i64 %315, 2
%335 = icmp eq i64 %334, %311
br i1 %335, label %336, label %312
336: ; preds = %312, %293
%337 = phi i64 [ 0, %293 ], [ %332, %312 ]
%338 = phi <4 x i32> [ %298, %293 ], [ %333, %312 ]
%339 = icmp eq i64 %308, 0
br i1 %339, label %348, label %340
340: ; preds = %336
%341 = add i64 %337, %287
%342 = sub <4 x i32> %338, %300
%343 = sitofp <4 x i32> %342 to <4 x double>
%344 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %302, <4 x double> %343, <4 x double> %304)
%345 = fptosi <4 x double> %344 to <4 x i32>
%346 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 %341
%347 = bitcast i32* %346 to <4 x i32>*
store <4 x i32> %345, <4 x i32>* %347
br label %348
348: ; preds = %336, %340
%349 = icmp eq i64 %291, %294
br i1 %349, label %352, label %350
350: ; preds = %285, %348
%351 = phi i64 [ %287, %285 ], [ %295, %348 ]
br label %358
352: ; preds = %358, %348, %268
%353 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %280, i32 %274)
%354 = load i32, i32* %4
%355 = add nsw i32 %354, -1
%356 = sext i32 %355 to i64
%357 = icmp slt i64 %270, %356
br i1 %357, label %268, label %369
358: ; preds = %350, %358
%359 = phi i64 [ %366, %358 ], [ %351, %350 ]
%360 = trunc i64 %359 to i32
%361 = sub i32 %360, %280
%362 = sitofp i32 %361 to double
%363 = call double @llvm.fmuladd.f64(double %283, double %362, double %286)
%364 = fptosi double %363 to i32
%365 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 %359
store i32 %364, i32* %365
%366 = add nsw i64 %359, 1
%367 = trunc i64 %366 to i32
%368 = icmp eq i32 %288, %367
br i1 %368, label %352, label %358
369: ; preds = %352
%370 = and i64 %270, 4294967295
br label %371
371: ; preds = %369, %258
%372 = phi i64 [ 0, %258 ], [ %370, %369 ]
%373 = getelementptr inbounds i32, i32* %52, i64 %372
%374 = load i32, i32* %373
%375 = getelementptr inbounds i32, i32* %53, i64 %372
%376 = load i32, i32* %375
%377 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %374, i32 %376)
%378 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i64 2, i64 1, i32* %29)
%379 = load i32, i32* %5
%380 = icmp sgt i32 %379, 1
br i1 %380, label %381, label %484
381: ; preds = %371, %465
%382 = phi i64 [ %383, %465 ], [ 0, %371 ]
%383 = add nuw nsw i64 %382, 1
%384 = getelementptr inbounds i32, i32* %49, i64 %383
%385 = load i32, i32* %384
%386 = getelementptr inbounds i32, i32* %49, i64 %382
%387 = load i32, i32* %386
%388 = sub nsw i32 %385, %387
%389 = sitofp i32 %388 to double
%390 = getelementptr inbounds i32, i32* %48, i64 %383
%391 = load i32, i32* %390
%392 = getelementptr inbounds i32, i32* %48, i64 %382
%393 = load i32, i32* %392
%394 = sub nsw i32 %391, %393
%395 = sitofp i32 %394 to double
%396 = fdiv double %389, %395
%397 = icmp slt i32 %391, %393
br i1 %397, label %465, label %398
398: ; preds = %381
%399 = sitofp i32 %387 to double
%400 = sext i32 %393 to i64
%401 = add i32 %391, 1
%402 = sub i32 %391, %393
%403 = zext i32 %402 to i64
%404 = add nuw nsw i64 %403, 1
%405 = icmp ult i32 %402, 3
br i1 %405, label %463, label %406
406: ; preds = %398
%407 = and i64 %404, 8589934588
%408 = add nsw i64 %407, %400
%409 = insertelement <4 x i32> poison, i32 %393, i64 0
%410 = shufflevector <4 x i32> %409, <4 x i32> poison, <4 x i32> zeroinitializer
%411 = add <4 x i32> %410, <i32 0, i32 1, i32 2, i32 3>
%412 = insertelement <4 x i32> poison, i32 %393, i64 0
%413 = shufflevector <4 x i32> %412, <4 x i32> poison, <4 x i32> zeroinitializer
%414 = insertelement <4 x double> poison, double %396, i64 0
%415 = shufflevector <4 x double> %414, <4 x double> poison, <4 x i32> zeroinitializer
%416 = insertelement <4 x double> poison, double %399, i64 0
%417 = shufflevector <4 x double> %416, <4 x double> poison, <4 x i32> zeroinitializer
%418 = add nsw i64 %407, -4
%419 = lshr exact i64 %418, 2
%420 = add nuw nsw i64 %419, 1
%421 = and i64 %420, 1
%422 = icmp eq i64 %418, 0
br i1 %422, label %449, label %423
423: ; preds = %406
%424 = and i64 %420, 9223372036854775806
br label %425
425: ; preds = %425, %423
%426 = phi i64 [ 0, %423 ], [ %445, %425 ]
%427 = phi <4 x i32> [ %411, %423 ], [ %446, %425 ]
%428 = phi i64 [ 0, %423 ], [ %447, %425 ]
%429 = add i64 %426, %400
%430 = sub <4 x i32> %427, %413
%431 = sitofp <4 x i32> %430 to <4 x double>
%432 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %415, <4 x double> %431, <4 x double> %417)
%433 = fptosi <4 x double> %432 to <4 x i32>
%434 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 %429
%435 = bitcast i32* %434 to <4 x i32>*
store <4 x i32> %433, <4 x i32>* %435
%436 = or i64 %426, 4
%437 = add <4 x i32> %427, <i32 4, i32 4, i32 4, i32 4>
%438 = add i64 %436, %400
%439 = sub <4 x i32> %437, %413
%440 = sitofp <4 x i32> %439 to <4 x double>
%441 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %415, <4 x double> %440, <4 x double> %417)
%442 = fptosi <4 x double> %441 to <4 x i32>
%443 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 %438
%444 = bitcast i32* %443 to <4 x i32>*
store <4 x i32> %442, <4 x i32>* %444
%445 = add nuw i64 %426, 8
%446 = add <4 x i32> %427, <i32 8, i32 8, i32 8, i32 8>
%447 = add i64 %428, 2
%448 = icmp eq i64 %447, %424
br i1 %448, label %449, label %425
449: ; preds = %425, %406
%450 = phi i64 [ 0, %406 ], [ %445, %425 ]
%451 = phi <4 x i32> [ %411, %406 ], [ %446, %425 ]
%452 = icmp eq i64 %421, 0
br i1 %452, label %461, label %453
453: ; preds = %449
%454 = add i64 %450, %400
%455 = sub <4 x i32> %451, %413
%456 = sitofp <4 x i32> %455 to <4 x double>
%457 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %415, <4 x double> %456, <4 x double> %417)
%458 = fptosi <4 x double> %457 to <4 x i32>
%459 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 %454
%460 = bitcast i32* %459 to <4 x i32>*
store <4 x i32> %458, <4 x i32>* %460
br label %461
461: ; preds = %449, %453
%462 = icmp eq i64 %404, %407
br i1 %462, label %465, label %463
463: ; preds = %398, %461
%464 = phi i64 [ %400, %398 ], [ %408, %461 ]
br label %471
465: ; preds = %471, %461, %381
%466 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 %393, i32 %387)
%467 = load i32, i32* %5
%468 = add nsw i32 %467, -1
%469 = sext i32 %468 to i64
%470 = icmp slt i64 %383, %469
br i1 %470, label %381, label %482
471: ; preds = %463, %471
%472 = phi i64 [ %479, %471 ], [ %464, %463 ]
%473 = trunc i64 %472 to i32
%474 = sub i32 %473, %393
%475 = sitofp i32 %474 to double
%476 = call double @llvm.fmuladd.f64(double %396, double %475, double %399)
%477 = fptosi double %476 to i32
%478 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 %472
store i32 %477, i32* %478
%479 = add nsw i64 %472, 1
%480 = trunc i64 %479 to i32
%481 = icmp eq i32 %401, %480
br i1 %481, label %465, label %471
482: ; preds = %465
%483 = and i64 %383, 4294967295
br label %484
484: ; preds = %482, %371
%485 = phi i64 [ 0, %371 ], [ %483, %482 ]
%486 = getelementptr inbounds i32, i32* %48, i64 %485
%487 = load i32, i32* %486
%488 = getelementptr inbounds i32, i32* %49, i64 %485
%489 = load i32, i32* %488
%490 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 %487, i32 %489)
%491 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i64 13, i64 1, i32* %26)
br label %496
492: ; preds = %496
%493 = bitcast [256 x i32]* %8 to i8*
%494 = bitcast [256 x i32]* %9 to i8*
%495 = bitcast [256 x i32]* %10 to i8*
ret i32 0
496: ; preds = %484, %496
%497 = phi i64 [ 0, %484 ], [ %505, %496 ]
%498 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %497
%499 = load i32, i32* %498
%500 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 %497
%501 = load i32, i32* %500
%502 = getelementptr inbounds [256 x i32], [256 x i32]* %10, i64 0, i64 %497
%503 = load i32, i32* %502
%504 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i32 %499, i32 %501, i32 %503)
%505 = add nuw nsw i64 %497, 1
%506 = icmp eq i64 %505, 256
br i1 %506, label %492, label %496
}