#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*/ celsius(int);
int /*<<< orphan*/ fahrenheit(int);
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  int n;
  printf("celsius to fahrenheit\n");
  for (n = 0; n <= 100; n++) {
    printf("%d\t%.2lf\n", n, fahrenheit(n));
  }
  printf("fahrenheit to celsius\n");
  for (n = 32; n <= 212; n++) {
    printf("%d\t%.2lf\n", n, celsius(n));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     1186 <main+0x56>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fahrenheit@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114d <main+0x1d>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x20,-0x4(%rbp)
cmpl   $0xd4,-0x4(%rbp)
jg     11d7 <main+0xa7>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <celsius@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    119b <main+0x6b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
call   1040 <fahrenheit@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1160 <main+0x20>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x20,%ebx
lea    0xe6b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1060 <celsius@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0xd5,%ebx
jne    11a0 <main+0x60>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"celsius to fahrenheit\0A\00"
@.str.1 = [10 x i8] c"%d\09%.2lf\0A\00"
@.str.2 = [23 x i8] c"fahrenheit to celsius\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @fahrenheit(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store i32 32, i32* %1
br label %16
16: ; preds = %24, %14
%17 = load i32, i32* %1
%18 = icmp sle i32 %17, 212
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i32, i32* %1
%21 = load i32, i32* %1
%22 = call i32 @celsius(i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %22)
br label %24
24: ; preds = %19
%25 = load i32, i32* %1
%26 = add nsw i32 %25, 1
store i32 %26, i32* %1
br label %16
27: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%d\09%.2lf\0A\00"
@str = [22 x i8] c"celsius to fahrenheit\00"
@str.3 = [22 x i8] c"fahrenheit to celsius\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i32 @fahrenheit(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 101
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ 32, %8 ], [ %14, %10 ]
%12 = tail call i32 @celsius(i32 %11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
%14 = add nuw nsw i32 %11, 1
%15 = icmp eq i32 %14, 213
br i1 %15, label %16, label %10
16: ; preds = %10
ret void
}