#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 fahr_to_cel() {
  float cel, fahr;
  fahr = 0;
  printf("%3s\t%6s\n", "F", "C");
  while (fahr <= 300) {
    cel = 5.0 * (fahr - 32.0) / 9.0;
    printf("%3.0f\t%6.1f\n", fahr, cel);
    fahr = fahr + 20;
  }
}


x86 assembly (clang, -O0):
<fahr_to_cel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xef9(%rip),%rdi
lea    0xefb(%rip),%rsi
lea    0xef6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xebc(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11bb <fahr_to_cel+0xab>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe91(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe90(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xe58(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <fahr_to_cel+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_cel>:
push   %rbp
push   %rbx
push   %rax
lea    0xefe(%rip),%rdi
lea    0xf00(%rip),%rsi
lea    0xefb(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffec,%ebp
lea    0xeea(%rip),%rbx
nopl   0x0(%rax,%rax,1)
add    $0x14,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
addsd  0xea7(%rip),%xmm1
mulsd  0xea7(%rip),%xmm1
divsd  0xea7(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
cmp    $0x119,%ebp
jb     1140 <fahr_to_cel+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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