#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 *, unsigned int);
void print_float() {
  union {
    float f;
    unsigned int u;
  } p;
  p.f = -13.0;
  unsigned int sign = (p.u >> 31) & 1;
  unsigned int exp = (p.u >> 23) & 0xff;
  unsigned int coef_mask = (1 << 23) - 1;
  unsigned int coef = p.u & coef_mask;
  printf("%d\n", sign);
  printf("%d\n", exp);
  printf("%x\n", coef);
}


x86 assembly (clang, -O0):
<print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x17,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
movl   $0x7fffff,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_float>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x82,%esi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x500000,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%union.anon = type { float }
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%x\0A\00"
define void @print_float() {
%1 = alloca %union.anon
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast %union.anon* %1 to float*
store float -1.300000e+01, float* %6
%7 = bitcast %union.anon* %1 to i32*
%8 = load i32, i32* %7
%9 = lshr i32 %8, 31
%10 = and i32 %9, 1
store i32 %10, i32* %2
%11 = bitcast %union.anon* %1 to i32*
%12 = load i32, i32* %11
%13 = lshr i32 %12, 23
%14 = and i32 %13, 255
store i32 %14, i32* %3
store i32 8388607, i32* %4
%15 = bitcast %union.anon* %1 to i32*
%16 = load i32, i32* %15
%17 = load i32, i32* %4
%18 = and i32 %16, %17
store i32 %18, i32* %5
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %3
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %5
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%x\0A\00"
define void @print_float() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 130)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5242880)
ret void
}