#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 */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, short, short, short, ...);
void timeratio_() {
  static short stage = 0;
  static struct timeval tv_a[3];
  double deltaThis, deltaPrevious;
  if (stage < 3)
    gettimeofday(&(tv_a[stage]), 0);
  printf("OAD: TIMING: stamp %u: %lu.%06lu\n", stage, tv_a[stage].tv_sec,
         tv_a[stage].tv_usec);
  if (stage > 0) {
    printf("OAD: TIMING: delta stamps %u-%u: %lu.%06lu\n", stage, stage - 1,
           (tv_a[stage].tv_usec < tv_a[stage - 1].tv_usec)
               ? tv_a[stage].tv_sec - tv_a[stage - 1].tv_sec - 1
               : tv_a[stage].tv_sec - tv_a[stage - 1].tv_sec,
           (tv_a[stage].tv_usec < tv_a[stage - 1].tv_usec)
               ? 1000000 - (tv_a[stage - 1].tv_usec - tv_a[stage].tv_usec)
               : tv_a[stage].tv_usec - tv_a[stage - 1].tv_usec);
  }
  if (stage > 1) {
    printf("OAD: TIMING: delta stamps %u-%u: %lu.%06lu\n", stage, 0,
           (tv_a[stage].tv_usec < tv_a[0].tv_usec)
               ? tv_a[stage].tv_sec - tv_a[0].tv_sec - 1
               : tv_a[stage].tv_sec - tv_a[0].tv_sec,
           (tv_a[stage].tv_usec < tv_a[0].tv_usec)
               ? 1000000 - (tv_a[0].tv_usec - tv_a[stage].tv_usec)
               : tv_a[stage].tv_usec - tv_a[0].tv_usec);
  }
  if (stage == 3 - 1 && stage > 1) {
    deltaThis = (tv_a[stage].tv_usec < tv_a[stage - 1].tv_usec)
                    ? tv_a[stage].tv_sec - tv_a[stage - 1].tv_sec - 1
                    : tv_a[stage].tv_sec - tv_a[stage - 1].tv_sec;
    deltaThis *= 1.0e6;
    deltaThis += (tv_a[stage].tv_usec < tv_a[stage - 1].tv_usec)
                     ? 1000000 - (tv_a[stage - 1].tv_usec - tv_a[stage].tv_usec)
                     : tv_a[stage].tv_usec - tv_a[stage - 1].tv_usec;
    deltaPrevious = (tv_a[stage - 1].tv_usec < tv_a[stage - 2].tv_usec)
                        ? tv_a[stage - 1].tv_sec - tv_a[stage - 2].tv_sec - 1
                        : tv_a[stage - 1].tv_sec - tv_a[stage - 2].tv_sec;
    deltaPrevious *= 1.0e6;
    deltaPrevious +=
        (tv_a[stage - 1].tv_usec < tv_a[stage - 2].tv_usec)
            ? 1000000 - (tv_a[stage - 2].tv_usec - tv_a[stage - 1].tv_usec)
            : tv_a[stage - 1].tv_usec - tv_a[stage - 2].tv_usec;
    printf("OAD: TIMING: ratio stamps (%u-%u)/(%u-%u): %e/%e=%e\n", stage,
           stage - 1, stage - 1, stage - 2, deltaThis, deltaPrevious,
           deltaThis / deltaPrevious);
    stage = 0;
  } else
    stage++;
}


