#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 *, ...);
int farenheat() {
  float c = 0;
  float f = 0;
  int step = 20;
  printf("farenheat\tcelcius\n");
  for (f = 0; f <= 300; f = f + step) {
    c = (5.0 * (f - 32.0)) / 9.0;
    printf("%.0f\t%.1f\n", f, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<farenheat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeb3(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11c5 <farenheat+0xb5>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe9c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe88(%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    0xe8d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1145 <farenheat+0x35>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<farenheat>:
push   %rbp
push   %rbx
push   %rax
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffec,%ebp
lea    0xedd(%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   1040 <printf@plt>
cmp    $0x119,%ebp
jb     1140 <farenheat+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [11 x i8] c"%.0f\09%.1f\0A\00"
@str = [18 x i8] c"farenheat\09celcius\00"
define i32 @farenheat() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, 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 ([11 x i8], [11 x i8]* @.str.1, 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 i32 0
}