#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*/ assert(int /*<<< orphan*/);
const char *rtext(unsigned fpc_round) {
  switch (fpc_round) {
  case 0:
    return "[-> near]";
  case 1:
    return "[-> zero]";
  case 2:
    return "[-> +inf]";
  case 3:
    return "[-> -inf]";
  }
  assert(0);
}


x86 assembly (clang, -O0):
<rtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     1180 <rtext+0x70>
mov    -0x18(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <rtext+0x77>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <rtext+0x77>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <rtext+0x77>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <rtext+0x77>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtext>:
push   %rax
cmp    $0x4,%edi
jae    1129 <rtext+0x19>
movslq %edi,%rax
lea    0xf08(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"[-> near]\00"
@.str.1 = [10 x i8] c"[-> zero]\00"
@.str.2 = [10 x i8] c"[-> +inf]\00"
@.str.3 = [10 x i8] c"[-> -inf]\00"
define i8* @rtext(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
6: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %11
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %1
%10 = call i32 @assert(i32 0)
br label %11
11: ; preds = %9, %8, %7, %6, %5
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"[-> near]\00"
@.str.1 = [10 x i8] c"[-> zero]\00"
@.str.2 = [10 x i8] c"[-> +inf]\00"
@.str.3 = [10 x i8] c"[-> -inf]\00"
@reltable.rtext = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.rtext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.rtext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.rtext to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.rtext to i64)) to i32)]
define i8* @rtext(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @assert(i32 0)
br label %9
5: ; preds = %1
%6 = sext i32 %0 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.rtext to i8*), i64 %7)
br label %9
9: ; preds = %5, %3
%10 = phi i8* [ undef, %3 ], [ %8, %5 ]
ret i8* %10
}