x86 assembly (clang, -O0):
<timeratio_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movswl 0x2f11(%rip),%eax
cmp    $0x3,%eax
jge    1155 <timeratio_+0x35>
movswq 0x2f00(%rip),%rax
lea    0x2f09(%rip),%rdi
shl    $0x4,%rax
add    %rax,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x2ee4(%rip),%dx
movswq 0x2edc(%rip),%rcx
lea    0x2ee5(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
mov    %ax,%cx
movswq 0x2ec1(%rip),%rsi
lea    0x2eca(%rip),%rax
shl    $0x4,%rsi
add    %rsi,%rax
mov    0x8(%rax),%rax
lea    0xe70(%rip),%rdi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movswl 0x2e91(%rip),%eax
cmp    $0x0,%eax
jle    137c <timeratio_+0x25c>
mov    0x2e81(%rip),%ax
mov    %ax,-0x14(%rbp)
movswl 0x2e76(%rip),%eax
sub    $0x1,%eax
mov    %ax,-0x12(%rbp)
movswq 0x2e67(%rip),%rcx
lea    0x2e70(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x2e4e(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2e51(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
cmp    0x8(%rcx),%rax
jge    1250 <timeratio_+0x130>
movswq 0x2e28(%rip),%rcx
lea    0x2e31(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
movswl 0x2e11(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2e14(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    (%rcx),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1288 <timeratio_+0x168>
movswq 0x2de8(%rip),%rcx
lea    0x2df1(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
movswl 0x2dd1(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2dd4(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    (%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %ax,-0x1a(%rbp)
movswq 0x2da9(%rip),%rcx
lea    0x2db2(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x2d90(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2d93(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
cmp    0x8(%rcx),%rax
jge    1318 <timeratio_+0x1f8>
movswl 0x2d6b(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2d6e(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rcx
movswq 0x2d4b(%rip),%rdx
lea    0x2d54(%rip),%rax
shl    $0x4,%rdx
add    %rdx,%rax
sub    0x8(%rax),%rcx
mov    $0xf4240,%eax
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    1355 <timeratio_+0x235>
movswq 0x2d20(%rip),%rcx
lea    0x2d29(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x2d07(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2d0a(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1a(%rbp),%ax
mov    -0x12(%rbp),%cx
mov    -0x14(%rbp),%dx
mov    -0x28(%rbp),%r8
lea    0xcbe(%rip),%rdi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movswl 0x2cbd(%rip),%eax
cmp    $0x1,%eax
jle    14af <timeratio_+0x38f>
mov    0x2cad(%rip),%ax
mov    %ax,-0x2a(%rbp)
movswq 0x2ca1(%rip),%rcx
lea    0x2caa(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
cmp    0x2ca0(%rip),%rax
jge    13e7 <timeratio_+0x2c7>
movswq 0x2c7a(%rip),%rcx
lea    0x2c83(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
sub    0x2c74(%rip),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1408 <timeratio_+0x2e8>
movswq 0x2c51(%rip),%rcx
lea    0x2c5a(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
sub    0x2c4b(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %ax,-0x32(%rbp)
movswq 0x2c29(%rip),%rcx
lea    0x2c32(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
cmp    0x2c28(%rip),%rax
jge    1468 <timeratio_+0x348>
mov    0x2c1b(%rip),%rcx
movswq 0x2bfb(%rip),%rdx
lea    0x2c04(%rip),%rax
shl    $0x4,%rdx
add    %rdx,%rax
sub    0x8(%rax),%rcx
mov    $0xf4240,%eax
sub    %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    148d <timeratio_+0x36d>
movswq 0x2bd0(%rip),%rcx
lea    0x2bd9(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
sub    0x2bcf(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x32(%rbp),%ax
mov    -0x2a(%rbp),%cx
mov    -0x40(%rbp),%r8
lea    0xb8a(%rip),%rdi
xor    %edx,%edx
movswl %cx,%esi
movswl %ax,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movswl 0x2b8a(%rip),%eax
cmp    $0x2,%eax
jne    18ac <timeratio_+0x78c>
movswl 0x2b7a(%rip),%eax
cmp    $0x1,%eax
jle    18ac <timeratio_+0x78c>
movswq 0x2b69(%rip),%rcx
lea    0x2b72(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x2b50(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2b53(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
cmp    0x8(%rcx),%rax
jge    154e <timeratio_+0x42e>
movswq 0x2b2a(%rip),%rcx
lea    0x2b33(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
movswl 0x2b13(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2b16(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    (%rcx),%eax
sub    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1586 <timeratio_+0x466>
movswq 0x2aea(%rip),%rcx
lea    0x2af3(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
movswl 0x2ad3(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2ad6(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    (%rcx),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xa66(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movswq 0x2a94(%rip),%rcx
lea    0x2a9d(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x2a7b(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2a7e(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
cmp    0x8(%rcx),%rax
jge    162d <timeratio_+0x50d>
movswl 0x2a56(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2a59(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rcx
movswq 0x2a36(%rip),%rdx
lea    0x2a3f(%rip),%rax
shl    $0x4,%rdx
add    %rdx,%rax
sub    0x8(%rax),%rcx
mov    $0xf4240,%eax
sub    %rcx,%rax
mov    %rax,-0x50(%rbp)
jmp    166a <timeratio_+0x54a>
movswq 0x2a0b(%rip),%rcx
lea    0x2a14(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x29f2(%rip),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x29f5(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
cvtsi2sd %rax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movswl 0x29bc(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x29bf(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x299d(%rip),%ecx
sub    $0x2,%ecx
movslq %ecx,%rdx
lea    0x29a0(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
cmp    0x8(%rcx),%rax
jge    1706 <timeratio_+0x5e6>
movswl 0x2978(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x297b(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
movswl 0x295b(%rip),%ecx
sub    $0x2,%ecx
movslq %ecx,%rdx
lea    0x295e(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    (%rcx),%eax
sub    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1743 <timeratio_+0x623>
movswl 0x2933(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2936(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
movswl 0x2916(%rip),%ecx
sub    $0x2,%ecx
movslq %ecx,%rdx
lea    0x2919(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    (%rcx),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0x8a9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movswl 0x28d8(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x28db(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x28b9(%rip),%ecx
sub    $0x2,%ecx
movslq %ecx,%rdx
lea    0x28bc(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
cmp    0x8(%rcx),%rax
jge    17f4 <timeratio_+0x6d4>
movswl 0x2894(%rip),%eax
sub    $0x2,%eax
movslq %eax,%rcx
lea    0x2897(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rcx
movswl 0x2875(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rdx
lea    0x2878(%rip),%rax
shl    $0x4,%rdx
add    %rdx,%rax
sub    0x8(%rax),%rcx
mov    $0xf4240,%eax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    1836 <timeratio_+0x716>
movswl 0x2845(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2848(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movswl 0x2826(%rip),%ecx
sub    $0x2,%ecx
movslq %ecx,%rdx
lea    0x2829(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
cvtsi2sd %rax,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x27f0(%rip),%dx
movswl 0x27e9(%rip),%eax
sub    $0x1,%eax
mov    %ax,%cx
movswl 0x27dc(%rip),%eax
sub    $0x1,%eax
movswl 0x27d1(%rip),%r8d
sub    $0x2,%r8d
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
divsd  -0x10(%rbp),%xmm2
lea    0x7c8(%rip),%rdi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
mov    $0x3,%al
call   1030 <printf@plt>
movw   $0x0,0x2799(%rip)
jmp    18be <timeratio_+0x79e>
mov    0x278d(%rip),%ax
add    $0x1,%ax
mov    %ax,0x2782(%rip)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeratio_>:
push   %r14
push   %rbx
push   %rax
movswq 0x2f14(%rip),%rax
cmp    $0x2,%rax
jg     114e <timeratio_+0x2e>
shl    $0x4,%rax
lea    0x2f13(%rip),%rdi
add    %rax,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
movzwl 0x2ef2(%rip),%eax
movswq %ax,%rax
mov    %rax,%rcx
shl    $0x4,%rcx
lea    0x2ef0(%rip),%r14
movswl (%rcx,%r14,1),%edx
movswl 0x8(%rcx,%r14,1),%ecx
movswl %ax,%esi
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0x2ebd(%rip),%ebx
test   %bx,%bx
jle    1330 <timeratio_+0x210>
movzwl %bx,%eax
mov    %rax,%rcx
shl    $0x4,%rcx
mov    0x8(%rcx,%r14,1),%r9
mov    -0x8(%rcx,%r14,1),%rsi
mov    %r9,%rdi
sub    %rsi,%rdi
add    $0xf4240,%rdi
mov    %r9,%r8
sub    %rsi,%r8
cmovl  %rdi,%r8
add    $0xffffffff,%eax
mov    %rax,%rsi
shl    $0x4,%rsi
mov    (%rsi,%r14,1),%edi
mov    %edi,%edx
neg    %edx
cmp    0x8(%rsi,%r14,1),%r9
not    %edi
cmovge %edx,%edi
add    (%rcx,%r14,1),%edi
movswl %di,%ecx
movswl %bx,%esi
movswl %ax,%edx
lea    0xe43(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0x2e4b(%rip),%ebx
cmp    $0x2,%bx
jl     1330 <timeratio_+0x210>
movzwl %bx,%eax
shl    $0x4,%rax
mov    0x8(%rax,%r14,1),%rcx
mov    0x2e46(%rip),%rdx
mov    %rcx,%rsi
sub    %rdx,%rsi
add    $0xf4240,%rsi
mov    %rcx,%r8
sub    %rdx,%r8
mov    0x2e25(%rip),%edi
cmovl  %rsi,%r8
mov    %edi,%esi
neg    %esi
cmp    %rdx,%rcx
not    %edi
cmovge %esi,%edi
add    (%rax,%r14,1),%edi
movswl %di,%ecx
movswl %bx,%esi
lea    0xdde(%rip),%rdi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movzwl 0x2de4(%rip),%ebx
cmp    $0x2,%bx
jne    1330 <timeratio_+0x210>
mov    0x2dfb(%rip),%rdx
mov    0x2de4(%rip),%rsi
mov    %rdx,%rcx
sub    %rsi,%rcx
add    $0xf4240,%rcx
mov    %rdx,%r8
sub    %rsi,%r8
cmovl  %rcx,%r8
mov    0x2dbf(%rip),%ecx
mov    %ecx,%edi
neg    %edi
cmp    %rsi,%rdx
mov    0x2dd9(%rip),%rbx
not    %ecx
cmovge %edi,%ecx
mov    %rbx,%rdi
sub    %rdx,%rdi
add    $0xf4240,%rdi
mov    %rbx,%rsi
sub    %rdx,%rsi
cmovl  %rdi,%rsi
mov    0x2d9f(%rip),%eax
mov    %eax,%edi
neg    %edi
cmp    %rdx,%rbx
mov    %eax,%edx
not    %edx
cmovge %edi,%edx
add    0x2d9b(%rip),%edx
cvtsi2sd %edx,%xmm1
movsd  0xd1f(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sd %rsi,%xmm0
addsd  %xmm1,%xmm0
add    %eax,%ecx
cvtsi2sd %ecx,%xmm3
mulsd  %xmm2,%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %r8,%xmm1
addsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
lea    0xd43(%rip),%rdi
xor    %ebx,%ebx
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1333 <timeratio_+0x213>
add    $0x1,%ebx
mov    %bx,0x2d06(%rip)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@timeratio_.stage = internal global i16 0
@timeratio_.tv_a = internal global [3 x %struct.timeval] zeroinitializer
@.str = [34 x i8] c"OAD: TIMING: stamp %u: %lu.%06lu\0A\00"
@.str.1 = [44 x i8] c"OAD: TIMING: delta stamps %u-%u: %lu.%06lu\0A\00"
@.str.2 = [53 x i8] c"OAD: TIMING: ratio stamps (%u-%u)/(%u-%u): %e/%e=%e\0A\00"
define void @timeratio_() {
%1 = alloca double
%2 = alloca double
%3 = load i16, i16* @timeratio_.stage
%4 = sext i16 %3 to i32
%5 = icmp slt i32 %4, 3
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i16, i16* @timeratio_.stage
%8 = sext i16 %7 to i64
%9 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %8
%10 = call i32 @gettimeofday(%struct.timeval* %9, i32 0)
br label %11
11: ; preds = %6, %0
%12 = load i16, i16* @timeratio_.stage
%13 = load i16, i16* @timeratio_.stage
%14 = sext i16 %13 to i64
%15 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = trunc i32 %17 to i16
%19 = load i16, i16* @timeratio_.stage
%20 = sext i16 %19 to i64
%21 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %20
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %21, i32 0, i32 1
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i16
%25 = call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i16 signext %12, i16 signext %18, i16 signext %24)
%26 = load i16, i16* @timeratio_.stage
%27 = sext i16 %26 to i32
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %125
29: ; preds = %11
%30 = load i16, i16* @timeratio_.stage
%31 = load i16, i16* @timeratio_.stage
%32 = sext i16 %31 to i32
%33 = sub nsw i32 %32, 1
%34 = trunc i32 %33 to i16
%35 = load i16, i16* @timeratio_.stage
%36 = sext i16 %35 to i64
%37 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %36
%38 = getelementptr inbounds %struct.timeval, %struct.timeval* %37, i32 0, i32 1
%39 = load i64, i64* %38
%40 = load i16, i16* @timeratio_.stage
%41 = sext i16 %40 to i32
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %43
%45 = getelementptr inbounds %struct.timeval, %struct.timeval* %44, i32 0, i32 1
%46 = load i64, i64* %45
%47 = icmp slt i64 %39, %46
br i1 %47, label %48, label %63
48: ; preds = %29
%49 = load i16, i16* @timeratio_.stage
%50 = sext i16 %49 to i64
%51 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %50
%52 = getelementptr inbounds %struct.timeval, %struct.timeval* %51, i32 0, i32 0
%53 = load i32, i32* %52
%54 = load i16, i16* @timeratio_.stage
%55 = sext i16 %54 to i32
%56 = sub nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %57
%59 = getelementptr inbounds %struct.timeval, %struct.timeval* %58, i32 0, i32 0
%60 = load i32, i32* %59
%61 = sub nsw i32 %53, %60
%62 = sub nsw i32 %61, 1
br label %77
63: ; preds = %29
%64 = load i16, i16* @timeratio_.stage
%65 = sext i16 %64 to i64
%66 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %65
%67 = getelementptr inbounds %struct.timeval, %struct.timeval* %66, i32 0, i32 0
%68 = load i32, i32* %67
%69 = load i16, i16* @timeratio_.stage
%70 = sext i16 %69 to i32
%71 = sub nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %72
%74 = getelementptr inbounds %struct.timeval, %struct.timeval* %73, i32 0, i32 0
%75 = load i32, i32* %74
%76 = sub nsw i32 %68, %75
br label %77
77: ; preds = %63, %48
%78 = phi i32 [ %62, %48 ], [ %76, %63 ]
%79 = trunc i32 %78 to i16
%80 = load i16, i16* @timeratio_.stage
%81 = sext i16 %80 to i64
%82 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %81
%83 = getelementptr inbounds %struct.timeval, %struct.timeval* %82, i32 0, i32 1
%84 = load i64, i64* %83
%85 = load i16, i16* @timeratio_.stage
%86 = sext i16 %85 to i32
%87 = sub nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %88
%90 = getelementptr inbounds %struct.timeval, %struct.timeval* %89, i32 0, i32 1
%91 = load i64, i64* %90
%92 = icmp slt i64 %84, %91
br i1 %92, label %93, label %108
93: ; preds = %77
%94 = load i16, i16* @timeratio_.stage
%95 = sext i16 %94 to i32
%96 = sub nsw i32 %95, 1
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %97
%99 = getelementptr inbounds %struct.timeval, %struct.timeval* %98, i32 0, i32 1
%100 = load i64, i64* %99
%101 = load i16, i16* @timeratio_.stage
%102 = sext i16 %101 to i64
%103 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %102
%104 = getelementptr inbounds %struct.timeval, %struct.timeval* %103, i32 0, i32 1
%105 = load i64, i64* %104
%106 = sub nsw i64 %100, %105
%107 = sub nsw i64 1000000, %106
br label %122
108: ; preds = %77
%109 = load i16, i16* @timeratio_.stage
%110 = sext i16 %109 to i64
%111 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %110
%112 = getelementptr inbounds %struct.timeval, %struct.timeval* %111, i32 0, i32 1
%113 = load i64, i64* %112
%114 = load i16, i16* @timeratio_.stage
%115 = sext i16 %114 to i32
%116 = sub nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %117
%119 = getelementptr inbounds %struct.timeval, %struct.timeval* %118, i32 0, i32 1
%120 = load i64, i64* %119
%121 = sub nsw i64 %113, %120
br label %122
122: ; preds = %108, %93
%123 = phi i64 [ %107, %93 ], [ %121, %108 ]
%124 = call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i16 signext %30, i16 signext %34, i16 signext %79, i64 %123)
br label %125
125: ; preds = %122, %11
%126 = load i16, i16* @timeratio_.stage
%127 = sext i16 %126 to i32
%128 = icmp sgt i32 %127, 1
br i1 %128, label %129, label %185
129: ; preds = %125
%130 = load i16, i16* @timeratio_.stage
%131 = load i16, i16* @timeratio_.stage
%132 = sext i16 %131 to i64
%133 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %132
%134 = getelementptr inbounds %struct.timeval, %struct.timeval* %133, i32 0, i32 1
%135 = load i64, i64* %134
%136 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 1)
%137 = icmp slt i64 %135, %136
br i1 %137, label %138, label %147
138: ; preds = %129
%139 = load i16, i16* @timeratio_.stage
%140 = sext i16 %139 to i64
%141 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %140
%142 = getelementptr inbounds %struct.timeval, %struct.timeval* %141, i32 0, i32 0
%143 = load i32, i32* %142
%144 = load i32, i32* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 0)
%145 = sub nsw i32 %143, %144
%146 = sub nsw i32 %145, 1
br label %155
147: ; preds = %129
%148 = load i16, i16* @timeratio_.stage
%149 = sext i16 %148 to i64
%150 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %149
%151 = getelementptr inbounds %struct.timeval, %struct.timeval* %150, i32 0, i32 0
%152 = load i32, i32* %151
%153 = load i32, i32* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 0)
%154 = sub nsw i32 %152, %153
br label %155
155: ; preds = %147, %138
%156 = phi i32 [ %146, %138 ], [ %154, %147 ]
%157 = trunc i32 %156 to i16
%158 = load i16, i16* @timeratio_.stage
%159 = sext i16 %158 to i64
%160 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %159
%161 = getelementptr inbounds %struct.timeval, %struct.timeval* %160, i32 0, i32 1
%162 = load i64, i64* %161
%163 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 1)
%164 = icmp slt i64 %162, %163
br i1 %164, label %165, label %174
165: ; preds = %155
%166 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 1)
%167 = load i16, i16* @timeratio_.stage
%168 = sext i16 %167 to i64
%169 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %168
%170 = getelementptr inbounds %struct.timeval, %struct.timeval* %169, i32 0, i32 1
%171 = load i64, i64* %170
%172 = sub nsw i64 %166, %171
%173 = sub nsw i64 1000000, %172
br label %182
174: ; preds = %155
%175 = load i16, i16* @timeratio_.stage
%176 = sext i16 %175 to i64
%177 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %176
%178 = getelementptr inbounds %struct.timeval, %struct.timeval* %177, i32 0, i32 1
%179 = load i64, i64* %178
%180 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 1)
%181 = sub nsw i64 %179, %180
br label %182
182: ; preds = %174, %165
%183 = phi i64 [ %173, %165 ], [ %181, %174 ]
%184 = call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i16 signext %130, i16 signext 0, i16 signext %157, i64 %183)
br label %185
185: ; preds = %182, %125
%186 = load i16, i16* @timeratio_.stage
%187 = sext i16 %186 to i32
%188 = icmp eq i32 %187, 2
br i1 %188, label %189, label %412
189: ; preds = %185
%190 = load i16, i16* @timeratio_.stage
%191 = sext i16 %190 to i32
%192 = icmp sgt i32 %191, 1
br i1 %192, label %193, label %412
193: ; preds = %189
%194 = load i16, i16* @timeratio_.stage
%195 = sext i16 %194 to i64
%196 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %195
%197 = getelementptr inbounds %struct.timeval, %struct.timeval* %196, i32 0, i32 1
%198 = load i64, i64* %197
%199 = load i16, i16* @timeratio_.stage
%200 = sext i16 %199 to i32
%201 = sub nsw i32 %200, 1
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %202
%204 = getelementptr inbounds %struct.timeval, %struct.timeval* %203, i32 0, i32 1
%205 = load i64, i64* %204
%206 = icmp slt i64 %198, %205
br i1 %206, label %207, label %222
207: ; preds = %193
%208 = load i16, i16* @timeratio_.stage
%209 = sext i16 %208 to i64
%210 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %209
%211 = getelementptr inbounds %struct.timeval, %struct.timeval* %210, i32 0, i32 0
%212 = load i32, i32* %211
%213 = load i16, i16* @timeratio_.stage
%214 = sext i16 %213 to i32
%215 = sub nsw i32 %214, 1
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %216
%218 = getelementptr inbounds %struct.timeval, %struct.timeval* %217, i32 0, i32 0
%219 = load i32, i32* %218
%220 = sub nsw i32 %212, %219
%221 = sub nsw i32 %220, 1
br label %236
222: ; preds = %193
%223 = load i16, i16* @timeratio_.stage
%224 = sext i16 %223 to i64
%225 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %224
%226 = getelementptr inbounds %struct.timeval, %struct.timeval* %225, i32 0, i32 0
%227 = load i32, i32* %226
%228 = load i16, i16* @timeratio_.stage
%229 = sext i16 %228 to i32
%230 = sub nsw i32 %229, 1
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %231
%233 = getelementptr inbounds %struct.timeval, %struct.timeval* %232, i32 0, i32 0
%234 = load i32, i32* %233
%235 = sub nsw i32 %227, %234
br label %236
236: ; preds = %222, %207
%237 = phi i32 [ %221, %207 ], [ %235, %222 ]
%238 = sitofp i32 %237 to double
store double %238, double* %1
%239 = load double, double* %1
%240 = fmul double %239, 1.000000e+06
store double %240, double* %1
%241 = load i16, i16* @timeratio_.stage
%242 = sext i16 %241 to i64
%243 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %242
%244 = getelementptr inbounds %struct.timeval, %struct.timeval* %243, i32 0, i32 1
%245 = load i64, i64* %244
%246 = load i16, i16* @timeratio_.stage
%247 = sext i16 %246 to i32
%248 = sub nsw i32 %247, 1
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %249
%251 = getelementptr inbounds %struct.timeval, %struct.timeval* %250, i32 0, i32 1
%252 = load i64, i64* %251
%253 = icmp slt i64 %245, %252
br i1 %253, label %254, label %269
254: ; preds = %236
%255 = load i16, i16* @timeratio_.stage
%256 = sext i16 %255 to i32
%257 = sub nsw i32 %256, 1
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %258
%260 = getelementptr inbounds %struct.timeval, %struct.timeval* %259, i32 0, i32 1
%261 = load i64, i64* %260
%262 = load i16, i16* @timeratio_.stage
%263 = sext i16 %262 to i64
%264 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %263
%265 = getelementptr inbounds %struct.timeval, %struct.timeval* %264, i32 0, i32 1
%266 = load i64, i64* %265
%267 = sub nsw i64 %261, %266
%268 = sub nsw i64 1000000, %267
br label %283
269: ; preds = %236
%270 = load i16, i16* @timeratio_.stage
%271 = sext i16 %270 to i64
%272 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %271
%273 = getelementptr inbounds %struct.timeval, %struct.timeval* %272, i32 0, i32 1
%274 = load i64, i64* %273
%275 = load i16, i16* @timeratio_.stage
%276 = sext i16 %275 to i32
%277 = sub nsw i32 %276, 1
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %278
%280 = getelementptr inbounds %struct.timeval, %struct.timeval* %279, i32 0, i32 1
%281 = load i64, i64* %280
%282 = sub nsw i64 %274, %281
br label %283
283: ; preds = %269, %254
%284 = phi i64 [ %268, %254 ], [ %282, %269 ]
%285 = sitofp i64 %284 to double
%286 = load double, double* %1
%287 = fadd double %286, %285
store double %287, double* %1
%288 = load i16, i16* @timeratio_.stage
%289 = sext i16 %288 to i32
%290 = sub nsw i32 %289, 1
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %291
%293 = getelementptr inbounds %struct.timeval, %struct.timeval* %292, i32 0, i32 1
%294 = load i64, i64* %293
%295 = load i16, i16* @timeratio_.stage
%296 = sext i16 %295 to i32
%297 = sub nsw i32 %296, 2
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %298
%300 = getelementptr inbounds %struct.timeval, %struct.timeval* %299, i32 0, i32 1
%301 = load i64, i64* %300
%302 = icmp slt i64 %294, %301
br i1 %302, label %303, label %320
303: ; preds = %283
%304 = load i16, i16* @timeratio_.stage
%305 = sext i16 %304 to i32
%306 = sub nsw i32 %305, 1
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %307
%309 = getelementptr inbounds %struct.timeval, %struct.timeval* %308, i32 0, i32 0
%310 = load i32, i32* %309
%311 = load i16, i16* @timeratio_.stage
%312 = sext i16 %311 to i32
%313 = sub nsw i32 %312, 2
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %314
%316 = getelementptr inbounds %struct.timeval, %struct.timeval* %315, i32 0, i32 0
%317 = load i32, i32* %316
%318 = sub nsw i32 %310, %317
%319 = sub nsw i32 %318, 1
br label %336
320: ; preds = %283
%321 = load i16, i16* @timeratio_.stage
%322 = sext i16 %321 to i32
%323 = sub nsw i32 %322, 1
%324 = sext i32 %323 to i64
%325 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %324
%326 = getelementptr inbounds %struct.timeval, %struct.timeval* %325, i32 0, i32 0
%327 = load i32, i32* %326
%328 = load i16, i16* @timeratio_.stage
%329 = sext i16 %328 to i32
%330 = sub nsw i32 %329, 2
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %331
%333 = getelementptr inbounds %struct.timeval, %struct.timeval* %332, i32 0, i32 0
%334 = load i32, i32* %333
%335 = sub nsw i32 %327, %334
br label %336
336: ; preds = %320, %303
%337 = phi i32 [ %319, %303 ], [ %335, %320 ]
%338 = sitofp i32 %337 to double
store double %338, double* %2
%339 = load double, double* %2
%340 = fmul double %339, 1.000000e+06
store double %340, double* %2
%341 = load i16, i16* @timeratio_.stage
%342 = sext i16 %341 to i32
%343 = sub nsw i32 %342, 1
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %344
%346 = getelementptr inbounds %struct.timeval, %struct.timeval* %345, i32 0, i32 1
%347 = load i64, i64* %346
%348 = load i16, i16* @timeratio_.stage
%349 = sext i16 %348 to i32
%350 = sub nsw i32 %349, 2
%351 = sext i32 %350 to i64
%352 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %351
%353 = getelementptr inbounds %struct.timeval, %struct.timeval* %352, i32 0, i32 1
%354 = load i64, i64* %353
%355 = icmp slt i64 %347, %354
br i1 %355, label %356, label %373
356: ; preds = %336
%357 = load i16, i16* @timeratio_.stage
%358 = sext i16 %357 to i32
%359 = sub nsw i32 %358, 2
%360 = sext i32 %359 to i64
%361 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %360
%362 = getelementptr inbounds %struct.timeval, %struct.timeval* %361, i32 0, i32 1
%363 = load i64, i64* %362
%364 = load i16, i16* @timeratio_.stage
%365 = sext i16 %364 to i32
%366 = sub nsw i32 %365, 1
%367 = sext i32 %366 to i64
%368 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %367
%369 = getelementptr inbounds %struct.timeval, %struct.timeval* %368, i32 0, i32 1
%370 = load i64, i64* %369
%371 = sub nsw i64 %363, %370
%372 = sub nsw i64 1000000, %371
br label %389
373: ; preds = %336
%374 = load i16, i16* @timeratio_.stage
%375 = sext i16 %374 to i32
%376 = sub nsw i32 %375, 1
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %377
%379 = getelementptr inbounds %struct.timeval, %struct.timeval* %378, i32 0, i32 1
%380 = load i64, i64* %379
%381 = load i16, i16* @timeratio_.stage
%382 = sext i16 %381 to i32
%383 = sub nsw i32 %382, 2
%384 = sext i32 %383 to i64
%385 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %384
%386 = getelementptr inbounds %struct.timeval, %struct.timeval* %385, i32 0, i32 1
%387 = load i64, i64* %386
%388 = sub nsw i64 %380, %387
br label %389
389: ; preds = %373, %356
%390 = phi i64 [ %372, %356 ], [ %388, %373 ]
%391 = sitofp i64 %390 to double
%392 = load double, double* %2
%393 = fadd double %392, %391
store double %393, double* %2
%394 = load i16, i16* @timeratio_.stage
%395 = load i16, i16* @timeratio_.stage
%396 = sext i16 %395 to i32
%397 = sub nsw i32 %396, 1
%398 = trunc i32 %397 to i16
%399 = load i16, i16* @timeratio_.stage
%400 = sext i16 %399 to i32
%401 = sub nsw i32 %400, 1
%402 = trunc i32 %401 to i16
%403 = load i16, i16* @timeratio_.stage
%404 = sext i16 %403 to i32
%405 = sub nsw i32 %404, 2
%406 = load double, double* %1
%407 = load double, double* %2
%408 = load double, double* %1
%409 = load double, double* %2
%410 = fdiv double %408, %409
%411 = call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i16 signext %394, i16 signext %398, i16 signext %402, i32 %405, double %406, double %407, double %410)
store i16 0, i16* @timeratio_.stage
br label %415
412: ; preds = %189, %185
%413 = load i16, i16* @timeratio_.stage
%414 = add i16 %413, 1
store i16 %414, i16* @timeratio_.stage
br label %415
415: ; preds = %412, %389
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@timeratio_.stage = internal unnamed_addr global i16 0
@timeratio_.tv_a = internal global [3 x %struct.timeval] zeroinitializer
@.str = [34 x i8] c"OAD: TIMING: stamp %u: %lu.%06lu\0A\00"
@.str.1 = [44 x i8] c"OAD: TIMING: delta stamps %u-%u: %lu.%06lu\0A\00"
@.str.2 = [53 x i8] c"OAD: TIMING: ratio stamps (%u-%u)/(%u-%u): %e/%e=%e\0A\00"
define void @timeratio_() {
%1 = load i16, i16* @timeratio_.stage
%2 = icmp slt i16 %1, 3
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = sext i16 %1 to i64
%5 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %4
%6 = tail call i32 @gettimeofday(%struct.timeval* %5, i32 0)
%7 = load i16, i16* @timeratio_.stage
br label %8
8: ; preds = %3, %0
%9 = phi i16 [ %7, %3 ], [ %1, %0 ]
%10 = sext i16 %9 to i64
%11 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %10, i32 0
%12 = load i32, i32* %11
%13 = trunc i32 %12 to i16
%14 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %10, i32 1
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i16
%17 = tail call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i16 signext %9, i16 signext %13, i16 signext %16)
%18 = load i16, i16* @timeratio_.stage
%19 = icmp sgt i16 %18, 0
br i1 %19, label %20, label %103
20: ; preds = %8
%21 = zext i16 %18 to i32
%22 = add nsw i32 %21, -1
%23 = trunc i32 %22 to i16
%24 = zext i16 %18 to i64
%25 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %24, i32 1
%26 = load i64, i64* %25
%27 = zext i32 %22 to i64
%28 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %27, i32 1
%29 = load i64, i64* %28
%30 = icmp slt i64 %26, %29
%31 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %24, i32 0
%32 = load i32, i32* %31
%33 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %27, i32 0
%34 = load i32, i32* %33
%35 = xor i32 %34, -1
%36 = sub i32 0, %34
%37 = select i1 %30, i32 %35, i32 %36
%38 = add i32 %32, %37
%39 = trunc i32 %38 to i16
%40 = add nsw i64 %24, -1
%41 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %40, i32 1
%42 = load i64, i64* %41
%43 = icmp slt i64 %26, %42
%44 = sub i64 %26, %42
%45 = add i64 %44, 1000000
%46 = select i1 %43, i64 %45, i64 %44
%47 = tail call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i16 signext %18, i16 signext %23, i16 signext %39, i64 %46)
%48 = load i16, i16* @timeratio_.stage
%49 = icmp sgt i16 %48, 1
br i1 %49, label %50, label %103
50: ; preds = %20
%51 = zext i16 %48 to i64
%52 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %51, i32 1
%53 = load i64, i64* %52
%54 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 1)
%55 = icmp slt i64 %53, %54
%56 = getelementptr inbounds [3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 %51, i32 0
%57 = load i32, i32* %56
%58 = load i32, i32* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 0)
%59 = xor i32 %58, -1
%60 = sub i32 0, %58
%61 = select i1 %55, i32 %59, i32 %60
%62 = add i32 %57, %61
%63 = trunc i32 %62 to i16
%64 = sub i64 %53, %54
%65 = add i64 %64, 1000000
%66 = select i1 %55, i64 %65, i64 %64
%67 = tail call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i16 signext %48, i16 signext 0, i16 signext %63, i64 %66)
%68 = load i16, i16* @timeratio_.stage
%69 = icmp eq i16 %68, 2
br i1 %69, label %70, label %103
70: ; preds = %50
%71 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 2, i32 1)
%72 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 1, i32 1)
%73 = icmp slt i64 %71, %72
%74 = load i32, i32* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 2, i32 0)
%75 = load i32, i32* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 1, i32 0)
%76 = xor i32 %75, -1
%77 = sub i32 0, %75
%78 = select i1 %73, i32 %76, i32 %77
%79 = add i32 %74, %78
%80 = sitofp i32 %79 to double
%81 = fmul double %80, 1.000000e+06
%82 = sub i64 %71, %72
%83 = add i64 %82, 1000000
%84 = select i1 %73, i64 %83, i64 %82
%85 = sitofp i64 %84 to double
%86 = fadd double %81, %85
%87 = load i64, i64* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 1)
%88 = icmp slt i64 %72, %87
%89 = load i32, i32* getelementptr inbounds ([3 x %struct.timeval], [3 x %struct.timeval]* @timeratio_.tv_a, i64 0, i64 0, i32 0)
%90 = xor i32 %89, -1
%91 = sub i32 0, %89
%92 = select i1 %88, i32 %90, i32 %91
%93 = add i32 %75, %92
%94 = sitofp i32 %93 to double
%95 = fmul double %94, 1.000000e+06
%96 = sub i64 %72, %87
%97 = add i64 %96, 1000000
%98 = select i1 %88, i64 %97, i64 %96
%99 = sitofp i64 %98 to double
%100 = fadd double %95, %99
%101 = fdiv double %86, %100
%102 = tail call i32 (i8*, i16, i16, i16, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i16 signext 2, i16 signext 1, i16 signext 1, i32 0, double %86, double %100, double %101)
br label %106
103: ; preds = %8, %20, %50
%104 = phi i16 [ %68, %50 ], [ %48, %20 ], [ %18, %8 ]
%105 = add i16 %104, 1
br label %106
106: ; preds = %103, %70
%107 = phi i16 [ %105, %103 ], [ 0, %70 ]
store i16 %107, i16* @timeratio_.stage
ret void
}