#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 main() {
  float lower, upper, step;
  lower = 300;
  upper = 0;
  step = 20;
  printf("Heading\n");
  for (float fahr = lower; fahr >= upper; fahr -= step) {
    float celsius = 5 * (fahr - 32) / 9;
    printf("%6.2f\t%6.2f\n", fahr, celsius);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11c7 <main+0xb7>
movss  -0x10(%rbp),%xmm1
movss  0xea2(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xe92(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  0xe82(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe75(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1152 <main+0x42>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
mov    $0x140,%ebp
lea    0xed1(%rip),%rbx
nopl   0x0(%rax,%rax,1)
add    $0xffffffec,%ebp
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addss  0xea7(%rip),%xmm1
mulss  0xea3(%rip),%xmm1
divss  0xe9f(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0x14,%ebp
jae    1140 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Heading\0A\00"
@.str.1 = [13 x i8] c"%6.2f\09%6.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float 3.000000e+02, float* %1
store float 0.000000e+00, float* %2
store float 2.000000e+01, float* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load float, float* %1
store float %7, float* %4
br label %8
8: ; preds = %22, %0
%9 = load float, float* %4
%10 = load float, float* %2
%11 = fcmp oge float %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load float, float* %4
%14 = fsub float %13, 3.200000e+01
%15 = fmul float 5.000000e+00, %14
%16 = fdiv float %15, 9.000000e+00
store float %16, float* %5
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = load float, float* %5
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %18, double %20)
br label %22
22: ; preds = %12
%23 = load float, float* %3
%24 = load float, float* %4
%25 = fsub float %24, %23
store float %25, float* %4
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%6.2f\09%6.2f\0A\00"
@str = [8 x i8] c"Heading\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
br label %3
2: ; preds = %3
ret void
3: ; preds = %0, %3
%4 = phi i32 [ 300, %0 ], [ %12, %3 ]
%5 = sitofp i32 %4 to float
%6 = fadd float %5, -3.200000e+01
%7 = fmul float %6, 5.000000e+00
%8 = fdiv float %7, 9.000000e+00
%9 = fpext float %5 to double
%10 = fpext float %8 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %9, double %10)
%12 = add nsw i32 %4, -20
%13 = icmp ult i32 %4, 20
br i1 %13, label %2, label %3
}