#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*/ dd_cos_taylor(double *, double *);
int /*<<< orphan*/ dd_dec(double *, double *);
int /*<<< orphan*/ dd_inc(double *, double *);
int dd_is_zero(double const *);
int /*<<< orphan*/ dd_minus(double *);
int /*<<< orphan*/ dd_mul(double *, double *, double *);
int /*<<< orphan*/ dd_reduce_modulo_2pi(double const *, double *, int *, int *,
                                        int *, int *);
int /*<<< orphan*/ dd_sin_taylor(double *, double *);
int /*<<< orphan*/ dd_sincos_taylor(double *, double *, double *);
int /*<<< orphan*/ sincostables(double *, double *, double *, double *);
void dd_sin(const double *a, double *sin_a) {
  if (dd_is_zero(a) == 1) {
    sin_a[0] = 0.0;
    sin_a[1] = 0.0;
  } else {
    double t[2];
    int j, k, abs_k, fail;
    dd_reduce_modulo_2pi(a, t, &j, &k, &abs_k, &fail);
    if (fail == 1) {
      sin_a[0] = -2.0;
      sin_a[1] = 0.0;
    } else if (k == 0) {
      if (j == 0) {
        dd_sin_taylor(t, sin_a);
      } else if (j == 1) {
        dd_cos_taylor(t, sin_a);
      } else if (j == -1) {
        dd_cos_taylor(t, sin_a);
        dd_minus(sin_a);
      } else {
        dd_sin_taylor(t, sin_a);
        dd_minus(sin_a);
      }
    } else {
      double u[2], v[2], w[2], t_sin[2], t_cos[2];
      double sintabhi[4], sintablo[4];
      double costabhi[4], costablo[4];
      sincostables(sintabhi, sintablo, costabhi, costablo);
      u[0] = costabhi[abs_k - 1];
      u[1] = costablo[abs_k - 1];
      v[0] = sintabhi[abs_k - 1];
      v[1] = sintablo[abs_k - 1];
      dd_sincos_taylor(t, t_sin, t_cos);
      if (j == 0) {
        dd_mul(u, t_sin, sin_a);
        dd_mul(v, t_cos, w);
        if (k > 0)
          dd_inc(sin_a, w);
        else
          dd_dec(sin_a, w);
      } else if (j == 1) {
        dd_mul(u, t_cos, sin_a);
        dd_mul(v, t_sin, w);
        if (k > 0)
          dd_dec(sin_a, w);
        else
          dd_inc(sin_a, w);
      } else if (j == -1) {
        dd_mul(v, t_sin, sin_a);
        dd_mul(u, t_cos, w);
        if (k > 0) {
          dd_dec(sin_a, w);
        } else {
          dd_minus(sin_a);
          dd_dec(sin_a, w);
        }
      } else {
        dd_mul(v, t_cos, sin_a);
        dd_mul(u, t_sin, w);
        if (k > 0) {
          dd_minus(sin_a);
          dd_dec(sin_a, w);
        } else {
          dd_dec(sin_a, w);
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<dd_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <dd_is_zero@plt>
cmp    $0x1,%eax
jne    11e1 <dd_sin+0x41>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    14c8 <dd_sin+0x328>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1070 <dd_reduce_modulo_2pi@plt>
cmpl   $0x1,-0x30(%rbp)
jne    1229 <dd_sin+0x89>
mov    -0x10(%rbp),%rax
movsd  0xdec(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    14c3 <dd_sin+0x323>
cmpl   $0x0,-0x28(%rbp)
jne    12b5 <dd_sin+0x115>
cmpl   $0x0,-0x24(%rbp)
jne    124f <dd_sin+0xaf>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10b0 <dd_sin_taylor@plt>
jmp    12b0 <dd_sin+0x110>
cmpl   $0x1,-0x24(%rbp)
jne    126b <dd_sin+0xcb>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <dd_cos_taylor@plt>
jmp    12ab <dd_sin+0x10b>
cmpl   $0xffffffff,-0x24(%rbp)
jne    1290 <dd_sin+0xf0>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <dd_cos_taylor@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <dd_minus@plt>
jmp    12a6 <dd_sin+0x106>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10b0 <dd_sin_taylor@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <dd_minus@plt>
jmp    12ab <dd_sin+0x10b>
jmp    12b0 <dd_sin+0x110>
jmp    14be <dd_sin+0x31e>
lea    -0xa0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    -0x100(%rbp),%rcx
call   1090 <sincostables@plt>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0xc0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x80(%rbp),%rdx
call   1060 <dd_sincos_taylor@plt>
cmpl   $0x0,-0x24(%rbp)
jne    1399 <dd_sin+0x1f9>
lea    -0x40(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   10a0 <dd_mul@plt>
lea    -0x50(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,-0x28(%rbp)
jle    1387 <dd_sin+0x1e7>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <dd_inc@plt>
jmp    1394 <dd_sin+0x1f4>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <dd_dec@plt>
jmp    14b9 <dd_sin+0x319>
cmpl   $0x1,-0x24(%rbp)
jne    13f3 <dd_sin+0x253>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   10a0 <dd_mul@plt>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,-0x28(%rbp)
jle    13e1 <dd_sin+0x241>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <dd_dec@plt>
jmp    13ee <dd_sin+0x24e>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <dd_inc@plt>
jmp    14b4 <dd_sin+0x314>
cmpl   $0xffffffff,-0x24(%rbp)
jne    1456 <dd_sin+0x2b6>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   10a0 <dd_mul@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,-0x28(%rbp)
jle    143b <dd_sin+0x29b>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <dd_dec@plt>
jmp    1451 <dd_sin+0x2b1>
mov    -0x10(%rbp),%rdi
call   10c0 <dd_minus@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <dd_dec@plt>
jmp    14af <dd_sin+0x30f>
lea    -0x50(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   10a0 <dd_mul@plt>
lea    -0x40(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,-0x28(%rbp)
jle    149d <dd_sin+0x2fd>
mov    -0x10(%rbp),%rdi
call   10c0 <dd_minus@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <dd_dec@plt>
jmp    14aa <dd_sin+0x30a>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <dd_dec@plt>
jmp    14af <dd_sin+0x30f>
jmp    14b4 <dd_sin+0x314>
jmp    14b9 <dd_sin+0x319>
jmp    14be <dd_sin+0x31e>
jmp    14c3 <dd_sin+0x323>
jmp    14c8 <dd_sin+0x328>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_sin>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <dd_is_zero@plt>
cmp    $0x1,%eax
jne    11c6 <dd_sin+0x26>
xorps  %xmm0,%xmm0
movups %xmm0,(%r14)
jmp    13d4 <dd_sin+0x234>
lea    0x50(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x2c(%rsp),%r8
lea    0x28(%rsp),%r9
mov    %rbx,%rdi
call   1070 <dd_reduce_modulo_2pi@plt>
cmpl   $0x1,0x28(%rsp)
jne    11ff <dd_sin+0x5f>
movsd  0xe0a(%rip),%xmm0
movups %xmm0,(%r14)
jmp    13d4 <dd_sin+0x234>
cmpl   $0x0,0xc(%rsp)
je     12d1 <dd_sin+0x131>
lea    0xe0(%rsp),%rdi
lea    0xc0(%rsp),%rsi
lea    0xa0(%rsp),%rdx
lea    0x80(%rsp),%rcx
call   1090 <sincostables@plt>
movslq 0x2c(%rsp),%rax
movsd  0x98(%rsp,%rax,8),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x78(%rsp,%rax,8),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0xd8(%rsp,%rax,8),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0xb8(%rsp,%rax,8),%xmm0
movsd  %xmm0,0x38(%rsp)
lea    0x50(%rsp),%rdi
lea    0x70(%rsp),%rsi
lea    0x60(%rsp),%rdx
call   1060 <dd_sincos_taylor@plt>
mov    0x24(%rsp),%eax
cmp    $0xffffffff,%eax
je     1301 <dd_sin+0x161>
cmp    $0x1,%eax
je     1330 <dd_sin+0x190>
test   %eax,%eax
jne    136c <dd_sin+0x1cc>
lea    0x40(%rsp),%rdi
lea    0x70(%rsp),%rsi
mov    %r14,%rdx
call   10a0 <dd_mul@plt>
lea    0x30(%rsp),%rdi
lea    0x60(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,0xc(%rsp)
jg     135d <dd_sin+0x1bd>
jmp    13a1 <dd_sin+0x201>
mov    0x24(%rsp),%eax
lea    0x50(%rsp),%rdi
cmp    $0xffffffff,%eax
je     13b0 <dd_sin+0x210>
cmp    $0x1,%eax
je     13ba <dd_sin+0x21a>
test   %eax,%eax
jne    13c4 <dd_sin+0x224>
mov    %r14,%rsi
call   10b0 <dd_sin_taylor@plt>
jmp    13d4 <dd_sin+0x234>
lea    0x30(%rsp),%rdi
lea    0x70(%rsp),%rsi
mov    %r14,%rdx
call   10a0 <dd_mul@plt>
lea    0x40(%rsp),%rdi
lea    0x60(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,0xc(%rsp)
jg     13a1 <dd_sin+0x201>
jmp    1399 <dd_sin+0x1f9>
lea    0x40(%rsp),%rdi
lea    0x60(%rsp),%rsi
mov    %r14,%rdx
call   10a0 <dd_mul@plt>
lea    0x30(%rsp),%rdi
lea    0x70(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,0xc(%rsp)
jg     13a1 <dd_sin+0x201>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1040 <dd_inc@plt>
jmp    13d4 <dd_sin+0x234>
lea    0x30(%rsp),%rdi
lea    0x60(%rsp),%rsi
mov    %r14,%rdx
call   10a0 <dd_mul@plt>
lea    0x40(%rsp),%rdi
lea    0x70(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10a0 <dd_mul@plt>
cmpl   $0x0,0xc(%rsp)
jle    13a1 <dd_sin+0x201>
mov    %r14,%rdi
call   10c0 <dd_minus@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1030 <dd_dec@plt>
jmp    13d4 <dd_sin+0x234>
mov    %r14,%rsi
call   1080 <dd_cos_taylor@plt>
jmp    13cc <dd_sin+0x22c>
mov    %r14,%rsi
call   1080 <dd_cos_taylor@plt>
jmp    13d4 <dd_sin+0x234>
mov    %r14,%rsi
call   10b0 <dd_sin_taylor@plt>
mov    %r14,%rdi
call   10c0 <dd_minus@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @dd_sin(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [2 x double]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [2 x double]
%11 = alloca [2 x double]
%12 = alloca [2 x double]
%13 = alloca [2 x double]
%14 = alloca [2 x double]
%15 = alloca [4 x double]
%16 = alloca [4 x double]
%17 = alloca [4 x double]
%18 = alloca [4 x double]
store double* %0, double** %3
store double* %1, double** %4
%19 = load double*, double** %3
%20 = call i32 @dd_is_zero(double* %19)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %27
22: ; preds = %2
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 0
store double 0.000000e+00, double* %24
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 1
store double 0.000000e+00, double* %26
br label %204
27: ; preds = %2
%28 = load double*, double** %3
%29 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%30 = call i32 @dd_reduce_modulo_2pi(double* %28, double* %29, i32* %6, i32* %7, i32* %8, i32* %9)
%31 = load i32, i32* %9
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %38
33: ; preds = %27
%34 = load double*, double** %4
%35 = getelementptr inbounds double, double* %34, i64 0
store double -2.000000e+00, double* %35
%36 = load double*, double** %4
%37 = getelementptr inbounds double, double* %36, i64 1
store double 0.000000e+00, double* %37
br label %203
38: ; preds = %27
%39 = load i32, i32* %7
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %73
41: ; preds = %38
%42 = load i32, i32* %6
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %41
%45 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%46 = load double*, double** %4
%47 = call i32 @dd_sin_taylor(double* %45, double* %46)
br label %72
48: ; preds = %41
%49 = load i32, i32* %6
%50 = icmp eq i32 %49, 1
br i1 %50, label %51, label %55
51: ; preds = %48
%52 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%53 = load double*, double** %4
%54 = call i32 @dd_cos_taylor(double* %52, double* %53)
br label %71
55: ; preds = %48
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %64
58: ; preds = %55
%59 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%60 = load double*, double** %4
%61 = call i32 @dd_cos_taylor(double* %59, double* %60)
%62 = load double*, double** %4
%63 = call i32 @dd_minus(double* %62)
br label %70
64: ; preds = %55
%65 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%66 = load double*, double** %4
%67 = call i32 @dd_sin_taylor(double* %65, double* %66)
%68 = load double*, double** %4
%69 = call i32 @dd_minus(double* %68)
br label %70
70: ; preds = %64, %58
br label %71
71: ; preds = %70, %51
br label %72
72: ; preds = %71, %44
br label %202
73: ; preds = %38
%74 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%75 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 0
%76 = getelementptr inbounds [4 x double], [4 x double]* %17, i64 0, i64 0
%77 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 0
%78 = call i32 @sincostables(double* %74, double* %75, double* %76, double* %77)
%79 = load i32, i32* %8
%80 = sub nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [4 x double], [4 x double]* %17, i64 0, i64 %81
%83 = load double, double* %82
%84 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
store double %83, double* %84
%85 = load i32, i32* %8
%86 = sub nsw i32 %85, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 %87
%89 = load double, double* %88
%90 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 1
store double %89, double* %90
%91 = load i32, i32* %8
%92 = sub nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 %93
%95 = load double, double* %94
%96 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
store double %95, double* %96
%97 = load i32, i32* %8
%98 = sub nsw i32 %97, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 %99
%101 = load double, double* %100
%102 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 1
store double %101, double* %102
%103 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%104 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%105 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%106 = call i32 @dd_sincos_taylor(double* %103, double* %104, double* %105)
%107 = load i32, i32* %6
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %129
109: ; preds = %73
%110 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%111 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%112 = load double*, double** %4
%113 = call i32 @dd_mul(double* %110, double* %111, double* %112)
%114 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%115 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%116 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%117 = call i32 @dd_mul(double* %114, double* %115, double* %116)
%118 = load i32, i32* %7
%119 = icmp sgt i32 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %109
%121 = load double*, double** %4
%122 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%123 = call i32 @dd_inc(double* %121, double* %122)
br label %128
124: ; preds = %109
%125 = load double*, double** %4
%126 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%127 = call i32 @dd_dec(double* %125, double* %126)
br label %128
128: ; preds = %124, %120
br label %201
129: ; preds = %73
%130 = load i32, i32* %6
%131 = icmp eq i32 %130, 1
br i1 %131, label %132, label %152
132: ; preds = %129
%133 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%134 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%135 = load double*, double** %4
%136 = call i32 @dd_mul(double* %133, double* %134, double* %135)
%137 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%138 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%139 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%140 = call i32 @dd_mul(double* %137, double* %138, double* %139)
%141 = load i32, i32* %7
%142 = icmp sgt i32 %141, 0
br i1 %142, label %143, label %147
143: ; preds = %132
%144 = load double*, double** %4
%145 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%146 = call i32 @dd_dec(double* %144, double* %145)
br label %151
147: ; preds = %132
%148 = load double*, double** %4
%149 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%150 = call i32 @dd_inc(double* %148, double* %149)
br label %151
151: ; preds = %147, %143
br label %200
152: ; preds = %129
%153 = load i32, i32* %6
%154 = icmp eq i32 %153, -1
br i1 %154, label %155, label %177
155: ; preds = %152
%156 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%157 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%158 = load double*, double** %4
%159 = call i32 @dd_mul(double* %156, double* %157, double* %158)
%160 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%161 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%162 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%163 = call i32 @dd_mul(double* %160, double* %161, double* %162)
%164 = load i32, i32* %7
%165 = icmp sgt i32 %164, 0
br i1 %165, label %166, label %170
166: ; preds = %155
%167 = load double*, double** %4
%168 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%169 = call i32 @dd_dec(double* %167, double* %168)
br label %176
170: ; preds = %155
%171 = load double*, double** %4
%172 = call i32 @dd_minus(double* %171)
%173 = load double*, double** %4
%174 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%175 = call i32 @dd_dec(double* %173, double* %174)
br label %176
176: ; preds = %170, %166
br label %199
177: ; preds = %152
%178 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%179 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%180 = load double*, double** %4
%181 = call i32 @dd_mul(double* %178, double* %179, double* %180)
%182 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%183 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%184 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%185 = call i32 @dd_mul(double* %182, double* %183, double* %184)
%186 = load i32, i32* %7
%187 = icmp sgt i32 %186, 0
br i1 %187, label %188, label %194
188: ; preds = %177
%189 = load double*, double** %4
%190 = call i32 @dd_minus(double* %189)
%191 = load double*, double** %4
%192 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%193 = call i32 @dd_dec(double* %191, double* %192)
br label %198
194: ; preds = %177
%195 = load double*, double** %4
%196 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%197 = call i32 @dd_dec(double* %195, double* %196)
br label %198
198: ; preds = %194, %188
br label %199
199: ; preds = %198, %176
br label %200
200: ; preds = %199, %151
br label %201
201: ; preds = %200, %128
br label %202
202: ; preds = %201, %72
br label %203
203: ; preds = %202, %33
br label %204
204: ; preds = %203, %22
ret void
}

LLVM IR (-O2):
define void @dd_sin(double* %0, double* %1) {
%3 = alloca [2 x double]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x double]
%9 = alloca [2 x double]
%10 = alloca [2 x double]
%11 = alloca [2 x double]
%12 = alloca [2 x double]
%13 = alloca [4 x double]
%14 = alloca [4 x double]
%15 = alloca [4 x double]
%16 = alloca [4 x double]
%17 = tail call i32 @dd_is_zero(double* %0)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = bitcast double* %1 to i8*
br label %126
21: ; preds = %2
%22 = bitcast [2 x double]* %3 to i8*
%23 = bitcast i32* %4 to i8*
%24 = bitcast i32* %5 to i8*
%25 = bitcast i32* %6 to i8*
%26 = bitcast i32* %7 to i8*
%27 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%28 = call i32 @dd_reduce_modulo_2pi(double* %0, double* %27, i32* %4, i32* %5, i32* %6, i32* %7)
%29 = load i32, i32* %7
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %21
%32 = bitcast double* %1 to <2 x double>*
store <2 x double> <double -2.000000e+00, double 0.000000e+00>, <2 x double>* %32
br label %125
33: ; preds = %21
%34 = load i32, i32* %5
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %48
36: ; preds = %33
%37 = load i32, i32* %4
switch i32 %37, label %45 [
i32 0, label %38
i32 1, label %40
i32 -1, label %42
]
38: ; preds = %36
%39 = call i32 @dd_sin_taylor(double* %27, double* %1)
br label %125
40: ; preds = %36
%41 = call i32 @dd_cos_taylor(double* %27, double* %1)
br label %125
42: ; preds = %36
%43 = call i32 @dd_cos_taylor(double* %27, double* %1)
%44 = call i32 @dd_minus(double* %1)
br label %125
45: ; preds = %36
%46 = call i32 @dd_sin_taylor(double* %27, double* %1)
%47 = call i32 @dd_minus(double* %1)
br label %125
48: ; preds = %33
%49 = bitcast [2 x double]* %8 to i8*
%50 = bitcast [2 x double]* %9 to i8*
%51 = bitcast [2 x double]* %10 to i8*
%52 = bitcast [2 x double]* %11 to i8*
%53 = bitcast [2 x double]* %12 to i8*
%54 = bitcast [4 x double]* %13 to i8*
%55 = bitcast [4 x double]* %14 to i8*
%56 = bitcast [4 x double]* %15 to i8*
%57 = bitcast [4 x double]* %16 to i8*
%58 = getelementptr inbounds [4 x double], [4 x double]* %13, i64 0, i64 0
%59 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%60 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%61 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 0
%62 = call i32 @sincostables(double* %58, double* %59, double* %60, double* %61)
%63 = load i32, i32* %6
%64 = add nsw i32 %63, -1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 %65
%67 = load double, double* %66
%68 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
store double %67, double* %68
%69 = getelementptr inbounds [4 x double], [4 x double]* %16, i64 0, i64 %65
%70 = load double, double* %69
%71 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
store double %70, double* %71
%72 = getelementptr inbounds [4 x double], [4 x double]* %13, i64 0, i64 %65
%73 = load double, double* %72
%74 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
store double %73, double* %74
%75 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 %65
%76 = load double, double* %75
%77 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
store double %76, double* %77
%78 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%79 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%80 = call i32 @dd_sincos_taylor(double* %27, double* %78, double* %79)
%81 = load i32, i32* %4
switch i32 %81, label %113 [
i32 0, label %82
i32 1, label %92
i32 -1, label %102
]
82: ; preds = %48
%83 = call i32 @dd_mul(double* %68, double* %78, double* %1)
%84 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%85 = call i32 @dd_mul(double* %74, double* %79, double* %84)
%86 = load i32, i32* %5
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %82
%89 = call i32 @dd_inc(double* %1, double* %84)
br label %124
90: ; preds = %82
%91 = call i32 @dd_dec(double* %1, double* %84)
br label %124
92: ; preds = %48
%93 = call i32 @dd_mul(double* %68, double* %79, double* %1)
%94 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%95 = call i32 @dd_mul(double* %74, double* %78, double* %94)
%96 = load i32, i32* %5
%97 = icmp sgt i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %92
%99 = call i32 @dd_dec(double* %1, double* %94)
br label %124
100: ; preds = %92
%101 = call i32 @dd_inc(double* %1, double* %94)
br label %124
102: ; preds = %48
%103 = call i32 @dd_mul(double* %74, double* %78, double* %1)
%104 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%105 = call i32 @dd_mul(double* %68, double* %79, double* %104)
%106 = load i32, i32* %5
%107 = icmp sgt i32 %106, 0
br i1 %107, label %108, label %110
108: ; preds = %102
%109 = call i32 @dd_dec(double* %1, double* %104)
br label %124
110: ; preds = %102
%111 = call i32 @dd_minus(double* %1)
%112 = call i32 @dd_dec(double* %1, double* %104)
br label %124
113: ; preds = %48
%114 = call i32 @dd_mul(double* %74, double* %79, double* %1)
%115 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%116 = call i32 @dd_mul(double* %68, double* %78, double* %115)
%117 = load i32, i32* %5
%118 = icmp sgt i32 %117, 0
br i1 %118, label %119, label %122
119: ; preds = %113
%120 = call i32 @dd_minus(double* %1)
%121 = call i32 @dd_dec(double* %1, double* %115)
br label %124
122: ; preds = %113
%123 = call i32 @dd_dec(double* %1, double* %115)
br label %124
124: ; preds = %100, %98, %119, %122, %108, %110, %88, %90
br label %125
125: ; preds = %124, %40, %45, %42, %38, %31
br label %126
126: ; preds = %125, %19
ret void
}