#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 */
float CtoF(float);
int /*<<< orphan*/ printf(char *, ...);
main() {
  float fahr, celsius;
  float lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  printf(" °C     °F\n");
  celsius = lower;
  while (celsius <= upper) {
    fahr = CtoF(celsius);
    printf("%3.0f %6.1f\n", celsius, fahr);
    celsius += step;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11bf <main+0x9f>
movss  -0xc(%rbp),%xmm0
call   1040 <CtoF@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe72(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1169 <main+0x49>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf8d(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
call   1050 <CtoF@plt>
cvtss2sd %xmm0,%xmm1
lea    0xf68(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe9b(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xec7(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe79(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe57(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe35(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe13(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdf1(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdcf(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe13(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdad(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xdf5(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd8b(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xdd7(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd69(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xdb9(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd47(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd9b(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd25(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd7d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd03(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd5f(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xce1(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd41(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xcbf(%rip),%xmm0
call   1050 <CtoF@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd23(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c" \C2\B0C \C2\B0F\0A\00"
@.str.1 = [13 x i8] c"%3.0f %6.1f\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 0.000000e+00, float* %4
store float 3.000000e+02, float* %5
store float 2.000000e+01, float* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load float, float* %4
store float %8, float* %3
br label %9
9: ; preds = %13, %0
%10 = load float, float* %3
%11 = load float, float* %5
%12 = fcmp ole float %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load float, float* %3
%15 = call float @CtoF(float %14)
store float %15, float* %2
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %17, double %19)
%21 = load float, float* %6
%22 = load float, float* %3
%23 = fadd float %22, %21
store float %23, float* %3
br label %9
24: ; preds = %9
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%3.0f %6.1f\0A\00"
@str = [13 x i8] c" \C2\B0C \C2\B0F\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call float @CtoF(float 0.000000e+00)
%3 = fpext float %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, double %3)
%5 = tail call float @CtoF(float 2.000000e+01)
%6 = fpext float %5 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+01, double %6)
%8 = tail call float @CtoF(float 4.000000e+01)
%9 = fpext float %8 to double
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 4.000000e+01, double %9)
%11 = tail call float @CtoF(float 6.000000e+01)
%12 = fpext float %11 to double
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+01, double %12)
%14 = tail call float @CtoF(float 8.000000e+01)
%15 = fpext float %14 to double
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 8.000000e+01, double %15)
%17 = tail call float @CtoF(float 1.000000e+02)
%18 = fpext float %17 to double
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+02, double %18)
%20 = tail call float @CtoF(float 1.200000e+02)
%21 = fpext float %20 to double
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.200000e+02, double %21)
%23 = tail call float @CtoF(float 1.400000e+02)
%24 = fpext float %23 to double
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.400000e+02, double %24)
%26 = tail call float @CtoF(float 1.600000e+02)
%27 = fpext float %26 to double
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.600000e+02, double %27)
%29 = tail call float @CtoF(float 1.800000e+02)
%30 = fpext float %29 to double
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.800000e+02, double %30)
%32 = tail call float @CtoF(float 2.000000e+02)
%33 = fpext float %32 to double
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+02, double %33)
%35 = tail call float @CtoF(float 2.200000e+02)
%36 = fpext float %35 to double
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.200000e+02, double %36)
%38 = tail call float @CtoF(float 2.400000e+02)
%39 = fpext float %38 to double
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.400000e+02, double %39)
%41 = tail call float @CtoF(float 2.600000e+02)
%42 = fpext float %41 to double
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.600000e+02, double %42)
%44 = tail call float @CtoF(float 2.800000e+02)
%45 = fpext float %44 to double
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.800000e+02, double %45)
%47 = tail call float @CtoF(float 3.000000e+02)
%48 = fpext float %47 to double
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+02, double %48)
ret i32 0
}