#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*/ assert(int);
double geopolySine(double r) {
  assert(r >= -0.5 * 3.1415926535897932385 && r <= 2.0 * 3.1415926535897932385);
  if (r >= 1.5 * 3.1415926535897932385) {
    r -= 2.0 * 3.1415926535897932385;
  }
  if (r >= 0.5 * 3.1415926535897932385) {
    return -geopolySine(r - 3.1415926535897932385);
  } else {
    double r2 = r * r;
    double r3 = r2 * r;
    double r5 = r3 * r2;
    return 0.9996949 * r - 0.1656700 * r3 + 0.0075134 * r5;
  }
}


x86 assembly (clang, -O0):
<geopolySine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xec4(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x29(%rbp)
jb     115c <geopolySine+0x3c>
movsd  0xeb7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1196 <geopolySine+0x76>
movsd  -0x10(%rbp),%xmm0
movsd  0xe7b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe75(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11e4 <geopolySine+0xc4>
movsd  -0x10(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <geopolySine@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1264 <geopolySine+0x144>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xe12(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xde6(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xdc9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geopolySine>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
ucomisd 0xecf(%rip),%xmm0
setae  %al
movsd  0xecc(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movsd  0xebb(%rip),%xmm0
movapd (%rsp),%xmm2
addsd  %xmm2,%xmm0
movsd  0xeb2(%rip),%xmm1
cmpnlesd %xmm2,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
ucomisd 0xea1(%rip),%xmm1
jae    11be <geopolySine+0x9e>
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xe93(%rip),%xmm2
movsd  0xe93(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  0xe8b(%rip),%xmm0
addsd  %xmm3,%xmm0
add    $0x18,%rsp
ret
movsd  0xe62(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <geopolySine@plt>
xorpd  0xe79(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @geopolySine(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
%7 = load double, double* %3
%8 = fcmp oge double %7, 0xBFF921FB54442D18
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp ole double %10, 0x401921FB54442D18
br label %12
12: ; preds = %9, %1
%13 = phi i1 [ false, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load double, double* %3
%17 = fcmp oge double %16, 0x4012D97C7F3321D2
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load double, double* %3
%20 = fsub double %19, 0x401921FB54442D18
store double %20, double* %3
br label %21
21: ; preds = %18, %12
%22 = load double, double* %3
%23 = fcmp oge double %22, 0x3FF921FB54442D18
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load double, double* %3
%26 = fsub double %25, 0x400921FB54442D18
%27 = call double @geopolySine(double %26)
%28 = fneg double %27
store double %28, double* %2
br label %46
29: ; preds = %21
%30 = load double, double* %3
%31 = load double, double* %3
%32 = fmul double %30, %31
store double %32, double* %4
%33 = load double, double* %4
%34 = load double, double* %3
%35 = fmul double %33, %34
store double %35, double* %5
%36 = load double, double* %5
%37 = load double, double* %4
%38 = fmul double %36, %37
store double %38, double* %6
%39 = load double, double* %3
%40 = load double, double* %5
%41 = fmul double 1.656700e-01, %40
%42 = fneg double %41
%43 = call double @llvm.fmuladd.f64(double 0x3FEFFD8028AF4BB3, double %39, double %42)
%44 = load double, double* %6
%45 = call double @llvm.fmuladd.f64(double 7.513400e-03, double %44, double %43)
store double %45, double* %2
br label %46
46: ; preds = %29, %24
%47 = load double, double* %2
ret double %47
}

LLVM IR (-O2):
define double @geopolySine(double %0) {
%2 = fcmp oge double %0, 0xBFF921FB54442D18
%3 = fcmp ole double %0, 0x401921FB54442D18
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp ult double %0, 0x4012D97C7F3321D2
%8 = fadd double %0, 0xC01921FB54442D18
%9 = select i1 %7, double %0, double %8
%10 = fcmp ult double %9, 0x3FF921FB54442D18
br i1 %10, label %17, label %13
11: ; preds = %17, %13
%12 = phi double [ %16, %13 ], [ %23, %17 ]
ret double %12
13: ; preds = %1
%14 = fadd double %9, 0xC00921FB54442D18
%15 = tail call double @geopolySine(double %14)
%16 = fneg double %15
br label %11
17: ; preds = %1
%18 = fmul double %9, %9
%19 = fmul double %9, %18
%20 = fmul double %18, %19
%21 = fmul double %19, -1.656700e-01
%22 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FEFFD8028AF4BB3, double %21)
%23 = tail call double @llvm.fmuladd.f64(double %20, double 7.513400e-03, double %22)
br label %11
}