#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, double);
void part_1_2() {
  int fahr = 0;
  while (fahr <= 300) {
    int celsius = 5 * (fahr - 32) / 9;
    printf("%d\t%d\n", fahr, celsius);
    fahr = fahr + 20;
  }
  for (fahr = 0; fahr <= 300; fahr = fahr + 20)
    printf("%3d %6.1f\n", fahr, (5.0 / 9.0) * (fahr - 32));
}


x86 assembly (clang, -O0):
<part_1_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x12c,-0x4(%rbp)
jg     1162 <part_1_2+0x52>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <part_1_2+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x12c,-0x4(%rbp)
jg     11a9 <part_1_2+0x99>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe75(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <part_1_2+0x59>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<part_1_2>:
push   %r15
push   %r14
push   %rbx
mov    $0xffffffec,%ebx
mov    $0xff60,%r15w
lea    0xf5a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
add    $0x14,%ebx
movswl %r15w,%eax
imul   $0x1c72,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x10,%eax
add    %ecx,%eax
cwtl
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x64,%r15d
cmp    $0x119,%ebx
jb     1130 <part_1_2+0x20>
lea    0xf1b(%rip),%rbx
movsd  0xe8c(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movsd  0xe82(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
movsd  0xe75(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
movsd  0xe68(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x3c,%esi
call   1030 <printf@plt>
movsd  0xe5b(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <printf@plt>
movsd  0xe4e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
movsd  0xe41(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x78,%esi
call   1030 <printf@plt>
movsd  0xe34(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x8c,%esi
call   1030 <printf@plt>
movsd  0xe27(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa0,%esi
call   1030 <printf@plt>
movsd  0xe1a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1030 <printf@plt>
movsd  0xe0d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1030 <printf@plt>
movsd  0xe00(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xdc,%esi
call   1030 <printf@plt>
movsd  0xdf3(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xf0,%esi
call   1030 <printf@plt>
movsd  0xde6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x104,%esi
call   1030 <printf@plt>
movsd  0xdd9(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x118,%esi
call   1030 <printf@plt>
movsd  0xdcc(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x12c,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%d\0A\00"
@.str.1 = [11 x i8] c"%3d %6.1f\0A\00"
define void @part_1_2() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = trunc i32 %2 to i16
%4 = mul nuw nsw i16 %3, 5
%5 = add nsw i16 %4, -160
%6 = sdiv i16 %5, 9
%7 = sitofp i16 %6 to double
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, double %7)
%9 = add nuw nsw i32 %2, 20
%10 = icmp ult i32 %2, 281
br i1 %10, label %1, label %11
11: ; preds = %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0, double 0xC031C71C71C71C72)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 20, double 0xC01AAAAAAAAAAAAB)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 40, double 0x4011C71C71C71C72)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 60, double 0x402F1C71C71C71C8)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 80, double 0x403AAAAAAAAAAAAB)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 100, double 0x4042E38E38E38E39)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 120, double 0x404871C71C71C71D)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 140, double 6.000000e+01)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 160, double 0x4051C71C71C71C72)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 180, double 0x40548E38E38E38E4)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 200, double 0x4057555555555556)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 220, double 0x405A1C71C71C71C7)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 240, double 0x405CE38E38E38E39)
%25 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 260, double 0x405FAAAAAAAAAAAB)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 280, double 0x406138E38E38E38E)
%27 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 300, double 0x40629C71C71C71C7)
ret void
}