#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 *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double Modf(double x, double pfrac, double pent) {
  printf("Enter a floating number ( integer and fractional part):");
  scanf("%lf", &x);
  pfrac = modf(x, &pent);
  printf("Integer part : %lf\n", pent);
  printf("Decimal part: %lf \n", pfrac);
  return (0);
}


x86 assembly (clang, -O0):
<Modf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Modf>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,(%rsp)
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rsp,%rdi
call   1040 <modf@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Enter a floating number ( integer and fractional part):\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"Integer part : %lf\0A\00"
@.str.3 = [20 x i8] c"Decimal part: %lf \0A\00"
define double @Modf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%9 = load double, double* %4
%10 = call double @modf(double %9, double* %6)
store double %10, double* %5
%11 = load double, double* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %11)
%13 = load double, double* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %13)
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [56 x i8] c"Enter a floating number ( integer and fractional part):\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"Integer part : %lf\0A\00"
@.str.3 = [20 x i8] c"Decimal part: %lf \0A\00"
define double @Modf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %2, double* %5
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%8 = load double, double* %4
%9 = call double @modf(double %8, double* %5)
%10 = load double, double* %5
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %9)
ret double 0.000000e+00
}