#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 DBL_EPSILON;
double aa_tf_cos_series2(double);
double aa_tf_sinc_series2(double);
double cos(double);
double sin(double);
double sqrt(double);
void aa_tf_sinccos2(double theta2, double *sc, double *c) {
  if (theta2 < sqrt(DBL_EPSILON)) {
    *sc = aa_tf_sinc_series2(theta2);
    *c = aa_tf_cos_series2(theta2);
  } else {
    double theta = sqrt(theta2);
    double s = sin(theta);
    *c = cos(theta);
    *sc = s / theta;
  }
}


x86 assembly (clang, -O0):
<aa_tf_sinccos2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2e72(%rip),%rax
movsd  (%rax),%xmm0
call   1070 <sqrt@plt>
movsd  -0x30(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    11b7 <aa_tf_sinccos2+0x67>
movsd  -0x8(%rbp),%xmm0
call   1050 <aa_tf_sinc_series2@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <aa_tf_cos_series2@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11f9 <aa_tf_sinccos2+0xa9>
movsd  -0x8(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_tf_sinccos2>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movapd %xmm0,%xmm2
mov    0x2e80(%rip),%rax
movsd  (%rax),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm2,0x8(%rsp)
jb     1199 <aa_tf_sinccos2+0x49>
sqrtsd %xmm0,%xmm0
ucomisd %xmm2,%xmm0
ja     11aa <aa_tf_sinccos2+0x5a>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     11c9 <aa_tf_sinccos2+0x79>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    11d2 <aa_tf_sinccos2+0x82>
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
ucomisd %xmm2,%xmm0
jbe    1186 <aa_tf_sinccos2+0x36>
movapd %xmm2,%xmm0
call   1050 <aa_tf_sinc_series2@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <aa_tf_cos_series2@plt>
movsd  %xmm0,(%r14)
jmp    1203 <aa_tf_sinccos2+0xb3>
movapd %xmm2,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,(%r14)
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@DBL_EPSILON = global double 0.000000e+00
define void @aa_tf_sinccos2(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%9 = load double, double* %4
%10 = load double, double* @DBL_EPSILON
%11 = call double @sqrt(double %10)
%12 = fcmp olt double %9, %11
br i1 %12, label %13, label %20
13: ; preds = %3
%14 = load double, double* %4
%15 = call double @aa_tf_sinc_series2(double %14)
%16 = load double*, double** %5
store double %15, double* %16
%17 = load double, double* %4
%18 = call double @aa_tf_cos_series2(double %17)
%19 = load double*, double** %6
store double %18, double* %19
br label %32
20: ; preds = %3
%21 = load double, double* %4
%22 = call double @sqrt(double %21)
store double %22, double* %7
%23 = load double, double* %7
%24 = call double @sin(double %23)
store double %24, double* %8
%25 = load double, double* %7
%26 = call double @cos(double %25)
%27 = load double*, double** %6
store double %26, double* %27
%28 = load double, double* %8
%29 = load double, double* %7
%30 = fdiv double %28, %29
%31 = load double*, double** %5
store double %30, double* %31
br label %32
32: ; preds = %20, %13
ret void
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define void @aa_tf_sinccos2(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = load double, double* @DBL_EPSILON
%5 = tail call double @sqrt(double %4)
%6 = fcmp ogt double %5, %0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call double @aa_tf_sinc_series2(double %0)
store double %8, double* %1
%9 = tail call double @aa_tf_cos_series2(double %0)
store double %9, double* %2
br label %15
10: ; preds = %3
%11 = tail call double @sqrt(double %0)
%12 = tail call double @sin(double %11)
%13 = tail call double @cos(double %11)
store double %13, double* %2
%14 = fdiv double %12, %11
store double %14, double* %1
br label %15
15: ; preds = %10, %7
ret void
}