#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*/ getch();
int /*<<< orphan*/ printf(char *, int);
main() {
  double mantissa, number;
  int exponent;
  number = 8.0;
  mantissa = frexp(number, &exponent);
  printf("The number two to the", number);
  printf("%lf times two to the", mantissa);
  printf("power of %d\n", exponent);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x14(%rbp),%rdi
call   1040 <frexp@plt>
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x10(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@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   1040 <frexp@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xeb5(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
cvttsd2si 0x10(%rsp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"The number two to the\00"
@.str.1 = [21 x i8] c"%lf times two to the\00"
@.str.2 = [13 x i8] c"power of %d\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i32
store double 8.000000e+00, double* %2
%4 = load double, double* %2
%5 = call double @frexp(double %4, i32* %3)
store double %5, double* %1
%6 = load double, double* %2
%7 = fptosi double %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load double, double* %1
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"The number two to the\00"
@.str.1 = [21 x i8] c"%lf times two to the\00"
@.str.2 = [13 x i8] c"power of %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call double @frexp(double 8.000000e+00, i32* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = fptosi double %3 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @getch()
ret i32 0
}