#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*/ init_exceptsets();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_dfl_env();
int /*<<< orphan*/ test_fegsetenv();
int /*<<< orphan*/ test_fegsetexceptflag();
int /*<<< orphan*/ test_fegsetround();
int /*<<< orphan*/ test_feholdupdate();
int /*<<< orphan*/ test_feraiseexcept();
int /*<<< orphan*/ test_fetestclearexcept();
int /*<<< orphan*/ test_masking();
int main(int argc, char *argv[]) {
  printf("1..8\n");
  init_exceptsets();
  test_dfl_env();
  printf("ok 1 - fenv\n");
  test_fetestclearexcept();
  printf("ok 2 - fenv\n");
  test_fegsetexceptflag();
  printf("ok 3 - fenv\n");
  test_feraiseexcept();
  printf("ok 4 - fenv\n");
  test_fegsetround();
  printf("ok 5 - fenv\n");
  test_fegsetenv();
  printf("ok 6 - fenv\n");
  test_masking();
  printf("ok 7 - fenv\n");
  test_feholdupdate();
  printf("ok 8 - fenv\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe43(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <init_exceptsets@plt>
mov    $0x0,%al
call   10c0 <test_dfl_env@plt>
lea    0xe2f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <test_fetestclearexcept@plt>
lea    0xe29(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <test_fegsetexceptflag@plt>
lea    0xe23(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   10b0 <test_feraiseexcept@plt>
lea    0xe1d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <test_fegsetround@plt>
lea    0xe17(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <test_fegsetenv@plt>
lea    0xe11(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <test_masking@plt>
lea    0xe0b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test_feholdupdate@plt>
lea    0xe05(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe58(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10a0 <init_exceptsets@plt>
xor    %eax,%eax
call   10c0 <test_dfl_env@plt>
lea    0xe43(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <test_fetestclearexcept@plt>
lea    0xe3c(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <test_fegsetexceptflag@plt>
lea    0xe35(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <test_feraiseexcept@plt>
lea    0xe2e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <test_fegsetround@plt>
lea    0xe27(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <test_fegsetenv@plt>
lea    0xe20(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <test_masking@plt>
lea    0xe19(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <test_feholdupdate@plt>
lea    0xe12(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1..8\0A\00"
@.str.1 = [13 x i8] c"ok 1 - fenv\0A\00"
@.str.2 = [13 x i8] c"ok 2 - fenv\0A\00"
@.str.3 = [13 x i8] c"ok 3 - fenv\0A\00"
@.str.4 = [13 x i8] c"ok 4 - fenv\0A\00"
@.str.5 = [13 x i8] c"ok 5 - fenv\0A\00"
@.str.6 = [13 x i8] c"ok 6 - fenv\0A\00"
@.str.7 = [13 x i8] c"ok 7 - fenv\0A\00"
@.str.8 = [13 x i8] c"ok 8 - fenv\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @init_exceptsets()
%8 = call i32 (...) @test_dfl_env()
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @test_fetestclearexcept()
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (...) @test_fegsetexceptflag()
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (...) @test_feraiseexcept()
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (...) @test_fegsetround()
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 (...) @test_fegsetenv()
%19 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 (...) @test_masking()
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (...) @test_feholdupdate()
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"1..8\00"
@str.9 = [12 x i8] c"ok 1 - fenv\00"
@str.10 = [12 x i8] c"ok 2 - fenv\00"
@str.11 = [12 x i8] c"ok 3 - fenv\00"
@str.12 = [12 x i8] c"ok 4 - fenv\00"
@str.13 = [12 x i8] c"ok 5 - fenv\00"
@str.14 = [12 x i8] c"ok 6 - fenv\00"
@str.15 = [12 x i8] c"ok 7 - fenv\00"
@str.16 = [12 x i8] c"ok 8 - fenv\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @init_exceptsets()
%5 = tail call i32 (...) @test_dfl_env()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 (...) @test_fetestclearexcept()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 (...) @test_fegsetexceptflag()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.11, i64 0, i64 0))
%11 = tail call i32 (...) @test_feraiseexcept()
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.12, i64 0, i64 0))
%13 = tail call i32 (...) @test_fegsetround()
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
%15 = tail call i32 (...) @test_fegsetenv()
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.14, i64 0, i64 0))
%17 = tail call i32 (...) @test_masking()
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.15, i64 0, i64 0))
%19 = tail call i32 (...) @test_feholdupdate()
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.16, i64 0, i64 0))
ret i32 0
}