int main() {
  int fahr, celcius;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  fahr = lower;
  printf("%s   %s\n", "fahrenheit", "celcius");
  while (fahr <= upper) {
    celcius = (5 * (fahr - 32)) / 9;
    printf("%10d%s%7d\n", fahr, "  ", celcius);
    fahr = fahr + 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    0xebf(%rip),%rdi
lea    0xec1(%rip),%rsi
lea    0xec5(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     119f <main+0x8f>
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),%ecx
lea    0xe99(%rip),%rdi
lea    0xe9d(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x46>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xee1(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xee7(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffec,%ebx
mov    $0xff60,%r12w
lea    0xed7(%rip),%r14
lea    0xedb(%rip),%r15
nopl   0x0(%rax)
add    $0x14,%ebx
movswl %r12w,%eax
imul   $0x1c72,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x10,%eax
add    %ecx,%eax
movswl %ax,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x64,%r12d
cmp    $0x119,%ebx
jb     1150 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%s %s\0A\00"
@.str.1 = [11 x i8] c"fahrenheit\00"
@.str.2 = [8 x i8] c"celcius\00"
@.str.3 = [11 x i8] c"%10d%s%7d\0A\00"
@.str.4 = [3 x i8] c" \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, 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 ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), 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
ret i32 0
}