#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 fahr_to_celsius(float);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float fahr;
  printf("------------------\n");
  printf("Temp(ºF)| Temp(ºC)\n");
  printf("------------------\n");
  for (fahr = 0.0; fahr < 300.0; fahr = fahr + 20.0)
    printf("%4.2f\t| %4.2f\n", fahr, fahr_to_celsius(fahr));
  printf("------------------\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11cd <main+0xad>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xe97(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1161 <main+0x41>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf91(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf6d(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
lea    0xf3f(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe82(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xeaa(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe64(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe90(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe46(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe76(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe28(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe0a(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe42(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdec(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe28(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdce(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe0e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdb0(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xdf4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd92(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xdda(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd74(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xdc0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd56(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xda6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd38(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xd8c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd1a(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xd72(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xcfc(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xd58(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"------------------\0A\00"
@.str.1 = [22 x i8] c"Temp(\C2\BAF)| Temp(\C2\BAC)\0A\00"
@.str.2 = [15 x i8] c"%4.2f\09| %4.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store float 0.000000e+00, float* %2
br label %6
6: ; preds = %16, %0
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fcmp olt double %8, 3.000000e+02
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = load float, float* %2
%14 = call double @fahr_to_celsius(float %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %12, double %14)
br label %16
16: ; preds = %10
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fadd double %18, 2.000000e+01
%20 = fptrunc double %19 to float
store float %20, float* %2
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [15 x i8] c"%4.2f\09| %4.2f\0A\00"
@str.3 = [21 x i8] c"Temp(\C2\BAF)| Temp(\C2\BAC)\00"
@str.5 = [19 x i8] c"------------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%4 = tail call double @fahr_to_celsius(float 0.000000e+00)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 0.000000e+00, double %4)
%6 = tail call double @fahr_to_celsius(float 2.000000e+01)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+01, double %6)
%8 = tail call double @fahr_to_celsius(float 4.000000e+01)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 4.000000e+01, double %8)
%10 = tail call double @fahr_to_celsius(float 6.000000e+01)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 6.000000e+01, double %10)
%12 = tail call double @fahr_to_celsius(float 8.000000e+01)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 8.000000e+01, double %12)
%14 = tail call double @fahr_to_celsius(float 1.000000e+02)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+02, double %14)
%16 = tail call double @fahr_to_celsius(float 1.200000e+02)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 1.200000e+02, double %16)
%18 = tail call double @fahr_to_celsius(float 1.400000e+02)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 1.400000e+02, double %18)
%20 = tail call double @fahr_to_celsius(float 1.600000e+02)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 1.600000e+02, double %20)
%22 = tail call double @fahr_to_celsius(float 1.800000e+02)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 1.800000e+02, double %22)
%24 = tail call double @fahr_to_celsius(float 2.000000e+02)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+02, double %24)
%26 = tail call double @fahr_to_celsius(float 2.200000e+02)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 2.200000e+02, double %26)
%28 = tail call double @fahr_to_celsius(float 2.400000e+02)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 2.400000e+02, double %28)
%30 = tail call double @fahr_to_celsius(float 2.600000e+02)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 2.600000e+02, double %30)
%32 = tail call double @fahr_to_celsius(float 2.800000e+02)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 2.800000e+02, double %32)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}