#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 /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ SIG_UNBLOCK;
float acosh(double);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void set_nan_(float *val) {
  sigset_t block_fpe;
  sigemptyset(&block_fpe);
  sigaddset(&block_fpe, SIGFPE);
  sigprocmask(SIG_BLOCK, &block_fpe, NULL);
  *val = acosh(.2);
  sigprocmask(SIG_UNBLOCK, &block_fpe, NULL);
  return;
}


x86 assembly (clang, -O0):
<set_nan_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <sigemptyset@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1060 <sigaddset@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
movsd  0xe7b(%rip),%xmm0
call   1040 <acosh@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nan_>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigemptyset@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1060 <sigaddset@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
movsd  0xe80(%rip),%xmm0
call   1040 <acosh@plt>
movss  %xmm0,(%r14)
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGFPE = global i32 0
@SIG_BLOCK = global i32 0
@SIG_UNBLOCK = global i32 0
define void @set_nan_(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* @SIGFPE
%6 = call i32 @sigaddset(i32* %3, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %3, i32* null)
%9 = call float @acosh(double 2.000000e-01)
%10 = load float*, float** %2
store float %9, float* %10
%11 = load i32, i32* @SIG_UNBLOCK
%12 = call i32 @sigprocmask(i32 %11, i32* %3, i32* null)
ret void
}

LLVM IR (-O2):
@SIGFPE = global i32 0
@SIG_BLOCK = global i32 0
@SIG_UNBLOCK = global i32 0
define void @set_nan_(float* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = load i32, i32* @SIGFPE
%6 = call i32 @sigaddset(i32* %2, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %2, i32* null)
%9 = call float @acosh(double 2.000000e-01)
store float %9, float* %0
%10 = load i32, i32* @SIG_UNBLOCK
%11 = call i32 @sigprocmask(i32 %10, i32* %2, i32* null)
ret void
}