#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 *);
void metersToFeetAndInchesByModf(double meters, unsigned int *ftPtr,
                                 double *inPtr) {
  double rawFeet = meters * 3.281;
  double feet;
  if (ftPtr && inPtr) {
    *inPtr = modf(rawFeet, &feet);
    *ftPtr = feet;
    *inPtr *= 12.0;
  }
}


x86 assembly (clang, -O0):
<metersToFeetAndInchesByModf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xed3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1185 <metersToFeetAndInchesByModf+0x75>
cmpq   $0x0,-0x18(%rbp)
je     1185 <metersToFeetAndInchesByModf+0x75>
movsd  -0x20(%rbp),%xmm0
lea    -0x28(%rbp),%rdi
call   1030 <modf@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cvttsd2si -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xe8b(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metersToFeetAndInchesByModf>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1149 <metersToFeetAndInchesByModf+0x39>
mov    %rsi,%r14
test   %rsi,%rsi
je     1149 <metersToFeetAndInchesByModf+0x39>
mov    %rdi,%rbx
mulsd  0xed4(%rip),%xmm0
mov    %rsp,%rdi
call   1030 <modf@plt>
cvttsd2si (%rsp),%rax
mov    %eax,(%rbx)
mulsd  0xec4(%rip),%xmm0
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @metersToFeetAndInchesByModf(double %0, i32* %1, double* %2) {
%4 = alloca double
%5 = alloca i32*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store i32* %1, i32** %5
store double* %2, double** %6
%9 = load double, double* %4
%10 = fmul double %9, 3.281000e+00
store double %10, double* %7
%11 = load i32*, i32** %5
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %26
13: ; preds = %3
%14 = load double*, double** %6
%15 = icmp ne double* %14, null
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load double, double* %7
%18 = call double @modf(double %17, double* %8)
%19 = load double*, double** %6
store double %18, double* %19
%20 = load double, double* %8
%21 = fptoui double %20 to i32
%22 = load i32*, i32** %5
store i32 %21, i32* %22
%23 = load double*, double** %6
%24 = load double, double* %23
%25 = fmul double %24, 1.200000e+01
store double %25, double* %23
br label %26
26: ; preds = %16, %13, %3
ret void
}

LLVM IR (-O2):
define void @metersToFeetAndInchesByModf(double %0, i32* writeonly %1, double* writeonly %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = icmp ne i32* %1, null
%7 = icmp ne double* %2, null
%8 = and i1 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = fmul double %0, 3.281000e+00
%11 = call double @modf(double %10, double* %4)
%12 = load double, double* %4
%13 = fptoui double %12 to i32
store i32 %13, i32* %1
%14 = fmul double %11, 1.200000e+01
store double %14, double* %2
br label %15
15: ; preds = %9, %3
ret void
}