#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 */
double celsius(int);
double fahrenheit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  printf("Celsius to fahrenheit:\n");
  printf("%4s\t%6s\n", "C:", "F:");
  for (i = 0; i <= 100; ++i)
    printf("%4d\t%6.2f\n", i, fahrenheit(i));
  printf("\nFahrenheit to celsius:\n");
  printf("%4s\t%6s\n", "C:", "F:");
  for (i = 0; i <= 100; ++i)
    printf("%4d\t%6.2f\n", i, celsius(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0xec6(%rip),%rsi
lea    0xec2(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     11a7 <main+0x77>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fahrenheit@plt>
mov    -0xc(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1170 <main+0x40>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe5c(%rip),%rdi
lea    0xe5e(%rip),%rsi
lea    0xe5a(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     120f <main+0xdf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <celsius@plt>
mov    -0x10(%rbp),%esi
lea    0xe2d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d8 <main+0xa8>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0xeab(%rip),%rsi
lea    0xea7(%rip),%rdx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1040 <fahrenheit@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1180 <main+0x40>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe52(%rip),%rdi
lea    0xe54(%rip),%rsi
lea    0xe50(%rip),%rdx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe43(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%edi
call   1060 <celsius@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    11d0 <main+0x90>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%4s\09%6s\0A\00"
@.str.2 = [3 x i8] c"C:\00"
@.str.3 = [3 x i8] c"F:\00"
@.str.4 = [11 x i8] c"%4d\09%6.2f\0A\00"
@str = [23 x i8] c"Celsius to fahrenheit:\00"
@str.6 = [24 x i8] c"\0AFahrenheit to celsius:\00"
define i32 @main() {
%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 ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = tail call double @fahrenheit(i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %4, double %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.6, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %9, %12
%13 = phi i32 [ 0, %9 ], [ %16, %12 ]
%14 = tail call double @celsius(i32 %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %13, double %14)
%16 = add nuw nsw i32 %13, 1
%17 = icmp eq i32 %16, 101
br i1 %17, label %18, label %12
18: ; preds = %12
ret i32 0
}