#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 *, int, int);
tempchart(int lower, int upper) {
  int celsius, fahr;
  int step;
  step = 20;
  fahr = lower;
  while (fahr <= upper) {
    celsius = 5 * (fahr - 32) / 9;
    fahr = fahr + step;
    printf("fahrenheit %d\t celsius %d\n", fahr, celsius);
  }
}


x86 assembly (clang, -O0):
<tempchart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x14,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <tempchart+0x5b>
mov    -0x14(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <tempchart+0x1b>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempchart>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edi
jg     115c <tempchart+0x4c>
mov    %esi,%r15d
mov    %edi,%ebx
lea    (%rbx,%rbx,4),%ebp
add    $0xffffff60,%ebp
lea    0xed0(%rip),%r14
movslq %ebp,%rbp
imul   $0x38e38e39,%rbp,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x21,%rdx
add    %eax,%edx
add    $0x14,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x64,%ebp
cmp    %r15d,%ebx
jle    1130 <tempchart+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"fahrenheit %d\09 celsius %d\0A\00"
define i32 @tempchart(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %0, %2 ]
%6 = mul i32 %5, 5
%7 = add i32 %6, -160
%8 = sdiv i32 %7, 9
%9 = add nsw i32 %5, 20
%10 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %8)
%11 = icmp sgt i32 %9, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret i32 undef
}