#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 */
double fahrenheit(float);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  float celsius;
  float lower, upper, step;
  lower = -60;
  upper = 300;
  step = 20;
  celsius = lower;
  printf("Celsius Fahrenheit\n");
  printf("%7.2f %10.1f\n", -273.15, fahrenheit(-273.15));
  while (celsius <= upper) {
    printf("%7.0f %10.2f\n", celsius, fahrenheit(celsius));
    celsius = celsius + step;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  0xe8b(%rip),%xmm0
call   1030 <fahrenheit@plt>
movaps %xmm0,%xmm1
lea    0xea0(%rip),%rdi
movsd  0xe6c(%rip),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x14(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11f0 <main+0xd0>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
lea    0xe65(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    119b <main+0x7b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xfcc(%rip),%rdi
call   1030 <puts@plt>
movss  0xebb(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
lea    0xf94(%rip),%rdi
movsd  0xef4(%rip),%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe99(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
lea    0xf7c(%rip),%rbx
movsd  0xed6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe74(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe56(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe20(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe02(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xe56(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xde4(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xe3c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xdc6(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xe22(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xda8(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xe08(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd8a(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xdee(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd6c(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xdd4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd4e(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xdba(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd30(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xda0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd12(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xd86(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xcf4(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xd6c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xcd6(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xd52(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xcb8(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xd38(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xc9a(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xd1e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xc7c(%rip),%xmm0
call   1040 <fahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xd04(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Celsius Fahrenheit\0A\00"
@.str.1 = [14 x i8] c"%7.2f %10.1f\0A\00"
@.str.2 = [14 x i8] c"%7.0f %10.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float -6.000000e+01, float* %7
store float 3.000000e+02, float* %8
store float 2.000000e+01, float* %9
%10 = load float, float* %7
store float %10, float* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = call double @fahrenheit(float 0xC071126660000000)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double -2.731500e+02, double %12)
br label %14
14: ; preds = %18, %2
%15 = load float, float* %6
%16 = load float, float* %8
%17 = fcmp ole float %15, %16
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load float, float* %6
%20 = fpext float %19 to double
%21 = load float, float* %6
%22 = call double @fahrenheit(float %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %20, double %22)
%24 = load float, float* %6
%25 = load float, float* %9
%26 = fadd float %24, %25
store float %26, float* %6
br label %14
27: ; preds = %14
ret i32 0
}

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