#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 *, ...);
void displayTemperatureTable(float fahr, float max, float step) {
  float celsius;
  printf("%10s %10s\n", "Fahrenheit", "Celsius");
  printf("%10s %10s\n", "----------", "-------");
  while (fahr <= max) {
    celsius = (5.0 / 9.0) * (fahr - 32.0);
    printf("%10.0f %10.1f\n", fahr, celsius);
    fahr = fahr + step;
  }
}


x86 assembly (clang, -O0):
<displayTemperatureTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
lea    0xee2(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xeea(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xed9(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11d0 <displayTemperatureTable+0xc0>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe85(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe84(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115f <displayTemperatureTable+0x4f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayTemperatureTable>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
lea    0xee2(%rip),%rbx
lea    0xee6(%rip),%rsi
lea    0xeea(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rsi
lea    0xedd(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
ucomiss %xmm1,%xmm0
jb     11c9 <displayTemperatureTable+0xb9>
lea    0xec3(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movss  %xmm1,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movaps %xmm0,%xmm1
addsd  0xe68(%rip),%xmm1
mulsd  0xe68(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm1
ucomiss %xmm1,%xmm0
jae    1180 <displayTemperatureTable+0x70>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%10s %10s\0A\00"
@.str.1 = [11 x i8] c"Fahrenheit\00"
@.str.2 = [8 x i8] c"Celsius\00"
@.str.3 = [11 x i8] c"----------\00"
@.str.4 = [8 x i8] c"-------\00"
@.str.5 = [15 x i8] c"%10.0f %10.1f\0A\00"
define void @displayTemperatureTable(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %10
10: ; preds = %14, %3
%11 = load float, float* %4
%12 = load float, float* %5
%13 = fcmp ole float %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = fsub double %16, 3.200000e+01
%18 = fmul double 0x3FE1C71C71C71C72, %17
%19 = fptrunc double %18 to float
store float %19, float* %7
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = load float, float* %7
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %21, double %23)
%25 = load float, float* %4
%26 = load float, float* %6
%27 = fadd float %25, %26
store float %27, float* %4
br label %10
28: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%10s %10s\0A\00"
@.str.1 = [11 x i8] c"Fahrenheit\00"
@.str.2 = [8 x i8] c"Celsius\00"
@.str.3 = [11 x i8] c"----------\00"
@.str.4 = [8 x i8] c"-------\00"
@.str.5 = [15 x i8] c"%10.0f %10.1f\0A\00"
define void @displayTemperatureTable(float %0, float %1, float %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%6 = fcmp ugt float %0, %1
br i1 %6, label %17, label %7
7: ; preds = %3, %7
%8 = phi float [ %15, %7 ], [ %0, %3 ]
%9 = fpext float %8 to double
%10 = fadd double %9, -3.200000e+01
%11 = fmul double %10, 0x3FE1C71C71C71C72
%12 = fptrunc double %11 to float
%13 = fpext float %12 to double
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %9, double %13)
%15 = fadd float %8, %2
%16 = fcmp ugt float %15, %1
br i1 %16, label %17, label %7
17: ; preds = %7, %3
ret void
}