#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 */
int /*<<< orphan*/ FE_ALL_EXCEPT;
int /*<<< orphan*/ FE_DIVBYZERO;
int /*<<< orphan*/ FE_INEXACT;
int /*<<< orphan*/ FE_INVALID;
int /*<<< orphan*/ FE_OVERFLOW;
int /*<<< orphan*/ FE_UNDERFLOW;
int /*<<< orphan*/ feclearexcept(int /*<<< orphan*/);
int /*<<< orphan*/ feraiseexcept(int /*<<< orphan*/);
int /*<<< orphan*/ show_fe_exceptions();
int main(void) {
  show_fe_exceptions();
  feclearexcept(FE_ALL_EXCEPT);
  feraiseexcept(FE_INEXACT);
  show_fe_exceptions();
  feclearexcept(FE_ALL_EXCEPT);
  feraiseexcept(FE_INVALID);
  show_fe_exceptions();
  feclearexcept(FE_ALL_EXCEPT);
  feraiseexcept(FE_DIVBYZERO);
  show_fe_exceptions();
  feclearexcept(FE_ALL_EXCEPT);
  feraiseexcept(FE_OVERFLOW);
  show_fe_exceptions();
  feclearexcept(FE_ALL_EXCEPT);
  feraiseexcept(FE_UNDERFLOW);
  show_fe_exceptions();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <show_fe_exceptions@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <feclearexcept@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
mov    $0x0,%al
call   1040 <show_fe_exceptions@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1050 <feclearexcept@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
mov    $0x0,%al
call   1040 <show_fe_exceptions@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
call   1050 <feclearexcept@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
mov    $0x0,%al
call   1040 <show_fe_exceptions@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1050 <feclearexcept@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
mov    $0x0,%al
call   1040 <show_fe_exceptions@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
call   1050 <feclearexcept@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
mov    $0x0,%al
call   1040 <show_fe_exceptions@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <show_fe_exceptions@plt>
mov    0x2e81(%rip),%rbx
mov    (%rbx),%edi
call   1050 <feclearexcept@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
call   1040 <show_fe_exceptions@plt>
mov    (%rbx),%edi
call   1050 <feclearexcept@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
call   1040 <show_fe_exceptions@plt>
mov    (%rbx),%edi
call   1050 <feclearexcept@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
call   1040 <show_fe_exceptions@plt>
mov    (%rbx),%edi
call   1050 <feclearexcept@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
call   1040 <show_fe_exceptions@plt>
mov    (%rbx),%edi
call   1050 <feclearexcept@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
call   1040 <show_fe_exceptions@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
@FE_INEXACT = global i32 0
@FE_INVALID = global i32 0
@FE_DIVBYZERO = global i32 0
@FE_OVERFLOW = global i32 0
@FE_UNDERFLOW = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @show_fe_exceptions()
%3 = load i32, i32* @FE_ALL_EXCEPT
%4 = call i32 @feclearexcept(i32 %3)
%5 = load i32, i32* @FE_INEXACT
%6 = call i32 @feraiseexcept(i32 %5)
%7 = call i32 (...) @show_fe_exceptions()
%8 = load i32, i32* @FE_ALL_EXCEPT
%9 = call i32 @feclearexcept(i32 %8)
%10 = load i32, i32* @FE_INVALID
%11 = call i32 @feraiseexcept(i32 %10)
%12 = call i32 (...) @show_fe_exceptions()
%13 = load i32, i32* @FE_ALL_EXCEPT
%14 = call i32 @feclearexcept(i32 %13)
%15 = load i32, i32* @FE_DIVBYZERO
%16 = call i32 @feraiseexcept(i32 %15)
%17 = call i32 (...) @show_fe_exceptions()
%18 = load i32, i32* @FE_ALL_EXCEPT
%19 = call i32 @feclearexcept(i32 %18)
%20 = load i32, i32* @FE_OVERFLOW
%21 = call i32 @feraiseexcept(i32 %20)
%22 = call i32 (...) @show_fe_exceptions()
%23 = load i32, i32* @FE_ALL_EXCEPT
%24 = call i32 @feclearexcept(i32 %23)
%25 = load i32, i32* @FE_UNDERFLOW
%26 = call i32 @feraiseexcept(i32 %25)
%27 = call i32 (...) @show_fe_exceptions()
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
@FE_INEXACT = global i32 0
@FE_INVALID = global i32 0
@FE_DIVBYZERO = global i32 0
@FE_OVERFLOW = global i32 0
@FE_UNDERFLOW = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @show_fe_exceptions()
%2 = load i32, i32* @FE_ALL_EXCEPT
%3 = tail call i32 @feclearexcept(i32 %2)
%4 = load i32, i32* @FE_INEXACT
%5 = tail call i32 @feraiseexcept(i32 %4)
%6 = tail call i32 (...) @show_fe_exceptions()
%7 = load i32, i32* @FE_ALL_EXCEPT
%8 = tail call i32 @feclearexcept(i32 %7)
%9 = load i32, i32* @FE_INVALID
%10 = tail call i32 @feraiseexcept(i32 %9)
%11 = tail call i32 (...) @show_fe_exceptions()
%12 = load i32, i32* @FE_ALL_EXCEPT
%13 = tail call i32 @feclearexcept(i32 %12)
%14 = load i32, i32* @FE_DIVBYZERO
%15 = tail call i32 @feraiseexcept(i32 %14)
%16 = tail call i32 (...) @show_fe_exceptions()
%17 = load i32, i32* @FE_ALL_EXCEPT
%18 = tail call i32 @feclearexcept(i32 %17)
%19 = load i32, i32* @FE_OVERFLOW
%20 = tail call i32 @feraiseexcept(i32 %19)
%21 = tail call i32 (...) @show_fe_exceptions()
%22 = load i32, i32* @FE_ALL_EXCEPT
%23 = tail call i32 @feclearexcept(i32 %22)
%24 = load i32, i32* @FE_UNDERFLOW
%25 = tail call i32 @feraiseexcept(i32 %24)
%26 = tail call i32 (...) @show_fe_exceptions()
ret i32 0
}