#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
double sqrt(double);
int /*<<< orphan*/ stderr;
int scd2(double u, double mc, double *s, double *c, double *d) {
  double B10 = 1.0 / 24.0, B11 = 1.0 / 6.0, B20 = 1.0 / 720.0;
  double B21 = 11.0 / 180.0, B22 = 1.0 / 45.0;
  double m, uA, uT, u0, v, a, b, y, z, my, mc2, m2, x, xz, w;
  int n, i, j;
  m = 1.0 - mc;
  uA = 1.76269 + mc * 1.16357;
  uT = 5.217e-3 - m * 2.143e-3;
  u0 = u;
  for (n = 0; n <= 20; n++) {
    if (u0 < uT)
      break;
    u0 /= 2.0;
  }
  if (n == 20) {
    fprintf(stderr, "error: argument u too large in scd2: u=%e", u);
    return 1;
  }
  v = u0 * u0;
  a = 1.0;
  b = v * (0.5 - v * (B10 + m * B11 - v * (B20 + m * (B21 + m * B22))));
  if (u < uA) {
    for (j = 0; j < n; j++) {
      y = b * (a * 2.0 - b);
      z = a * a;
      my = m * y;
      b = y * 2.0 * (z - my);
      a = z * z - my * y;
    }
  } else {
    for (j = 0; j < n; j++) {
      y = b * (a * 2.0 - b);
      z = a * a;
      my = m * y;
      if (z < my * 2.0) {
        *c = a - b;
        mc2 = mc * 2.0;
        m2 = m * 2.0;
        for (i = j; i <= n; i++) {
          x = (*c) * (*c);
          z = a * a;
          w = m * x * x - mc * z * z;
          xz = x * z;
          *c = mc2 * xz + w;
          a = m2 * xz - w;
        }
        *c /= a;
        x = (*c) * (*c);
        *s = sqrt(1.0 - x);
        *d = sqrt(mc + m * x);
        return 0;
      }
      b = y * 2.0 * (z - my);
      a = z * z - my * y;
    }
  }
  b /= a;
  y = b * (2.0 - b);
  *c = 1.0 - b;
  *s = sqrt(y);
  *d = sqrt(1.0 - m * y);
  return 0;
}


