#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 main() {
  char *fahrstr = "Fahrenheit";
  char *celstr = "Celsius";
  float fahr, celsius;
  int min, max, step;
  min = 0;
  max = 300;
  step = 20;
  printf("Fahrenheit - Celsius Table\n");
  printf("--------------------------\n");
  printf("%10s\t%7s\n", "Fahrenheit", "Celsius");
  for (fahr = 0; fahr <= 300; fahr += step) {
    celsius = (5.0 / 9.0) * (fahr - 32.0);
    printf("%10.0f\t%+7.1f\n", fahr, celsius);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x12c,-0x28(%rbp)
movl   $0x14,-0x2c(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0xea4(%rip),%rsi
lea    0xea8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe6e(%rip),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jb     11fa <main+0xea>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe63(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe8e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
cvtsi2ssl -0x2c(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    118a <main+0x7a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xff4(%rip),%rdi
call   1030 <puts@plt>
lea    0x1003(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc3(%rip),%rdi
lea    0xfa9(%rip),%rsi
lea    0xfad(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfb1(%rip),%rbx
movsd  0xe9c(%rip),%xmm1
xorps  %xmm0,%xmm0
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
movsd  0xe7b(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe71(%rip),%xmm0
movsd  0xe71(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe67(%rip),%xmm0
movsd  0xe67(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe5d(%rip),%xmm0
movsd  0xe5d(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe53(%rip),%xmm0
mov    %rbx,%rdi
movsd  0xe08(%rip),%xmm1
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
call   1040 <printf@plt>
movsd  0xe23(%rip),%xmm0
movsd  0xe23(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe19(%rip),%xmm0
movsd  0xe19(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe0f(%rip),%xmm0
movsd  0xe0f(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe05(%rip),%xmm0
movsd  0xe05(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xdfb(%rip),%xmm0
movsd  0xdfb(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Fahrenheit\00"
@.str.1 = [8 x i8] c"Celsius\00"
@.str.4 = [10 x i8] c"%10s\09%7s\0A\00"
@.str.5 = [15 x i8] c"%10.0f\09%+7.1f\0A\00"
@str = [27 x i8] c"Fahrenheit - Celsius Table\00"
@str.6 = [27 x i8] c"--------------------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 0.000000e+00, double 0xC031C71C80000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 2.000000e+01, double 0xC01AAAAAA0000000)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 4.000000e+01, double 0x4011C71C80000000)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 6.000000e+01, double 0x402F1C71C0000000)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 8.000000e+01, double 0x403AAAAAA0000000)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 1.000000e+02, double 0x4042E38E40000000)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 1.200000e+02, double 0x404871C720000000)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 1.400000e+02, double 6.000000e+01)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 1.600000e+02, double 0x4051C71C80000000)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 1.800000e+02, double 0x40548E38E0000000)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 2.000000e+02, double 0x4057555560000000)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 2.200000e+02, double 0x405A1C71C0000000)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 2.400000e+02, double 0x405CE38E40000000)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 2.600000e+02, double 0x405FAAAAA0000000)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 2.800000e+02, double 0x406138E380000000)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 3.000000e+02, double 0x40629C71C0000000)
ret i32 0
}