#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 */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ print_mxcsr_exception_flags(int /*<<< orphan*/ *, int const);
void print_mxcsr(FILE *f, const uint32_t mxcsr) {
  fprintf(f, "value: %04x\n", mxcsr);
  fprintf(f, "Calculations\n");
  fprintf(f, "* flush to zero     : %s\n", ((mxcsr & (0x8000)) ? "yes" : "no"));
  fprintf(f, "* denormals are zero: %s\n", ((mxcsr & (0x0040)) ? "yes" : "no"));
  print_mxcsr_exception_flags(f, mxcsr);
  fprintf(f, "Exception masks\n");
  fprintf(f, "* precision         : %s\n", ((mxcsr & (0x1000)) ? "yes" : "no"));
  fprintf(f, "* underflow         : %s\n", ((mxcsr & (0x0800)) ? "yes" : "no"));
  fprintf(f, "* overflow          : %s\n", ((mxcsr & (0x0400)) ? "yes" : "no"));
  fprintf(f, "* divide by zero    : %s\n", ((mxcsr & (0x0200)) ? "yes" : "no"));
  fprintf(f, "* denormal          : %s\n", ((mxcsr & (0x0100)) ? "yes" : "no"));
  fprintf(f, "* invalid operation : %s\n", ((mxcsr & (0x0080)) ? "yes" : "no"));
}


