#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*/ __set_fpscr(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_xf0(float *);
scalar_t__ test_00(int, int);
scalar_t__ test_01(int, int);
int test_02(int);
int /*<<< orphan*/ write_xf0(float *);
int main(void) {
  float test_value;
  int r = 0;
  __set_fpscr(0x200000);
  test_value = 123;
  write_xf0(&test_value);
  r += test_00(40, 4);
  read_xf0(&test_value);
  assert(test_value == 123);
  test_value = 321;
  write_xf0(&test_value);
  r += test_01(50, 5);
  read_xf0(&test_value);
  assert(test_value == 321);
  return test_02(r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x200000,%edi
call   1060 <__set_fpscr@plt>
movss  0xe6c(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <write_xf0@plt>
mov    $0x28,%edi
mov    $0x4,%esi
call   1090 <test_00@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <read_xf0@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe2c(%rip),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movss  0xe0b(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <write_xf0@plt>
mov    $0x32,%edi
mov    $0x5,%esi
call   1030 <test_01@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <read_xf0@plt>
movss  -0x8(%rbp),%xmm0
movss  0xdcb(%rip),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0xc(%rbp),%edi
call   1080 <test_02@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x200000,%edi
call   1060 <__set_fpscr@plt>
movl   $0x42f60000,0x4(%rsp)
42
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <write_xf0@plt>
mov    $0x28,%edi
mov    $0x4,%esi
call   1090 <test_00@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <read_xf0@plt>
movss  0xe4b(%rip),%xmm0
cmpeqss 0x4(%rsp),%xmm0
movd   %xmm0,%edi
and    $0x1,%edi
call   1070 <assert@plt>
movl   $0x43a08000,0x4(%rsp)
43
mov    %r14,%rdi
call   1050 <write_xf0@plt>
mov    $0x32,%edi
mov    $0x5,%esi
call   1030 <test_01@plt>
add    %eax,%ebx
mov    %r14,%rdi
call   1040 <read_xf0@plt>
movss  0xe0b(%rip),%xmm0
cmpeqss 0x4(%rsp),%xmm0
movd   %xmm0,%edi
and    $0x1,%edi
call   1070 <assert@plt>
mov    %ebx,%edi
call   1080 <test_02@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @__set_fpscr(i32 2097152)
store float 1.230000e+02, float* %2
%5 = call i32 @write_xf0(float* %2)
%6 = call i64 @test_00(i32 40, i32 4)
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, %6
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = call i32 @read_xf0(float* %2)
%12 = load float, float* %2
%13 = fcmp oeq float %12, 1.230000e+02
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
store float 3.210000e+02, float* %2
%16 = call i32 @write_xf0(float* %2)
%17 = call i64 @test_01(i32 50, i32 5)
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
%22 = call i32 @read_xf0(float* %2)
%23 = load float, float* %2
%24 = fcmp oeq float %23, 3.210000e+02
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i32, i32* %3
%28 = call i32 @test_02(i32 %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @__set_fpscr(i32 2097152)
store float 1.230000e+02, float* %1
%4 = call i32 @write_xf0(float* %1)
%5 = call i64 @test_00(i32 40, i32 4)
%6 = call i32 @read_xf0(float* %1)
%7 = load float, float* %1
%8 = fcmp oeq float %7, 1.230000e+02
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store float 3.210000e+02, float* %1
%11 = call i32 @write_xf0(float* %1)
%12 = call i64 @test_01(i32 50, i32 5)
%13 = add i64 %12, %5
%14 = trunc i64 %13 to i32
%15 = call i32 @read_xf0(float* %1)
%16 = load float, float* %1
%17 = fcmp oeq float %16, 3.210000e+02
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @test_02(i32 %14)
ret i32 %20
}