#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 *, ...);
fahr2cels() {
  float fahr, celsius;
  printf("华氏温度转换摄氏温度\n");
  printf("%6s\t%6s\n", "华氏(F)", "摄氏(C)");
  for (fahr = 0; fahr <= 300; fahr += 20) {
    celsius = 5 * (fahr - 32) / 9.0;
    printf("%6.0f\t%6.1f\n", fahr, celsius);
  }
}


x86 assembly (clang, -O0):
<fahr2cels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
lea    0xf0d(%rip),%rsi
lea    0xf10(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeae(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11c9 <fahr2cels+0xb9>
movss  -0x8(%rbp),%xmm1
movss  0xe9f(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xe8f(%rip),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xeaa(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xe52(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114a <fahr2cels+0x3a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr2cels>:
push   %rbp
push   %rbx
push   %rax
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xedb(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffec,%ebp
lea    0xed2(%rip),%rbx
nopw   0x0(%rax,%rax,1)
add    $0x14,%ebp
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addss  0xe87(%rip),%xmm1
mulss  0xe83(%rip),%xmm1
divss  0xe7f(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0x119,%ebp
jb     1160 <fahr2cels+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\E5\8D\8E\E6\B0\8F\E6\B8\A9\E5\BA\A6\E8\BD\AC\E6\8D\A2\E6\91\84\E6\B0\8F\E6\B8\A9\E5\BA\A6\0A\00"
@.str.1 = [9 x i8] c"%6s\09%6s\0A\00"
@.str.2 = [10 x i8] c"\E5\8D\8E\E6\B0\8F(F)\00"
@.str.3 = [10 x i8] c"\E6\91\84\E6\B0\8F(C)\00"
@.str.4 = [13 x i8] c"%6.0f\09%6.1f\0A\00"
define i32 @fahr2cels() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
store float 0.000000e+00, float* %2
br label %6
6: ; preds = %21, %0
%7 = load float, float* %2
%8 = fcmp ole float %7, 3.000000e+02
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load float, float* %2
%11 = fsub float %10, 3.200000e+01
%12 = fmul float 5.000000e+00, %11
%13 = fpext float %12 to double
%14 = fdiv double %13, 9.000000e+00
%15 = fptrunc double %14 to float
store float %15, float* %3
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %17, double %19)
br label %21
21: ; preds = %9
%22 = load float, float* %2
%23 = fadd float %22, 2.000000e+01
store float %23, float* %2
br label %6
24: ; preds = %6
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%6s\09%6s\0A\00"
@.str.2 = [10 x i8] c"\E5\8D\8E\E6\B0\8F(F)\00"
@.str.3 = [10 x i8] c"\E6\91\84\E6\B0\8F(C)\00"
@.str.4 = [13 x i8] c"%6.0f\09%6.1f\0A\00"
@str = [31 x i8] c"\E5\8D\8E\E6\B0\8F\E6\B8\A9\E5\BA\A6\E8\BD\AC\E6\8D\A2\E6\91\84\E6\B0\8F\E6\B8\A9\E5\BA\A6\00"
define i32 @fahr2cels() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 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 ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %12, %3 ]
%5 = sitofp i32 %4 to float
%6 = fadd float %5, -3.200000e+01
%7 = fmul float %6, 5.000000e+00
%8 = fdiv float %7, 9.000000e+00
%9 = fpext float %5 to double
%10 = fpext float %8 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %9, double %10)
%12 = add nuw nsw i32 %4, 20
%13 = icmp ugt i32 %4, 280
br i1 %13, label %14, label %3
14: ; preds = %3
ret i32 undef
}