#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 CrossWind(double, double);
int /*<<< orphan*/ DegtoRad(double);
double HeadWind(double, double);
double RadtoMOA(int /*<<< orphan*/);
double Windage(double, double, double, double);
int /*<<< orphan*/ atan(double);
double cos(int /*<<< orphan*/);
scalar_t__ fabs(int);
scalar_t__ malloc(int);
double pow(double, double);
double retard(int, double, double);
double sin(int /*<<< orphan*/);
int SolveAll(int DragFunction, double DragCoefficient, double Vi,
             double SightHeight, double ShootingAngle, double ZAngle,
             double WindSpeed, double WindAngle, double **Solution) {
  double *ptr;
  ptr = (double *)malloc(10 * 50001 * sizeof(double) + 2048);
  double t = 0;
  double dt = 0.5 / Vi;
  double v = 0;
  double vx = 0, vx1 = 0, vy = 0, vy1 = 0;
  double dv = 0, dvx = 0, dvy = 0;
  double x = 0, y = 0;
  double headwind = HeadWind(WindSpeed, WindAngle);
  double crosswind = CrossWind(WindSpeed, WindAngle);
  double Gy = (-32.194) * cos(DegtoRad((ShootingAngle + ZAngle)));
  double Gx = (-32.194) * sin(DegtoRad((ShootingAngle + ZAngle)));
  vx = Vi * cos(DegtoRad(ZAngle));
  vy = Vi * sin(DegtoRad(ZAngle));
  y = -SightHeight / 12;
  int n = 0;
  for (t = 0;; t = t + dt) {
    vx1 = vx, vy1 = vy;
    v = pow(pow(vx, 2) + pow(vy, 2), 0.5);
    dt = 0.5 / v;
    dv = retard(DragFunction, DragCoefficient, v + headwind);
    dvx = -(vx / v) * dv;
    dvy = -(vy / v) * dv;
    vx = vx + dt * dvx + dt * Gx;
    vy = vy + dt * dvy + dt * Gy;
    if (x / 3 >= n) {
      ptr[10 * n + 0] = x / 3;
      ptr[10 * n + 1] = y * 12;
      ptr[10 * n + 2] = -RadtoMOA(atan(y / x));
      ptr[10 * n + 3] = t + dt;
      ptr[10 * n + 4] = Windage(crosswind, Vi, x, t + dt);
      ptr[10 * n + 5] = RadtoMOA(atan(ptr[10 * n + 4]));
      ptr[10 * n + 6] = v;
      ptr[10 * n + 7] = vx;
      ptr[10 * n + 8] = vy;
      ptr[10 * n + 9] = 0;
      n++;
    }
    x = x + dt * (vx + vx1) / 2;
    y = y + dt * (vy + vy1) / 2;
    if (fabs(vy) > fabs(3 * vx))
      break;
    if (n >= 50001 + 1)
      break;
  }
  ptr[10 * 50001 + 1] = (double)n;
  *Solution = ptr;
  return n;
}


