#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 */
typedef int uint32_t;

/* Variables and functions */
float fastersin(float x) {
  static const float fouroverpi = 1.2732395447351627f;
  static const float fouroverpisq = 0.40528473456935109f;
  static const float q = 0.77633023248007499f;
  union {
    float f;
    uint32_t i;
  } p = {0.22308510060189463f};
  union {
    float f;
    uint32_t i;
  } vx = {x};
  uint32_t sign = vx.i & 0x80000000;
  vx.i &= 0x7FFFFFFF;
  float qpprox = fouroverpi * x - fouroverpisq * x * vx.f;
  p.i |= sign;
  return qpprox * (q + p.f * qpprox);
}


x86 assembly (clang, -O0):
<fastersin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    0xefd(%rip),%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x80000000,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec9(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xea6(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  0xe71(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastersin>:
movmskps %xmm0,%eax
shl    $0x1f,%eax
movaps 0xef3(%rip),%xmm1
andps  %xmm0,%xmm1
movss  0xef8(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  0xef0(%rip),%xmm0
mulss  %xmm1,%xmm2
addss  %xmm2,%xmm0
or     $0x3e64706c,%eax
movd   %eax,%xmm1
mulss  %xmm0,%xmm1
addss  0xed7(%rip),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
%union.anon.0 = type { float }
@fastersin.fouroverpi = internal constant float 0x3FF45F3060000000
@fastersin.fouroverpisq = internal constant float 0x3FD9F02F60000000
@fastersin.q = internal constant float 0x3FE8D7B280000000
@__const.fastersin.p = %union.anon { float 0x3FCC8E0D80000000 }
define float @fastersin(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca %union.anon.0
%5 = alloca i32
%6 = alloca float
store float %0, float* %2
%7 = bitcast %union.anon* %3 to i8*
%8 = bitcast %union.anon.0* %4 to float*
%9 = load float, float* %2
store float %9, float* %8
%10 = bitcast %union.anon.0* %4 to i32*
%11 = load i32, i32* %10
%12 = and i32 %11, -2147483648
store i32 %12, i32* %5
%13 = bitcast %union.anon.0* %4 to i32*
%14 = load i32, i32* %13
%15 = and i32 %14, 2147483647
store i32 %15, i32* %13
%16 = load float, float* %2
%17 = load float, float* %2
%18 = fmul float 0x3FD9F02F60000000, %17
%19 = bitcast %union.anon.0* %4 to float*
%20 = load float, float* %19
%21 = fmul float %18, %20
%22 = fneg float %21
%23 = call float @llvm.fmuladd.f32(float 0x3FF45F3060000000, float %16, float %22)
store float %23, float* %6
%24 = load i32, i32* %5
%25 = bitcast %union.anon* %3 to i32*
%26 = load i32, i32* %25
%27 = or i32 %26, %24
store i32 %27, i32* %25
%28 = load float, float* %6
%29 = bitcast %union.anon* %3 to float*
%30 = load float, float* %29
%31 = load float, float* %6
%32 = call float @llvm.fmuladd.f32(float %30, float %31, float 0x3FE8D7B280000000)
%33 = fmul float %28, %32
ret float %33
}

LLVM IR (-O2):
define float @fastersin(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, -2147483648
%4 = and i32 %2, 2147483647
%5 = bitcast i32 %4 to float
%6 = fmul float %0, 0xBFD9F02F60000000
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FF45F3060000000, float %7)
%9 = or i32 %3, 1046769772
%10 = bitcast i32 %9 to float
%11 = tail call float @llvm.fmuladd.f32(float %10, float %8, float 0x3FE8D7B280000000)
%12 = fmul float %8, %11
ret float %12
}