#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);
int /*<<< orphan*/ printf(char *, double, ...);
void metersToFeetAndInches(double meters, unsigned int *ftPtr, double *inPtr) {
  double rawFeet = meters * 3.281;
  unsigned int feet = (unsigned int)floor(rawFeet);
  if (ftPtr) {
    printf("Storeing %u to the address %p\n", feet, ftPtr);
    *ftPtr = feet;
  }
  double fractionalFoot = rawFeet - feet;
  double inches = fractionalFoot * 12.0;
  if (inPtr) {
    printf("Storing %.2f to the address %p\n", inches, inPtr);
    *inPtr = 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  0xec3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1182 <metersToFeetAndInches+0x62>
mov    -0x24(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe68(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11d9 <metersToFeetAndInches+0xb9>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
lea    0xe6a(%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   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mulsd  0xec9(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1040 <floor@plt>
mov    %rax,%r15
mov    %r15d,%eax
cvtsi2sd %rax,%xmm1
test   %rbx,%rbx
je     1177 <metersToFeetAndInches+0x57>
lea    0xeb8(%rip),%rdi
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm1
mov    %r15d,(%rbx)
test   %r14,%r14
je     11ad <metersToFeetAndInches+0x8d>
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
mulsd  0xe7b(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xe96(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Storeing %u 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 i32
%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 i64 @floor(double %13)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %8
%16 = load i32*, i32** %5
%17 = icmp ne i32* %16, null
br i1 %17, label %18, label %25
18: ; preds = %3
%19 = load i32, i32* %8
%20 = uitofp i32 %19 to double
%21 = load i32*, i32** %5
%22 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), double %20, i32* %21)
%23 = load i32, i32* %8
%24 = load i32*, i32** %5
store i32 %23, i32* %24
br label %25
25: ; preds = %18, %3
%26 = load double, double* %7
%27 = load i32, i32* %8
%28 = uitofp i32 %27 to double
%29 = fsub double %26, %28
store double %29, double* %9
%30 = load double, double* %9
%31 = fmul double %30, 1.200000e+01
store double %31, double* %10
%32 = load double*, double** %6
%33 = icmp ne double* %32, null
br i1 %33, label %34, label %40
34: ; preds = %25
%35 = load double, double* %10
%36 = load double*, double** %6
%37 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %35, double* %36)
%38 = load double, double* %10
%39 = load double*, double** %6
store double %38, double* %39
br label %40
40: ; preds = %34, %25
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Storeing %u 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 = fmul double %0, 3.281000e+00
%5 = tail call i64 @floor(double %4)
%6 = trunc i64 %5 to i32
%7 = icmp eq i32* %1, null
%8 = uitofp i32 %6 to double
br i1 %7, label %11, label %9
9: ; preds = %3
%10 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), double %8, i32* %1)
store i32 %6, i32* %1
br label %11
11: ; preds = %3, %9
%12 = fsub double %4, %8
%13 = fmul double %12, 1.200000e+01
%14 = icmp eq double* %2, null
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %13, double* %2)
store double %13, double* %2
br label %17
17: ; preds = %15, %11
ret void
}