#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 funcion_modf(double x, double pfrac, double pentera) {
  printf(gettext("Enter a floating number ( integer and fractional part):"));
  scanf("%lf", &x);
  pfrac = modf(x, &pentera);
  printf(gettext("Integer part : "));
  printf("%lf\n", pentera);
  printf(gettext("Decimal part: "));
  printf("%lf \n", pfrac);
  return (0);
}


x86 assembly (clang, -O0):
<funcion_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    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe85(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcion_modf>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,(%rsp)
lea    0xeaa(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rsp,%rdi
call   1050 <modf@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xeab(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <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 = [16 x i8] c"Integer part : \00"
@.str.3 = [5 x i8] c"%lf\0A\00"
@.str.4 = [15 x i8] c"Decimal part: \00"
@.str.5 = [6 x i8] c"%lf \0A\00"
define double @funcion_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 ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %14)
%16 = call i8* @gettext(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* %16)
%18 = load double, double* %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, 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 = [5 x i8] c"%lf\0A\00"
@.str.4 = [15 x i8] c"Decimal part: \00"
@.str.5 = [6 x i8] c"%lf \0A\00"
define double @funcion_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 ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = call i8* @gettext(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %10)
ret double 0.000000e+00
}