#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 fabs(double);
double __kernel_tan(double x, double y, int iy) {
  double z, r, v, w, s;
  int ix, hx;
  hx = *(1 + (int *)&x);
  ix = hx & 0x7fffffff;
  if (ix < 0x3e300000) {
    if ((int)x == 0) {
      if (((ix | *(int *)&x) | (iy + 1)) == 0) {
        return 1.00000000000000000000e+00 / fabs(x);
      } else {
        if (iy == 1) {
          return x;
        } else {
          double a, t;
          z = w = x + y;
          *(int *)&z = 0;
          v = y - (z - x);
          t = a = -1.00000000000000000000e+00 / w;
          *(int *)&t = 0;
          s = 1.00000000000000000000e+00 + t * z;
          return t + a * (s + t * v);
        }
      }
    }
  }
  if (ix >= 0x3FE59428) {
    if (hx < 0) {
      x = -x;
      y = -y;
    }
    z = 7.85398163397448278999e-01 - x;
    w = 3.06161699786838301793e-17 - y;
    x = z + w;
    y = 0.0;
  }
  z = x * x;
  w = z * z;
  r = 1.33333333333201242699e-01 +
      w * (2.18694882948595424599e-02 +
           w * (3.59207910759131235356e-03 +
                w * (5.88041240820264096874e-04 +
                     w * (7.81794442939557092300e-05 +
                          w * -1.85586374855275456654e-05))));
  v = z * (5.39682539762260521377e-02 +
           w * (8.86323982359930005737e-03 +
                w * (1.45620945432529025516e-03 +
                     w * (2.46463134818469906812e-04 +
                          w * (7.14072491382608190305e-05 +
                               w * 2.59073051863633712884e-05)))));
  s = z * x;
  r = y + z * (s * (r + v) + y);
  r += 3.33333333333334091986e-01 * s;
  w = x + r;
  if (ix >= 0x3FE59428) {
    v = (double)iy;
    return (double)(1 - ((hx >> 30) & 2)) *
           (v - 2.0 * (x - (w * w / (w + v) - r)));
  }
  if (iy == 1) {
    return w;
  } else {
    double a, t;
    z = w;
    *(int *)&z = 0;
    v = r - (z - x);
    t = a = -1.0 / w;
    *(int *)&t = 0;
    s = 1.0 + t * z;
    return t + a * (s + t * v);
  }
}


