#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() {
  float fahr, celsius;
  int lower, upper, step;
  float ratio;
  lower = 0;
  upper = 300;
  step = 20;
  ratio = 5.0 / 9.0;
  fahr = lower;
  printf("This is a simple program that converts\n");
  printf("Celsius to Fahrenheit in decimal format\n");
  while (fahr <= upper) {
    celsius = ratio * (fahr - 32);
    printf("Celsius: %6.2f Fahrenheit: %3.1f\n", celsius, fahr);
    fahr = fahr + step;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x12c,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11d1 <main+0xc1>
movss  -0x1c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe78(%rip),%xmm2
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xea7(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1167 <main+0x57>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xff2(%rip),%rdi
call   1030 <puts@plt>
lea    0x100d(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb8(%rip),%rbx
movsd  0xeb8(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xeab(%rip),%xmm0
movsd  0xeab(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xea1(%rip),%xmm0
movsd  0xea1(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe97(%rip),%xmm0
movsd  0xe97(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe8d(%rip),%xmm0
movsd  0xe8d(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe83(%rip),%xmm0
movsd  0xe83(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe79(%rip),%xmm0
movsd  0xe79(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe6f(%rip),%xmm0
movsd  0xe6f(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe65(%rip),%xmm0
movsd  0xe65(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe5b(%rip),%xmm0
movsd  0xe5b(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe51(%rip),%xmm0
movsd  0xe51(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe47(%rip),%xmm0
movsd  0xe47(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe3d(%rip),%xmm0
movsd  0xe3d(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe33(%rip),%xmm0
movsd  0xe33(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe29(%rip),%xmm0
movsd  0xe29(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe1f(%rip),%xmm0
movsd  0xe1f(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"This is a simple program that converts\0A\00"
@.str.1 = [41 x i8] c"Celsius to Fahrenheit in decimal format\0A\00"
@.str.2 = [34 x i8] c"Celsius: %6.2f Fahrenheit: %3.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %1
store i32 0, i32* %4
store i32 300, i32* %5
store i32 20, i32* %6
store float 0x3FE1C71C80000000, float* %7
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
store float %9, float* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %17, %0
%13 = load float, float* %2
%14 = load i32, i32* %5
%15 = sitofp i32 %14 to float
%16 = fcmp ole float %13, %15
br i1 %16, label %17, label %31
17: ; preds = %12
%18 = load float, float* %7
%19 = load float, float* %2
%20 = fsub float %19, 3.200000e+01
%21 = fmul float %18, %20
store float %21, float* %3
%22 = load float, float* %3
%23 = fpext float %22 to double
%24 = load float, float* %2
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double %23, double %25)
%27 = load float, float* %2
%28 = load i32, i32* %6
%29 = sitofp i32 %28 to float
%30 = fadd float %27, %29
store float %30, float* %2
br label %12
31: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [34 x i8] c"Celsius: %6.2f Fahrenheit: %3.1f\0A\00"
@str = [39 x i8] c"This is a simple program that converts\00"
@str.3 = [40 x i8] c"Celsius to Fahrenheit in decimal format\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0xC031C71C80000000, double 0.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0xC01AAAAAC0000000, double 2.000000e+01)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x4011C71C80000000, double 4.000000e+01)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x402F1C71E0000000, double 6.000000e+01)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x403AAAAAC0000000, double 8.000000e+01)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x4042E38E40000000, double 1.000000e+02)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x404871C740000000, double 1.200000e+02)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x404E000020000000, double 1.400000e+02)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x4051C71C80000000, double 1.600000e+02)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x40548E3900000000, double 1.800000e+02)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x4057555560000000, double 2.000000e+02)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x405A1C71E0000000, double 2.200000e+02)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x405CE38E40000000, double 2.400000e+02)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x405FAAAAC0000000, double 2.600000e+02)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x406138E3A0000000, double 2.800000e+02)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x40629C71E0000000, double 3.000000e+02)
ret i32 0
}