#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 log(double);
double pow(double, int);
double math_dilog(double x) {
  const double C[20] = {
      0.42996693560813697,  0.40975987533077105,  -0.01858843665014592,
      0.00145751084062268,  -0.00014304184442340, 0.00001588415541880,
      -0.00000190784959387, 0.00000024195180854,  -0.00000003193341274,
      0.00000000434545063,  -0.00000000060578480, 0.00000000008612098,
      -0.00000000001244332, 0.00000000000182256,  -0.00000000000027007,
      0.00000000000004042,  -0.00000000000000610, 0.00000000000000093,
      -0.00000000000000014, 0.00000000000000002};
  const double PI3 = 3.14159265358979323846 * 3.14159265358979323846 / 3.;
  const double PI6 = 3.14159265358979323846 * 3.14159265358979323846 / 6.;
  const double PI12 = 3.14159265358979323846 * 3.14159265358979323846 / 12.;
  if (x == 10) {
    return PI6;
  } else if ((x == -1.) || (1. - x == 0.)) {
    return -PI12;
  } else {
    double T = -x;
    double A, S, Y;
    if (T <= -2) {
      Y = -1. / (1. + T);
      S = 1.;
      A = -PI3 + 0.5 * (pow(log(-T), 2.) - pow(log(1. + 1. / T), 2.));
    } else if (T < -1.) {
      Y = -1. - T;
      S = -1.;
      A = log(-T);
      A = -PI6 + A * (A + log(1. + 1. / T));
    } else if (T <= -0.5) {
      Y = -(1. + T) / T;
      S = 1.;
      A = log(-T);
      A = -PI6 + A * (-0.5 * A + log(1. + T));
    } else if (T < 0.) {
      Y = -T / (1. + T);
      S = -1.;
      A = 0.5 * pow(log(1 + T), 2.);
    } else if (T <= 1.) {
      Y = T;
      S = 1.;
      A = 0.;
    } else {
      Y = 1. / T;
      S = -1.;
      A = PI6 + 0.5 * pow(log(T), 2);
    }
    const double H = Y + Y - 1;
    const double ALFA = H + H;
    double B0, B1 = 0., B2 = 0.;
    int i;
    for (i = 19; i >= 0; i--) {
      B0 = C[i] + ALFA * B1 - B2;
      B2 = B1;
      B1 = B0;
    }
    return -(S * (B0 - H * B2) + A);
  }
}


