#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 temperatureConvert() {
  float celsius, fahr;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  fahr = lower;
  printf("fahrenheit  centigrade\n");
  while (fahr < upper) {
    celsius = (5.0 / 9.0) * (fahr - 32.0);
    printf("   %3.0f      %6.1f\n", fahr, celsius);
    fahr = fahr + step;
  }
}


x86 assembly (clang, -O0):
<temperatureConvert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x12c,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ba <temperatureConvert+0xaa>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe9f(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
mulsd  %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 -0x14(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1145 <temperatureConvert+0x35>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<temperatureConvert>:
push   %rbx
lea    0xfcd(%rip),%rdi
call   1030 <puts@plt>
lea    0xfac(%rip),%rbx
movsd  0xec4(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xeb7(%rip),%xmm0
movsd  0xeb7(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xead(%rip),%xmm0
movsd  0xead(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xea3(%rip),%xmm0
movsd  0xea3(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe99(%rip),%xmm0
movsd  0xe99(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe8f(%rip),%xmm0
movsd  0xe8f(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe85(%rip),%xmm0
movsd  0xe85(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe7b(%rip),%xmm0
mov    %rbx,%rdi
movsd  0xe30(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe69(%rip),%xmm0
movsd  0xe69(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe5f(%rip),%xmm0
movsd  0xe5f(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe55(%rip),%xmm0
movsd  0xe55(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe4b(%rip),%xmm0
movsd  0xe4b(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe41(%rip),%xmm0
movsd  0xe41(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe37(%rip),%xmm0
movsd  0xe37(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe2d(%rip),%xmm0
movsd  0xe2d(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"fahrenheit centigrade\0A\00"
@.str.1 = [21 x i8] c" %3.0f %6.1f\0A\00"
define void @temperatureConvert() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %3
store i32 300, i32* %4
store i32 20, i32* %5
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to float
store float %7, float* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %14, %0
%10 = load float, float* %2
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to float
%13 = fcmp olt float %10, %12
br i1 %13, label %14, label %29
14: ; preds = %9
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fsub double %16, 3.200000e+01
%18 = fmul double 0x3FE1C71C71C71C72, %17
%19 = fptrunc double %18 to float
store float %19, float* %1
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = load float, float* %1
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %21, double %23)
%25 = load float, float* %2
%26 = load i32, i32* %5
%27 = sitofp i32 %26 to float
%28 = fadd float %25, %27
store float %28, float* %2
br label %9
29: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c" %3.0f %6.1f\0A\00"
@str = [23 x i8] c"fahrenheit centigrade\00"
define void @temperatureConvert() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, double 0xC031C71C80000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+01, double 0xC01AAAAAA0000000)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 4.000000e+01, double 0x4011C71C80000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+01, double 0x402F1C71C0000000)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 8.000000e+01, double 0x403AAAAAA0000000)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+02, double 0x4042E38E40000000)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 1.200000e+02, double 0x404871C720000000)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 1.400000e+02, double 6.000000e+01)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 1.600000e+02, double 0x4051C71C80000000)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 1.800000e+02, double 0x40548E38E0000000)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+02, double 0x4057555560000000)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 2.200000e+02, double 0x405A1C71C0000000)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 2.400000e+02, double 0x405CE38E40000000)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 2.600000e+02, double 0x405FAAAAA0000000)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 2.800000e+02, double 0x406138E380000000)
ret void
}