#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 *, ...);
main() {
  int fahr, celsius;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  fahr = lower;
  printf("This is INTEGER conversation of F to C\n\n");
  while (fahr <= upper) {
    celsius = 5 * (fahr - 32) / 9;
    printf("%d\t%d\n", fahr, celsius);
    fahr = fahr + step;
  }
  printf("\n\nThis is FLOAT conversation of F to C\n");
  float celsiusF;
  float fahrF = lower;
  while (fahrF <= upper) {
    celsiusF = (5.0 / 9.0) * (fahrF - 32.0);
    printf("%3.0f\t%6.1f\n", fahrF, celsiusF);
    fahrF = fahrF + step;
  }
  printf("\n\nThis is FLOAT conversation of C to F\n");
  celsiusF = lower;
  fahrF;
  while (celsiusF <= upper) {
    fahrF = (celsiusF / (5.0 / 9.0)) + 32.0;
    printf("%f\t%f\n", celsiusF, fahrF);
    celsiusF = celsiusF + step;
  }
}


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)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     118a <main+0x7a>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x38>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1217 <main+0x107>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe3a(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe36(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe70(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    11a2 <main+0x92>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     12a4 <main+0x194>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdb5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xda1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe18(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    122f <main+0x11f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xfed(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffec,%ebx
mov    $0xff60,%r15w
lea    0xfbc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x14,%ebx
movswl %r15w,%eax
imul   $0x1c72,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x10,%eax
add    %ecx,%eax
movswl %ax,%edx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x64,%r15d
cmp    $0x119,%ebx
jb     1150 <main+0x30>
lea    0xfba(%rip),%rdi
call   1030 <puts@plt>
lea    0xf72(%rip),%rbx
movsd  0xe63(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe56(%rip),%xmm0
movsd  0xe56(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe4c(%rip),%xmm0
movsd  0xe4c(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe42(%rip),%xmm0
movsd  0xe42(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe38(%rip),%xmm0
movsd  0xe38(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe2e(%rip),%xmm0
movsd  0xe2e(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe24(%rip),%xmm0
movsd  0xe24(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe1a(%rip),%xmm0
mov    %rbx,%rdi
movsd  0xdcf(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe08(%rip),%xmm0
movsd  0xe08(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xdfe(%rip),%xmm0
movsd  0xdfe(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xdf4(%rip),%xmm0
movsd  0xdf4(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xdea(%rip),%xmm0
movsd  0xdea(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xde0(%rip),%xmm0
movsd  0xde0(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xdd6(%rip),%xmm0
movsd  0xdd6(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xdcc(%rip),%xmm0
movsd  0xdcc(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xdc2(%rip),%xmm0
movsd  0xdc2(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe33(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffec,%ebp
lea    0xdcc(%rip),%rbx
nopl   0x0(%rax,%rax,1)
add    $0x14,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
divsd  0xd87(%rip),%xmm1
addsd  0xd87(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0x119,%ebp
jb     1350 <main+0x230>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"This is INTEGER conversation of F to C\0A\0A\00"
@.str.1 = [7 x i8] c"%d\09%d\0A\00"
@.str.2 = [40 x i8] c"\0A\0AThis is FLOAT conversation of F to C\0A\00"
@.str.3 = [13 x i8] c"%3.0f\09%6.1f\0A\00"
@.str.4 = [40 x i8] c"\0A\0AThis is FLOAT conversation of C to F\0A\00"
@.str.5 = [7 x i8] c"%f\09%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
store i32 0, i32* %4
store i32 300, i32* %5
store i32 20, i32* %6
%9 = load i32, i32* %4
store i32 %9, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %15, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %5
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 32
%18 = mul nsw i32 5, %17
%19 = sdiv i32 %18, 9
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %21)
%23 = load i32, i32* %2
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
store i32 %25, i32* %2
br label %11
26: ; preds = %11
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = sitofp i32 %28 to float
store float %29, float* %8
br label %30
30: ; preds = %35, %26
%31 = load float, float* %8
%32 = load i32, i32* %5
%33 = sitofp i32 %32 to float
%34 = fcmp ole float %31, %33
br i1 %34, label %35, label %50
35: ; preds = %30
%36 = load float, float* %8
%37 = fpext float %36 to double
%38 = fsub double %37, 3.200000e+01
%39 = fmul double 0x3FE1C71C71C71C72, %38
%40 = fptrunc double %39 to float
store float %40, float* %7
%41 = load float, float* %8
%42 = fpext float %41 to double
%43 = load float, float* %7
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %42, double %44)
%46 = load float, float* %8
%47 = load i32, i32* %6
%48 = sitofp i32 %47 to float
%49 = fadd float %46, %48
store float %49, float* %8
br label %30
50: ; preds = %30
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%52 = load i32, i32* %4
%53 = sitofp i32 %52 to float
store float %53, float* %7
%54 = load float, float* %8
br label %55
55: ; preds = %60, %50
%56 = load float, float* %7
%57 = load i32, i32* %5
%58 = sitofp i32 %57 to float
%59 = fcmp ole float %56, %58
br i1 %59, label %60, label %75
60: ; preds = %55
%61 = load float, float* %7
%62 = fpext float %61 to double
%63 = fdiv double %62, 0x3FE1C71C71C71C72
%64 = fadd double %63, 3.200000e+01
%65 = fptrunc double %64 to float
store float %65, float* %8
%66 = load float, float* %7
%67 = fpext float %66 to double
%68 = load float, float* %8
%69 = fpext float %68 to double
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %67, double %69)
%71 = load float, float* %7
%72 = load i32, i32* %6
%73 = sitofp i32 %72 to float
%74 = fadd float %71, %73
store float %74, float* %7
br label %55
75: ; preds = %55
%76 = load i32, i32* %1
ret i32 %76
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d\09%d\0A\00"
@.str.3 = [13 x i8] c"%3.0f\09%6.1f\0A\00"
@.str.5 = [7 x i8] c"%f\09%f\0A\00"
@str = [40 x i8] c"This is INTEGER conversation of F to C\0A\00"
@str.6 = [39 x i8] c"\0A\0AThis is FLOAT conversation of F to C\00"
@str.7 = [39 x i8] c"\0A\0AThis is FLOAT conversation of C to F\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %10, %2 ]
%4 = trunc i32 %3 to i16
%5 = mul nuw nsw i16 %4, 5
%6 = add nsw i16 %5, -160
%7 = sdiv i16 %6, 9
%8 = sext i16 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %8)
%10 = add nuw nsw i32 %3, 20
%11 = icmp ult i32 %3, 281
br i1 %11, label %2, label %12
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.6, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 0.000000e+00, double 0xC031C71C80000000)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 2.000000e+01, double 0xC01AAAAAA0000000)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 4.000000e+01, double 0x4011C71C80000000)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 6.000000e+01, double 0x402F1C71C0000000)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 8.000000e+01, double 0x403AAAAAA0000000)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 1.000000e+02, double 0x4042E38E40000000)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 1.200000e+02, double 0x404871C720000000)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 1.400000e+02, double 6.000000e+01)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 1.600000e+02, double 0x4051C71C80000000)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 1.800000e+02, double 0x40548E38E0000000)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 2.000000e+02, double 0x4057555560000000)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 2.200000e+02, double 0x405A1C71C0000000)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 2.400000e+02, double 0x405CE38E40000000)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 2.600000e+02, double 0x405FAAAAA0000000)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 2.800000e+02, double 0x406138E380000000)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double 3.000000e+02, double 0x40629C71C0000000)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.7, i64 0, i64 0))
br label %31
31: ; preds = %12, %31
%32 = phi i32 [ 0, %12 ], [ %40, %31 ]
%33 = sitofp i32 %32 to float
%34 = fpext float %33 to double
%35 = fdiv double %34, 0x3FE1C71C71C71C72
%36 = fadd double %35, 3.200000e+01
%37 = fptrunc double %36 to float
%38 = fpext float %37 to double
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %34, double %38)
%40 = add nuw nsw i32 %32, 20
%41 = icmp ugt i32 %32, 280
br i1 %41, label %42, label %31
42: ; preds = %31
ret i32 0
}