#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 MIN(double, double);
double acos(int /*<<< orphan*/);
double asin(double);
double atan(double);
int /*<<< orphan*/ copysign(double, double);
double cos(double);
double fabs(double);
int /*<<< orphan*/ printf(char *, double, double, double);
double sin(double);
double sqrt(double);
void disazi(float rearth, double lateq, double loneq, double latst,
            double lonst, double *xnorth, double *yeast) {
  int iangle;
  double latb, lonb, latc, lonc, angleb, anglec;
  double dis, a, b, c, s, aa;
  double PI = 4.0 * atan(1.0);
  double PI2 = 2 * PI;
  double DEGTORAD = 1.745329252e-02;
  latb = lateq * DEGTORAD;
  lonb = loneq * DEGTORAD;
  latc = latst * DEGTORAD;
  lonc = lonst * DEGTORAD;
  if (lonb < 0.0) {
    lonb = lonb + PI2;
  }
  if (lonc < 0.0) {
    lonc = lonc + PI2;
  }
  b = 0.5 * PI - latb;
  c = 0.5 * PI - latc;
  if (lonc > lonb) {
    aa = lonc - lonb;
    if (aa <= PI) {
      iangle = 1;
    } else {
      aa = PI2 - aa;
      iangle = -1;
    }
  } else {
    aa = lonb - lonc;
    if (aa <= PI) {
      iangle = -1;
    } else {
      aa = PI2 - aa;
      iangle = 1;
    }
  }
  s = cos(b) * cos(c) + sin(b) * sin(c) * cos(aa);
  a = acos(copysign(MIN(fabs(s), 1.0), s));
  dis = a * rearth;
  printf("s=%lf, a=%lf ,term=%lf\n", s, a, fabs(s));
  if (a * b * c == 0.0) {
    angleb = 0.0;
    anglec = 0.0;
  } else {
    s = 0.5 * (a + b + c);
    a = MIN(a, s);
    b = MIN(b, s);
    c = MIN(c, s);
    anglec =
        2.0 * asin(MIN(1.0, sqrt(sin(s - a) * sin(s - b) / (sin(a) * sin(b)))));
    angleb =
        2.0 * asin(MIN(1.0, sqrt(sin(s - a) * sin(s - c) / (sin(a) * sin(c)))));
    if (iangle == 1) {
      angleb = PI2 - angleb;
    } else {
      anglec = PI2 - anglec;
    }
  }
  *xnorth = dis * cos(anglec);
  *yeast = dis * sin(anglec);
}


