#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 */
int /*<<< orphan*/ metersToFeetAndInchesByModf(double, unsigned int *,
                                               double *);
double modf(double, double *);
int /*<<< orphan*/ printf(char *, double, unsigned int, ...);
int main(int argc, const char *argv[]) {
  double pi = 3.14;
  double integerPart;
  double fractionPart;
  fractionPart = modf(pi, &integerPart);
  printf("integerPart = %.0f, fractionPart = %.2f\n", integerPart,
         fractionPart);
  double meters = 3.0;
  unsigned int feet;
  double inches;
  metersToFeetAndInchesByModf(meters, &feet, &inches);
  printf("%.1f meters is equal to %d feet and %.1f inches.\n", meters, feet,
         inches);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x40091eb851eb851f,%rax
1e 09 40
mov    %rax,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
cvttsd2si -0x28(%rbp),%rax
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    -0x34(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <metersToFeetAndInchesByModf@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x34(%rbp),%esi
movsd  -0x40(%rbp),%xmm1
lea    0xe7c(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xec4(%rip),%xmm0
lea    0x10(%rsp),%rdi
call   1040 <modf@plt>
movsd  0x10(%rsp),%xmm1
cvttsd2si %xmm0,%rsi
lea    0xeb8(%rip),%rdi
movaps %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe9e(%rip),%xmm0
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1050 <metersToFeetAndInchesByModf@plt>
mov    0x4(%rsp),%esi
movsd  0x8(%rsp),%xmm1
lea    0xeaf(%rip),%rdi
movsd  0xe76(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"integerPart = %.0f, fractionPart = %.2f\0A\00"
@.str.1 = [50 x i8] c"%.1f meters is equal to %d feet and %.1f inches.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 3.140000e+00, double* %6
%12 = load double, double* %6
%13 = call double @modf(double %12, double* %7)
store double %13, double* %8
%14 = load double, double* %7
%15 = load double, double* %8
%16 = fptoui double %15 to i32
%17 = call i32 (i8*, double, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double %14, i32 %16)
store double 3.000000e+00, double* %9
%18 = load double, double* %9
%19 = call i32 @metersToFeetAndInchesByModf(double %18, i32* %10, double* %11)
%20 = load double, double* %9
%21 = load i32, i32* %10
%22 = load double, double* %11
%23 = call i32 (i8*, double, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), double %20, i32 %21, double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"integerPart = %.0f, fractionPart = %.2f\0A\00"
@.str.1 = [50 x i8] c"%.1f meters is equal to %d feet and %.1f inches.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = bitcast double* %3 to i8*
%7 = call double @modf(double 3.140000e+00, double* %3)
%8 = load double, double* %3
%9 = fptoui double %7 to i32
%10 = tail call i32 (i8*, double, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double %8, i32 %9)
%11 = bitcast i32* %4 to i8*
%12 = bitcast double* %5 to i8*
%13 = call i32 @metersToFeetAndInchesByModf(double 3.000000e+00, i32* %4, double* %5)
%14 = load i32, i32* %4
%15 = load double, double* %5
%16 = call i32 (i8*, double, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+00, i32 %14, double %15)
ret i32 0
}