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


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 $0x4008000000000000,%rax
mov    %rax,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <metersToFeetAndInches@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  -0x28(%rbp),%xmm2
lea    0xe89(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xe72(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    -0x38(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    0xe83(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xec4(%rip),%xmm0
lea    0x4(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1050 <metersToFeetAndInches@plt>
mov    0x4(%rsp),%eax
cvtsi2sd %rax,%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xeaf(%rip),%rdi
movsd  0xe97(%rip),%xmm0
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xe90(%rip),%xmm0
lea    0x8(%rsp),%rdi
call   1040 <modf@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
lea    0xeb0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

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

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