x86 assembly (clang, -O0):
<print_mxcsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x8000,%ecx
lea    0xecf(%rip),%rdx
lea    0xec4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x40,%ecx
lea    0xea2(%rip),%rdx
lea    0xe97(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_mxcsr_exception_flags@plt>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x1000,%ecx
lea    0xe54(%rip),%rdx
lea    0xe49(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x800,%ecx
lea    0xe24(%rip),%rdx
lea    0xe19(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe57(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x400,%ecx
lea    0xdf4(%rip),%rdx
lea    0xde9(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x200,%ecx
lea    0xdc4(%rip),%rdx
lea    0xdb9(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe2b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x100,%ecx
lea    0xd94(%rip),%rdx
lea    0xd89(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe15(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0x80,%ecx
lea    0xd64(%rip),%rdx
lea    0xd59(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xdff(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mxcsr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0xedb(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xed7(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
movd   %r15d,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xe86(%rip),%xmm1
pand   %xmm0,%xmm1
pand   0xe8a(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebp
lea    0xeb4(%rip),%r12
lea    0xea9(%rip),%rbx
test   $0x80,%bpl
mov    %rbx,%rdx
cmovne %r12,%rdx
lea    0xe7d(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   $0x40,%bpl
mov    %rbx,%rdx
cmovne %r12,%rdx
lea    0xe82(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r14,%rdi
mov    %r15d,%esi
call   1030 <print_mxcsr_exception_flags@plt>
lea    0xe80(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
test   $0x20,%bpl
mov    %rbx,%rdx
cmovne %r12,%rdx
lea    0xe6d(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   $0x10,%bpl
mov    %rbx,%rdx
cmovne %r12,%rdx
lea    0xe6b(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   $0x8,%bpl
mov    %rbx,%rdx
cmovne %r12,%rdx
lea    0xe69(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   $0x4,%bpl
mov    %rbx,%rdx
cmovne %r12,%rdx
lea    0xe67(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   $0x2,%bpl
mov    %rbx,%rdx
cmovne %r12,%rdx
lea    0xe65(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   $0x1,%bpl
cmovne %r12,%rbx
lea    0xe66(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"value: %04x\0A\00"
@.str.1 = [14 x i8] c"Calculations\0A\00"
@.str.2 = [26 x i8] c"* flush to zero : %s\0A\00"
@.str.3 = [4 x i8] c"yes\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [26 x i8] c"* denormals are zero: %s\0A\00"
@.str.6 = [17 x i8] c"Exception masks\0A\00"
@.str.7 = [26 x i8] c"* precision : %s\0A\00"
@.str.8 = [26 x i8] c"* underflow : %s\0A\00"
@.str.9 = [26 x i8] c"* overflow : %s\0A\00"
@.str.10 = [26 x i8] c"* divide by zero : %s\0A\00"
@.str.11 = [26 x i8] c"* denormal : %s\0A\00"
@.str.12 = [26 x i8] c"* invalid operation : %s\0A\00"
define void @print_mxcsr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %3
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = and i32 %11, 32768
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = and i32 %18, 64
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%24 = load i32*, i32** %3
%25 = load i32, i32* %4
%26 = call i32 @print_mxcsr_exception_flags(i32* %24, i32 %25)
%27 = load i32*, i32** %3
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%29 = load i32*, i32** %3
%30 = load i32, i32* %4
%31 = and i32 %30, 4096
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i64
%34 = select i1 %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %34)
%36 = load i32*, i32** %3
%37 = load i32, i32* %4
%38 = and i32 %37, 2048
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i8* %41)
%43 = load i32*, i32** %3
%44 = load i32, i32* %4
%45 = and i32 %44, 1024
%46 = icmp ne i32 %45, 0
%47 = zext i1 %46 to i64
%48 = select i1 %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %48)
%50 = load i32*, i32** %3
%51 = load i32, i32* %4
%52 = and i32 %51, 512
%53 = icmp ne i32 %52, 0
%54 = zext i1 %53 to i64
%55 = select i1 %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %55)
%57 = load i32*, i32** %3
%58 = load i32, i32* %4
%59 = and i32 %58, 256
%60 = icmp ne i32 %59, 0
%61 = zext i1 %60 to i64
%62 = select i1 %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* %62)
%64 = load i32*, i32** %3
%65 = load i32, i32* %4
%66 = and i32 %65, 128
%67 = icmp ne i32 %66, 0
%68 = zext i1 %67 to i64
%69 = select i1 %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i8* %69)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"value: %04x\0A\00"
@.str.1 = [14 x i8] c"Calculations\0A\00"
@.str.2 = [26 x i8] c"* flush to zero : %s\0A\00"
@.str.3 = [4 x i8] c"yes\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [26 x i8] c"* denormals are zero: %s\0A\00"
@.str.6 = [17 x i8] c"Exception masks\0A\00"
@.str.7 = [26 x i8] c"* precision : %s\0A\00"
@.str.8 = [26 x i8] c"* underflow : %s\0A\00"
@.str.9 = [26 x i8] c"* overflow : %s\0A\00"
@.str.10 = [26 x i8] c"* divide by zero : %s\0A\00"
@.str.11 = [26 x i8] c"* denormal : %s\0A\00"
@.str.12 = [26 x i8] c"* invalid operation : %s\0A\00"
define void @print_mxcsr(i32* %0, i32 %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 13, i64 1, i32* %0)
%5 = insertelement <8 x i32> poison, i32 %1, i64 0
%6 = shufflevector <8 x i32> %5, <8 x i32> poison, <8 x i32> zeroinitializer
%7 = and <8 x i32> %6, <i32 128, i32 256, i32 512, i32 1024, i32 2048, i32 4096, i32 64, i32 32768>
%8 = icmp eq <8 x i32> %7, zeroinitializer
%9 = extractelement <8 x i1> %8, i64 7
%10 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = extractelement <8 x i1> %8, i64 6
%13 = select i1 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%15 = tail call i32 @print_mxcsr_exception_flags(i32* %0, i32 %1)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i64 16, i64 1, i32* %0)
%17 = extractelement <8 x i1> %8, i64 5
%18 = select i1 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %18)
%20 = extractelement <8 x i1> %8, i64 4
%21 = select i1 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i8* %21)
%23 = extractelement <8 x i1> %8, i64 3
%24 = select i1 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%25 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %24)
%26 = extractelement <8 x i1> %8, i64 2
%27 = select i1 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%28 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %27)
%29 = extractelement <8 x i1> %8, i64 1
%30 = select i1 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%31 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* %30)
%32 = extractelement <8 x i1> %8, i64 0
%33 = select i1 %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%34 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i8* %33)
ret void
}