x86 assembly (clang, -O0):
<__kernel_tan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x3e300000,-0x4c(%rbp)
jge    123b <__kernel_tan+0x13b>
cvttsd2si -0x10(%rbp),%eax
cmp    $0x0,%eax
jne    1236 <__kernel_tan+0x136>
mov    -0x4c(%rbp),%eax
or     -0x10(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
jne    117a <__kernel_tan+0x7a>
movsd  -0x10(%rbp),%xmm1
movaps 0xf30(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xf0c(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    156b <__kernel_tan+0x46b>
cmpl   $0x1,-0x1c(%rbp)
jne    1193 <__kernel_tan+0x93>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    156b <__kernel_tan+0x46b>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeb2(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    156b <__kernel_tan+0x46b>
jmp    123b <__kernel_tan+0x13b>
cmpl   $0x3fe59428,-0x4c(%rbp)
jl     12cf <__kernel_tan+0x1cf>
cmpl   $0x0,-0x50(%rbp)
jge    1294 <__kernel_tan+0x194>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xd6c(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xd52(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
movsd  0xd5a(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xd56(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd36(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd1e(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd06(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcee(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm5
movsd  0xcaf(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xcab(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xc8b(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xc73(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xc5b(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc43(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm4
addsd  -0x38(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xbda(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x3fe59428,-0x4c(%rbp)
jl     14be <__kernel_tan+0x3be>
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x50(%rbp),%ecx
sar    $0x1e,%ecx
and    $0x2,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mulsd  -0x40(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
addsd  -0x38(%rbp),%xmm4
divsd  %xmm4,%xmm3
subsd  -0x30(%rbp),%xmm3
subsd  %xmm3,%xmm2
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    156b <__kernel_tan+0x46b>
cmpl   $0x1,-0x1c(%rbp)
jne    14d7 <__kernel_tan+0x3d7>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    156b <__kernel_tan+0x46b>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xb78(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb44(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm3
movsd  -0x70(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__kernel_tan>:
movq   %xmm0,%rdx
mov    %rdx,%rax
shr    $0x20,%rax
mov    %eax,%ecx
and    $0x7fffffff,%ecx
cmp    $0x3e2fffff,%ecx
ja     113b <__kernel_tan+0x3b>
cvttsd2si %xmm0,%esi
test   %esi,%esi
jne    113b <__kernel_tan+0x3b>
lea    0x1(%rdi),%eax
or     %edx,%eax
or     %ecx,%eax
je     129f <__kernel_tan+0x19f>
cmp    $0x1,%edi
jne    12b8 <__kernel_tan+0x1b8>
ret
cmp    $0x3fe59428,%ecx
jb     1178 <__kernel_tan+0x78>
test   %rdx,%rdx
jns    1158 <__kernel_tan+0x58>
movapd 0xeb0(%rip),%xmm2
xorpd  %xmm2,%xmm0
xorpd  %xmm2,%xmm1
movsd  0xec0(%rip),%xmm2
subsd  %xmm0,%xmm2
movsd  0xebc(%rip),%xmm0
subsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm3,%xmm4
mulsd  %xmm3,%xmm4
movsd  0xea0(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  0xe9c(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  0xe98(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  0xe94(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  0xe90(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  0xe8c(%rip),%xmm2
movsd  0xe8c(%rip),%xmm5
mulsd  %xmm4,%xmm5
addsd  0xe88(%rip),%xmm5
mulsd  %xmm4,%xmm5
addsd  0xe84(%rip),%xmm5
mulsd  %xmm4,%xmm5
addsd  0xe80(%rip),%xmm5
mulsd  %xmm4,%xmm5
addsd  0xe7c(%rip),%xmm5
mulsd  %xmm4,%xmm5
addsd  0xe78(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm2,%xmm5
movapd %xmm0,%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm5
addsd  %xmm1,%xmm5
mulsd  %xmm3,%xmm5
mulsd  0xe5c(%rip),%xmm2
addsd  %xmm1,%xmm5
addsd  %xmm5,%xmm2
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
cmp    $0x3fe59428,%ecx
jb     1291 <__kernel_tan+0x191>
xorps  %xmm3,%xmm3
cvtsi2sd %edi,%xmm3
shr    $0x1e,%eax
and    $0xfffffffe,%eax
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm4,%xmm4
cvtsi2sd %ecx,%xmm4
movapd %xmm1,%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm5
subsd  %xmm2,%xmm5
subsd  %xmm5,%xmm0
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm3
mulsd  %xmm4,%xmm3
movapd %xmm3,%xmm1
jmp    129a <__kernel_tan+0x19a>
cmp    $0x1,%edi
jne    131d <__kernel_tan+0x21d>
movapd %xmm1,%xmm0
ret
andpd  0xd69(%rip),%xmm0
movsd  0xdf1(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movq   %xmm2,%rax
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rcx,%rax
movq   %rax,%xmm3
movdqa %xmm3,%xmm4
subsd  %xmm0,%xmm4
subsd  %xmm4,%xmm1
movsd  0xdad(%rip),%xmm0
divsd  %xmm2,%xmm0
movq   %xmm0,%rax
and    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm2,%xmm3
addsd  0xd98(%rip),%xmm3
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret
movq   %xmm1,%rax
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rcx,%rax
movq   %rax,%xmm3
movdqa %xmm3,%xmm4
subsd  %xmm0,%xmm4
subsd  %xmm4,%xmm2
movsd  0xd50(%rip),%xmm0
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
and    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm1,%xmm3
addsd  0xd3b(%rip),%xmm3
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @__kernel_tan(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
%19 = bitcast double* %5 to i32*
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
store i32 %21, i32* %14
%22 = load i32, i32* %14
%23 = and i32 %22, 2147483647
store i32 %23, i32* %13
%24 = load i32, i32* %13
%25 = icmp slt i32 %24, 1043333120
br i1 %25, label %26, label %72
26: ; preds = %3
%27 = load double, double* %5
%28 = fptosi double %27 to i32
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %71
30: ; preds = %26
%31 = load i32, i32* %13
%32 = bitcast double* %5 to i32*
%33 = load i32, i32* %32
%34 = or i32 %31, %33
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
%37 = or i32 %34, %36
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %30
%40 = load double, double* %5
%41 = call double @llvm.fabs.f64(double %40)
%42 = fdiv double 1.000000e+00, %41
store double %42, double* %4
br label %188
43: ; preds = %30
%44 = load i32, i32* %7
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = load double, double* %5
store double %47, double* %4
br label %188
48: ; preds = %43
%49 = load double, double* %5
%50 = load double, double* %6
%51 = fadd double %49, %50
store double %51, double* %11
store double %51, double* %8
%52 = bitcast double* %8 to i32*
store i32 0, i32* %52
%53 = load double, double* %6
%54 = load double, double* %8
%55 = load double, double* %5
%56 = fsub double %54, %55
%57 = fsub double %53, %56
store double %57, double* %10
%58 = load double, double* %11
%59 = fdiv double -1.000000e+00, %58
store double %59, double* %15
store double %59, double* %16
%60 = bitcast double* %16 to i32*
store i32 0, i32* %60
%61 = load double, double* %16
%62 = load double, double* %8
%63 = call double @llvm.fmuladd.f64(double %61, double %62, double 1.000000e+00)
store double %63, double* %12
%64 = load double, double* %16
%65 = load double, double* %15
%66 = load double, double* %12
%67 = load double, double* %16
%68 = load double, double* %10
%69 = call double @llvm.fmuladd.f64(double %67, double %68, double %66)
%70 = call double @llvm.fmuladd.f64(double %65, double %69, double %64)
store double %70, double* %4
br label %188
71: ; preds = %26
br label %72
72: ; preds = %71, %3
%73 = load i32, i32* %13
%74 = icmp sge i32 %73, 1072010280
br i1 %74, label %75, label %91
75: ; preds = %72
%76 = load i32, i32* %14
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %83
78: ; preds = %75
%79 = load double, double* %5
%80 = fneg double %79
store double %80, double* %5
%81 = load double, double* %6
%82 = fneg double %81
store double %82, double* %6
br label %83
83: ; preds = %78, %75
%84 = load double, double* %5
%85 = fsub double 0x3FE921FB54442D18, %84
store double %85, double* %8
%86 = load double, double* %6
%87 = fsub double 0x3C81A62633145C07, %86
store double %87, double* %11
%88 = load double, double* %8
%89 = load double, double* %11
%90 = fadd double %88, %89
store double %90, double* %5
store double 0.000000e+00, double* %6
br label %91
91: ; preds = %83, %72
%92 = load double, double* %5
%93 = load double, double* %5
%94 = fmul double %92, %93
store double %94, double* %8
%95 = load double, double* %8
%96 = load double, double* %8
%97 = fmul double %95, %96
store double %97, double* %11
%98 = load double, double* %11
%99 = load double, double* %11
%100 = load double, double* %11
%101 = load double, double* %11
%102 = load double, double* %11
%103 = call double @llvm.fmuladd.f64(double %102, double 0xBEF375CBDB605373, double 0x3F147E88A03792A6)
%104 = call double @llvm.fmuladd.f64(double %101, double %103, double 0x3F4344D8F2F26501)
%105 = call double @llvm.fmuladd.f64(double %100, double %104, double 0x3F6D6D22C9560328)
%106 = call double @llvm.fmuladd.f64(double %99, double %105, double 0x3F9664F48406D637)
%107 = call double @llvm.fmuladd.f64(double %98, double %106, double 0x3FC111111110FE7A)
store double %107, double* %9
%108 = load double, double* %8
%109 = load double, double* %11
%110 = load double, double* %11
%111 = load double, double* %11
%112 = load double, double* %11
%113 = load double, double* %11
%114 = call double @llvm.fmuladd.f64(double %113, double 0x3EFB2A7074BF7AD4, double 0x3F12B80F32F0A7E9)
%115 = call double @llvm.fmuladd.f64(double %112, double %114, double 0x3F3026F71A8D1068)
%116 = call double @llvm.fmuladd.f64(double %111, double %115, double 0x3F57DBC8FEE08315)
%117 = call double @llvm.fmuladd.f64(double %110, double %116, double 0x3F8226E3E96E8493)
%118 = call double @llvm.fmuladd.f64(double %109, double %117, double 0x3FABA1BA1BB341FE)
%119 = fmul double %108, %118
store double %119, double* %10
%120 = load double, double* %8
%121 = load double, double* %5
%122 = fmul double %120, %121
store double %122, double* %12
%123 = load double, double* %6
%124 = load double, double* %8
%125 = load double, double* %12
%126 = load double, double* %9
%127 = load double, double* %10
%128 = fadd double %126, %127
%129 = load double, double* %6
%130 = call double @llvm.fmuladd.f64(double %125, double %128, double %129)
%131 = call double @llvm.fmuladd.f64(double %124, double %130, double %123)
store double %131, double* %9
%132 = load double, double* %12
%133 = load double, double* %9
%134 = call double @llvm.fmuladd.f64(double 0x3FD5555555555563, double %132, double %133)
store double %134, double* %9
%135 = load double, double* %5
%136 = load double, double* %9
%137 = fadd double %135, %136
store double %137, double* %11
%138 = load i32, i32* %13
%139 = icmp sge i32 %138, 1072010280
br i1 %139, label %140, label %162
140: ; preds = %91
%141 = load i32, i32* %7
%142 = sitofp i32 %141 to double
store double %142, double* %10
%143 = load i32, i32* %14
%144 = ashr i32 %143, 30
%145 = and i32 %144, 2
%146 = sub nsw i32 1, %145
%147 = sitofp i32 %146 to double
%148 = load double, double* %10
%149 = load double, double* %5
%150 = load double, double* %11
%151 = load double, double* %11
%152 = fmul double %150, %151
%153 = load double, double* %11
%154 = load double, double* %10
%155 = fadd double %153, %154
%156 = fdiv double %152, %155
%157 = load double, double* %9
%158 = fsub double %156, %157
%159 = fsub double %149, %158
%160 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %159, double %148)
%161 = fmul double %147, %160
store double %161, double* %4
br label %188
162: ; preds = %91
%163 = load i32, i32* %7
%164 = icmp eq i32 %163, 1
br i1 %164, label %165, label %167
165: ; preds = %162
%166 = load double, double* %11
store double %166, double* %4
br label %188
167: ; preds = %162
%168 = load double, double* %11
store double %168, double* %8
%169 = bitcast double* %8 to i32*
store i32 0, i32* %169
%170 = load double, double* %9
%171 = load double, double* %8
%172 = load double, double* %5
%173 = fsub double %171, %172
%174 = fsub double %170, %173
store double %174, double* %10
%175 = load double, double* %11
%176 = fdiv double -1.000000e+00, %175
store double %176, double* %17
store double %176, double* %18
%177 = bitcast double* %18 to i32*
store i32 0, i32* %177
%178 = load double, double* %18
%179 = load double, double* %8
%180 = call double @llvm.fmuladd.f64(double %178, double %179, double 1.000000e+00)
store double %180, double* %12
%181 = load double, double* %18
%182 = load double, double* %17
%183 = load double, double* %12
%184 = load double, double* %18
%185 = load double, double* %10
%186 = call double @llvm.fmuladd.f64(double %184, double %185, double %183)
%187 = call double @llvm.fmuladd.f64(double %182, double %186, double %181)
store double %187, double* %4
br label %188
188: ; preds = %167, %165, %140, %48, %46, %39
%189 = load double, double* %4
ret double %189
}

LLVM IR (-O2):
define double @__kernel_tan(double %0, double %1, i32 %2) {
%4 = bitcast double %0 to i64
%5 = lshr i64 %4, 32
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 2147483647
%8 = icmp ult i32 %7, 1043333120
%9 = fptosi double %0 to i32
%10 = icmp eq i32 %9, 0
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %12, label %37
12: ; preds = %3
%13 = trunc i64 %4 to i32
%14 = add nsw i32 %2, 1
%15 = or i32 %14, %13
%16 = or i32 %15, %7
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = tail call double @llvm.fabs.f64(double %0)
%20 = fdiv double 1.000000e+00, %19
br label %98
21: ; preds = %12
%22 = icmp eq i32 %2, 1
br i1 %22, label %98, label %23
23: ; preds = %21
%24 = fadd double %0, %1
%25 = bitcast double %24 to i64
%26 = and i64 %25, -4294967296
%27 = bitcast i64 %26 to double
%28 = fsub double %27, %0
%29 = fsub double %1, %28
%30 = fdiv double -1.000000e+00, %24
%31 = bitcast double %30 to i64
%32 = and i64 %31, -4294967296
%33 = bitcast i64 %32 to double
%34 = tail call double @llvm.fmuladd.f64(double %33, double %27, double 1.000000e+00)
%35 = tail call double @llvm.fmuladd.f64(double %33, double %29, double %34)
%36 = tail call double @llvm.fmuladd.f64(double %30, double %35, double %33)
br label %98
37: ; preds = %3
%38 = icmp ugt i32 %7, 1072010279
br i1 %38, label %39, label %48
39: ; preds = %37
%40 = icmp slt i64 %4, 0
%41 = fneg double %0
%42 = fneg double %1
%43 = select i1 %40, double %42, double %1
%44 = select i1 %40, double %41, double %0
%45 = fsub double 0x3FE921FB54442D18, %44
%46 = fsub double 0x3C81A62633145C07, %43
%47 = fadd double %45, %46
br label %48
48: ; preds = %39, %37
%49 = phi double [ 0.000000e+00, %39 ], [ %1, %37 ]
%50 = phi double [ %47, %39 ], [ %0, %37 ]
%51 = fmul double %50, %50
%52 = fmul double %51, %51
%53 = tail call double @llvm.fmuladd.f64(double %52, double 0xBEF375CBDB605373, double 0x3F147E88A03792A6)
%54 = tail call double @llvm.fmuladd.f64(double %52, double %53, double 0x3F4344D8F2F26501)
%55 = tail call double @llvm.fmuladd.f64(double %52, double %54, double 0x3F6D6D22C9560328)
%56 = tail call double @llvm.fmuladd.f64(double %52, double %55, double 0x3F9664F48406D637)
%57 = tail call double @llvm.fmuladd.f64(double %52, double %56, double 0x3FC111111110FE7A)
%58 = tail call double @llvm.fmuladd.f64(double %52, double 0x3EFB2A7074BF7AD4, double 0x3F12B80F32F0A7E9)
%59 = tail call double @llvm.fmuladd.f64(double %52, double %58, double 0x3F3026F71A8D1068)
%60 = tail call double @llvm.fmuladd.f64(double %52, double %59, double 0x3F57DBC8FEE08315)
%61 = tail call double @llvm.fmuladd.f64(double %52, double %60, double 0x3F8226E3E96E8493)
%62 = tail call double @llvm.fmuladd.f64(double %52, double %61, double 0x3FABA1BA1BB341FE)
%63 = fmul double %51, %62
%64 = fmul double %50, %51
%65 = fadd double %57, %63
%66 = tail call double @llvm.fmuladd.f64(double %64, double %65, double %49)
%67 = tail call double @llvm.fmuladd.f64(double %51, double %66, double %49)
%68 = tail call double @llvm.fmuladd.f64(double %64, double 0x3FD5555555555563, double %67)
%69 = fadd double %50, %68
br i1 %38, label %70, label %83
70: ; preds = %48
%71 = sitofp i32 %2 to double
%72 = lshr i32 %6, 30
%73 = and i32 %72, 2
%74 = sub nsw i32 1, %73
%75 = sitofp i32 %74 to double
%76 = fmul double %69, %69
%77 = fadd double %69, %71
%78 = fdiv double %76, %77
%79 = fsub double %78, %68
%80 = fsub double %50, %79
%81 = tail call double @llvm.fmuladd.f64(double %80, double -2.000000e+00, double %71)
%82 = fmul double %81, %75
br label %98
83: ; preds = %48
%84 = icmp eq i32 %2, 1
br i1 %84, label %98, label %85
85: ; preds = %83
%86 = bitcast double %69 to i64
%87 = and i64 %86, -4294967296
%88 = bitcast i64 %87 to double
%89 = fsub double %88, %50
%90 = fsub double %68, %89
%91 = fdiv double -1.000000e+00, %69
%92 = bitcast double %91 to i64
%93 = and i64 %92, -4294967296
%94 = bitcast i64 %93 to double
%95 = tail call double @llvm.fmuladd.f64(double %94, double %88, double 1.000000e+00)
%96 = tail call double @llvm.fmuladd.f64(double %94, double %90, double %95)
%97 = tail call double @llvm.fmuladd.f64(double %91, double %96, double %94)
br label %98
98: ; preds = %83, %21, %85, %70, %23, %18
%99 = phi double [ %20, %18 ], [ %36, %23 ], [ %82, %70 ], [ %97, %85 ], [ %0, %21 ], [ %69, %83 ]
ret double %99
}