#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 */
double cos(double);
double sin(double);
double V3DHFGetHeightFromWorldPosition(double x, double y, double hf_x,
                                       double hf_y, double hf_z,
                                       double hf_heading, double hf_len_x,
                                       double hf_len_y, double hf_len_z,
                                       int hf_widthp, int hf_heightp,
                                       double *hf_data) {
  double cos_theta, sin_theta;
  double dx, dy, drx, dry;
  double hf_half_x_len = hf_len_x / 2, hf_half_y_len = hf_len_y / 2;
  double hf_grid_x_spacing, hf_grid_y_spacing;
  int hf_xi, hf_yi;
  if ((hf_len_x <= 0.0) || (hf_len_y <= 0.0))
    return (0.0);
  if ((hf_widthp <= 0) || (hf_heightp <= 0))
    return (0.0);
  hf_grid_x_spacing = hf_len_x / (double)hf_widthp;
  hf_grid_y_spacing = hf_len_y / (double)hf_heightp;
  if ((hf_grid_x_spacing <= 0.0) || (hf_grid_y_spacing <= 0.0))
    return (0.0);
  dx = x - hf_x;
  dy = hf_y - y;
  cos_theta = cos(-hf_heading);
  sin_theta = sin(-hf_heading);
  drx = (dx * cos_theta) - (dy * sin_theta);
  dry = (dy * cos_theta) + (dx * sin_theta);
  hf_xi = (int)((drx + hf_half_x_len) / hf_grid_x_spacing);
  hf_yi = (int)((dry + hf_half_y_len) / hf_grid_y_spacing);
  if ((hf_xi < 0) || (hf_xi >= hf_widthp) || (hf_yi < 0) ||
      (hf_yi >= hf_heightp))
    return (0.0);
  if (hf_data == NULL) {
    return (hf_z);
  } else {
    double in_grid_x_c =
        ((drx + hf_half_x_len) - (hf_xi * hf_grid_x_spacing)) /
        (((hf_xi + 1) * hf_grid_x_spacing) - (hf_xi * hf_grid_x_spacing));
    double in_grid_y_c =
        ((dry + hf_half_y_len) - (hf_yi * hf_grid_y_spacing)) /
        (((hf_yi + 1) * hf_grid_y_spacing) - (hf_yi * hf_grid_y_spacing));
    double z_value[4];
    double z_result;
    if (in_grid_x_c <= in_grid_y_c) {
      z_value[0] = hf_data[(hf_yi * hf_widthp) + hf_xi];
      if ((hf_yi + 1) < hf_heightp) {
        z_value[2] = hf_data[((hf_yi + 1) * hf_widthp) + hf_xi];
      } else {
        z_value[2] = z_value[0];
      }
      if (((hf_xi + 1) < hf_widthp) && ((hf_yi + 1) < hf_heightp)) {
        z_value[3] = hf_data[((hf_yi + 1) * hf_widthp) + (hf_xi + 1)];
      } else if ((hf_yi + 1) < hf_heightp) {
        z_value[3] = z_value[2];
      } else if ((hf_xi + 1) < hf_widthp) {
        z_value[3] = hf_data[(hf_yi * hf_widthp) + (hf_xi + 1)];
      } else {
        z_value[3] = z_value[0];
      }
      {
        double height_delta_x = z_value[3] - z_value[2];
        double height_delta_y = z_value[0] - z_value[2];
        z_result = z_value[2] + (height_delta_x * in_grid_x_c) +
                   (height_delta_y * (1.0 - in_grid_y_c));
      }
    } else {
      z_value[0] = hf_data[(hf_yi * hf_widthp) + hf_xi];
      if ((hf_xi + 1) < hf_widthp) {
        z_value[1] = hf_data[(hf_yi * hf_widthp) + (hf_xi + 1)];
      } else {
        z_value[1] = z_value[0];
      }
      if (((hf_xi + 1) < hf_widthp) && ((hf_yi + 1) < hf_heightp)) {
        z_value[3] = hf_data[((hf_yi + 1) * hf_widthp) + (hf_xi + 1)];
      } else if ((hf_yi + 1) < hf_heightp) {
        z_value[3] = hf_data[((hf_yi + 1) * hf_widthp) + hf_xi];
      } else if ((hf_xi + 1) < hf_widthp) {
        z_value[3] = z_value[1];
      } else {
        z_value[3] = z_value[0];
      }
      {
        double height_delta_x = z_value[0] - z_value[1];
        double height_delta_y = z_value[3] - z_value[1];
        z_result = z_value[1] + (height_delta_x * (1.0 - in_grid_x_c)) +
                   (height_delta_y * in_grid_y_c);
      }
    }
    return (z_result + hf_z);
  }
}