x86 assembly (clang, -O0):
<scd2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  0xeff(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe96(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe6f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe26(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe22(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0xd4(%rbp)
cmpl   $0x14,-0xd4(%rbp)
jg     1253 <scd2+0x133>
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1229 <scd2+0x109>
jmp    1253 <scd2+0x133>
movsd  -0x78(%rbp),%xmm0
movsd  0xe1a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1203 <scd2+0xe3>
cmpl   $0x14,-0xd4(%rbp)
jne    1286 <scd2+0x166>
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
movsd  -0x10(%rbp),%xmm0
lea    0xdeb(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1857 <scd2+0x737>
movsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xd83(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  -0x80(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm5
movsd  -0x60(%rbp),%xmm4
movsd  -0x50(%rbp),%xmm7
movsd  -0x60(%rbp),%xmm6
movsd  -0x58(%rbp),%xmm8
mulsd  %xmm8,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xd20(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1474 <scd2+0x354>
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jge    146f <scd2+0x34f>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xc60(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
subsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    1366 <scd2+0x246>
jmp    17a2 <scd2+0x682>
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jge    179d <scd2+0x67d>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xb40(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1716 <scd2+0x5f6>
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x90(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xb0e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xaf9(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0xdc(%rbp),%eax
mov    %eax,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jg     1696 <scd2+0x576>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm2
ff
movsd  -0x18(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0xa0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm2
ff
movsd  -0xd0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm2
ff
movsd  -0xd0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    1570 <scd2+0x450>
movsd  -0x88(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0x952(%rip),%xmm0
subsd  -0xc0(%rbp),%xmm0
ff
call   1040 <sqrt@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1857 <scd2+0x737>
movsd  0x932(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
subsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    147e <scd2+0x35e>
jmp    17a2 <scd2+0x682>
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0x882(%rip),%xmm1
subsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0x836(%rip),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
call   1040 <sqrt@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x7e1(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scd2>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movsd  0xed0(%rip),%xmm8
movapd %xmm8,%xmm7
subsd  %xmm1,%xmm7
movsd  0xed7(%rip),%xmm2
mulsd  %xmm7,%xmm2
addsd  0xed3(%rip),%xmm2
mov    %rdx,%r14
mov    %rdi,%rbx
xor    %eax,%eax
ucomisd %xmm0,%xmm2
movapd %xmm0,%xmm3
ja     11a8 <scd2+0x88>
xor    %eax,%eax
movsd  0xebf(%rip),%xmm4
movapd %xmm0,%xmm3
nopl   (%rax)
mov    %eax,%ecx
mulsd  %xmm4,%xmm3
lea    0x1(%rcx),%eax
cmp    $0x13,%ecx
ja     1184 <scd2+0x64>
ucomisd %xmm3,%xmm2
jbe    1170 <scd2+0x50>
cmp    $0x14,%eax
jne    11a8 <scd2+0x88>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
jmp    146a <scd2+0x34a>
movsd  0xe58(%rip),%xmm4
mulsd  %xmm1,%xmm4
addsd  0xe54(%rip),%xmm4
movsd  0xe6c(%rip),%xmm5
mulsd  %xmm7,%xmm5
addsd  0xe68(%rip),%xmm5
movsd  0xe68(%rip),%xmm2
mulsd  %xmm7,%xmm2
addsd  0xe64(%rip),%xmm2
mulsd  %xmm3,%xmm3
mulsd  %xmm7,%xmm2
addsd  0xe5c(%rip),%xmm2
mulsd  %xmm3,%xmm2
subsd  %xmm2,%xmm5
mulsd  %xmm3,%xmm5
movsd  0xe20(%rip),%xmm2
subsd  %xmm5,%xmm2
mulsd  %xmm3,%xmm2
ucomisd %xmm0,%xmm4
jbe    1272 <scd2+0x152>
test   %eax,%eax
je     12eb <scd2+0x1cb>
movsd  0xdda(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
movapd %xmm3,%xmm0
addsd  %xmm3,%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm3
movapd %xmm7,%xmm4
mulsd  %xmm0,%xmm4
movapd %xmm3,%xmm2
subsd  %xmm4,%xmm2
mulsd  %xmm0,%xmm4
addsd  %xmm0,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm3
subsd  %xmm4,%xmm3
add    $0xffffffff,%eax
jne    1230 <scd2+0x110>
jmp    12f0 <scd2+0x1d0>
test   %eax,%eax
je     12eb <scd2+0x1cb>
lea    0x1(%rax),%ecx
movsd  0xd7f(%rip),%xmm0
xor    %edx,%edx
movapd %xmm0,%xmm3
nopw   0x0(%rax,%rax,1)
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
subsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm3
movapd %xmm7,%xmm5
mulsd  %xmm4,%xmm5
movapd %xmm5,%xmm6
addsd  %xmm5,%xmm6
ucomisd %xmm3,%xmm6
ja     1372 <scd2+0x252>
movapd %xmm4,%xmm0
addsd  %xmm4,%xmm0
movapd %xmm3,%xmm2
subsd  %xmm5,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm5,%xmm4
mulsd  %xmm3,%xmm3
subsd  %xmm4,%xmm3
add    $0x1,%edx
movapd %xmm3,%xmm0
cmp    %edx,%eax
jne    1290 <scd2+0x170>
jmp    12f0 <scd2+0x1d0>
movapd %xmm8,%xmm3
divsd  %xmm3,%xmm2
xorpd  0xd64(%rip),%xmm7
movsd  0xd54(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm2,%xmm8
movsd  %xmm8,(%rsi)
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jb     1329 <scd2+0x209>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    134c <scd2+0x22c>
movapd %xmm1,%xmm0
movapd %xmm7,0x10(%rsp)
movsd  %xmm1,(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  (%rsp),%xmm1
movapd 0x10(%rsp),%xmm7
movsd  %xmm0,(%rbx)
mulsd  %xmm1,%xmm7
addsd  0xca4(%rip),%xmm7
ucomisd %xmm2,%xmm7
jb     145a <scd2+0x33a>
xorps  %xmm0,%xmm0
sqrtsd %xmm7,%xmm0
jmp    1463 <scd2+0x343>
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
cmp    %eax,%edx
ja     13f1 <scd2+0x2d1>
movapd %xmm7,%xmm6
unpcklpd %xmm1,%xmm6
addpd  %xmm6,%xmm6
sub    %edx,%ecx
unpcklpd %xmm3,%xmm0
movapd 0xcc8(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
mulpd  %xmm0,%xmm0
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
movapd %xmm7,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm0,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm0,%xmm5
mulsd  %xmm3,%xmm4
subsd  %xmm5,%xmm4
mulsd  %xmm0,%xmm3
movapd %xmm4,%xmm0
xorpd  %xmm2,%xmm0
unpcklpd %xmm3,%xmm3
mulpd  %xmm6,%xmm3
unpcklpd %xmm4,%xmm0
addpd  %xmm3,%xmm0
add    $0xffffffff,%ecx
jne    13a0 <scd2+0x280>
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,(%rsi)
mulsd  %xmm3,%xmm3
movsd  0xbfb(%rip),%xmm0
subsd  %xmm3,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1419 <scd2+0x2f9>
sqrtsd %xmm0,%xmm0
jmp    1444 <scd2+0x324>
movapd %xmm7,0x10(%rsp)
movapd %xmm1,(%rsp)
movapd %xmm3,0x20(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm2,%xmm2
movapd 0x20(%rsp),%xmm3
movapd (%rsp),%xmm1
movapd 0x10(%rsp),%xmm7
movsd  %xmm0,(%rbx)
mulsd  %xmm3,%xmm7
addsd  %xmm1,%xmm7
ucomisd %xmm2,%xmm7
jae    1366 <scd2+0x246>
movapd %xmm7,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"error: argument u too large in scd2: u=%e\00"
define i32 @scd2(double %0, double %1, double* nocapture writeonly %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = fsub double 1.000000e+00, %1
%7 = tail call double @llvm.fmuladd.f64(double %1, double 1.163570e+00, double 1.762690e+00)
%8 = fneg double %6
%9 = tail call double @llvm.fmuladd.f64(double %8, double 2.143000e-03, double 5.217000e-03)
%10 = fcmp ogt double %9, %0
br i1 %10, label %24, label %11
11: ; preds = %5, %11
%12 = phi i32 [ %15, %11 ], [ 0, %5 ]
%13 = phi double [ %14, %11 ], [ %0, %5 ]
%14 = fmul double %13, 5.000000e-01
%15 = add nuw nsw i32 %12, 1
%16 = icmp ugt i32 %12, 19
%17 = fcmp olt double %14, %9
%18 = select i1 %16, i1 true, i1 %17
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = icmp eq i32 %15, 20
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), double %0)
br label %127
24: ; preds = %5, %19
%25 = phi i32 [ %15, %19 ], [ 0, %5 ]
%26 = phi double [ %14, %19 ], [ %0, %5 ]
%27 = fmul double %26, %26
%28 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FC5555555555555, double 0x3FA5555555555555)
%29 = tail call double @llvm.fmuladd.f64(double %6, double 0x3F96C16C16C16C17, double 0x3FAF49F49F49F49F)
%30 = tail call double @llvm.fmuladd.f64(double %6, double %29, double 0x3F56C16C16C16C17)
%31 = fneg double %27
%32 = tail call double @llvm.fmuladd.f64(double %31, double %30, double %28)
%33 = tail call double @llvm.fmuladd.f64(double %31, double %32, double 5.000000e-01)
%34 = fmul double %27, %33
%35 = fcmp ogt double %7, %0
%36 = icmp eq i32 %25, 0
br i1 %35, label %38, label %37
37: ; preds = %24
br i1 %36, label %117, label %56
38: ; preds = %24
br i1 %36, label %117, label %39
39: ; preds = %38, %39
%40 = phi i32 [ %54, %39 ], [ 0, %38 ]
%41 = phi double [ %53, %39 ], [ 1.000000e+00, %38 ]
%42 = phi double [ %50, %39 ], [ %34, %38 ]
%43 = fneg double %42
%44 = tail call double @llvm.fmuladd.f64(double %41, double 2.000000e+00, double %43)
%45 = fmul double %42, %44
%46 = fmul double %41, %41
%47 = fmul double %6, %45
%48 = fmul double %45, 2.000000e+00
%49 = fsub double %46, %47
%50 = fmul double %48, %49
%51 = fneg double %47
%52 = fmul double %45, %51
%53 = tail call double @llvm.fmuladd.f64(double %46, double %46, double %52)
%54 = add nuw nsw i32 %40, 1
%55 = icmp eq i32 %54, %25
br i1 %55, label %117, label %39
56: ; preds = %37, %108
%57 = phi i32 [ %115, %108 ], [ 0, %37 ]
%58 = phi double [ %114, %108 ], [ 1.000000e+00, %37 ]
%59 = phi double [ %111, %108 ], [ %34, %37 ]
%60 = fneg double %59
%61 = tail call double @llvm.fmuladd.f64(double %58, double 2.000000e+00, double %60)
%62 = fmul double %59, %61
%63 = fmul double %58, %58
%64 = fmul double %6, %62
%65 = fmul double %64, 2.000000e+00
%66 = fcmp olt double %63, %65
br i1 %66, label %67, label %108
67: ; preds = %56
%68 = fsub double %58, %59
%69 = insertelement <2 x double> poison, double %6, i64 0
%70 = insertelement <2 x double> %69, double %1, i64 1
%71 = fmul <2 x double> %70, <double 2.000000e+00, double 2.000000e+00>
%72 = icmp ugt i32 %57, %25
br i1 %72, label %99, label %73
73: ; preds = %67
%74 = insertelement <2 x double> poison, double %58, i64 0
%75 = insertelement <2 x double> %74, double %68, i64 1
br label %76
76: ; preds = %73, %76
%77 = phi i32 [ %94, %76 ], [ %57, %73 ]
%78 = phi <2 x double> [ %93, %76 ], [ %75, %73 ]
%79 = fmul <2 x double> %78, %78
%80 = extractelement <2 x double> %79, i64 1
%81 = fmul double %6, %80
%82 = extractelement <2 x double> %79, i64 0
%83 = fneg double %82
%84 = fmul double %83, %1
%85 = fmul double %82, %84
%86 = tail call double @llvm.fmuladd.f64(double %81, double %80, double %85)
%87 = fmul double %82, %80
%88 = fneg double %86
%89 = insertelement <2 x double> poison, double %87, i64 0
%90 = shufflevector <2 x double> %89, <2 x double> poison, <2 x i32> zeroinitializer
%91 = insertelement <2 x double> poison, double %88, i64 0
%92 = insertelement <2 x double> %91, double %86, i64 1
%93 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %71, <2 x double> %90, <2 x double> %92)
%94 = add nuw nsw i32 %77, 1
%95 = icmp eq i32 %77, %25
br i1 %95, label %96, label %76
96: ; preds = %76
%97 = extractelement <2 x double> %93, i64 1
%98 = extractelement <2 x double> %93, i64 0
br label %99
99: ; preds = %96, %67
%100 = phi double [ %68, %67 ], [ %97, %96 ]
%101 = phi double [ %58, %67 ], [ %98, %96 ]
%102 = fdiv double %100, %101
store double %102, double* %3
%103 = fmul double %102, %102
%104 = fsub double 1.000000e+00, %103
%105 = tail call double @sqrt(double %104)
store double %105, double* %2
%106 = tail call double @llvm.fmuladd.f64(double %6, double %103, double %1)
%107 = tail call double @sqrt(double %106)
store double %107, double* %4
br label %127
108: ; preds = %56
%109 = fmul double %62, 2.000000e+00
%110 = fsub double %63, %64
%111 = fmul double %109, %110
%112 = fneg double %64
%113 = fmul double %62, %112
%114 = tail call double @llvm.fmuladd.f64(double %63, double %63, double %113)
%115 = add nuw nsw i32 %57, 1
%116 = icmp eq i32 %115, %25
br i1 %116, label %117, label %56
117: ; preds = %108, %39, %37, %38
%118 = phi double [ %34, %38 ], [ %34, %37 ], [ %50, %39 ], [ %111, %108 ]
%119 = phi double [ 1.000000e+00, %38 ], [ 1.000000e+00, %37 ], [ %53, %39 ], [ %114, %108 ]
%120 = fdiv double %118, %119
%121 = fsub double 2.000000e+00, %120
%122 = fmul double %120, %121
%123 = fsub double 1.000000e+00, %120
store double %123, double* %3
%124 = tail call double @sqrt(double %122)
store double %124, double* %2
%125 = tail call double @llvm.fmuladd.f64(double %8, double %122, double 1.000000e+00)
%126 = tail call double @sqrt(double %125)
store double %126, double* %4
br label %127
127: ; preds = %117, %99, %21
%128 = phi i32 [ 1, %21 ], [ 0, %117 ], [ 0, %99 ]
ret i32 %128
}