#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*/ printf(char *);
void dissect_fpscr_rounding_mode(unsigned long local_fpscr) {
  printf("Rounding Mode: ");
  if (local_fpscr & (0x1 << (63 - 62)))
    if (local_fpscr & (0x1 << (63 - 63)))
      printf("RN-to--INF");
    else
      printf("RN-to-+INF");
  else if (local_fpscr & (0x1 << (63 - 63)))
    printf("RN-to-Nearest");
  else
    printf("RN-to-Zero");
}


x86 assembly (clang, -O0):
<dissect_fpscr_rounding_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     116e <dissect_fpscr_rounding_mode+0x5e>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     115d <dissect_fpscr_rounding_mode+0x4d>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <dissect_fpscr_rounding_mode+0x59>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <dissect_fpscr_rounding_mode+0x92>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1191 <dissect_fpscr_rounding_mode+0x81>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <dissect_fpscr_rounding_mode+0x8d>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <dissect_fpscr_rounding_mode+0x92>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dissect_fpscr_rounding_mode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
test   $0x1,%bl
lea    0xef1(%rip),%rax
lea    0xedf(%rip),%rcx
cmove  %rax,%rcx
lea    0xef8(%rip),%rax
lea    0xee3(%rip),%rdi
cmove  %rax,%rdi
test   $0x2,%bl
cmovne %rcx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Rounding Mode: \00"
@.str.1 = [11 x i8] c"RN-to--INF\00"
@.str.2 = [11 x i8] c"RN-to-+INF\00"
@.str.3 = [14 x i8] c"RN-to-Nearest\00"
@.str.4 = [11 x i8] c"RN-to-Zero\00"
define void @dissect_fpscr_rounding_mode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i64, i64* %2
%5 = and i64 %4, 2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i64, i64* %2
%9 = and i64 %8, 1
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br label %25
16: ; preds = %1
%17 = load i64, i64* %2
%18 = and i64 %17, 1
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %24
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
br label %25
25: ; preds = %24, %15
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Rounding Mode: \00"
@.str.1 = [11 x i8] c"RN-to--INF\00"
@.str.2 = [11 x i8] c"RN-to-+INF\00"
@.str.3 = [14 x i8] c"RN-to-Nearest\00"
@.str.4 = [11 x i8] c"RN-to-Zero\00"
define void @dissect_fpscr_rounding_mode(i64 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = and i64 %0, 2
%4 = icmp eq i64 %3, 0
%5 = and i64 %0, 1
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%8 = select i1 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0)
%9 = select i1 %4, i8* %8, i8* %7
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
ret void
}