double astASind(v) const double v;
{
  if (v <= -1.0) {
    if (v + 1.0 > -1e-10)
      return -90.0;
  } else if (v == 0.0) {
    return 0.0;
  } else if (v >= 1.0) {
    if (v - 1.0 < 1e-10)
      return 90.0;
  }
  return asin(v) * 180.0 / 3.141592653589793238462643;
}


x86 assembly (clang, -O0):
<astASind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1166 <astASind+0x56>
movsd  0xed0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1161 <astASind+0x51>
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    120d <astASind+0xfd>
jmp    11e6 <astASind+0xd6>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118b <astASind+0x7b>
jp     118b <astASind+0x7b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    120d <astASind+0xfd>
movsd  -0x10(%rbp),%xmm0
movsd  0xe70(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11dc <astASind+0xcc>
movsd  -0x10(%rbp),%xmm1
movsd  0xe59(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe55(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11d7 <astASind+0xc7>
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    120d <astASind+0xfd>
jmp    11dc <astASind+0xcc>
jmp    11e1 <astASind+0xd1>
jmp    11e6 <astASind+0xd6>
movsd  -0x10(%rbp),%xmm0
call   1030 <asin@plt>
movsd  0xe38(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe24(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astASind>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1159 <astASind+0x49>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112b <astASind+0x1b>
jnp    1192 <astASind+0x82>
ucomisd 0xed5(%rip),%xmm0
jb     1179 <astASind+0x69>
movsd  0xec3(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xedf(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1179 <astASind+0x69>
movsd  0xec9(%rip),%xmm1
jmp    1192 <astASind+0x82>
movsd  0xea7(%rip),%xmm1
addsd  %xmm0,%xmm1
ucomisd 0xeab(%rip),%xmm1
jbe    1179 <astASind+0x69>
movsd  0xe99(%rip),%xmm1
jmp    1192 <astASind+0x82>
call   1030 <asin@plt>
movapd %xmm0,%xmm1
mulsd  0xea6(%rip),%xmm1
divsd  0xea6(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @astASind(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, -1.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 1.000000e+00
%9 = fcmp ogt double %8, -1.000000e-10
br i1 %9, label %10, label %11
10: ; preds = %6
store double -9.000000e+01, double* %2
br label %32
11: ; preds = %6
br label %27
12: ; preds = %1
%13 = load double, double* %3
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
store double 0.000000e+00, double* %2
br label %32
16: ; preds = %12
%17 = load double, double* %3
%18 = fcmp oge double %17, 1.000000e+00
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = load double, double* %3
%21 = fsub double %20, 1.000000e+00
%22 = fcmp olt double %21, 1.000000e-10
br i1 %22, label %23, label %24
23: ; preds = %19
store double 9.000000e+01, double* %2
br label %32
24: ; preds = %19
br label %25
25: ; preds = %24, %16
br label %26
26: ; preds = %25
br label %27
27: ; preds = %26, %11
%28 = load double, double* %3
%29 = call double @asin(double %28)
%30 = fmul double %29, 1.800000e+02
%31 = fdiv double %30, 0x400921FB54442D18
store double %31, double* %2
br label %32
32: ; preds = %27, %23, %15, %10
%33 = load double, double* %2
ret double %33
}

LLVM IR (-O2):
define double @astASind(double %0) {
%2 = fcmp ugt double %0, -1.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fadd double %0, 1.000000e+00
%5 = fcmp ogt double %4, -1.000000e-10
br i1 %5, label %17, label %13
6: ; preds = %1
%7 = fcmp oeq double %0, 0.000000e+00
br i1 %7, label %17, label %8
8: ; preds = %6
%9 = fcmp oge double %0, 1.000000e+00
%10 = fadd double %0, -1.000000e+00
%11 = fcmp olt double %10, 1.000000e-10
%12 = and i1 %9, %11
br i1 %12, label %17, label %13
13: ; preds = %8, %3
%14 = tail call double @asin(double %0)
%15 = fmul double %14, 1.800000e+02
%16 = fdiv double %15, 0x400921FB54442D18
br label %17
17: ; preds = %8, %6, %3, %13
%18 = phi double [ %16, %13 ], [ -9.000000e+01, %3 ], [ 0.000000e+00, %6 ], [ 9.000000e+01, %8 ]
ret double %18
}