#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 */
long double NAN;
long double __domain_error();
long atanl(long double);
scalar_t__ isnan(long double);
long sqrtl(long);
long double asinl(long double x) {
  if ((x > 1.l) || (x < -1.l))
    return __domain_error();
  if (isnan(x))
    return NAN;
  return 2.l * atanl(x / (1.l + sqrtl(1.l - x * x)));
}


x86 assembly (clang, -O0):
<asinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fld1
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
ja     117a <asinl+0x3a>
jmp    1164 <asinl+0x24>
fldt   -0x20(%rbp)
fld1
fchs
fucomip %st(1),%st
fstp   %st(0)
jbe    1189 <asinl+0x49>
jmp    117a <asinl+0x3a>
xor    %eax,%eax
call   1040 <__domain_error@plt>
fstpt  -0x10(%rbp)
jmp    120d <asinl+0xcd>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <isnan@plt>
cmp    $0x0,%rax
je     11b1 <asinl+0x71>
mov    0x2e51(%rip),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    120d <asinl+0xcd>
fldt   -0x20(%rbp)
fld    %st(0)
fstpt  -0x48(%rbp)
fmul   %st,%st(0)
fld1
fld    %st(0)
fstpt  -0x54(%rbp)
fsubp  %st,%st(1)
fnstcw -0x3a(%rbp)
movzwl -0x3a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x3c(%rbp)
fldcw  -0x3c(%rbp)
fistpll -0x38(%rbp)
fldcw  -0x3a(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <sqrtl@plt>
fldt   -0x54(%rbp)
fldt   -0x48(%rbp)
mov    %rax,-0x30(%rbp)
fildll -0x30(%rbp)
faddp  %st,%st(2)
fdivp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <atanl@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
fadd   %st,%st(0)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fld1
fxch   %st(1)
fucomi %st(1),%st
ja     117f <asinl+0x3f>
fxch   %st(1)
fchs
fucomip %st(1),%st
fldz
fxch   %st(1)
ja     117f <asinl+0x3f>
fstp   %st(1)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1060 <isnan@plt>
test   %rax,%rax
je     118e <asinl+0x4e>
mov    0x2e80(%rip),%rax
fldt   (%rax)
add    $0x48,%rsp
ret
fstp   %st(1)
fstp   %st(0)
xor    %eax,%eax
add    $0x48,%rsp
jmp    1040 <__domain_error@plt>
fldt   0x14(%rsp)
fmul   %st,%st(0)
fld1
fld    %st(0)
fstpt  0x3c(%rsp)
fsubp  %st,%st(1)
fnstcw 0x10(%rsp)
movzwl 0x10(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x12(%rsp)
fldcw  0x12(%rsp)
fistpll 0x20(%rsp)
fldcw  0x10(%rsp)
mov    0x20(%rsp),%rdi
call   1050 <sqrtl@plt>
mov    %rax,0x28(%rsp)
fildll 0x28(%rsp)
fldt   0x3c(%rsp)
faddp  %st,%st(1)
fldt   0x14(%rsp)
fdivp  %st,%st(1)
fstpt  (%rsp)
call   1030 <atanl@plt>
mov    %rax,0x30(%rsp)
fildll 0x30(%rsp)
fadd   %st,%st(0)
add    $0x48,%rsp
ret

LLVM IR (-O0):
@NAN = global x86_fp80 0xK00000000000000000000
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fcmp ogt x86_fp80 %4, 0xK3FFF8000000000000000
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load x86_fp80, x86_fp80* %3
%8 = fcmp olt x86_fp80 %7, 0xKBFFF8000000000000000
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = call x86_fp80 (...) @__domain_error()
store x86_fp80 %10, x86_fp80* %2
br label %31
11: ; preds = %6
%12 = load x86_fp80, x86_fp80* %3
%13 = call i64 @isnan(x86_fp80 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load x86_fp80, x86_fp80* @NAN
store x86_fp80 %16, x86_fp80* %2
br label %31
17: ; preds = %11
%18 = load x86_fp80, x86_fp80* %3
%19 = load x86_fp80, x86_fp80* %3
%20 = load x86_fp80, x86_fp80* %3
%21 = fneg x86_fp80 %19
%22 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %21, x86_fp80 %20, x86_fp80 0xK3FFF8000000000000000)
%23 = fptosi x86_fp80 %22 to i64
%24 = call i64 @sqrtl(i64 %23)
%25 = sitofp i64 %24 to x86_fp80
%26 = fadd x86_fp80 0xK3FFF8000000000000000, %25
%27 = fdiv x86_fp80 %18, %26
%28 = call i64 @atanl(x86_fp80 %27)
%29 = sitofp i64 %28 to x86_fp80
%30 = fmul x86_fp80 0xK40008000000000000000, %29
store x86_fp80 %30, x86_fp80* %2
br label %31
31: ; preds = %17, %15, %9
%32 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %32
}

LLVM IR (-O2):
@NAN = global x86_fp80 0xK00000000000000000000
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = fcmp ogt x86_fp80 %0, 0xK3FFF8000000000000000
%3 = fcmp olt x86_fp80 %0, 0xKBFFF8000000000000000
%4 = or i1 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call x86_fp80 (...) @__domain_error()
br label %23
7: ; preds = %1
%8 = tail call i64 @isnan(x86_fp80 %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = load x86_fp80, x86_fp80* @NAN
br label %23
12: ; preds = %7
%13 = fneg x86_fp80 %0
%14 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %13, x86_fp80 %0, x86_fp80 0xK3FFF8000000000000000)
%15 = fptosi x86_fp80 %14 to i64
%16 = tail call i64 @sqrtl(i64 %15)
%17 = sitofp i64 %16 to x86_fp80
%18 = fadd x86_fp80 %17, 0xK3FFF8000000000000000
%19 = fdiv x86_fp80 %0, %18
%20 = tail call i64 @atanl(x86_fp80 %19)
%21 = sitofp i64 %20 to x86_fp80
%22 = fmul x86_fp80 %21, 0xK40008000000000000000
br label %23
23: ; preds = %12, %10, %5
%24 = phi x86_fp80 [ %6, %5 ], [ %11, %10 ], [ %22, %12 ]
ret x86_fp80 %24
}