x86 assembly (clang, -O0):
<SolveAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %edi,-0x4(%rbp)
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)
mov    %rsi,-0x48(%rbp)
mov    $0x3d1150,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdfd(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
call   10c0 <HeadWind@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
call   10e0 <CrossWind@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xd3a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xd0d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xc71(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movl   $0x0,-0xd4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  0xc4f(%rip),%xmm1
call   1090 <pow@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  0xc35(%rip),%xmm1
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  0xc09(%rip),%xmm1
call   1090 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  0xbf7(%rip),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
addsd  -0xb8(%rbp),%xmm1
ff
call   10b0 <retard@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0xd0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0xc8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xaf9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0xd4(%rbp),%xmm1
ff
ucomisd %xmm1,%xmm0
jb     16d9 <SolveAll+0x519>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xad3(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xa99(%rip),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb0(%rbp),%xmm0
ff
divsd  -0xa8(%rbp),%xmm0
ff
call   1050 <atan@plt>
mov    %eax,%edi
call   10d0 <RadtoMOA@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x58(%rbp),%xmm3
addsd  -0x60(%rbp),%xmm3
call   10a0 <Windage@plt>
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1050 <atan@plt>
mov    %eax,%edi
call   10d0 <RadtoMOA@plt>
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x7,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
imul   $0xa,-0xd4(%rbp),%ecx
add    $0x9,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
addsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x924(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
addsd  -0x88(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0x8ee(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
cvttsd2si -0x80(%rbp),%edi
call   1030 <fabs@plt>
mov    %rax,-0xf8(%rbp)
movsd  0x8bd(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    -0xf8(%rbp),%rax
cmp    %rcx,%rax
jle    1781 <SolveAll+0x5c1>
jmp    17af <SolveAll+0x5ef>
cmpl   $0xc352,-0xd4(%rbp)
jl     1796 <SolveAll+0x5d6>
jmp    17af <SolveAll+0x5ef>
jmp    179b <SolveAll+0x5db>
movsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    13ad <SolveAll+0x1ed>
cvtsi2sdl -0xd4(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
movsd  %xmm0,0x3d0958(%rax)
mov    -0x50(%rbp),%rcx
mov    -0x48(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xd4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SolveAll>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xb0,%rsp
mov    %rsi,%r14
movsd  %xmm6,0x40(%rsp)
movsd  %xmm5,0x30(%rsp)
movsd  %xmm4,(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movaps %xmm1,0x80(%rsp)
movsd  %xmm0,0x78(%rsp)
mov    %edi,%r15d
mov    $0x3d1150,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
movsd  0x30(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
call   10c0 <HeadWind@plt>
movsd  %xmm0,0x70(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
call   10e0 <CrossWind@plt>
movsd  %xmm0,0x68(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1080 <cos@plt>
movapd %xmm0,0x50(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movapd 0x50(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  0xd7e(%rip),%xmm1
movapd %xmm1,0x50(%rsp)
movsd  (%rsp),%xmm0
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1080 <cos@plt>
movaps %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1060 <DegtoRad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
unpcklpd 0x10(%rsp),%xmm0
movapd 0x80(%rsp),%xmm2
unpcklpd %xmm2,%xmm2
movsd  0x8(%rsp),%xmm1
divsd  0xd50(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mulpd  %xmm0,%xmm2
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd3b(%rip),%xmm3
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
nopw   0x0(%rax,%rax,1)
movapd %xmm2,0x40(%rsp)
movapd %xmm2,%xmm1
mulpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm3,%xmm1
call   1090 <pow@plt>
movapd %xmm0,0x30(%rsp)
movsd  0xcf7(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp)
movsd  0x70(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    %r15d,%edi
movsd  0x78(%rsp),%xmm0
call   10b0 <retard@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd 0x40(%rsp),%xmm4
movapd %xmm4,%xmm2
divpd  %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
mulpd  %xmm2,%xmm0
movapd 0x10(%rsp),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm3,%xmm0
movapd %xmm4,%xmm1
subpd  %xmm0,%xmm1
mulpd  0x50(%rsp),%xmm3
addpd  %xmm1,%xmm3
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
divsd  0xc85(%rip),%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
movapd %xmm3,0x90(%rsp)
movapd %xmm1,0xa0(%rsp)
jb     14a1 <SolveAll+0x2e1>
lea    0x0(%rbp,%rbp,1),%eax
lea    (%rax,%rax,4),%eax
movslq %eax,%rbx
movsd  %xmm0,(%r12,%rbx,8)
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0xc47(%rip),%xmm0
mov    %ebx,%eax
or     $0x1,%eax
cltq
movsd  %xmm0,(%r12,%rax,8)
movapd %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm2,(%rsp)
call   1050 <atan@plt>
mov    %eax,%edi
call   10d0 <RadtoMOA@plt>
xorpd  0xbf1(%rip),%xmm0
movlpd %xmm0,0x10(%r12,%rbx,8)
movsd  0x28(%rsp),%xmm3
addsd  0x10(%rsp),%xmm3
movsd  %xmm3,0x18(%r12,%rbx,8)
movsd  0x68(%rsp),%xmm0
movapd 0x80(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   10a0 <Windage@plt>
movsd  %xmm0,0x20(%r12,%rbx,8)
call   1050 <atan@plt>
mov    %eax,%edi
call   10d0 <RadtoMOA@plt>
movapd 0x90(%rsp),%xmm3
movsd  %xmm0,0x28(%r12,%rbx,8)
movaps 0x30(%rsp),%xmm0
movsd  %xmm0,0x30(%r12,%rbx,8)
movapd 0xa0(%rsp),%xmm0
unpcklpd %xmm3,%xmm0
movupd %xmm0,0x38(%r12,%rbx,8)
movq   $0x0,0x48(%r12,%rbx,8)
add    $0x1,%ebp
cvttsd2si %xmm3,%edi
call   1030 <fabs@plt>
mov    %rax,%rbx
movapd 0xa0(%rsp),%xmm0
mulsd  0xb72(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
cmp    %rax,%rbx
jg     1544 <SolveAll+0x384>
cmp    $0xc351,%ebp
jg     1544 <SolveAll+0x384>
movapd 0x40(%rsp),%xmm2
movapd 0x90(%rsp),%xmm5
addpd  %xmm5,%xmm2
movapd 0x10(%rsp),%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xb2b(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
unpckhpd %xmm2,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm2
movsd  (%rsp),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
addsd  %xmm4,%xmm0
movsd  %xmm0,0x28(%rsp)
movapd %xmm5,%xmm2
jmp    1300 <SolveAll+0x140>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x3d0958(%r12)
mov    %r12,(%r14)
mov    %ebp,%eax
add    $0xb0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SolveAll(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double** %8) {
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%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 double
%24 = alloca double
%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
store i32 %0, i32* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double** %8, double*** %18
%37 = call i64 @malloc(i32 4002128)
%38 = inttoptr i64 %37 to double*
store double* %38, double** %19
store double 0.000000e+00, double* %20
%39 = load double, double* %12
%40 = fdiv double 5.000000e-01, %39
store double %40, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %27
store double 0.000000e+00, double* %28
store double 0.000000e+00, double* %29
store double 0.000000e+00, double* %30
store double 0.000000e+00, double* %31
%41 = load double, double* %16
%42 = load double, double* %17
%43 = call double @HeadWind(double %41, double %42)
store double %43, double* %32
%44 = load double, double* %16
%45 = load double, double* %17
%46 = call double @CrossWind(double %44, double %45)
store double %46, double* %33
%47 = load double, double* %14
%48 = load double, double* %15
%49 = fadd double %47, %48
%50 = call i32 @DegtoRad(double %49)
%51 = call double @cos(i32 %50)
%52 = fmul double -3.219400e+01, %51
store double %52, double* %34
%53 = load double, double* %14
%54 = load double, double* %15
%55 = fadd double %53, %54
%56 = call i32 @DegtoRad(double %55)
%57 = call double @sin(i32 %56)
%58 = fmul double -3.219400e+01, %57
store double %58, double* %35
%59 = load double, double* %12
%60 = load double, double* %15
%61 = call i32 @DegtoRad(double %60)
%62 = call double @cos(i32 %61)
%63 = fmul double %59, %62
store double %63, double* %23
%64 = load double, double* %12
%65 = load double, double* %15
%66 = call i32 @DegtoRad(double %65)
%67 = call double @sin(i32 %66)
%68 = fmul double %64, %67
store double %68, double* %25
%69 = load double, double* %13
%70 = fneg double %69
%71 = fdiv double %70, 1.200000e+01
store double %71, double* %31
store i32 0, i32* %36
store double 0.000000e+00, double* %20
br label %72
72: ; preds = %246, %9
%73 = load double, double* %23
store double %73, double* %24
%74 = load double, double* %25
store double %74, double* %26
%75 = load double, double* %23
%76 = call double @pow(double %75, double 2.000000e+00)
%77 = load double, double* %25
%78 = call double @pow(double %77, double 2.000000e+00)
%79 = fadd double %76, %78
%80 = call double @pow(double %79, double 5.000000e-01)
store double %80, double* %22
%81 = load double, double* %22
%82 = fdiv double 5.000000e-01, %81
store double %82, double* %21
%83 = load i32, i32* %10
%84 = load double, double* %11
%85 = load double, double* %22
%86 = load double, double* %32
%87 = fadd double %85, %86
%88 = call double @retard(i32 %83, double %84, double %87)
store double %88, double* %27
%89 = load double, double* %23
%90 = load double, double* %22
%91 = fdiv double %89, %90
%92 = fneg double %91
%93 = load double, double* %27
%94 = fmul double %92, %93
store double %94, double* %28
%95 = load double, double* %25
%96 = load double, double* %22
%97 = fdiv double %95, %96
%98 = fneg double %97
%99 = load double, double* %27
%100 = fmul double %98, %99
store double %100, double* %29
%101 = load double, double* %23
%102 = load double, double* %21
%103 = load double, double* %28
%104 = call double @llvm.fmuladd.f64(double %102, double %103, double %101)
%105 = load double, double* %21
%106 = load double, double* %35
%107 = call double @llvm.fmuladd.f64(double %105, double %106, double %104)
store double %107, double* %23
%108 = load double, double* %25
%109 = load double, double* %21
%110 = load double, double* %29
%111 = call double @llvm.fmuladd.f64(double %109, double %110, double %108)
%112 = load double, double* %21
%113 = load double, double* %34
%114 = call double @llvm.fmuladd.f64(double %112, double %113, double %111)
store double %114, double* %25
%115 = load double, double* %30
%116 = fdiv double %115, 3.000000e+00
%117 = load i32, i32* %36
%118 = sitofp i32 %117 to double
%119 = fcmp oge double %116, %118
br i1 %119, label %120, label %215
120: ; preds = %72
%121 = load double, double* %30
%122 = fdiv double %121, 3.000000e+00
%123 = load double*, double** %19
%124 = load i32, i32* %36
%125 = mul nsw i32 10, %124
%126 = add nsw i32 %125, 0
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %123, i64 %127
store double %122, double* %128
%129 = load double, double* %31
%130 = fmul double %129, 1.200000e+01
%131 = load double*, double** %19
%132 = load i32, i32* %36
%133 = mul nsw i32 10, %132
%134 = add nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %131, i64 %135
store double %130, double* %136
%137 = load double, double* %31
%138 = load double, double* %30
%139 = fdiv double %137, %138
%140 = call i32 @atan(double %139)
%141 = call double @RadtoMOA(i32 %140)
%142 = fneg double %141
%143 = load double*, double** %19
%144 = load i32, i32* %36
%145 = mul nsw i32 10, %144
%146 = add nsw i32 %145, 2
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %143, i64 %147
store double %142, double* %148
%149 = load double, double* %20
%150 = load double, double* %21
%151 = fadd double %149, %150
%152 = load double*, double** %19
%153 = load i32, i32* %36
%154 = mul nsw i32 10, %153
%155 = add nsw i32 %154, 3
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %152, i64 %156
store double %151, double* %157
%158 = load double, double* %33
%159 = load double, double* %12
%160 = load double, double* %30
%161 = load double, double* %20
%162 = load double, double* %21
%163 = fadd double %161, %162
%164 = call double @Windage(double %158, double %159, double %160, double %163)
%165 = load double*, double** %19
%166 = load i32, i32* %36
%167 = mul nsw i32 10, %166
%168 = add nsw i32 %167, 4
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %165, i64 %169
store double %164, double* %170
%171 = load double*, double** %19
%172 = load i32, i32* %36
%173 = mul nsw i32 10, %172
%174 = add nsw i32 %173, 4
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double, double* %171, i64 %175
%177 = load double, double* %176
%178 = call i32 @atan(double %177)
%179 = call double @RadtoMOA(i32 %178)
%180 = load double*, double** %19
%181 = load i32, i32* %36
%182 = mul nsw i32 10, %181
%183 = add nsw i32 %182, 5
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %180, i64 %184
store double %179, double* %185
%186 = load double, double* %22
%187 = load double*, double** %19
%188 = load i32, i32* %36
%189 = mul nsw i32 10, %188
%190 = add nsw i32 %189, 6
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds double, double* %187, i64 %191
store double %186, double* %192
%193 = load double, double* %23
%194 = load double*, double** %19
%195 = load i32, i32* %36
%196 = mul nsw i32 10, %195
%197 = add nsw i32 %196, 7
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %194, i64 %198
store double %193, double* %199
%200 = load double, double* %25
%201 = load double*, double** %19
%202 = load i32, i32* %36
%203 = mul nsw i32 10, %202
%204 = add nsw i32 %203, 8
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds double, double* %201, i64 %205
store double %200, double* %206
%207 = load double*, double** %19
%208 = load i32, i32* %36
%209 = mul nsw i32 10, %208
%210 = add nsw i32 %209, 9
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %207, i64 %211
store double 0.000000e+00, double* %212
%213 = load i32, i32* %36
%214 = add nsw i32 %213, 1
store i32 %214, i32* %36
br label %215
215: ; preds = %120, %72
%216 = load double, double* %30
%217 = load double, double* %21
%218 = load double, double* %23
%219 = load double, double* %24
%220 = fadd double %218, %219
%221 = fmul double %217, %220
%222 = fdiv double %221, 2.000000e+00
%223 = fadd double %216, %222
store double %223, double* %30
%224 = load double, double* %31
%225 = load double, double* %21
%226 = load double, double* %25
%227 = load double, double* %26
%228 = fadd double %226, %227
%229 = fmul double %225, %228
%230 = fdiv double %229, 2.000000e+00
%231 = fadd double %224, %230
store double %231, double* %31
%232 = load double, double* %25
%233 = fptosi double %232 to i32
%234 = call i64 @fabs(i32 %233)
%235 = load double, double* %23
%236 = fmul double 3.000000e+00, %235
%237 = fptosi double %236 to i32
%238 = call i64 @fabs(i32 %237)
%239 = icmp sgt i64 %234, %238
br i1 %239, label %240, label %241
240: ; preds = %215
br label %250
241: ; preds = %215
%242 = load i32, i32* %36
%243 = icmp sge i32 %242, 50002
br i1 %243, label %244, label %245
244: ; preds = %241
br label %250
245: ; preds = %241
br label %246
246: ; preds = %245
%247 = load double, double* %20
%248 = load double, double* %21
%249 = fadd double %247, %248
store double %249, double* %20
br label %72
250: ; preds = %244, %240
%251 = load i32, i32* %36
%252 = sitofp i32 %251 to double
%253 = load double*, double** %19
%254 = getelementptr inbounds double, double* %253, i64 500011
store double %252, double* %254
%255 = load double*, double** %19
%256 = load double**, double*** %18
store double* %255, double** %256
%257 = load i32, i32* %36
ret i32 %257
}

LLVM IR (-O2):
define i32 @SolveAll(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double** nocapture writeonly %8) {
%10 = tail call i64 @malloc(i32 4002128)
%11 = inttoptr i64 %10 to double*
%12 = tail call double @HeadWind(double %6, double %7)
%13 = tail call double @CrossWind(double %6, double %7)
%14 = fadd double %4, %5
%15 = tail call i32 @DegtoRad(double %14)
%16 = tail call double @cos(i32 %15)
%17 = tail call i32 @DegtoRad(double %14)
%18 = tail call double @sin(i32 %17)
%19 = insertelement <2 x double> poison, double %16, i64 0
%20 = insertelement <2 x double> %19, double %18, i64 1
%21 = fmul <2 x double> %20, <double -3.219400e+01, double -3.219400e+01>
%22 = tail call i32 @DegtoRad(double %5)
%23 = tail call double @cos(i32 %22)
%24 = tail call i32 @DegtoRad(double %5)
%25 = tail call double @sin(i32 %24)
%26 = insertelement <2 x double> poison, double %25, i64 0
%27 = insertelement <2 x double> %26, double %23, i64 1
%28 = insertelement <2 x double> poison, double %2, i64 0
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
%30 = fmul <2 x double> %27, %29
%31 = fdiv double %3, -1.200000e+01
br label %32
32: ; preds = %115, %9
%33 = phi double [ 0.000000e+00, %9 ], [ %125, %115 ]
%34 = phi double [ %31, %9 ], [ %120, %115 ]
%35 = phi double [ 0.000000e+00, %9 ], [ %126, %115 ]
%36 = phi i32 [ 0, %9 ], [ %104, %115 ]
%37 = phi <2 x double> [ %30, %9 ], [ %56, %115 ]
%38 = fmul <2 x double> %37, %37
%39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%40 = fadd <2 x double> %38, %39
%41 = extractelement <2 x double> %40, i64 0
%42 = tail call double @pow(double %41, double 5.000000e-01)
%43 = fdiv double 5.000000e-01, %42
%44 = fadd double %12, %42
%45 = tail call double @retard(i32 %0, double %1, double %44)
%46 = fneg <2 x double> %37
%47 = insertelement <2 x double> poison, double %42, i64 0
%48 = shufflevector <2 x double> %47, <2 x double> poison, <2 x i32> zeroinitializer
%49 = fdiv <2 x double> %46, %48
%50 = insertelement <2 x double> poison, double %45, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> zeroinitializer
%52 = fmul <2 x double> %49, %51
%53 = insertelement <2 x double> poison, double %43, i64 0
%54 = shufflevector <2 x double> %53, <2 x double> poison, <2 x i32> zeroinitializer
%55 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %54, <2 x double> %52, <2 x double> %37)
%56 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %54, <2 x double> %21, <2 x double> %55)
%57 = fdiv double %33, 3.000000e+00
%58 = sitofp i32 %36 to double
%59 = fcmp ult double %57, %58
br i1 %59, label %103, label %60
60: ; preds = %32
%61 = mul nsw i32 %36, 10
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %11, i64 %62
store double %57, double* %63
%64 = fmul double %34, 1.200000e+01
%65 = or i32 %61, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %11, i64 %66
store double %64, double* %67
%68 = fdiv double %34, %33
%69 = tail call i32 @atan(double %68)
%70 = tail call double @RadtoMOA(i32 %69)
%71 = fneg double %70
%72 = add nsw i32 %61, 2
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %11, i64 %73
store double %71, double* %74
%75 = fadd double %35, %43
%76 = add nsw i32 %61, 3
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %11, i64 %77
store double %75, double* %78
%79 = tail call double @Windage(double %13, double %2, double %33, double %75)
%80 = add nsw i32 %61, 4
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %11, i64 %81
store double %79, double* %82
%83 = tail call i32 @atan(double %79)
%84 = tail call double @RadtoMOA(i32 %83)
%85 = add nsw i32 %61, 5
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %11, i64 %86
store double %84, double* %87
%88 = add nsw i32 %61, 6
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %11, i64 %89
store double %42, double* %90
%91 = add nsw i32 %61, 7
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %11, i64 %92
%94 = extractelement <2 x double> %56, i64 1
store double %94, double* %93
%95 = add nsw i32 %61, 8
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %11, i64 %96
%98 = extractelement <2 x double> %56, i64 0
store double %98, double* %97
%99 = add nsw i32 %61, 9
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %11, i64 %100
store double 0.000000e+00, double* %101
%102 = add nsw i32 %36, 1
br label %103
103: ; preds = %60, %32
%104 = phi i32 [ %102, %60 ], [ %36, %32 ]
%105 = extractelement <2 x double> %56, i64 0
%106 = fptosi double %105 to i32
%107 = tail call i64 @fabs(i32 %106)
%108 = extractelement <2 x double> %56, i64 1
%109 = fmul double %108, 3.000000e+00
%110 = fptosi double %109 to i32
%111 = tail call i64 @fabs(i32 %110)
%112 = icmp sgt i64 %107, %111
%113 = icmp sgt i32 %104, 50001
%114 = select i1 %112, i1 true, i1 %113
br i1 %114, label %127, label %115
115: ; preds = %103
%116 = fadd <2 x double> %37, %56
%117 = extractelement <2 x double> %116, i64 0
%118 = fmul double %43, %117
%119 = fmul double %118, 5.000000e-01
%120 = fadd double %34, %119
%121 = fadd <2 x double> %37, %56
%122 = extractelement <2 x double> %121, i64 1
%123 = fmul double %43, %122
%124 = fmul double %123, 5.000000e-01
%125 = fadd double %33, %124
%126 = fadd double %35, %43
br label %32
127: ; preds = %103
%128 = sitofp i32 %104 to double
%129 = getelementptr inbounds double, double* %11, i64 500011
store double %128, double* %129
store double* %11, double** %8
ret i32 %104
}