#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 *, ...);
int main() {
  double trip, mile, distance;
  trip = 2.36;
  mile = 5280;
  printf("\nWe are calculating the distance in feet of a trip that is 2.36 "
         "miles\n");
  printf("A mile is %5.0f feet.\n", mile);
  printf("So the trip would be 2.36 x 5280 feet,");
  distance = trip * mile;
  printf("\nwhich equals %5.2f feet\n", distance);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xf04(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xf12(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
movsd  0xea8(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [71 x i8] c"\0AWe are calculating the distance in feet of a trip that is 2.36 miles\0A\00"
@.str.1 = [23 x i8] c"A mile is %5.0f feet.\0A\00"
@.str.2 = [39 x i8] c"So the trip would be 2.36 x 5280 feet,\00"
@.str.3 = [26 x i8] c"\0Awhich equals %5.2f feet\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 2.360000e+00, double* %2
store double 5.280000e+03, double* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%6 = load double, double* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fmul double %9, %10
store double %11, double* %4
%12 = load double, double* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"A mile is %5.0f feet.\0A\00"
@.str.2 = [39 x i8] c"So the trip would be 2.36 x 5280 feet,\00"
@.str.3 = [26 x i8] c"\0Awhich equals %5.2f feet\0A\00"
@str = [70 x i8] c"\0AWe are calculating the distance in feet of a trip that is 2.36 miles\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double 5.280000e+03)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), double 1.246080e+04)
ret i32 0
}