#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 */
scalar_t__ floor(double);
double modf(double, double *);
int /*<<< orphan*/ printf(char *, double, ...);
void metersToFeetAndInches(double meters, unsigned int *feetPointer,
                           double *inchesPointer) {
  double rawFeet = meters * 3.281;
  double feet;
  double fractionalFoot = modf(rawFeet, &feet);
  printf("Storing %d to the address %p\n", (int)floor(feet), feetPointer);
  *feetPointer = (int)floor(feet);
  double inches = fractionalFoot * 12.0;
  printf("Storing %.2f to the address %p\n", inches, inchesPointer);
  *inchesPointer = inches;
}


x86 assembly (clang, -O0):
<metersToFeetAndInches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xebb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    -0x28(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <floor@plt>
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rsi
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
call   1050 <floor@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  0xe5c(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
lea    0xe70(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metersToFeetAndInches>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mulsd  0xebb(%rip),%xmm0
lea    0x10(%rsp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1050 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
call   1050 <floor@plt>
mov    %eax,(%rbx)
movsd  (%rsp),%xmm0
mulsd  0xe71(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xe8b(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Storing %d to the address %p\0A\00"
@.str.1 = [32 x i8] c"Storing %.2f to the address %p\0A\00"
define void @metersToFeetAndInches(double %0, i32* %1, double* %2) {
%4 = alloca double
%5 = alloca i32*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store i32* %1, i32** %5
store double* %2, double** %6
%11 = load double, double* %4
%12 = fmul double %11, 3.281000e+00
store double %12, double* %7
%13 = load double, double* %7
%14 = call double @modf(double %13, double* %8)
store double %14, double* %9
%15 = load double, double* %8
%16 = call i64 @floor(double %15)
%17 = trunc i64 %16 to i32
%18 = sitofp i32 %17 to double
%19 = load i32*, i32** %5
%20 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %18, i32* %19)
%21 = load double, double* %8
%22 = call i64 @floor(double %21)
%23 = trunc i64 %22 to i32
%24 = load i32*, i32** %5
store i32 %23, i32* %24
%25 = load double, double* %9
%26 = fmul double %25, 1.200000e+01
store double %26, double* %10
%27 = load double, double* %10
%28 = load double*, double** %6
%29 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %27, double* %28)
%30 = load double, double* %10
%31 = load double*, double** %6
store double %30, double* %31
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Storing %d to the address %p\0A\00"
@.str.1 = [32 x i8] c"Storing %.2f to the address %p\0A\00"
define void @metersToFeetAndInches(double %0, i32* %1, double* %2) {
%4 = alloca double
%5 = fmul double %0, 3.281000e+00
%6 = bitcast double* %4 to i8*
%7 = call double @modf(double %5, double* %4)
%8 = load double, double* %4
%9 = tail call i64 @floor(double %8)
%10 = trunc i64 %9 to i32
%11 = sitofp i32 %10 to double
%12 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %11, i32* %1)
%13 = tail call i64 @floor(double %8)
%14 = trunc i64 %13 to i32
store i32 %14, i32* %1
%15 = fmul double %7, 1.200000e+01
%16 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %15, double* %2)
store double %15, double* %2
ret void
}