#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 sqrt(double);
double asin(double x) {
  double y;
  int sign;
  if (x > 1.0 || x < -1.0)
    return (1);
  sign = 0;
  if (x < 0) {
    sign = 1;
    x = -x;
  }
  y = ((((((-.0012624911 * x + .0066700901) * x - .0170881256) * x +
          .0308918810) *
             x -
         .0501743046) *
            x +
        .0889789874) *
           x -
       .2145988016) *
          x +
      1.5707963050;
  y = 1.57079632679 - sqrt(1.0 - x) * y;
  if (sign)
    y = -y;
  return (y);
}


x86 assembly (clang, -O0):
<asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1147 <asin+0x37>
movsd  0xecc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1159 <asin+0x49>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ae <asin+0x19e>
movl   $0x0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1196 <asin+0x86>
movl   $0x1,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe42(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe25(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe08(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdeb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xdc2(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xda0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     12a4 <asin+0x194>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asin>:
sub    $0x28,%rsp
movapd %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
ucomisd %xmm0,%xmm1
ja     1225 <asin+0x115>
movsd  0xed6(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1225 <asin+0x115>
movapd 0xf1c(%rip),%xmm0
xorpd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm1,%xmm4
cmpltsd %xmm2,%xmm4
andpd  %xmm4,%xmm0
movapd %xmm4,%xmm3
andnpd %xmm1,%xmm3
orpd   %xmm0,%xmm3
movsd  0xea3(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  0xe9f(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  0xe9b(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  0xe97(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  0xe93(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  0xe8f(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  0xe8b(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  0xe87(%rip),%xmm5
movsd  0xe37(%rip),%xmm0
subsd  %xmm3,%xmm0
ucomisd %xmm2,%xmm0
jb     11dc <asin+0xcc>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    11fd <asin+0xed>
movapd %xmm4,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm5
movapd 0x10(%rsp),%xmm4
movapd %xmm0,%xmm1
mulsd  %xmm5,%xmm1
movsd  0xe47(%rip),%xmm0
subsd  %xmm1,%xmm0
movapd %xmm4,%xmm1
andnpd %xmm0,%xmm1
xorpd  0xe43(%rip),%xmm0
andpd  %xmm4,%xmm0
orpd   %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 1.000000e+00
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load double, double* %3
%10 = fcmp olt double %9, -1.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8, %1
store double 1.000000e+00, double* %2
br label %46
12: ; preds = %8
store i32 0, i32* %5
%13 = load double, double* %3
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %12
store i32 1, i32* %5
%16 = load double, double* %3
%17 = fneg double %16
store double %17, double* %3
br label %18
18: ; preds = %15, %12
%19 = load double, double* %3
%20 = call double @llvm.fmuladd.f64(double 0xBF54AF457F1A7A45, double %19, double 0x3F7B5218AD7437A2)
%21 = load double, double* %3
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double 0xBF917F8CB268630F)
%23 = load double, double* %3
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double 0x3F9FA21F0A6D7D6D)
%25 = load double, double* %3
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double 0xBFA9B0724AB68CB8)
%27 = load double, double* %3
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double 0x3FB6C753B0EA08C1)
%29 = load double, double* %3
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double 0xBFCB77F93950FF58)
%31 = load double, double* %3
%32 = call double @llvm.fmuladd.f64(double %30, double %31, double 0x3FF921FB4E6A7138)
store double %32, double* %4
%33 = load double, double* %3
%34 = fsub double 1.000000e+00, %33
%35 = call double @sqrt(double %34)
%36 = load double, double* %4
%37 = fneg double %35
%38 = call double @llvm.fmuladd.f64(double %37, double %36, double 0x3FF921FB5443D6F4)
store double %38, double* %4
%39 = load i32, i32* %5
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %18
%42 = load double, double* %4
%43 = fneg double %42
store double %43, double* %4
br label %44
44: ; preds = %41, %18
%45 = load double, double* %4
store double %45, double* %2
br label %46
46: ; preds = %44, %11
%47 = load double, double* %2
ret double %47
}

LLVM IR (-O2):
define double @asin(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
%3 = fcmp olt double %0, -1.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %22, label %5
5: ; preds = %1
%6 = fcmp olt double %0, 0.000000e+00
%7 = fneg double %0
%8 = select i1 %6, double %7, double %0
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0xBF54AF457F1A7A45, double 0x3F7B5218AD7437A2)
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double 0xBF917F8CB268630F)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %8, double 0x3F9FA21F0A6D7D6D)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %8, double 0xBFA9B0724AB68CB8)
%13 = tail call double @llvm.fmuladd.f64(double %12, double %8, double 0x3FB6C753B0EA08C1)
%14 = tail call double @llvm.fmuladd.f64(double %13, double %8, double 0xBFCB77F93950FF58)
%15 = tail call double @llvm.fmuladd.f64(double %14, double %8, double 0x3FF921FB4E6A7138)
%16 = fsub double 1.000000e+00, %8
%17 = tail call double @sqrt(double %16)
%18 = fneg double %17
%19 = tail call double @llvm.fmuladd.f64(double %18, double %15, double 0x3FF921FB5443D6F4)
%20 = fneg double %19
%21 = select i1 %6, double %20, double %19
br label %22
22: ; preds = %1, %5
%23 = phi double [ %21, %5 ], [ 1.000000e+00, %1 ]
ret double %23
}