x86 assembly (clang, -O0):
<disazi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
movsd  0xe54(%rip),%xmm0
call   1070 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe3c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xe20(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xe00(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    1270 <disazi+0xe0>
movsd  -0x50(%rbp),%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    1290 <disazi+0x100>
movsd  -0x60(%rbp),%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xd64(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xd28(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    1374 <disazi+0x1e4>
movsd  -0x60(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1350 <disazi+0x1c0>
movl   $0x1,-0x3c(%rbp)
jmp    136f <disazi+0x1df>
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0xffffffff,-0x3c(%rbp)
jmp    13d0 <disazi+0x240>
movsd  -0x50(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     13ac <disazi+0x21c>
movl   $0xffffffff,-0x3c(%rbp)
jmp    13cb <disazi+0x23b>
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x1,-0x3c(%rbp)
jmp    13d0 <disazi+0x240>
movsd  -0x88(%rbp),%xmm0
ff
call   10a0 <cos@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
call   10a0 <cos@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   1060 <sin@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
call   10a0 <cos@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  -0xc8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movaps 0xbb2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xb8e(%rip),%xmm1
call   1030 <MIN@plt>
movsd  -0x98(%rbp),%xmm1
ff
call   1090 <copysign@plt>
mov    %eax,%edi
call   1050 <acos@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm2
ff
movaps 0xb55(%rip),%xmm3
pand   %xmm3,%xmm2
lea    0xb5a(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x80(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x90(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1528 <disazi+0x398>
jp     1528 <disazi+0x398>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1736 <disazi+0x5a6>
movsd  -0x80(%rbp),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
addsd  -0x90(%rbp),%xmm1
ff
movsd  0xadb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
call   1030 <MIN@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
call   1030 <MIN@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
call   1030 <MIN@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   1060 <sin@plt>
movsd  -0x100(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   10b0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0x9e6(%rip),%xmm0
call   1030 <MIN@plt>
call   1080 <asin@plt>
movaps %xmm0,%xmm1
movsd  0x9c1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x90(%rbp),%xmm0
ff
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
call   1060 <sin@plt>
movsd  -0xe8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   10b0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0x938(%rip),%xmm0
call   1030 <MIN@plt>
call   1080 <asin@plt>
movaps %xmm0,%xmm1
movsd  0x913(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x1,-0x3c(%rbp)
jne    171f <disazi+0x58f>
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1731 <disazi+0x5a1>
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1736 <disazi+0x5a6>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
call   10a0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x110(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disazi>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movaps %xmm4,0x30(%rsp)
movsd  %xmm3,0x8(%rsp)
movaps %xmm2,0x10(%rsp)
movsd  %xmm1,0x28(%rsp)
movss  %xmm0,0x50(%rsp)
movsd  0xe3e(%rip),%xmm0
call   1070 <atan@plt>
movapd 0x30(%rsp),%xmm3
unpcklpd 0x10(%rsp),%xmm3
mulpd  0xe65(%rip),%xmm3
xorpd  %xmm0,%xmm0
movapd %xmm3,%xmm1
cmpltpd %xmm0,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm3,%xmm0
addpd  0xe58(%rip),%xmm3
andpd  %xmm1,%xmm3
orpd   %xmm0,%xmm3
movsd  0xe00(%rip),%xmm2
movsd  0x28(%rsp),%xmm4
mulsd  %xmm2,%xmm4
movsd  0xdf6(%rip),%xmm1
movapd %xmm1,%xmm0
subsd  %xmm4,%xmm0
movsd  0x8(%rsp),%xmm4
mulsd  %xmm2,%xmm4
subsd  %xmm4,%xmm1
pshufd $0xee,%xmm3,%xmm2
ucomisd %xmm2,%xmm3
movsd  %xmm1,0x8(%rsp)
jbe    126c <disazi+0xdc>
subsd  %xmm2,%xmm3
mov    $0x1,%bpl
movsd  0xdc8(%rip),%xmm1
ucomisd %xmm3,%xmm1
jae    1295 <disazi+0x105>
movsd  0xdc2(%rip),%xmm1
subsd  %xmm3,%xmm1
movapd %xmm1,0x10(%rsp)
xor    %ebp,%ebp
jmp    12a5 <disazi+0x115>
subsd  %xmm3,%xmm2
movsd  0xda0(%rip),%xmm1
ucomisd %xmm2,%xmm1
jae    129d <disazi+0x10d>
movsd  0xd9a(%rip),%xmm1
subsd  %xmm2,%xmm1
mov    $0x1,%bpl
movapd %xmm1,0x10(%rsp)
jmp    12a5 <disazi+0x115>
movapd %xmm3,0x10(%rsp)
jmp    12a5 <disazi+0x115>
xor    %ebp,%ebp
movapd %xmm2,0x10(%rsp)
movsd  %xmm0,0x28(%rsp)
call   10a0 <cos@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x28(%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movapd 0x10(%rsp),%xmm0
call   10a0 <cos@plt>
mulsd  0x48(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm1
addsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movapd 0xd42(%rip),%xmm2
andpd  %xmm0,%xmm2
movapd %xmm2,0x30(%rsp)
movsd  0xcd0(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <MIN@plt>
movaps 0x10(%rsp),%xmm1
call   1090 <copysign@plt>
mov    %eax,%edi
call   1050 <acos@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x20(%rsp)
movss  0x50(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rsp)
lea    0xd01(%rip),%rdi
movapd 0x10(%rsp),%xmm0
movaps 0x30(%rsp),%xmm2
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm5
movsd  0x28(%rsp),%xmm2
movsd  0x8(%rsp),%xmm4
movapd %xmm2,%xmm3
mulsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    13ad <disazi+0x21d>
jnp    1560 <disazi+0x3d0>
movapd %xmm5,%xmm1
addsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
mulsd  0xc67(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movapd %xmm5,%xmm0
call   1030 <MIN@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <MIN@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <MIN@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
call   1060 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0x58(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     1481 <disazi+0x2f1>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    148a <disazi+0x2fa>
call   10b0 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0xb6e(%rip),%xmm0
call   1030 <MIN@plt>
call   1080 <asin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x48(%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x30(%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0x30(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd 0xb30(%rip),%xmm1
jb     1513 <disazi+0x383>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    151c <disazi+0x38c>
call   10b0 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0xadc(%rip),%xmm0
call   1030 <MIN@plt>
movsd  0xaff(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1594 <disazi+0x404>
ucomisd 0xac1(%rip),%xmm0
ja     1594 <disazi+0x404>
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
test   %bpl,%bpl
jne    1560 <disazi+0x3d0>
movsd  0xac8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   10a0 <cos@plt>
mulsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
call   1080 <asin@plt>
jmp    1541 <disazi+0x3b1>

LLVM IR (-O0):
@.str = [24 x i8] c"s=%lf, a=%lf ,term=%lf\0A\00"
define void @disazi(float %0, double %1, double %2, double %3, double %4, double* %5, double* %6) {
%8 = alloca float
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%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
store float %0, float* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double* %5, double** %13
store double* %6, double** %14
%31 = call double @atan(double 1.000000e+00)
%32 = fmul double 4.000000e+00, %31
store double %32, double* %28
%33 = load double, double* %28
%34 = fmul double 2.000000e+00, %33
store double %34, double* %29
store double 0x3F91DF46A252DD11, double* %30
%35 = load double, double* %9
%36 = load double, double* %30
%37 = fmul double %35, %36
store double %37, double* %16
%38 = load double, double* %10
%39 = load double, double* %30
%40 = fmul double %38, %39
store double %40, double* %17
%41 = load double, double* %11
%42 = load double, double* %30
%43 = fmul double %41, %42
store double %43, double* %18
%44 = load double, double* %12
%45 = load double, double* %30
%46 = fmul double %44, %45
store double %46, double* %19
%47 = load double, double* %17
%48 = fcmp olt double %47, 0.000000e+00
br i1 %48, label %49, label %53
49: ; preds = %7
%50 = load double, double* %17
%51 = load double, double* %29
%52 = fadd double %50, %51
store double %52, double* %17
br label %53
53: ; preds = %49, %7
%54 = load double, double* %19
%55 = fcmp olt double %54, 0.000000e+00
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = load double, double* %19
%58 = load double, double* %29
%59 = fadd double %57, %58
store double %59, double* %19
br label %60
60: ; preds = %56, %53
%61 = load double, double* %28
%62 = load double, double* %16
%63 = fneg double %62
%64 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %61, double %63)
store double %64, double* %24
%65 = load double, double* %28
%66 = load double, double* %18
%67 = fneg double %66
%68 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %65, double %67)
store double %68, double* %25
%69 = load double, double* %19
%70 = load double, double* %17
%71 = fcmp ogt double %69, %70
br i1 %71, label %72, label %85
72: ; preds = %60
%73 = load double, double* %19
%74 = load double, double* %17
%75 = fsub double %73, %74
store double %75, double* %27
%76 = load double, double* %27
%77 = load double, double* %28
%78 = fcmp ole double %76, %77
br i1 %78, label %79, label %80
79: ; preds = %72
store i32 1, i32* %15
br label %84
80: ; preds = %72
%81 = load double, double* %29
%82 = load double, double* %27
%83 = fsub double %81, %82
store double %83, double* %27
store i32 -1, i32* %15
br label %84
84: ; preds = %80, %79
br label %98
85: ; preds = %60
%86 = load double, double* %17
%87 = load double, double* %19
%88 = fsub double %86, %87
store double %88, double* %27
%89 = load double, double* %27
%90 = load double, double* %28
%91 = fcmp ole double %89, %90
br i1 %91, label %92, label %93
92: ; preds = %85
store i32 -1, i32* %15
br label %97
93: ; preds = %85
%94 = load double, double* %29
%95 = load double, double* %27
%96 = fsub double %94, %95
store double %96, double* %27
store i32 1, i32* %15
br label %97
97: ; preds = %93, %92
br label %98
98: ; preds = %97, %84
%99 = load double, double* %24
%100 = call double @cos(double %99)
%101 = load double, double* %25
%102 = call double @cos(double %101)
%103 = load double, double* %24
%104 = call double @sin(double %103)
%105 = load double, double* %25
%106 = call double @sin(double %105)
%107 = fmul double %104, %106
%108 = load double, double* %27
%109 = call double @cos(double %108)
%110 = fmul double %107, %109
%111 = call double @llvm.fmuladd.f64(double %100, double %102, double %110)
store double %111, double* %26
%112 = load double, double* %26
%113 = call double @llvm.fabs.f64(double %112)
%114 = call double @MIN(double %113, double 1.000000e+00)
%115 = load double, double* %26
%116 = call i32 @copysign(double %114, double %115)
%117 = call double @acos(i32 %116)
store double %117, double* %23
%118 = load double, double* %23
%119 = load float, float* %8
%120 = fpext float %119 to double
%121 = fmul double %118, %120
store double %121, double* %22
%122 = load double, double* %26
%123 = load double, double* %23
%124 = load double, double* %26
%125 = call double @llvm.fabs.f64(double %124)
%126 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %122, double %123, double %125)
%127 = load double, double* %23
%128 = load double, double* %24
%129 = fmul double %127, %128
%130 = load double, double* %25
%131 = fmul double %129, %130
%132 = fcmp oeq double %131, 0.000000e+00
br i1 %132, label %133, label %134
133: ; preds = %98
store double 0.000000e+00, double* %20
store double 0.000000e+00, double* %21
br label %199
134: ; preds = %98
%135 = load double, double* %23
%136 = load double, double* %24
%137 = fadd double %135, %136
%138 = load double, double* %25
%139 = fadd double %137, %138
%140 = fmul double 5.000000e-01, %139
store double %140, double* %26
%141 = load double, double* %23
%142 = load double, double* %26
%143 = call double @MIN(double %141, double %142)
store double %143, double* %23
%144 = load double, double* %24
%145 = load double, double* %26
%146 = call double @MIN(double %144, double %145)
store double %146, double* %24
%147 = load double, double* %25
%148 = load double, double* %26
%149 = call double @MIN(double %147, double %148)
store double %149, double* %25
%150 = load double, double* %26
%151 = load double, double* %23
%152 = fsub double %150, %151
%153 = call double @sin(double %152)
%154 = load double, double* %26
%155 = load double, double* %24
%156 = fsub double %154, %155
%157 = call double @sin(double %156)
%158 = fmul double %153, %157
%159 = load double, double* %23
%160 = call double @sin(double %159)
%161 = load double, double* %24
%162 = call double @sin(double %161)
%163 = fmul double %160, %162
%164 = fdiv double %158, %163
%165 = call double @sqrt(double %164)
%166 = call double @MIN(double 1.000000e+00, double %165)
%167 = call double @asin(double %166)
%168 = fmul double 2.000000e+00, %167
store double %168, double* %21
%169 = load double, double* %26
%170 = load double, double* %23
%171 = fsub double %169, %170
%172 = call double @sin(double %171)
%173 = load double, double* %26
%174 = load double, double* %25
%175 = fsub double %173, %174
%176 = call double @sin(double %175)
%177 = fmul double %172, %176
%178 = load double, double* %23
%179 = call double @sin(double %178)
%180 = load double, double* %25
%181 = call double @sin(double %180)
%182 = fmul double %179, %181
%183 = fdiv double %177, %182
%184 = call double @sqrt(double %183)
%185 = call double @MIN(double 1.000000e+00, double %184)
%186 = call double @asin(double %185)
%187 = fmul double 2.000000e+00, %186
store double %187, double* %20
%188 = load i32, i32* %15
%189 = icmp eq i32 %188, 1
br i1 %189, label %190, label %194
190: ; preds = %134
%191 = load double, double* %29
%192 = load double, double* %20
%193 = fsub double %191, %192
store double %193, double* %20
br label %198
194: ; preds = %134
%195 = load double, double* %29
%196 = load double, double* %21
%197 = fsub double %195, %196
store double %197, double* %21
br label %198
198: ; preds = %194, %190
br label %199
199: ; preds = %198, %133
%200 = load double, double* %22
%201 = load double, double* %21
%202 = call double @cos(double %201)
%203 = fmul double %200, %202
%204 = load double*, double** %13
store double %203, double* %204
%205 = load double, double* %22
%206 = load double, double* %21
%207 = call double @sin(double %206)
%208 = fmul double %205, %207
%209 = load double*, double** %14
store double %208, double* %209
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"s=%lf, a=%lf ,term=%lf\0A\00"
define void @disazi(float %0, double %1, double %2, double %3, double %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = tail call double @atan(double 1.000000e+00)
%9 = insertelement <2 x double> poison, double %4, i64 0
%10 = insertelement <2 x double> %9, double %2, i64 1
%11 = fmul <2 x double> %10, <double 0x3F91DF46A252DD11, double 0x3F91DF46A252DD11>
%12 = fcmp olt <2 x double> %11, zeroinitializer
%13 = fadd <2 x double> %11, <double 0x401921FB54442D18, double 0x401921FB54442D18>
%14 = select <2 x i1> %12, <2 x double> %13, <2 x double> %11
%15 = fmul double %1, 0x3F91DF46A252DD11
%16 = fsub double 0x3FF921FB54442D18, %15
%17 = fmul double %3, 0x3F91DF46A252DD11
%18 = fsub double 0x3FF921FB54442D18, %17
%19 = extractelement <2 x double> %14, i64 0
%20 = extractelement <2 x double> %14, i64 1
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %27
22: ; preds = %7
%23 = fsub double %19, %20
%24 = fcmp ugt double %23, 0x400921FB54442D18
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = fsub double 0x401921FB54442D18, %23
br label %32
27: ; preds = %7
%28 = fsub double %20, %19
%29 = fcmp ugt double %28, 0x400921FB54442D18
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = fsub double 0x401921FB54442D18, %28
br label %32
32: ; preds = %27, %22, %30, %25
%33 = phi double [ %26, %25 ], [ %31, %30 ], [ %23, %22 ], [ %28, %27 ]
%34 = phi i1 [ false, %25 ], [ true, %30 ], [ true, %22 ], [ false, %27 ]
%35 = tail call double @cos(double %16)
%36 = tail call double @cos(double %18)
%37 = tail call double @sin(double %16)
%38 = tail call double @sin(double %18)
%39 = fmul double %37, %38
%40 = tail call double @cos(double %33)
%41 = fmul double %39, %40
%42 = tail call double @llvm.fmuladd.f64(double %35, double %36, double %41)
%43 = tail call double @llvm.fabs.f64(double %42)
%44 = tail call double @MIN(double %43, double 1.000000e+00)
%45 = tail call i32 @copysign(double %44, double %42)
%46 = tail call double @acos(i32 %45)
%47 = fpext float %0 to double
%48 = fmul double %46, %47
%49 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %42, double %46, double %43)
%50 = fmul double %16, %46
%51 = fmul double %18, %50
%52 = fcmp oeq double %51, 0.000000e+00
br i1 %52, label %91, label %53
53: ; preds = %32
%54 = fadd double %16, %46
%55 = fadd double %18, %54
%56 = fmul double %55, 5.000000e-01
%57 = tail call double @MIN(double %46, double %56)
%58 = tail call double @MIN(double %16, double %56)
%59 = tail call double @MIN(double %18, double %56)
%60 = fsub double %56, %57
%61 = tail call double @sin(double %60)
%62 = fsub double %56, %58
%63 = tail call double @sin(double %62)
%64 = fmul double %61, %63
%65 = tail call double @sin(double %57)
%66 = tail call double @sin(double %58)
%67 = fmul double %65, %66
%68 = fdiv double %64, %67
%69 = tail call double @sqrt(double %68)
%70 = tail call double @MIN(double 1.000000e+00, double %69)
%71 = tail call double @asin(double %70)
%72 = fmul double %71, 2.000000e+00
%73 = tail call double @sin(double %60)
%74 = fsub double %56, %59
%75 = tail call double @sin(double %74)
%76 = fmul double %73, %75
%77 = tail call double @sin(double %57)
%78 = tail call double @sin(double %59)
%79 = fmul double %77, %78
%80 = fdiv double %76, %79
%81 = tail call double @sqrt(double %80)
%82 = tail call double @MIN(double 1.000000e+00, double %81)
%83 = fcmp ogt double %82, 1.000000e+00
%84 = fcmp olt double %82, -1.000000e+00
%85 = or i1 %84, %83
br i1 %85, label %86, label %88
86: ; preds = %53
%87 = tail call double @asin(double %82)
br label %88
88: ; preds = %53, %86
%89 = fsub double 0x401921FB54442D18, %72
%90 = select i1 %34, double %72, double %89
br label %91
91: ; preds = %88, %32
%92 = phi double [ 0.000000e+00, %32 ], [ %90, %88 ]
%93 = tail call double @cos(double %92)
%94 = fmul double %48, %93
store double %94, double* %5
%95 = tail call double @sin(double %92)
%96 = fmul double %48, %95
store double %96, double* %6
ret void
}