#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);
int main() {
  float distance = 378921.46;
  float speed = 140;
  float duration = distance / speed;
  float days = duration / 24;
  float *d;
  d = &distance;
  printf("The moon is %f kilometers away. \n", *d);
  d = &speed;
  printf("At %.2f kilometers per hour,", *d);
  d = &duration;
  printf("It would take us %.3f hours to get there. \n", *d);
  d = &days;
  printf("That would mean roughly %.f days. Hella lot! \n", *d);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
movss  0xec0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
movss  0xeb0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"The moon is %f kilometers away. \0A\00"
@.str.1 = [29 x i8] c"At %.2f kilometers per hour,\00"
@.str.2 = [44 x i8] c"It would take us %.3f hours to get there. \0A\00"
@.str.3 = [47 x i8] c"That would mean roughly %.f days. Hella lot! \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store i32 0, i32* %1
store float 0x411720A5E0000000, float* %2
store float 1.400000e+02, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fdiv float %7, %8
store float %9, float* %4
%10 = load float, float* %4
%11 = fdiv float %10, 2.400000e+01
store float %11, float* %5
store float* %2, float** %6
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), float %13)
store float* %3, float** %6
%15 = load float*, float** %6
%16 = load float, float* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), float %16)
store float* %4, float** %6
%18 = load float*, float** %6
%19 = load float, float* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), float %19)
store float* %5, float** %6
%21 = load float*, float** %6
%22 = load float, float* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), float %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"The moon is %f kilometers away. \0A\00"
@.str.1 = [29 x i8] c"At %.2f kilometers per hour,\00"
@.str.2 = [44 x i8] c"It would take us %.3f hours to get there. \0A\00"
@.str.3 = [47 x i8] c"That would mean roughly %.f days. Hella lot! \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), float 0x411720A5E0000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), float 1.400000e+02)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), float 0x40A5252A00000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), float 0x405C318D60000000)
ret i32 0
}