#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 fabs(double);
double pow(double, double);
double sqrt(double);
void trap(int *n, double a[], double Mp[], double *M, int type[]) {
  int i, j, k;
  double a_m, rH, l1, l2, ll, ll2;
  for (i = 0; i < (*n) - 1; i++) {
    if (type[i] == 0 || type[i] == 1) {
      j = i + 1;
      if (type[j] == 0 || type[j] == 1) {
        for (k = i + 2; k < (*n); k++) {
          if (type[k] == 0 || type[k] == 1) {
            if (fabs(a[i] - a[k]) < fabs(a[i] - a[j]))
              j = k;
          }
        }
        a_m = sqrt(a[i] * a[j]);
        rH = pow((Mp[i] + Mp[j]) / (3.0 * (*M)), 1.0 / 3.0) * a_m;
        if (fabs(a[i] - a[j]) < 5 * rH) {
          if (type[i] == 4)
            type[j] = 4;
          else if (type[j] == 4)
            type[i] = 4;
          if (type[i] == 4 || type[j] == 4) {
            if (a[i] < a[j])
              a[j] = a[i] + 5 * rH;
            else
              a[i] = a[j] + 5 * rH;
          } else {
            l1 = Mp[i] * sqrt(a[i] * 6.6738480e-8 * (*M));
            l2 = Mp[j] * sqrt(a[j] * 6.6738480e-8 * (*M));
            ll = l1 + l2;
            if (a[i] < a[j])
              a[j] = a[i] + 5 * rH;
            else
              a[i] = a[j] + 5 * rH;
            do {
              a[i] -= 1.0e-3;
              a[j] -= 1.0e-3;
              l1 = Mp[i] * sqrt(a[i] * 6.6738480e-8 * (*M));
              l2 = Mp[j] * sqrt(a[j] * 6.6738480e-8 * (*M));
              ll2 = l1 + l2;
            } while (ll2 > ll);
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<trap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    163f <trap+0x50f>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     118e <trap+0x5e>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    162c <trap+0x4fc>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11bb <trap+0x8b>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1627 <trap+0x4f7>
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1263 <trap+0x133>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11f7 <trap+0xc7>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1250 <trap+0x120>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x6c(%rbp),%eax
cmp    %ecx,%eax
jge    124b <trap+0x11b>
mov    -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    1250 <trap+0x120>
jmp    1255 <trap+0x125>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c4 <trap+0x94>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movsd  0xd63(%rip),%xmm1
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd4b(%rip),%xmm1
call   1040 <pow@plt>
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd09(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1622 <trap+0x4f2>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x4,(%rax,%rcx,4)
jne    132c <trap+0x1fc>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movl   $0x4,(%rax,%rcx,4)
jmp    1352 <trap+0x222>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpl   $0x4,(%rax,%rcx,4)
jne    134d <trap+0x21d>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movl   $0x4,(%rax,%rcx,4)
jmp    1352 <trap+0x222>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x4,(%rax,%rcx,4)
je     1376 <trap+0x246>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpl   $0x4,(%rax,%rcx,4)
jne    1402 <trap+0x2d2>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    13ce <trap+0x29e>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xc4c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13fd <trap+0x2cd>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xc18(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    161d <trap+0x4ed>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  0xbf4(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  0xbaf(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    14f3 <trap+0x3c3>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xb27(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1522 <trap+0x3f2>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xaf3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1527 <trap+0x3f7>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xae4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xac6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  0xa90(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  0xa45(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
ja     1527 <trap+0x3f7>
jmp    161d <trap+0x4ed>
jmp    1622 <trap+0x4f2>
jmp    1627 <trap+0x4f7>
jmp    162c <trap+0x4fc>
jmp    1631 <trap+0x501>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1156 <trap+0x26>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trap>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8,0x28(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rdi,0x48(%rsp)
mov    (%rdi),%eax
cmp    $0x2,%eax
jl     14e1 <trap+0x3b1>
mov    %rcx,%rbx
mov    %rsi,%r12
mov    $0x2,%r14d
xor    %r15d,%r15d
mov    %rcx,0x50(%rsp)
jmp    11c1 <trap+0x91>
mov    %rcx,%rax
movl   $0x4,(%rax)
movsd  0x0(%rbp),%xmm0
movsd  0x0(%r13),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r13,%rbp
minsd  %xmm1,%xmm0
mulsd  0xe7a(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x0(%rbp)
nop
mov    0x48(%rsp),%rax
movslq (%rax),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
add    $0x1,%r14
mov    0x20(%rsp),%r15
cmp    %rcx,%r15
jge    14e1 <trap+0x3b1>
lea    0x1(%r15),%rcx
mov    %rcx,0x20(%rsp)
mov    0x28(%rsp),%rcx
cmpl   $0x1,(%rcx,%r15,4)
ja     11a0 <trap+0x70>
mov    0x28(%rsp),%rcx
mov    0x20(%rsp),%rdx
cmpl   $0x1,(%rcx,%rdx,4)
ja     11a0 <trap+0x70>
lea    0x2(%r15),%ecx
cmp    %eax,%ecx
jge    124f <trap+0x11f>
mov    %r14,%rbx
mov    0x20(%rsp),%rcx
mov    %ecx,%r13d
jmp    1212 <trap+0xe2>
nopl   0x0(%rax,%rax,1)
mov    0x48(%rsp),%rax
mov    (%rax),%eax
mov    %ecx,%r13d
add    $0x1,%rbx
cmp    %ebx,%eax
jle    1257 <trap+0x127>
mov    0x28(%rsp),%rcx
cmpl   $0x1,(%rcx,%rbx,4)
ja     120a <trap+0xda>
movsd  (%r12,%r15,8),%xmm0
subsd  (%r12,%rbx,8),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  (%r12,%r15,8),%xmm0
movslq %r13d,%rax
subsd  (%r12,%rax,8),%xmm0
call   1030 <fabs@plt>
mov    %ebx,%ecx
cmp    %eax,%ebp
jl     1200 <trap+0xd0>
mov    %r13d,%ecx
jmp    1200 <trap+0xd0>
mov    0x20(%rsp),%rax
mov    %eax,%r13d
movsd  (%r12,%r15,8),%xmm0
movslq %r13d,%rax
mov    %rax,0x18(%rsp)
mulsd  (%r12,%rax,8),%xmm0
ucomisd 0xdb5(%rip),%xmm0
mov    0x50(%rsp),%rbx
jb     1280 <trap+0x150>
sqrtsd %xmm0,%xmm0
jmp    1285 <trap+0x155>
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
lea    (%r12,%r15,8),%rbp
mov    0x10(%rsp),%rax
movsd  (%rax,%r15,8),%xmm0
mov    0x18(%rsp),%rcx
addsd  (%rax,%rcx,8),%xmm0
lea    (%r12,%rcx,8),%r13
movsd  (%rbx),%xmm1
mulsd  0xd4c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd48(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x0(%rbp),%xmm0
subsd  0x0(%r13),%xmm0
call   1030 <fabs@plt>
movsd  0x8(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm2,%xmm1
mulsd  0xd16(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11a0 <trap+0x70>
mov    0x28(%rsp),%rcx
lea    (%rcx,%r15,4),%rax
cmpl   $0x4,(%rax)
mov    0x18(%rsp),%rdx
lea    (%rcx,%rdx,4),%rcx
je     116e <trap+0x3e>
cmpl   $0x4,(%rcx)
je     1171 <trap+0x41>
mov    0x10(%rsp),%rax
movsd  (%rax,%r15,8),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x0(%rbp),%xmm0
mulsd  0xcd2(%rip),%xmm0
mulsd  (%rbx),%xmm0
ucomisd 0xcd6(%rip),%xmm0
jb     135d <trap+0x22d>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    1366 <trap+0x236>
call   1050 <sqrt@plt>
movapd %xmm0,%xmm1
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x0(%r13),%xmm0
mulsd  0xc95(%rip),%xmm0
mulsd  (%rbx),%xmm0
ucomisd 0xc99(%rip),%xmm0
jb     1397 <trap+0x267>
sqrtsd %xmm0,%xmm0
jmp    13b4 <trap+0x284>
movsd  %xmm1,0x38(%rsp)
movsd  %xmm3,0x30(%rsp)
call   1050 <sqrt@plt>
movsd  0x30(%rsp),%xmm3
movsd  0x38(%rsp),%xmm1
mulsd  %xmm0,%xmm3
movsd  0x40(%rsp),%xmm2
mulsd  %xmm1,%xmm2
movsd  0x0(%rbp),%xmm0
movsd  0x0(%r13),%xmm1
ucomisd %xmm0,%xmm1
addsd  %xmm3,%xmm2
movsd  %xmm2,0x40(%rsp)
mov    %rbp,%rax
cmova  %r13,%rax
minsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xc1c(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rax)
jmp    143b <trap+0x30b>
xchg   %ax,%ax
movsd  %xmm2,0x38(%rsp)
movsd  %xmm3,0x30(%rsp)
call   1050 <sqrt@plt>
movsd  0x30(%rsp),%xmm3
movsd  0x38(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
ucomisd 0x40(%rsp),%xmm1
jbe    11a0 <trap+0x70>
movsd  0x0(%rbp),%xmm0
movsd  0xbd8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp)
movsd  0x0(%r13),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%r13)
mov    0x10(%rsp),%rax
movsd  (%rax,%r15,8),%xmm1
movsd  0x0(%rbp),%xmm0
mulsd  0xb9f(%rip),%xmm0
mulsd  (%rbx),%xmm0
ucomisd 0xba3(%rip),%xmm0
movsd  %xmm1,0x8(%rsp)
jb     14a0 <trap+0x370>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    14a9 <trap+0x379>
cs nopw 0x0(%rax,%rax,1)
call   1050 <sqrt@plt>
movapd %xmm0,%xmm2
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x0(%r13),%xmm0
mulsd  0xb52(%rip),%xmm0
mulsd  (%rbx),%xmm0
ucomisd 0xb56(%rip),%xmm0
jb     1400 <trap+0x2d0>
sqrtsd %xmm0,%xmm0
jmp    141d <trap+0x2ed>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @trap(i32* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, i32* nocapture %4) {
%6 = load i32, i32* %0
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %146
8: ; preds = %5, %140
%9 = phi i32 [ %141, %140 ], [ %6, %5 ]
%10 = phi i64 [ %15, %140 ], [ 0, %5 ]
%11 = phi i64 [ %145, %140 ], [ 2, %5 ]
%12 = getelementptr inbounds i32, i32* %4, i64 %10
%13 = load i32, i32* %12
%14 = icmp ult i32 %13, 2
%15 = add nuw nsw i64 %10, 1
br i1 %14, label %16, label %140
16: ; preds = %8
%17 = getelementptr inbounds i32, i32* %4, i64 %15
%18 = load i32, i32* %17
%19 = icmp ult i32 %18, 2
br i1 %19, label %20, label %140
20: ; preds = %16
%21 = trunc i64 %10 to i32
%22 = add i32 %21, 2
%23 = icmp slt i32 %22, %9
%24 = trunc i64 %15 to i32
br i1 %23, label %25, label %56
25: ; preds = %20
%26 = getelementptr inbounds double, double* %1, i64 %10
br label %27
27: ; preds = %25, %50
%28 = phi i32 [ %9, %25 ], [ %51, %50 ]
%29 = phi i64 [ %11, %25 ], [ %53, %50 ]
%30 = phi i32 [ %24, %25 ], [ %52, %50 ]
%31 = getelementptr inbounds i32, i32* %4, i64 %29
%32 = load i32, i32* %31
%33 = icmp ult i32 %32, 2
br i1 %33, label %34, label %50
34: ; preds = %27
%35 = load double, double* %26
%36 = getelementptr inbounds double, double* %1, i64 %29
%37 = load double, double* %36
%38 = fsub double %35, %37
%39 = tail call i32 @fabs(double %38)
%40 = load double, double* %26
%41 = sext i32 %30 to i64
%42 = getelementptr inbounds double, double* %1, i64 %41
%43 = load double, double* %42
%44 = fsub double %40, %43
%45 = tail call i32 @fabs(double %44)
%46 = icmp slt i32 %39, %45
%47 = trunc i64 %29 to i32
%48 = select i1 %46, i32 %47, i32 %30
%49 = load i32, i32* %0
br label %50
50: ; preds = %34, %27
%51 = phi i32 [ %28, %27 ], [ %49, %34 ]
%52 = phi i32 [ %30, %27 ], [ %48, %34 ]
%53 = add nuw nsw i64 %29, 1
%54 = trunc i64 %53 to i32
%55 = icmp sgt i32 %51, %54
br i1 %55, label %27, label %56
56: ; preds = %50, %20
%57 = phi i32 [ %24, %20 ], [ %52, %50 ]
%58 = getelementptr inbounds double, double* %1, i64 %10
%59 = load double, double* %58
%60 = sext i32 %57 to i64
%61 = getelementptr inbounds double, double* %1, i64 %60
%62 = load double, double* %61
%63 = fmul double %59, %62
%64 = tail call double @sqrt(double %63)
%65 = getelementptr inbounds double, double* %2, i64 %10
%66 = load double, double* %65
%67 = getelementptr inbounds double, double* %2, i64 %60
%68 = load double, double* %67
%69 = fadd double %66, %68
%70 = load double, double* %3
%71 = fmul double %70, 3.000000e+00
%72 = fdiv double %69, %71
%73 = tail call double @pow(double %72, double 0x3FD5555555555555)
%74 = fmul double %64, %73
%75 = load double, double* %58
%76 = load double, double* %61
%77 = fsub double %75, %76
%78 = tail call i32 @fabs(double %77)
%79 = sitofp i32 %78 to double
%80 = fmul double %74, 5.000000e+00
%81 = fcmp ogt double %80, %79
br i1 %81, label %82, label %140
82: ; preds = %56
%83 = load i32, i32* %12
%84 = icmp eq i32 %83, 4
%85 = getelementptr inbounds i32, i32* %4, i64 %60
br i1 %84, label %89, label %86
86: ; preds = %82
%87 = load i32, i32* %85
%88 = icmp eq i32 %87, 4
br i1 %88, label %89, label %97
89: ; preds = %82, %86
%90 = phi i32* [ %12, %86 ], [ %85, %82 ]
store i32 4, i32* %90
%91 = load double, double* %58
%92 = load double, double* %61
%93 = fcmp olt double %91, %92
%94 = select i1 %93, double %91, double %92
%95 = select i1 %93, double* %61, double* %58
%96 = tail call double @llvm.fmuladd.f64(double %74, double 5.000000e+00, double %94)
store double %96, double* %95
br label %140
97: ; preds = %86
%98 = load double, double* %65
%99 = load double, double* %58
%100 = fmul double %99, 0x3E71EA3BC1A8C623
%101 = load double, double* %3
%102 = fmul double %100, %101
%103 = tail call double @sqrt(double %102)
%104 = fmul double %98, %103
%105 = load double, double* %67
%106 = load double, double* %61
%107 = fmul double %106, 0x3E71EA3BC1A8C623
%108 = load double, double* %3
%109 = fmul double %107, %108
%110 = tail call double @sqrt(double %109)
%111 = fmul double %105, %110
%112 = fadd double %104, %111
%113 = load double, double* %58
%114 = load double, double* %61
%115 = fcmp olt double %113, %114
%116 = select i1 %115, double %113, double %114
%117 = select i1 %115, double* %61, double* %58
%118 = tail call double @llvm.fmuladd.f64(double %74, double 5.000000e+00, double %116)
store double %118, double* %117
br label %119
119: ; preds = %119, %97
%120 = load double, double* %58
%121 = fadd double %120, -1.000000e-03
store double %121, double* %58
%122 = load double, double* %61
%123 = fadd double %122, -1.000000e-03
store double %123, double* %61
%124 = load double, double* %65
%125 = load double, double* %58
%126 = fmul double %125, 0x3E71EA3BC1A8C623
%127 = load double, double* %3
%128 = fmul double %126, %127
%129 = tail call double @sqrt(double %128)
%130 = fmul double %124, %129
%131 = load double, double* %67
%132 = load double, double* %61
%133 = fmul double %132, 0x3E71EA3BC1A8C623
%134 = load double, double* %3
%135 = fmul double %133, %134
%136 = tail call double @sqrt(double %135)
%137 = fmul double %131, %136
%138 = fadd double %130, %137
%139 = fcmp ogt double %138, %112
br i1 %139, label %119, label %140
140: ; preds = %119, %89, %8, %16, %56
%141 = load i32, i32* %0
%142 = add nsw i32 %141, -1
%143 = sext i32 %142 to i64
%144 = icmp slt i64 %15, %143
%145 = add nuw nsw i64 %11, 1
br i1 %144, label %8, label %146
146: ; preds = %140, %5
ret void
}