x86 assembly (clang, -O0):
<math_dilog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movsd  %xmm0,-0x10(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xf12(%rip),%rsi
mov    $0xa0,%edx
call   1030 <memcpy@plt>
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xe6b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11b7 <math_dilog+0x87>
jp     11b7 <math_dilog+0x87>
movsd  0xe63(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    177b <math_dilog+0x64b>
movsd  -0x10(%rbp),%xmm0
movsd  0xe5c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11d9 <math_dilog+0xa9>
jp     11d9 <math_dilog+0xa9>
jmp    11f9 <math_dilog+0xc9>
movsd  0xe47(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    120b <math_dilog+0xdb>
jp     120b <math_dilog+0xdb>
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    177b <math_dilog+0x64b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xdf9(%rip),%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
jb     130e <math_dilog+0x1de>
movsd  0xddb(%rip),%xmm1
addsd  -0xd0(%rbp),%xmm1
ff
movsd  0xdc3(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  0xdb7(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <log@plt>
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,-0x120(%rbp)
ff
movsd  0xd71(%rip),%xmm1
divsd  -0xd0(%rbp),%xmm1
ff
movsd  0xd61(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <log@plt>
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x120(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  0xd4f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd53(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    163b <math_dilog+0x50b>
movsd  0xd0a(%rip),%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
jbe    13ed <math_dilog+0x2bd>
movsd  0xcf4(%rip),%xmm0
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  0xcdc(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  0xc88(%rip),%xmm1
divsd  -0xd0(%rbp),%xmm1
ff
movsd  0xc78(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  -0x130(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x128(%rbp),%xmm0
ff
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc6c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    1636 <math_dilog+0x506>
movsd  0xc43(%rip),%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
jb     14eb <math_dilog+0x3bb>
movsd  0xc1d(%rip),%xmm0
addsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  0xbe6(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  0xb8a(%rip),%xmm0
addsd  -0xd0(%rbp),%xmm0
ff
call   1040 <log@plt>
movsd  -0x140(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x138(%rbp),%xmm0
ff
movsd  0xb72(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb6e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    1631 <math_dilog+0x501>
xorps  %xmm0,%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
jbe    1582 <math_dilog+0x452>
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xb05(%rip),%xmm1
addsd  -0xd0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  0xae1(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xad9(%rip),%xmm0
addsd  -0xd0(%rbp),%xmm0
ff
call   1040 <log@plt>
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xacf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    162c <math_dilog+0x4fc>
movsd  0xa9e(%rip),%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
jb     15c8 <math_dilog+0x498>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  0xa78(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    1627 <math_dilog+0x4f7>
movsd  0xa58(%rip),%xmm0
divsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  0xa38(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
call   1040 <log@plt>
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0xa31(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x9f5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    162c <math_dilog+0x4fc>
jmp    1631 <math_dilog+0x501>
jmp    1636 <math_dilog+0x506>
jmp    163b <math_dilog+0x50b>
movsd  -0xe8(%rbp),%xmm0
ff
addsd  -0xe8(%rbp),%xmm0
ff
movsd  0x9d5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
addsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movl   $0x13,-0x114(%rbp)
cmpl   $0x0,-0x114(%rbp)
jl     1710 <math_dilog+0x5e0>
movslq -0x114(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm1
ff ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  -0x108(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x114(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x114(%rbp)
jmp    1697 <math_dilog+0x567>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  -0x100(%rbp),%xmm1
ff
movsd  -0xf0(%rbp),%xmm2
ff
movsd  -0x110(%rbp),%xmm3
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0xd8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_dilog>:
sub    $0x38,%rsp
ucomisd 0xedc(%rip),%xmm0
jne    113d <math_dilog+0x1d>
jp     113d <math_dilog+0x1d>
movsd  0xec8(%rip),%xmm0
add    $0x38,%rsp
ret
movapd %xmm0,%xmm2
ucomisd 0xec7(%rip),%xmm0
movsd  0xecf(%rip),%xmm0
jne    1159 <math_dilog+0x39>
jnp    142b <math_dilog+0x30b>
movsd  0xeb7(%rip),%xmm4
movapd %xmm4,%xmm3
subsd  %xmm2,%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm3
jne    1179 <math_dilog+0x59>
jnp    142b <math_dilog+0x30b>
ucomisd 0xea7(%rip),%xmm2
jae    11fd <math_dilog+0xdd>
ucomisd 0xe8d(%rip),%xmm2
jbe    1430 <math_dilog+0x310>
movapd %xmm2,%xmm0
addsd  0xe73(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
movapd %xmm2,%xmm0
movapd %xmm2,0x10(%rsp)
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe50(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
addsd  0xe4a(%rip),%xmm0
call   1030 <log@plt>
movapd 0x20(%rsp),%xmm5
movsd  0xe2f(%rip),%xmm4
movapd %xmm0,%xmm6
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm6
mulsd  %xmm0,%xmm6
addsd  0xe4d(%rip),%xmm6
jmp    127b <math_dilog+0x15b>
movsd  0xe0b(%rip),%xmm0
divsd  %xmm3,%xmm0
movapd %xmm0,0x20(%rsp)
movapd %xmm2,%xmm0
movapd %xmm2,0x10(%rsp)
call   1030 <log@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xdda(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
addsd  0xdd4(%rip),%xmm0
call   1030 <log@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm6
movapd 0x20(%rsp),%xmm5
movsd  0xdb1(%rip),%xmm4
subsd  %xmm0,%xmm6
mulsd  0xdbd(%rip),%xmm6
addsd  0xdbd(%rip),%xmm6
addsd  %xmm5,%xmm5
addsd  0xd89(%rip),%xmm5
movapd %xmm5,%xmm0
addsd  %xmm5,%xmm0
xorpd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdb1(%rip),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xda9(%rip),%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  0xda1(%rip),%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  0xd95(%rip),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xd89(%rip),%xmm2
subsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  0xd7d(%rip),%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  0xd71(%rip),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xd65(%rip),%xmm2
subsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  0xd59(%rip),%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  0xd4d(%rip),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xd41(%rip),%xmm2
subsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  0xd35(%rip),%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  0xd29(%rip),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xd1d(%rip),%xmm2
subsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  0xd11(%rip),%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  0xd05(%rip),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xcf9(%rip),%xmm2
subsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  0xced(%rip),%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  0xce1(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xcd9(%rip),%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm5,%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm6,%xmm0
xorpd  0xcc5(%rip),%xmm0
add    $0x38,%rsp
ret
ucomisd 0xbf8(%rip),%xmm2
jae    1484 <math_dilog+0x364>
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm2
jbe    14e7 <math_dilog+0x3c7>
divsd  %xmm3,%xmm2
movapd %xmm2,0x10(%rsp)
movapd %xmm3,%xmm0
call   1030 <log@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movapd %xmm0,%xmm6
mulsd  0xbbf(%rip),%xmm6
movsd  0xb97(%rip),%xmm4
movapd 0x10(%rsp),%xmm5
jmp    127b <math_dilog+0x15b>
movapd %xmm3,%xmm0
divsd  %xmm2,%xmm0
movapd %xmm0,0x20(%rsp)
movapd %xmm2,%xmm0
movsd  %xmm3,0x8(%rsp)
call   1030 <log@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
movapd 0x20(%rsp),%xmm5
movsd  0xb58(%rip),%xmm4
movsd  0xb78(%rip),%xmm6
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm6
addsd  %xmm0,%xmm6
mulsd  %xmm1,%xmm6
addsd  0xb66(%rip),%xmm6
jmp    127b <math_dilog+0x15b>
movapd 0xc01(%rip),%xmm5
xorpd  %xmm2,%xmm5
ucomisd 0xb15(%rip),%xmm2
jae    127b <math_dilog+0x15b>
movsd  0xb07(%rip),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x20(%rsp)
movapd %xmm5,%xmm0
call   1030 <log@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0xae2(%rip),%xmm4
movapd %xmm0,%xmm6
mulsd  0xaf6(%rip),%xmm6
addsd  0xabe(%rip),%xmm6
movsd  0x20(%rsp),%xmm5
jmp    127b <math_dilog+0x15b>

LLVM IR (-O0):
@__const.math_dilog.C = [20 x double] [double 0x3FDB849409B3171F, double 0x3FDA39817BF08E86, double 0xBF9308D8DDFC0D4F, double 0x3F57E13E5937F30A, double 0xBF22BFB01667739B, double 0x3EF0A7DED94933E6, double 0xBEC001136800414C, double 0x3E903CB34EB21236, double 0xBE6124E5136EDD51, double 0x3E32A9DF9D688CC9, double 0xBE04D08A198ABF22, double 0x3DD7AC39A75BF8C6, double 0xBDAB5CF766EF3E37, double 1.822560e-12, double -2.700700e-13, double 4.042000e-14, double -6.100000e-15, double 9.300000e-16, double -1.400000e-16, double 2.000000e-17]
define double @math_dilog(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca [20 x double]
%5 = alloca double
%6 = alloca double
%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 i32
store double %0, double* %3
%18 = bitcast [20 x double]* %4 to i8*
store double 0x400A51A6625307D3, double* %5
store double 0x3FFA51A6625307D3, double* %6
store double 0x3FEA51A6625307D3, double* %7
%19 = load double, double* %3
%20 = fcmp oeq double %19, 1.000000e+01
br i1 %20, label %21, label %22
21: ; preds = %1
store double 0x3FFA51A6625307D3, double* %2
br label %152
22: ; preds = %1
%23 = load double, double* %3
%24 = fcmp oeq double %23, -1.000000e+00
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = load double, double* %3
%27 = fsub double 1.000000e+00, %26
%28 = fcmp oeq double %27, 0.000000e+00
br i1 %28, label %29, label %30
29: ; preds = %25, %22
store double 0xBFEA51A6625307D3, double* %2
br label %152
30: ; preds = %25
%31 = load double, double* %3
%32 = fneg double %31
store double %32, double* %8
%33 = load double, double* %8
%34 = fcmp ole double %33, -2.000000e+00
br i1 %34, label %35, label %50
35: ; preds = %30
%36 = load double, double* %8
%37 = fadd double 1.000000e+00, %36
%38 = fdiv double -1.000000e+00, %37
store double %38, double* %11
store double 1.000000e+00, double* %10
%39 = load double, double* %8
%40 = fneg double %39
%41 = call double @log(double %40)
%42 = call double @pow(double %41, i32 2)
%43 = load double, double* %8
%44 = fdiv double 1.000000e+00, %43
%45 = fadd double 1.000000e+00, %44
%46 = call double @log(double %45)
%47 = call double @pow(double %46, i32 2)
%48 = fsub double %42, %47
%49 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %48, double 0xC00A51A6625307D3)
store double %49, double* %9
br label %116
50: ; preds = %30
%51 = load double, double* %8
%52 = fcmp olt double %51, -1.000000e+00
br i1 %52, label %53, label %67
53: ; preds = %50
%54 = load double, double* %8
%55 = fsub double -1.000000e+00, %54
store double %55, double* %11
store double -1.000000e+00, double* %10
%56 = load double, double* %8
%57 = fneg double %56
%58 = call double @log(double %57)
store double %58, double* %9
%59 = load double, double* %9
%60 = load double, double* %9
%61 = load double, double* %8
%62 = fdiv double 1.000000e+00, %61
%63 = fadd double 1.000000e+00, %62
%64 = call double @log(double %63)
%65 = fadd double %60, %64
%66 = call double @llvm.fmuladd.f64(double %59, double %65, double 0xBFFA51A6625307D3)
store double %66, double* %9
br label %115
67: ; preds = %50
%68 = load double, double* %8
%69 = fcmp ole double %68, -5.000000e-01
br i1 %69, label %70, label %86
70: ; preds = %67
%71 = load double, double* %8
%72 = fadd double 1.000000e+00, %71
%73 = fneg double %72
%74 = load double, double* %8
%75 = fdiv double %73, %74
store double %75, double* %11
store double 1.000000e+00, double* %10
%76 = load double, double* %8
%77 = fneg double %76
%78 = call double @log(double %77)
store double %78, double* %9
%79 = load double, double* %9
%80 = load double, double* %9
%81 = load double, double* %8
%82 = fadd double 1.000000e+00, %81
%83 = call double @log(double %82)
%84 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %80, double %83)
%85 = call double @llvm.fmuladd.f64(double %79, double %84, double 0xBFFA51A6625307D3)
store double %85, double* %9
br label %114
86: ; preds = %67
%87 = load double, double* %8
%88 = fcmp olt double %87, 0.000000e+00
br i1 %88, label %89, label %100
89: ; preds = %86
%90 = load double, double* %8
%91 = fneg double %90
%92 = load double, double* %8
%93 = fadd double 1.000000e+00, %92
%94 = fdiv double %91, %93
store double %94, double* %11
store double -1.000000e+00, double* %10
%95 = load double, double* %8
%96 = fadd double 1.000000e+00, %95
%97 = call double @log(double %96)
%98 = call double @pow(double %97, i32 2)
%99 = fmul double 5.000000e-01, %98
store double %99, double* %9
br label %113
100: ; preds = %86
%101 = load double, double* %8
%102 = fcmp ole double %101, 1.000000e+00
br i1 %102, label %103, label %105
103: ; preds = %100
%104 = load double, double* %8
store double %104, double* %11
store double 1.000000e+00, double* %10
store double 0.000000e+00, double* %9
br label %112
105: ; preds = %100
%106 = load double, double* %8
%107 = fdiv double 1.000000e+00, %106
store double %107, double* %11
store double -1.000000e+00, double* %10
%108 = load double, double* %8
%109 = call double @log(double %108)
%110 = call double @pow(double %109, i32 2)
%111 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %110, double 0x3FFA51A6625307D3)
store double %111, double* %9
br label %112
112: ; preds = %105, %103
br label %113
113: ; preds = %112, %89
br label %114
114: ; preds = %113, %70
br label %115
115: ; preds = %114, %53
br label %116
116: ; preds = %115, %35
%117 = load double, double* %11
%118 = load double, double* %11
%119 = fadd double %117, %118
%120 = fsub double %119, 1.000000e+00
store double %120, double* %12
%121 = load double, double* %12
%122 = load double, double* %12
%123 = fadd double %121, %122
store double %123, double* %13
store double 0.000000e+00, double* %15
store double 0.000000e+00, double* %16
store i32 19, i32* %17
br label %124
124: ; preds = %139, %116
%125 = load i32, i32* %17
%126 = icmp sge i32 %125, 0
br i1 %126, label %127, label %142
127: ; preds = %124
%128 = load i32, i32* %17
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [20 x double], [20 x double]* %4, i64 0, i64 %129
%131 = load double, double* %130
%132 = load double, double* %13
%133 = load double, double* %15
%134 = call double @llvm.fmuladd.f64(double %132, double %133, double %131)
%135 = load double, double* %16
%136 = fsub double %134, %135
store double %136, double* %14
%137 = load double, double* %15
store double %137, double* %16
%138 = load double, double* %14
store double %138, double* %15
br label %139
139: ; preds = %127
%140 = load i32, i32* %17
%141 = add nsw i32 %140, -1
store i32 %141, i32* %17
br label %124
142: ; preds = %124
%143 = load double, double* %10
%144 = load double, double* %14
%145 = load double, double* %12
%146 = load double, double* %16
%147 = fneg double %145
%148 = call double @llvm.fmuladd.f64(double %147, double %146, double %144)
%149 = load double, double* %9
%150 = call double @llvm.fmuladd.f64(double %143, double %148, double %149)
%151 = fneg double %150
store double %151, double* %2
br label %152
152: ; preds = %142, %29, %21
%153 = load double, double* %2
ret double %153
}

LLVM IR (-O2):
define double @math_dilog(double %0) {
%2 = fcmp oeq double %0, 1.000000e+01
br i1 %2, label %102, label %3
3: ; preds = %1
%4 = fcmp oeq double %0, -1.000000e+00
%5 = fsub double 1.000000e+00, %0
%6 = fcmp oeq double %5, 0.000000e+00
%7 = or i1 %4, %6
br i1 %7, label %102, label %8
8: ; preds = %3
%9 = fneg double %0
%10 = fcmp ult double %0, 2.000000e+00
br i1 %10, label %21, label %11
11: ; preds = %8
%12 = fdiv double -1.000000e+00, %5
%13 = tail call double @log(double %0)
%14 = tail call double @pow(double %13, i32 2)
%15 = fdiv double 1.000000e+00, %0
%16 = fsub double 1.000000e+00, %15
%17 = tail call double @log(double %16)
%18 = tail call double @pow(double %17, i32 2)
%19 = fsub double %14, %18
%20 = tail call double @llvm.fmuladd.f64(double %19, double 5.000000e-01, double 0xC00A51A6625307D3)
br label %53
21: ; preds = %8
%22 = fcmp ogt double %0, 1.000000e+00
br i1 %22, label %23, label %31
23: ; preds = %21
%24 = fadd double %0, -1.000000e+00
%25 = tail call double @log(double %0)
%26 = fdiv double 1.000000e+00, %0
%27 = fsub double 1.000000e+00, %26
%28 = tail call double @log(double %27)
%29 = fadd double %25, %28
%30 = tail call double @llvm.fmuladd.f64(double %25, double %29, double 0xBFFA51A6625307D3)
br label %53
31: ; preds = %21
%32 = fcmp ult double %0, 5.000000e-01
br i1 %32, label %39, label %33
33: ; preds = %31
%34 = fdiv double %5, %0
%35 = tail call double @log(double %0)
%36 = tail call double @log(double %5)
%37 = tail call double @llvm.fmuladd.f64(double %35, double -5.000000e-01, double %36)
%38 = tail call double @llvm.fmuladd.f64(double %35, double %37, double 0xBFFA51A6625307D3)
br label %53
39: ; preds = %31
%40 = fcmp ogt double %0, 0.000000e+00
br i1 %40, label %41, label %46
41: ; preds = %39
%42 = fdiv double %0, %5
%43 = tail call double @log(double %5)
%44 = tail call double @pow(double %43, i32 2)
%45 = fmul double %44, 5.000000e-01
br label %53
46: ; preds = %39
%47 = fcmp ult double %0, -1.000000e+00
br i1 %47, label %48, label %53
48: ; preds = %46
%49 = fdiv double -1.000000e+00, %0
%50 = tail call double @log(double %9)
%51 = tail call double @pow(double %50, i32 2)
%52 = tail call double @llvm.fmuladd.f64(double %51, double 5.000000e-01, double 0x3FFA51A6625307D3)
br label %53
53: ; preds = %46, %23, %41, %48, %33, %11
%54 = phi double [ %20, %11 ], [ %30, %23 ], [ %38, %33 ], [ %45, %41 ], [ %52, %48 ], [ 0.000000e+00, %46 ]
%55 = phi double [ 1.000000e+00, %11 ], [ -1.000000e+00, %23 ], [ 1.000000e+00, %33 ], [ -1.000000e+00, %41 ], [ -1.000000e+00, %48 ], [ 1.000000e+00, %46 ]
%56 = phi double [ %12, %11 ], [ %24, %23 ], [ %34, %33 ], [ %42, %41 ], [ %49, %48 ], [ %9, %46 ]
%57 = fadd double %56, %56
%58 = fadd double %57, -1.000000e+00
%59 = fadd double %58, %58
%60 = tail call double @llvm.fmuladd.f64(double %59, double 0.000000e+00, double 2.000000e-17)
%61 = tail call double @llvm.fmuladd.f64(double %59, double %60, double -1.400000e-16)
%62 = tail call double @llvm.fmuladd.f64(double %59, double %61, double 9.300000e-16)
%63 = fsub double %62, %60
%64 = tail call double @llvm.fmuladd.f64(double %59, double %63, double -6.100000e-15)
%65 = fsub double %64, %61
%66 = tail call double @llvm.fmuladd.f64(double %59, double %65, double 4.042000e-14)
%67 = fsub double %66, %63
%68 = tail call double @llvm.fmuladd.f64(double %59, double %67, double -2.700700e-13)
%69 = fsub double %68, %65
%70 = tail call double @llvm.fmuladd.f64(double %59, double %69, double 1.822560e-12)
%71 = fsub double %70, %67
%72 = tail call double @llvm.fmuladd.f64(double %59, double %71, double 0xBDAB5CF766EF3E37)
%73 = fsub double %72, %69
%74 = tail call double @llvm.fmuladd.f64(double %59, double %73, double 0x3DD7AC39A75BF8C6)
%75 = fsub double %74, %71
%76 = tail call double @llvm.fmuladd.f64(double %59, double %75, double 0xBE04D08A198ABF22)
%77 = fsub double %76, %73
%78 = tail call double @llvm.fmuladd.f64(double %59, double %77, double 0x3E32A9DF9D688CC9)
%79 = fsub double %78, %75
%80 = tail call double @llvm.fmuladd.f64(double %59, double %79, double 0xBE6124E5136EDD51)
%81 = fsub double %80, %77
%82 = tail call double @llvm.fmuladd.f64(double %59, double %81, double 0x3E903CB34EB21236)
%83 = fsub double %82, %79
%84 = tail call double @llvm.fmuladd.f64(double %59, double %83, double 0xBEC001136800414C)
%85 = fsub double %84, %81
%86 = tail call double @llvm.fmuladd.f64(double %59, double %85, double 0x3EF0A7DED94933E6)
%87 = fsub double %86, %83
%88 = tail call double @llvm.fmuladd.f64(double %59, double %87, double 0xBF22BFB01667739B)
%89 = fsub double %88, %85
%90 = tail call double @llvm.fmuladd.f64(double %59, double %89, double 0x3F57E13E5937F30A)
%91 = fsub double %90, %87
%92 = tail call double @llvm.fmuladd.f64(double %59, double %91, double 0xBF9308D8DDFC0D4F)
%93 = fsub double %92, %89
%94 = tail call double @llvm.fmuladd.f64(double %59, double %93, double 0x3FDA39817BF08E86)
%95 = fsub double %94, %91
%96 = tail call double @llvm.fmuladd.f64(double %59, double %95, double 0x3FDB849409B3171F)
%97 = fsub double %96, %93
%98 = fneg double %58
%99 = tail call double @llvm.fmuladd.f64(double %98, double %95, double %97)
%100 = tail call double @llvm.fmuladd.f64(double %55, double %99, double %54)
%101 = fneg double %100
br label %102
102: ; preds = %3, %1, %53
%103 = phi double [ %101, %53 ], [ 0x3FFA51A6625307D3, %1 ], [ 0xBFEA51A6625307D3, %3 ]
ret double %103
}