#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 */
struct sigaction {
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ sa_handler;
  int /*<<< orphan*/ sa_flags;
};

/* Variables and functions */
int /*<<< orphan*/ SA_SIGINFO;
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int remove_sigaction_FP(void) {
  struct sigaction sa;
  sa.sa_flags = SA_SIGINFO;
  sa.sa_handler = SIG_DFL;
  sigemptyset(&sa.sa_mask);
  sigaction(SIGFPE, &sa, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<remove_sigaction_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_sigaction_FP>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32, i32, i32 }
@SA_SIGINFO = global i32 0
@SIG_DFL = global i32 0
@SIGFPE = global i32 0
define i32 @remove_sigaction_FP() {
%1 = alloca %struct.sigaction
%2 = load i32, i32* @SA_SIGINFO
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 2
store i32 %2, i32* %3
%4 = load i32, i32* @SIG_DFL
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
%7 = call i32 @sigemptyset(i32* %6)
%8 = load i32, i32* @SIGFPE
%9 = call i32 @sigaction(i32 %8, %struct.sigaction* %1, i32* null)
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type { i32, i32, i32 }
@SA_SIGINFO = global i32 0
@SIG_DFL = global i32 0
@SIGFPE = global i32 0
define i32 @remove_sigaction_FP() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SA_SIGINFO
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 2
store i32 %3, i32* %4
%5 = load i32, i32* @SIG_DFL
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 1
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
%8 = call i32 @sigemptyset(i32* %7)
%9 = load i32, i32* @SIGFPE
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %1, i32* null)
ret i32 0
}