#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);
int main() {
  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("0x%x\n", coef);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%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    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"0x%x\0A\00"
define i32 @main() {
%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 ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5242880)
ret i32 0
}