#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 celsius2fahrenheit(int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int i;
  printf("  °C    °F\n");
  printf(" ==========\n");
  for (i = 0; i < 100; ++i) {
    printf("%4d %5.1f\n", i, celsius2fahrenheit(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1189 <main+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <celsius2fahrenheit@plt>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1050 <celsius2fahrenheit@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c" \C2\B0C \C2\B0F\0A\00"
@.str.1 = [13 x i8] c" ==========\0A\00"
@.str.2 = [11 x i8] c"%4d %5.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %2
%7 = icmp slt 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 @celsius2fahrenheit(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, 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
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [11 x i8] c"%4d %5.1f\0A\00"
@str = [13 x i8] c" \C2\B0C \C2\B0F\00"
@str.3 = [12 x i8] c" ==========\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 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 @celsius2fahrenheit(i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %4, double %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 100
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}