#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*/ printf(char *, float);
void display_calories(float weight, float distance, float coeff) {
  printf("Weight: %3.2f kg\n", weight / 2.2046);
  printf("Distance: %3.2f km\n", distance * 1.609344);
  printf("Calories burned: %4.2f cal\n", coeff * weight * distance);
}


x86 assembly (clang, -O0):
<display_calories>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_calories>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x10(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
divsd  0xecb(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeae(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
lea    0xeb3(%rip),%rdi
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Weight: %3.2f kg\0A\00"
@.str.1 = [20 x i8] c"Distance: %3.2f km\0A\00"
@.str.2 = [28 x i8] c"Calories burned: %4.2f cal\0A\00"
define void @display_calories(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fdiv double %8, 2.204600e+00
%10 = fptrunc double %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %10)
%12 = load float, float* %5
%13 = fpext float %12 to double
%14 = fmul double %13, 0x3FF9BFDF7E8038A0
%15 = fptrunc double %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %15)
%17 = load float, float* %6
%18 = load float, float* %4
%19 = fmul float %17, %18
%20 = load float, float* %5
%21 = fmul float %19, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), float %21)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Weight: %3.2f kg\0A\00"
@.str.1 = [20 x i8] c"Distance: %3.2f km\0A\00"
@.str.2 = [28 x i8] c"Calories burned: %4.2f cal\0A\00"
define void @display_calories(float %0, float %1, float %2) {
%4 = fpext float %0 to double
%5 = fdiv double %4, 2.204600e+00
%6 = fptrunc double %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %6)
%8 = fpext float %1 to double
%9 = fmul double %8, 0x3FF9BFDF7E8038A0
%10 = fptrunc double %9 to float
%11 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %10)
%12 = fmul float %0, %2
%13 = fmul float %12, %1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), float %13)
ret void
}