x86 assembly (clang, -O0):
<V3DHFGetHeightFromWorldPosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
mov    %edi,-0x4c(%rbp)
mov    %esi,-0x50(%rbp)
mov    %rdx,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jae    11b1 <V3DHFGetHeightFromWorldPosition+0x91>
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jb     11be <V3DHFGetHeightFromWorldPosition+0x9e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    186c <V3DHFGetHeightFromWorldPosition+0x74c>
cmpl   $0x0,-0x4c(%rbp)
jle    11d2 <V3DHFGetHeightFromWorldPosition+0xb2>
cmpl   $0x0,-0x50(%rbp)
jg     11df <V3DHFGetHeightFromWorldPosition+0xbf>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    186c <V3DHFGetHeightFromWorldPosition+0x74c>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x4c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jae    122d <V3DHFGetHeightFromWorldPosition+0x10d>
xorps  %xmm0,%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jb     123a <V3DHFGetHeightFromWorldPosition+0x11a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    186c <V3DHFGetHeightFromWorldPosition+0x74c>
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
divsd  -0xa0(%rbp),%xmm0
ff
cvttsd2si %xmm0,%eax
mov    %eax,-0xac(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x98(%rbp),%xmm0
ff
divsd  -0xa8(%rbp),%xmm0
ff
cvttsd2si %xmm0,%eax
mov    %eax,-0xb0(%rbp)
cmpl   $0x0,-0xac(%rbp)
jl     1379 <V3DHFGetHeightFromWorldPosition+0x259>
mov    -0xac(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    1379 <V3DHFGetHeightFromWorldPosition+0x259>
cmpl   $0x0,-0xb0(%rbp)
jl     1379 <V3DHFGetHeightFromWorldPosition+0x259>
mov    -0xb0(%rbp),%eax
cmp    -0x50(%rbp),%eax
jl     1386 <V3DHFGetHeightFromWorldPosition+0x266>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    186c <V3DHFGetHeightFromWorldPosition+0x74c>
cmpq   $0x0,-0x58(%rbp)
jne    13a0 <V3DHFGetHeightFromWorldPosition+0x280>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    186c <V3DHFGetHeightFromWorldPosition+0x74c>
movsd  -0x80(%rbp),%xmm1
addsd  -0x90(%rbp),%xmm1
ff
cvtsi2sdl -0xac(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xac(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  -0xa0(%rbp),%xmm3
ff
cvtsi2sdl -0xac(%rbp),%xmm2
ff
mulsd  -0xa0(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
addsd  -0x98(%rbp),%xmm1
ff
cvtsi2sdl -0xb0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  -0xa8(%rbp),%xmm3
ff
cvtsi2sdl -0xb0(%rbp),%xmm2
ff
mulsd  -0xa8(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     169a <V3DHFGetHeightFromWorldPosition+0x57a>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    -0xac(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
cmp    -0x50(%rbp),%eax
jge    1537 <V3DHFGetHeightFromWorldPosition+0x417>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
add    $0x1,%ecx
imul   -0x4c(%rbp),%ecx
add    -0xac(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1547 <V3DHFGetHeightFromWorldPosition+0x427>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0xac(%rbp),%eax
add    $0x1,%eax
cmp    -0x4c(%rbp),%eax
jge    159c <V3DHFGetHeightFromWorldPosition+0x47c>
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
cmp    -0x50(%rbp),%eax
jge    159c <V3DHFGetHeightFromWorldPosition+0x47c>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
add    $0x1,%ecx
imul   -0x4c(%rbp),%ecx
mov    -0xac(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    161d <V3DHFGetHeightFromWorldPosition+0x4fd>
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
cmp    -0x50(%rbp),%eax
jge    15c3 <V3DHFGetHeightFromWorldPosition+0x4a3>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1618 <V3DHFGetHeightFromWorldPosition+0x4f8>
mov    -0xac(%rbp),%eax
add    $0x1,%eax
cmp    -0x4c(%rbp),%eax
jge    1603 <V3DHFGetHeightFromWorldPosition+0x4e3>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
mov    -0xac(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1613 <V3DHFGetHeightFromWorldPosition+0x4f3>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1618 <V3DHFGetHeightFromWorldPosition+0x4f8>
jmp    161d <V3DHFGetHeightFromWorldPosition+0x4fd>
movsd  -0xc8(%rbp),%xmm0
ff
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0xf0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
movsd  0x98b(%rip),%xmm2
subsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
jmp    185a <V3DHFGetHeightFromWorldPosition+0x73a>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    -0xac(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0xac(%rbp),%eax
add    $0x1,%eax
cmp    -0x4c(%rbp),%eax
jge    16fe <V3DHFGetHeightFromWorldPosition+0x5de>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
mov    -0xac(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    170e <V3DHFGetHeightFromWorldPosition+0x5ee>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0xac(%rbp),%eax
add    $0x1,%eax
cmp    -0x4c(%rbp),%eax
jge    1763 <V3DHFGetHeightFromWorldPosition+0x643>
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
cmp    -0x50(%rbp),%eax
jge    1763 <V3DHFGetHeightFromWorldPosition+0x643>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
add    $0x1,%ecx
imul   -0x4c(%rbp),%ecx
mov    -0xac(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    17e2 <V3DHFGetHeightFromWorldPosition+0x6c2>
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
cmp    -0x50(%rbp),%eax
jge    17a1 <V3DHFGetHeightFromWorldPosition+0x681>
mov    -0x58(%rbp),%rax
mov    -0xb0(%rbp),%ecx
add    $0x1,%ecx
imul   -0x4c(%rbp),%ecx
add    -0xac(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    17dd <V3DHFGetHeightFromWorldPosition+0x6bd>
mov    -0xac(%rbp),%eax
add    $0x1,%eax
cmp    -0x4c(%rbp),%eax
jge    17c8 <V3DHFGetHeightFromWorldPosition+0x6a8>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    17d8 <V3DHFGetHeightFromWorldPosition+0x6b8>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    17dd <V3DHFGetHeightFromWorldPosition+0x6bd>
jmp    17e2 <V3DHFGetHeightFromWorldPosition+0x6c2>
movsd  -0xe0(%rbp),%xmm0
ff
subsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
subsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0x100(%rbp),%xmm1
ff
movsd  0x7de(%rip),%xmm2
subsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V3DHFGetHeightFromWorldPosition>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
movapd %xmm0,%xmm9
xorpd  %xmm0,%xmm0
ucomisd %xmm6,%xmm0
jae    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
xorpd  %xmm8,%xmm8
ucomisd %xmm7,%xmm8
jae    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
mov    %edi,%ebp
test   %edi,%edi
jle    12e0 <V3DHFGetHeightFromWorldPosition+0x1c0>
mov    %esi,%ebx
xorpd  %xmm0,%xmm0
test   %esi,%esi
jle    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
unpcklpd %xmm7,%xmm6
movd   %ebx,%xmm0
movd   %ebp,%xmm7
punpckldq %xmm0,%xmm7
cvtdq2pd %xmm7,%xmm0
movapd %xmm6,%xmm10
divpd  %xmm0,%xmm10
xorpd  %xmm0,%xmm0
ucomisd %xmm10,%xmm0
jae    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
movapd %xmm10,%xmm8
unpckhpd %xmm10,%xmm8
pxor   %xmm7,%xmm7
ucomisd %xmm8,%xmm7
jae    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
mov    %rdx,%r14
movsd  %xmm4,(%rsp)
mulpd  0xe47(%rip),%xmm6
movapd %xmm6,0x30(%rsp)
unpcklpd %xmm3,%xmm9
unpcklpd %xmm1,%xmm2
subpd  %xmm2,%xmm9
movapd %xmm9,0x20(%rsp)
movapd %xmm5,%xmm0
movapd %xmm10,0x40(%rsp)
movsd  %xmm5,0x8(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x40(%rsp),%xmm4
movapd 0x10(%rsp),%xmm6
movapd 0xe01(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd 0x20(%rsp),%xmm3
movapd %xmm3,%xmm2
shufpd $0x1,%xmm3,%xmm2
unpcklpd %xmm1,%xmm0
mulpd  %xmm2,%xmm0
unpcklpd %xmm6,%xmm6
mulpd  %xmm3,%xmm6
addpd  %xmm0,%xmm6
addpd  0x30(%rsp),%xmm6
movapd %xmm6,%xmm0
divpd  %xmm4,%xmm0
cvttpd2dq %xmm0,%xmm3
movd   %xmm3,%eax
test   %eax,%eax
js     12e0 <V3DHFGetHeightFromWorldPosition+0x1c0>
cmp    %ebp,%eax
jae    12e0 <V3DHFGetHeightFromWorldPosition+0x1c0>
pshufd $0x55,%xmm3,%xmm0
movd   %xmm0,%ecx
pxor   %xmm0,%xmm0
test   %ecx,%ecx
js     12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
cmp    %ebx,%ecx
movsd  (%rsp),%xmm5
jge    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
test   %r14,%r14
je     12ed <V3DHFGetHeightFromWorldPosition+0x1cd>
cvtdq2pd %xmm3,%xmm0
mulpd  %xmm4,%xmm0
subpd  %xmm0,%xmm6
pcmpeqd %xmm1,%xmm1
psubd  %xmm1,%xmm3
cvtdq2pd %xmm3,%xmm1
mulpd  %xmm4,%xmm1
subpd  %xmm0,%xmm1
divpd  %xmm1,%xmm6
movapd %xmm6,%xmm1
unpckhpd %xmm6,%xmm1
imul   %ebp,%ecx
lea    (%rcx,%rax,1),%edx
ucomisd %xmm6,%xmm1
movslq %edx,%rdx
movsd  (%r14,%rdx,8),%xmm2
jae    12f3 <V3DHFGetHeightFromWorldPosition+0x1d3>
movd   %xmm3,%edx
cmp    %ebp,%edx
jae    1319 <V3DHFGetHeightFromWorldPosition+0x1f9>
add    %edx,%ecx
movslq %ecx,%rax
movsd  (%r14,%rax,8),%xmm4
pshufd $0x55,%xmm3,%xmm0
movd   %xmm0,%ecx
mov    %edx,%eax
movapd %xmm4,%xmm0
jmp    132a <V3DHFGetHeightFromWorldPosition+0x20a>
xorpd  %xmm0,%xmm0
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
movapd %xmm5,%xmm0
jmp    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>
pshufd $0x55,%xmm3,%xmm0
movd   %xmm0,%esi
movd   %xmm3,%edx
cmp    %ebx,%esi
jae    1367 <V3DHFGetHeightFromWorldPosition+0x247>
imul   %ebp,%esi
add    %esi,%eax
cltq
movsd  (%r14,%rax,8),%xmm0
mov    %esi,%ecx
movapd %xmm0,%xmm3
jmp    136f <V3DHFGetHeightFromWorldPosition+0x24f>
pshufd $0x55,%xmm3,%xmm0
movd   %xmm0,%ecx
movapd %xmm2,%xmm4
movapd %xmm2,%xmm0
cmp    %ebx,%ecx
jae    1345 <V3DHFGetHeightFromWorldPosition+0x225>
pshufd $0x55,%xmm3,%xmm0
movd   %xmm0,%ecx
imul   %ebp,%ecx
add    %eax,%ecx
movslq %ecx,%rax
movsd  (%r14,%rax,8),%xmm0
subsd  %xmm4,%xmm2
subsd  %xmm4,%xmm0
movsd  0xccb(%rip),%xmm3
subsd  %xmm6,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm0
jmp    139e <V3DHFGetHeightFromWorldPosition+0x27e>
movapd %xmm2,%xmm0
movapd %xmm2,%xmm3
cmp    %ebp,%edx
jae    137e <V3DHFGetHeightFromWorldPosition+0x25e>
add    %edx,%ecx
movslq %ecx,%rax
movsd  (%r14,%rax,8),%xmm3
subsd  %xmm0,%xmm3
subsd  %xmm0,%xmm2
mulsd  %xmm6,%xmm3
addsd  %xmm0,%xmm3
movsd  0xc8a(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm5,%xmm0
jmp    12e4 <V3DHFGetHeightFromWorldPosition+0x1c4>

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

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