#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 */
double frexp(double, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  double d = 0.04296875;
  double m;
  int e;
  m = frexp(d, &e);
  printf("float = [%.8f]\n", d);
  printf("(float = mantissa * 2^exponent)\n\n");
  printf("\tmantissa = [%.5f]\n\n", m);
  printf("\texponent = [%d]\n", e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x1c(%rbp),%rdi
call   1040 <frexp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xec4(%rip),%xmm0
lea    0xc(%rsp),%rdi
call   1050 <frexp@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xeb5(%rip),%rdi
movsd  0xea5(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"float = [%.8f]\0A\00"
@.str.1 = [34 x i8] c"(float = mantissa * 2^exponent)\0A\0A\00"
@.str.2 = [21 x i8] c"\09mantissa = [%.5f]\0A\0A\00"
@.str.3 = [18 x i8] c"\09exponent = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store double 0x3FA6000000000000, double* %2
%5 = load double, double* %2
%6 = call double @frexp(double %5, i32* %4)
store double %6, double* %3
%7 = load double, double* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%10 = load double, double* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"float = [%.8f]\0A\00"
@.str.2 = [21 x i8] c"\09mantissa = [%.5f]\0A\0A\00"
@.str.3 = [18 x i8] c"\09exponent = [%d]\0A\00"
@str = [33 x i8] c"(float = mantissa * 2^exponent)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call double @frexp(double 0x3FA6000000000000, i32* %1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 0x3FA6000000000000)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %3)
%7 = load i32, i32* %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %7)
ret i32 0
}