#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 *);
float modff(float, float *);
long double modfl(long double, long double *);
int /*<<< orphan*/ printf(char *, float, double, long double);
int main(int argc, char *argv[]) {
  float intpartf;
  double intpart;
  long double intpartl;
  float fracf = modff(100.0f, &intpartf);
  double frac = modf(100.0, &intpart);
  long double fracl = modfl(100.0l, &intpartl);
  printf("integer parts: %f, %f, %Lf.\n", intpartf, intpart, intpartl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xea2(%rip),%xmm0
lea    -0x14(%rbp),%rdi
call   1030 <modff@plt>
movss  %xmm0,-0x34(%rbp)
movsd  0xe94(%rip),%xmm0
lea    -0x20(%rbp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,-0x40(%rbp)
mov    %rsp,%rax
flds   0xe75(%rip)
fstpt  (%rax)
lea    -0x30(%rbp),%rdi
call   1060 <modfl@plt>
fstpt  -0x50(%rbp)
movss  -0x14(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movss  0xeb4(%rip),%xmm0
lea    0x14(%rsp),%rdi
call   1030 <modff@plt>
movsd  0xeaa(%rip),%xmm0
lea    0x18(%rsp),%rdi
call   1050 <modf@plt>
flds   0xe92(%rip)
fstpt  (%rsp)
lea    0x20(%rsp),%rdi
call   1060 <modfl@plt>
fstp   %st(0)
movss  0x14(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
fldt   0x20(%rsp)
fstpt  (%rsp)
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"integer parts: %f, %f, %Lf.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca double
%8 = alloca x86_fp80
%9 = alloca float
%10 = alloca double
%11 = alloca x86_fp80
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call float @modff(float 1.000000e+02, float* %6)
store float %12, float* %9
%13 = call double @modf(double 1.000000e+02, double* %7)
store double %13, double* %10
%14 = call x86_fp80 @modfl(x86_fp80 0xK4005C800000000000000, x86_fp80* %8)
store x86_fp80 %14, x86_fp80* %11
%15 = load float, float* %6
%16 = load double, double* %7
%17 = load x86_fp80, x86_fp80* %8
%18 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %15, double %16, x86_fp80 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"integer parts: %f, %f, %Lf.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca double
%5 = alloca x86_fp80
%6 = bitcast float* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast x86_fp80* %5 to i8*
%9 = call float @modff(float 1.000000e+02, float* %3)
%10 = call double @modf(double 1.000000e+02, double* %4)
%11 = call x86_fp80 @modfl(x86_fp80 0xK4005C800000000000000, x86_fp80* %5)
%12 = load float, float* %3
%13 = load double, double* %4
%14 = load x86_fp80, x86_fp80* %5
%15 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %12, double %13, x86_fp80 %14)
ret i32 0
}