#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 */

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ isinf(float);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, ...);
int read(int, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int i, result, done = 0;
  int fd, temp_int, rate, channels;
  float points[4];
  int ticks = 0, trace_ticks = 0;
  double watts;
  long long temp64;
  int trace = 0;
  int state = 0;
  double trace_joules = 0.0;
  int time_in_state = 0;
  int threshold = 1;
  double total_joules = 0.0;
  double total_time = 0.0;
  if (argc > 1) {
    fd = open(argv[1], O_RDONLY);
    if (fd < 1) {
      fprintf(stderr, "Could not open %s\n", argv[1]);
      return -1;
    }
  } else {
    fd = 0;
  }
  read(fd, &temp_int, 4);
  printf("(* Version %d *)\n", temp_int);
  read(fd, &temp64, 8);
  printf("(* Start Time %lld.", temp64);
  read(fd, &temp64, 8);
  printf("%06lld)\n", temp64);
  read(fd, &temp_int, 4);
  rate = temp_int;
  printf("(* Rate %d Hz *)\n", rate);
  threshold = rate / 500;
  if (threshold < 1)
    threshold = 1;
  read(fd, &temp_int, 4);
  channels = temp_int;
  printf("(* Channels %d *)\n", channels);
  while (!done) {
    for (i = 0; i < channels; i++) {
      result = read(fd, &points[i], sizeof(float));
      if (isinf(points[i])) {
        done = 1;
        break;
      }
      if (result < sizeof(float)) {
        done = 1;
        break;
      }
    }
    if (done)
      break;
    if (state == 0) {
      if (points[3] > 4.0) {
        time_in_state++;
        if (time_in_state > threshold) {
          state = 1;
          time_in_state = 0;
        }
      }
    } else if (state == 1) {
      if (points[3] < -4.0) {
        state = 3;
        printf("Starting Trace %d at %lf\n", trace,
               (double)ticks / (double)rate);
        trace_ticks = 0;
        trace_joules = 0.0;
        time_in_state = 0;
      }
    } else if (state == 3) {
      if (points[3] > 4.0) {
        time_in_state++;
        if (time_in_state > threshold) {
          state = 2;
          printf("Ending Trace %d at %lfs, %lfs Elapsed\n", trace,
                 (double)ticks / (double)rate,
                 (double)trace_ticks / (double)rate);
          printf("Total Energy: %lfJ Average Power: %lfW\n", trace_joules,
                 trace_joules / ((double)trace_ticks / (double)rate));
          total_joules += trace_joules;
          total_time += (double)trace_ticks / (double)rate;
          trace++;
          time_in_state = 0;
        }
      }
    } else if (state == 2) {
      if (points[3] < -4.0) {
        state = 0;
        time_in_state = 0;
      }
    }
    if (state == 3) {
      watts = ((points[0] / 300.0) / 0.00333) * points[1];
      trace_joules += (watts / rate);
      trace_ticks++;
    }
    ticks++;
  }
  read(fd, &temp64, 8);
  printf("(* Stop Time %lld.", temp64);
  read(fd, &temp64, 8);
  printf("%06lld)\n", temp64);
  printf("Average Joules=%lf\tAverage Watts=%lf\n",
         total_joules / (double)trace, total_joules / total_time);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x1,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    120d <main+0xbd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e1d(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x1,-0x20(%rbp)
jge    1208 <main+0xb8>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe29(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    166d <main+0x51d>
jmp    1214 <main+0xc4>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <read@plt>
cvtsi2sdl -0x24(%rbp),%xmm0
lea    0xe00(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%edi
lea    -0x58(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <read@plt>
cvtsi2sdq -0x58(%rbp),%xmm0
lea    0xdeb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%edi
lea    -0x58(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <read@plt>
cvtsi2sdq -0x58(%rbp),%xmm0
lea    0xdd8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <read@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
cvtsi2sdl -0x28(%rbp),%xmm0
lea    0xdb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
mov    $0x1f4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x70(%rbp)
cmpl   $0x1,-0x70(%rbp)
jge    12d3 <main+0x183>
movl   $0x1,-0x70(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <read@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm0
lea    0xd7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1315 <main+0x1c5>
jmp    15f2 <main+0x4a2>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    139b <main+0x24b>
mov    -0x20(%rbp),%edi
movslq -0x14(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
movslq -0x14(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
call   1070 <isinf@plt>
cmp    $0x0,%rax
je     136e <main+0x21e>
movl   $0x1,-0x1c(%rbp)
jmp    139b <main+0x24b>
movslq -0x18(%rbp),%rax
cmp    $0x4,%rax
jae    1388 <main+0x238>
movl   $0x1,-0x1c(%rbp)
jmp    139b <main+0x24b>
jmp    138d <main+0x23d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    131c <main+0x1cc>
cmpl   $0x0,-0x1c(%rbp)
je     13aa <main+0x25a>
jmp    15f2 <main+0x4a2>
cmpl   $0x0,-0x60(%rbp)
jne    13fc <main+0x2ac>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc43(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13f7 <main+0x2a7>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x70(%rbp),%eax
jle    13f2 <main+0x2a2>
movl   $0x1,-0x60(%rbp)
movl   $0x0,-0x6c(%rbp)
jmp    13f7 <main+0x2a7>
jmp    1586 <main+0x436>
cmpl   $0x1,-0x60(%rbp)
jne    1464 <main+0x314>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xbe9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    145f <main+0x30f>
movl   $0x3,-0x60(%rbp)
cvtsi2sdl -0x5c(%rbp),%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
cvtsi2sdl -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
lea    0xc45(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
jmp    1581 <main+0x431>
cmpl   $0x3,-0x60(%rbp)
jne    153f <main+0x3ef>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb89(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    153a <main+0x3ea>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x70(%rbp),%eax
jle    1535 <main+0x3e5>
movl   $0x2,-0x60(%rbp)
cvtsi2sdl -0x5c(%rbp),%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
cvtsi2sdl -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
cvtsi2sdl -0x48(%rbp),%xmm2
cvtsi2sdl -0x28(%rbp),%xmm3
divsd  %xmm3,%xmm2
lea    0xbd4(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
cvtsi2sdl -0x48(%rbp),%xmm2
cvtsi2sdl -0x28(%rbp),%xmm3
divsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
lea    0xbd1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x68(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
cvtsi2sdl -0x48(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x6c(%rbp)
jmp    153a <main+0x3ea>
jmp    157c <main+0x42c>
cmpl   $0x2,-0x60(%rbp)
jne    1577 <main+0x427>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xaa6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1572 <main+0x422>
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x6c(%rbp)
jmp    1577 <main+0x427>
jmp    157c <main+0x42c>
jmp    1581 <main+0x431>
jmp    1586 <main+0x436>
cmpl   $0x3,-0x60(%rbp)
jne    15e4 <main+0x494>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa77(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xa63(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x3c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12ff <main+0x1af>
mov    -0x20(%rbp),%edi
lea    -0x58(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <read@plt>
cvtsi2sdq -0x58(%rbp),%xmm0
lea    0xade(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%edi
lea    -0x58(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <read@plt>
cvtsi2sdq -0x58(%rbp),%xmm0
lea    0xa20(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x5c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x78(%rbp),%xmm1
divsd  -0x80(%rbp),%xmm1
lea    0xaa4(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    $0x0,%r13d
cmp    $0x2,%edi
jl     1189 <main+0x39>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,%r13d
test   %eax,%eax
jle    15a3 <main+0x453>
lea    0xc(%rsp),%r14
mov    %r13d,%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <read@plt>
cvtsi2sdl 0xc(%rsp),%xmm0
lea    0xe8e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x18(%rsp),%rbx
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <read@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x18(%rsp),%xmm0
lea    0xe71(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <read@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x18(%rsp),%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r13d,%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <read@plt>
movslq 0xc(%rsp),%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
lea    0xe38(%rip),%rdi
movsd  %xmm0,0x28(%rsp)
mov    $0x1,%al
call   1030 <printf@plt>
imul   $0x10624dd3,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
test   %eax,%eax
mov    $0x1,%ecx
cmovg  %eax,%ecx
mov    %ecx,0x20(%rsp)
mov    %r13d,%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <read@plt>
mov    0xc(%rsp),%eax
mov    %rax,0x50(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xdf2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %r15d,%r15d
movl   $0x0,0x24(%rsp)
movl   $0x0,0x8(%rsp)
xor    %r12d,%r12d
xor    %eax,%eax
mov    %rax,(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x38(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
jmp    12d4 <main+0x184>
nopl   (%rax)
add    $0x1,%r15d
cmpl   $0x0,0x50(%rsp)
jle    132a <main+0x1da>
mov    0x50(%rsp),%r14
lea    0x40(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x4,%edx
mov    %r13d,%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <read@plt>
mov    %eax,%ebx
movss  0x0(%rbp),%xmm0
call   1070 <isinf@plt>
test   %rax,%rax
jne    150c <main+0x3bc>
cmp    $0x4,%ebx
jb     150c <main+0x3bc>
add    $0x4,%rbp
add    $0xffffffffffffffff,%r14
jne    12f0 <main+0x1a0>
cmp    $0x3,%r12d
ja     12d0 <main+0x180>
mov    %r12d,%eax
lea    0xcde(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  0x4c(%rsp),%xmm0
xor    %r12d,%r12d
ucomiss 0xcb1(%rip),%xmm0
jbe    12d0 <main+0x180>
xor    %r12d,%r12d
mov    (%rsp),%rax
cmp    0x20(%rsp),%eax
lea    0x1(%rax),%eax
setge  %r12b
mov    $0x0,%ecx
cmovge %ecx,%eax
mov    %rax,(%rsp)
add    $0x1,%r15d
jmp    12d4 <main+0x184>
mov    $0x2,%r12d
movss  0xc72(%rip),%xmm0
ucomiss 0x4c(%rsp),%xmm0
jbe    12d0 <main+0x180>
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %r12d,%r12d
jmp    12d0 <main+0x180>
mov    $0x1,%r12d
movss  0xc4b(%rip),%xmm0
ucomiss 0x4c(%rsp),%xmm0
jbe    12d0 <main+0x180>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
divsd  0x28(%rsp),%xmm1
lea    0xcb1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x28(%rsp),%xmm4
xorpd  %xmm3,%xmm3
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %eax,%eax
jmp    1429 <main+0x2d9>
movss  0x4c(%rsp),%xmm0
ucomiss 0xbfe(%rip),%xmm0
movsd  0x28(%rsp),%xmm4
movsd  0x10(%rsp),%xmm3
mov    0x24(%rsp),%eax
jbe    1429 <main+0x2d9>
mov    (%rsp),%rcx
cmp    0x20(%rsp),%ecx
jge    1475 <main+0x325>
add    $0x1,%ecx
mov    %rcx,(%rsp)
movss  0x40(%rsp),%xmm0
movss  0x44(%rsp),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  0xbc7(%rip),%xmm0
divsd  0xbc7(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
divsd  %xmm4,%xmm1
addsd  %xmm1,%xmm3
movsd  %xmm3,0x10(%rsp)
add    $0x1,%eax
mov    %eax,0x24(%rsp)
mov    $0x3,%r12d
add    $0x1,%r15d
jmp    12d4 <main+0x184>
mov    0x8(%rsp),%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
divsd  %xmm4,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
divsd  %xmm4,%xmm2
movsd  %xmm2,(%rsp)
lea    0xc06(%rip),%rdi
mov    $0x3,%al
movsd  %xmm3,0x10(%rsp)
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm1
divsd  (%rsp),%xmm1
lea    0xc0a(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x38(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x30(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
add    $0x1,%ebx
mov    %ebx,0x8(%rsp)
mov    $0x2,%r12d
xor    %eax,%eax
mov    %rax,(%rsp)
add    $0x1,%r15d
jmp    12d4 <main+0x184>
xor    %ebp,%ebp
lea    0x18(%rsp),%rbx
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <read@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x18(%rsp),%xmm0
lea    0xbc2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <read@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x18(%rsp),%xmm0
lea    0xb01(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm2,%xmm2
cvtsi2sdl 0x8(%rsp),%xmm2
movsd  0x38(%rsp),%xmm1
movapd %xmm1,%xmm0
divsd  %xmm2,%xmm0
divsd  0x30(%rsp),%xmm1
lea    0xb80(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a2e(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
lea    0xa71(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%ebp
jmp    1592 <main+0x442>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [19 x i8] c"Could not open %s\0A\00"
@.str.1 = [18 x i8] c"(* Version %d *)\0A\00"
@.str.2 = [20 x i8] c"(* Start Time %lld.\00"
@.str.3 = [9 x i8] c"%06lld)\0A\00"
@.str.4 = [18 x i8] c"(* Rate %d Hz *)\0A\00"
@.str.5 = [19 x i8] c"(* Channels %d *)\0A\00"
@.str.6 = [26 x i8] c"Starting Trace %d at %lf\0A\00"
@.str.7 = [39 x i8] c"Ending Trace %d at %lfs, %lfs Elapsed\0A\00"
@.str.8 = [40 x i8] c"Total Energy: %lfJ Average Power: %lfW\0A\00"
@.str.9 = [19 x i8] c"(* Stop Time %lld.\00"
@.str.10 = [38 x i8] c"Average Joules=%lf\09Average Watts=%lf\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 [4 x float]
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca i64
%18 = alloca i32
%19 = alloca i32
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca double
%24 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %18
store i32 0, i32* %19
store double 0.000000e+00, double* %20
store i32 0, i32* %21
store i32 1, i32* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
%25 = load i32, i32* %4
%26 = icmp sgt i32 %25, 1
br i1 %26, label %27, label %42
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = load i32, i32* @O_RDONLY
%32 = call i32 @open(i8* %30, i32 %31)
store i32 %32, i32* %9
%33 = load i32, i32* %9
%34 = icmp slt i32 %33, 1
br i1 %34, label %35, label %41
35: ; preds = %27
%36 = load i32, i32* @stderr
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %39)
store i32 -1, i32* %3
br label %254
41: ; preds = %27
br label %43
42: ; preds = %2
store i32 0, i32* %9
br label %43
43: ; preds = %42, %41
%44 = load i32, i32* %9
%45 = call i32 (i32, ...) @read(i32 %44, i32* %10, i32 4)
%46 = load i32, i32* %10
%47 = sitofp i32 %46 to double
%48 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %47)
%49 = load i32, i32* %9
%50 = call i32 (i32, ...) @read(i32 %49, i64* %17, i32 8)
%51 = load i64, i64* %17
%52 = sitofp i64 %51 to double
%53 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %52)
%54 = load i32, i32* %9
%55 = call i32 (i32, ...) @read(i32 %54, i64* %17, i32 8)
%56 = load i64, i64* %17
%57 = sitofp i64 %56 to double
%58 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %57)
%59 = load i32, i32* %9
%60 = call i32 (i32, ...) @read(i32 %59, i32* %10, i32 4)
%61 = load i32, i32* %10
store i32 %61, i32* %11
%62 = load i32, i32* %11
%63 = sitofp i32 %62 to double
%64 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %63)
%65 = load i32, i32* %11
%66 = sdiv i32 %65, 500
store i32 %66, i32* %22
%67 = load i32, i32* %22
%68 = icmp slt i32 %67, 1
br i1 %68, label %69, label %70
69: ; preds = %43
store i32 1, i32* %22
br label %70
70: ; preds = %69, %43
%71 = load i32, i32* %9
%72 = call i32 (i32, ...) @read(i32 %71, i32* %10, i32 4)
%73 = load i32, i32* %10
store i32 %73, i32* %12
%74 = load i32, i32* %12
%75 = sitofp i32 %74 to double
%76 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), double %75)
br label %77
77: ; preds = %232, %70
%78 = load i32, i32* %8
%79 = icmp ne i32 %78, 0
%80 = xor i1 %79, true
br i1 %80, label %81, label %235
81: ; preds = %77
store i32 0, i32* %6
br label %82
82: ; preds = %105, %81
%83 = load i32, i32* %6
%84 = load i32, i32* %12
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %108
86: ; preds = %82
%87 = load i32, i32* %9
%88 = load i32, i32* %6
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 %89
%91 = call i32 (i32, ...) @read(i32 %87, float* %90, i64 4)
store i32 %91, i32* %7
%92 = load i32, i32* %6
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 %93
%95 = load float, float* %94
%96 = call i64 @isinf(float %95)
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %99
98: ; preds = %86
store i32 1, i32* %8
br label %108
99: ; preds = %86
%100 = load i32, i32* %7
%101 = sext i32 %100 to i64
%102 = icmp ult i64 %101, 4
br i1 %102, label %103, label %104
103: ; preds = %99
store i32 1, i32* %8
br label %108
104: ; preds = %99
br label %105
105: ; preds = %104
%106 = load i32, i32* %6
%107 = add nsw i32 %106, 1
store i32 %107, i32* %6
br label %82
108: ; preds = %103, %98, %82
%109 = load i32, i32* %8
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %112
111: ; preds = %108
br label %235
112: ; preds = %108
%113 = load i32, i32* %19
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %129
115: ; preds = %112
%116 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 3
%117 = load float, float* %116
%118 = fpext float %117 to double
%119 = fcmp ogt double %118, 4.000000e+00
br i1 %119, label %120, label %128
120: ; preds = %115
%121 = load i32, i32* %21
%122 = add nsw i32 %121, 1
store i32 %122, i32* %21
%123 = load i32, i32* %21
%124 = load i32, i32* %22
%125 = icmp sgt i32 %123, %124
br i1 %125, label %126, label %127
126: ; preds = %120
store i32 1, i32* %19
store i32 0, i32* %21
br label %127
127: ; preds = %126, %120
br label %128
128: ; preds = %127, %115
br label %211
129: ; preds = %112
%130 = load i32, i32* %19
%131 = icmp eq i32 %130, 1
br i1 %131, label %132, label %147
132: ; preds = %129
%133 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 3
%134 = load float, float* %133
%135 = fpext float %134 to double
%136 = fcmp olt double %135, -4.000000e+00
br i1 %136, label %137, label %146
137: ; preds = %132
store i32 3, i32* %19
%138 = load i32, i32* %18
%139 = sitofp i32 %138 to double
%140 = load i32, i32* %14
%141 = sitofp i32 %140 to double
%142 = load i32, i32* %11
%143 = sitofp i32 %142 to double
%144 = fdiv double %141, %143
%145 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), double %139, double %144)
store i32 0, i32* %15
store double 0.000000e+00, double* %20
store i32 0, i32* %21
br label %146
146: ; preds = %137, %132
br label %210
147: ; preds = %129
%148 = load i32, i32* %19
%149 = icmp eq i32 %148, 3
br i1 %149, label %150, label %198
150: ; preds = %147
%151 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 3
%152 = load float, float* %151
%153 = fpext float %152 to double
%154 = fcmp ogt double %153, 4.000000e+00
br i1 %154, label %155, label %197
155: ; preds = %150
%156 = load i32, i32* %21
%157 = add nsw i32 %156, 1
store i32 %157, i32* %21
%158 = load i32, i32* %21
%159 = load i32, i32* %22
%160 = icmp sgt i32 %158, %159
br i1 %160, label %161, label %196
161: ; preds = %155
store i32 2, i32* %19
%162 = load i32, i32* %18
%163 = sitofp i32 %162 to double
%164 = load i32, i32* %14
%165 = sitofp i32 %164 to double
%166 = load i32, i32* %11
%167 = sitofp i32 %166 to double
%168 = fdiv double %165, %167
%169 = load i32, i32* %15
%170 = sitofp i32 %169 to double
%171 = load i32, i32* %11
%172 = sitofp i32 %171 to double
%173 = fdiv double %170, %172
%174 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), double %163, double %168, double %173)
%175 = load double, double* %20
%176 = load double, double* %20
%177 = load i32, i32* %15
%178 = sitofp i32 %177 to double
%179 = load i32, i32* %11
%180 = sitofp i32 %179 to double
%181 = fdiv double %178, %180
%182 = fdiv double %176, %181
%183 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), double %175, double %182)
%184 = load double, double* %20
%185 = load double, double* %23
%186 = fadd double %185, %184
store double %186, double* %23
%187 = load i32, i32* %15
%188 = sitofp i32 %187 to double
%189 = load i32, i32* %11
%190 = sitofp i32 %189 to double
%191 = fdiv double %188, %190
%192 = load double, double* %24
%193 = fadd double %192, %191
store double %193, double* %24
%194 = load i32, i32* %18
%195 = add nsw i32 %194, 1
store i32 %195, i32* %18
store i32 0, i32* %21
br label %196
196: ; preds = %161, %155
br label %197
197: ; preds = %196, %150
br label %209
198: ; preds = %147
%199 = load i32, i32* %19
%200 = icmp eq i32 %199, 2
br i1 %200, label %201, label %208
201: ; preds = %198
%202 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 3
%203 = load float, float* %202
%204 = fpext float %203 to double
%205 = fcmp olt double %204, -4.000000e+00
br i1 %205, label %206, label %207
206: ; preds = %201
store i32 0, i32* %19
store i32 0, i32* %21
br label %207
207: ; preds = %206, %201
br label %208
208: ; preds = %207, %198
br label %209
209: ; preds = %208, %197
br label %210
210: ; preds = %209, %146
br label %211
211: ; preds = %210, %128
%212 = load i32, i32* %19
%213 = icmp eq i32 %212, 3
br i1 %213, label %214, label %232
214: ; preds = %211
%215 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 0
%216 = load float, float* %215
%217 = fpext float %216 to double
%218 = fdiv double %217, 3.000000e+02
%219 = fdiv double %218, 3.330000e-03
%220 = getelementptr inbounds [4 x float], [4 x float]* %13, i64 0, i64 1
%221 = load float, float* %220
%222 = fpext float %221 to double
%223 = fmul double %219, %222
store double %223, double* %16
%224 = load double, double* %16
%225 = load i32, i32* %11
%226 = sitofp i32 %225 to double
%227 = fdiv double %224, %226
%228 = load double, double* %20
%229 = fadd double %228, %227
store double %229, double* %20
%230 = load i32, i32* %15
%231 = add nsw i32 %230, 1
store i32 %231, i32* %15
br label %232
232: ; preds = %214, %211
%233 = load i32, i32* %14
%234 = add nsw i32 %233, 1
store i32 %234, i32* %14
br label %77
235: ; preds = %111, %77
%236 = load i32, i32* %9
%237 = call i32 (i32, ...) @read(i32 %236, i64* %17, i32 8)
%238 = load i64, i64* %17
%239 = sitofp i64 %238 to double
%240 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), double %239)
%241 = load i32, i32* %9
%242 = call i32 (i32, ...) @read(i32 %241, i64* %17, i32 8)
%243 = load i64, i64* %17
%244 = sitofp i64 %243 to double
%245 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %244)
%246 = load double, double* %23
%247 = load i32, i32* %18
%248 = sitofp i32 %247 to double
%249 = fdiv double %246, %248
%250 = load double, double* %23
%251 = load double, double* %24
%252 = fdiv double %250, %251
%253 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), double %249, double %252)
store i32 0, i32* %3
br label %254
254: ; preds = %235, %35
%255 = load i32, i32* %3
ret i32 %255
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [19 x i8] c"Could not open %s\0A\00"
@.str.1 = [18 x i8] c"(* Version %d *)\0A\00"
@.str.2 = [20 x i8] c"(* Start Time %lld.\00"
@.str.3 = [9 x i8] c"%06lld)\0A\00"
@.str.4 = [18 x i8] c"(* Rate %d Hz *)\0A\00"
@.str.5 = [19 x i8] c"(* Channels %d *)\0A\00"
@.str.6 = [26 x i8] c"Starting Trace %d at %lf\0A\00"
@.str.7 = [39 x i8] c"Ending Trace %d at %lfs, %lfs Elapsed\0A\00"
@.str.8 = [40 x i8] c"Total Energy: %lfJ Average Power: %lfW\0A\00"
@.str.9 = [19 x i8] c"(* Stop Time %lld.\00"
@.str.10 = [38 x i8] c"Average Joules=%lf\09Average Watts=%lf\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [4 x float]
%5 = alloca i64
%6 = bitcast i32* %3 to i8*
%7 = bitcast [4 x float]* %4 to i8*
%8 = bitcast i64* %5 to i8*
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i32, i32* @O_RDONLY
%14 = tail call i32 @open(i8* %12, i32 %13)
%15 = icmp slt i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %11
%19 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %147
20: ; preds = %2, %10
%21 = phi i32 [ %14, %10 ], [ 0, %2 ]
%22 = call i32 (i32, ...) @read(i32 %21, i32* %3, i32 4)
%23 = load i32, i32* %3
%24 = sitofp i32 %23 to double
%25 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %24)
%26 = call i32 (i32, ...) @read(i32 %21, i64* %5, i32 8)
%27 = load i64, i64* %5
%28 = sitofp i64 %27 to double
%29 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %28)
%30 = call i32 (i32, ...) @read(i32 %21, i64* %5, i32 8)
%31 = load i64, i64* %5
%32 = sitofp i64 %31 to double
%33 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %32)
%34 = call i32 (i32, ...) @read(i32 %21, i32* %3, i32 4)
%35 = load i32, i32* %3
%36 = sitofp i32 %35 to double
%37 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %36)
%38 = sdiv i32 %35, 500
%39 = icmp sgt i32 %38, 1
%40 = select i1 %39, i32 %38, i32 1
%41 = call i32 (i32, ...) @read(i32 %21, i32* %3, i32 4)
%42 = load i32, i32* %3
%43 = sitofp i32 %42 to double
%44 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), double %43)
%45 = icmp sgt i32 %42, 0
%46 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 3
%47 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%48 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 1
%49 = zext i32 %42 to i64
br label %50
50: ; preds = %125, %20
%51 = phi i32 [ 0, %20 ], [ %133, %125 ]
%52 = phi i32 [ 0, %20 ], [ %131, %125 ]
%53 = phi i32 [ 0, %20 ], [ %130, %125 ]
%54 = phi i32 [ 0, %20 ], [ %129, %125 ]
%55 = phi double [ 0.000000e+00, %20 ], [ %132, %125 ]
%56 = phi i32 [ 0, %20 ], [ %128, %125 ]
%57 = phi double [ 0.000000e+00, %20 ], [ %127, %125 ]
%58 = phi double [ 0.000000e+00, %20 ], [ %126, %125 ]
br i1 %45, label %61, label %71
59: ; preds = %61
%60 = icmp eq i64 %70, %49
br i1 %60, label %71, label %61
61: ; preds = %50, %59
%62 = phi i64 [ %70, %59 ], [ 0, %50 ]
%63 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 %62
%64 = call i32 (i32, ...) @read(i32 %21, float* %63, i64 4)
%65 = load float, float* %63
%66 = call i64 @isinf(float %65)
%67 = icmp ne i64 %66, 0
%68 = icmp ult i32 %64, 4
%69 = select i1 %67, i1 true, i1 %68
%70 = add nuw nsw i64 %62, 1
br i1 %69, label %134, label %59
71: ; preds = %59, %50
switch i32 %54, label %125 [
i32 0, label %72
i32 1, label %81
i32 3, label %89
i32 2, label %107
]
72: ; preds = %71
%73 = load float, float* %46
%74 = fcmp ogt float %73, 4.000000e+00
br i1 %74, label %75, label %125
75: ; preds = %72
%76 = add nsw i32 %56, 1
%77 = icmp slt i32 %56, %40
%78 = xor i1 %77, true
%79 = zext i1 %78 to i32
%80 = select i1 %77, i32 %76, i32 0
br label %125
81: ; preds = %71
%82 = load float, float* %46
%83 = fcmp olt float %82, -4.000000e+00
br i1 %83, label %84, label %125
84: ; preds = %81
%85 = sitofp i32 %53 to double
%86 = sitofp i32 %51 to double
%87 = fdiv double %86, %36
%88 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), double %85, double %87)
br label %111
89: ; preds = %71
%90 = load float, float* %46
%91 = fcmp ogt float %90, 4.000000e+00
br i1 %91, label %92, label %111
92: ; preds = %89
%93 = add nsw i32 %56, 1
%94 = icmp slt i32 %56, %40
br i1 %94, label %111, label %95
95: ; preds = %92
%96 = sitofp i32 %53 to double
%97 = sitofp i32 %51 to double
%98 = fdiv double %97, %36
%99 = sitofp i32 %52 to double
%100 = fdiv double %99, %36
%101 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), double %96, double %98, double %100)
%102 = fdiv double %55, %100
%103 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), double %55, double %102)
%104 = fadd double %55, %57
%105 = fadd double %100, %58
%106 = add nsw i32 %53, 1
br label %125
107: ; preds = %71
%108 = load float, float* %46
%109 = fcmp olt float %108, -4.000000e+00
br i1 %109, label %110, label %125
110: ; preds = %107
br label %125
111: ; preds = %89, %92, %84
%112 = phi i32 [ %56, %89 ], [ %93, %92 ], [ 0, %84 ]
%113 = phi double [ %55, %89 ], [ %55, %92 ], [ 0.000000e+00, %84 ]
%114 = phi i32 [ %52, %89 ], [ %52, %92 ], [ 0, %84 ]
%115 = load float, float* %47
%116 = fpext float %115 to double
%117 = fdiv double %116, 3.000000e+02
%118 = fdiv double %117, 3.330000e-03
%119 = load float, float* %48
%120 = fpext float %119 to double
%121 = fmul double %118, %120
%122 = fdiv double %121, %36
%123 = fadd double %113, %122
%124 = add nsw i32 %114, 1
br label %125
125: ; preds = %71, %75, %107, %110, %95, %81, %72, %111
%126 = phi double [ %58, %111 ], [ %58, %75 ], [ %58, %107 ], [ %58, %110 ], [ %105, %95 ], [ %58, %81 ], [ %58, %72 ], [ %58, %71 ]
%127 = phi double [ %57, %111 ], [ %57, %75 ], [ %57, %107 ], [ %57, %110 ], [ %104, %95 ], [ %57, %81 ], [ %57, %72 ], [ %57, %71 ]
%128 = phi i32 [ %112, %111 ], [ %80, %75 ], [ %56, %107 ], [ 0, %110 ], [ 0, %95 ], [ %56, %81 ], [ %56, %72 ], [ %56, %71 ]
%129 = phi i32 [ 3, %111 ], [ %79, %75 ], [ 2, %107 ], [ 0, %110 ], [ 2, %95 ], [ 1, %81 ], [ 0, %72 ], [ %54, %71 ]
%130 = phi i32 [ %53, %111 ], [ %53, %75 ], [ %53, %107 ], [ %53, %110 ], [ %106, %95 ], [ %53, %81 ], [ %53, %72 ], [ %53, %71 ]
%131 = phi i32 [ %124, %111 ], [ %52, %75 ], [ %52, %107 ], [ %52, %110 ], [ %52, %95 ], [ %52, %81 ], [ %52, %72 ], [ %52, %71 ]
%132 = phi double [ %123, %111 ], [ %55, %75 ], [ %55, %107 ], [ %55, %110 ], [ %55, %95 ], [ %55, %81 ], [ %55, %72 ], [ %55, %71 ]
%133 = add nuw nsw i32 %51, 1
br label %50
134: ; preds = %61
%135 = call i32 (i32, ...) @read(i32 %21, i64* %5, i32 8)
%136 = load i64, i64* %5
%137 = sitofp i64 %136 to double
%138 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), double %137)
%139 = call i32 (i32, ...) @read(i32 %21, i64* %5, i32 8)
%140 = load i64, i64* %5
%141 = sitofp i64 %140 to double
%142 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %141)
%143 = sitofp i32 %53 to double
%144 = fdiv double %57, %143
%145 = fdiv double %57, %58
%146 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), double %144, double %145)
br label %147
147: ; preds = %134, %16
%148 = phi i32 [ -1, %16 ], [ 0, %134 ]
ret i32 %148
}