#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 */
char *gettext(char *);
double modf(double, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double Modf(double x, double pfrac, double pent) {
  printf(gettext("Enter a floating number ( integer and fractional part):"));
  scanf("%lf", &x);
  pfrac = modf(x, &pent);
  printf(gettext("Integer part : "));
  printf("%lf", pent);
  printf(gettext("\nDecimal part: "));
  printf("%lf ", 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    0xea2(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,-0x10(%rbp)
lea    0xea5(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe81(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Modf>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
lea    0xea8(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movsd  0x10(%rsp),%xmm0
lea    0x8(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,0x18(%rsp)
lea    0xea4(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe88(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbx
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 = [16 x i8] c"Integer part : \00"
@.str.3 = [16 x i8] c"\0ADecimal part: \00"
@.str.4 = [5 x i8] c"%lf \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 i8* @gettext(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%10 = load double, double* %4
%11 = call double @modf(double %10, double* %6)
store double %11, double* %5
%12 = call i8* @gettext(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* %12)
%14 = load double, double* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %14)
%16 = call i8* @gettext(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* %16)
%18 = load double, double* %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %18)
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 = [16 x i8] c"Integer part : \00"
@.str.3 = [16 x i8] c"\0ADecimal part: \00"
@.str.4 = [5 x i8] c"%lf \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 i8* @gettext(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %6)
%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* %5)
%11 = call i8* @gettext(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %11)
%13 = load double, double* %5
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = call i8* @gettext(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %10)
ret double 0.000000e+00
}