#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 modf(double, double *);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double x = 1234567890.0987654321;
  double y = -1234567890.0987654321;
  double ntgr, frac;
  frac = modf(x, &ntgr);
  printf("%.10f:\n", x);
  printf("\tInteger portion  = %.0f\n", ntgr);
  printf("\tFraction portion = %.10f\n", frac);
  frac = modf(y, &ntgr);
  printf("%.10f:\n", y);
  printf("\tInteger portion  = %.0f\n", ntgr);
  printf("\tFraction portion = %.10f\n", frac);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  0xecd(%rip),%xmm0
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1040 <modf@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xec3(%rip),%r15
mov    %r15,%rdi
movsd  0xea8(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
lea    0xeae(%rip),%r12
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
movsd  0xe79(%rip),%xmm0
mov    %r14,%rdi
call   1040 <modf@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
movsd  0xe60(%rip),%xmm0
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %r12,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%.10f:\0A\00"
@.str.1 = [26 x i8] c"\09Integer portion = %.0f\0A\00"
@.str.2 = [27 x i8] c"\09Fraction portion = %.10f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double 0x41D26580B486522C, double* %2
store double 0xC1D26580B486522C, double* %3
%6 = load double, double* %2
%7 = call double @modf(double %6, double* %4)
store double %7, double* %5
%8 = load double, double* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %8)
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load double, double* %3
%15 = call double @modf(double %14, double* %4)
store double %15, double* %5
%16 = load double, double* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %16)
%18 = load double, double* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = load double, double* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.10f:\0A\00"
@.str.1 = [26 x i8] c"\09Integer portion = %.0f\0A\00"
@.str.2 = [27 x i8] c"\09Fraction portion = %.10f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call double @modf(double 0x41D26580B486522C, double* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x41D26580B486522C)
%5 = load double, double* %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %3)
%8 = call double @modf(double 0xC1D26580B486522C, double* %1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0xC1D26580B486522C)
%10 = load double, double* %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}