#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_DOWNWARD;
int /*<<< orphan*/ FE_TONEAREST;
int /*<<< orphan*/ FE_TOWARDZERO;
int /*<<< orphan*/ FE_UPWARD;
int /*<<< orphan*/ test(int /*<<< orphan*/, char *);
int main() {
  test(FE_TONEAREST, "Round to nearest");
  test(FE_UPWARD, "Round toward +infinity");
  test(FE_DOWNWARD, "Round toward -infinity");
  test(FE_TOWARDZERO, "Round toward zero");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <test@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <test@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <test@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <test@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <test@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <test@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
@.str = [17 x i8] c"Round to nearest\00"
@FE_UPWARD = global i32 0
@.str.1 = [23 x i8] c"Round toward +infinity\00"
@FE_DOWNWARD = global i32 0
@.str.2 = [23 x i8] c"Round toward -infinity\00"
@FE_TOWARDZERO = global i32 0
@.str.3 = [18 x i8] c"Round toward zero\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @FE_TONEAREST
%3 = call i32 @test(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @FE_UPWARD
%5 = call i32 @test(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @FE_DOWNWARD
%7 = call i32 @test(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @FE_TOWARDZERO
%9 = call i32 @test(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
@.str = [17 x i8] c"Round to nearest\00"
@FE_UPWARD = global i32 0
@.str.1 = [23 x i8] c"Round toward +infinity\00"
@FE_DOWNWARD = global i32 0
@.str.2 = [23 x i8] c"Round toward -infinity\00"
@FE_TOWARDZERO = global i32 0
@.str.3 = [18 x i8] c"Round toward zero\00"
define i32 @main() {
%1 = load i32, i32* @FE_TONEAREST
%2 = tail call i32 @test(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @FE_UPWARD
%4 = tail call i32 @test(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @FE_DOWNWARD
%6 = tail call i32 @test(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @FE_TOWARDZERO
%8 = tail call i32 @test(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}