#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 *);
float single_tax(float income) {
  if (income < 0) {
    printf("The income can not be nagetive number.The data is wrong!");
    return 0;
  }
  if (income < 23350) {
    return income * 0.15;
  } else if (income < 56550) {
    return 3502.5 + 0.28 * (income - 23350);
  } else if (income < 117950) {
    return 12798.5 + 0.31 * (income - 56550);
  } else if (income < 256500) {
    return 31832.5 + 0.36 * (income - 117950);
  } else {
    return 81710.5 + 0.396 * (income - 256500);
  }
  return 0;
}


x86 assembly (clang, -O0):
<single_tax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1143 <single_tax+0x33>
lea    0xf27(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1295 <single_tax+0x185>
movss  0xeb5(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1178 <single_tax+0x68>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1295 <single_tax+0x185>
movss  0xe84(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11c5 <single_tax+0xb5>
movss  -0x8(%rbp),%xmm0
movss  0xe69(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1295 <single_tax+0x185>
movss  0xe3b(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1212 <single_tax+0x102>
movss  -0x8(%rbp),%xmm0
movss  0xe20(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe38(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1295 <single_tax+0x185>
movss  0xdf2(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    125f <single_tax+0x14f>
movss  -0x8(%rbp),%xmm0
movss  0xdd7(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xddf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xddb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1295 <single_tax+0x185>
movss  -0x8(%rbp),%xmm0
movss  0xda0(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd94(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd90(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<single_tax>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    112a <single_tax+0x1a>
lea    0xf48(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret
movss  0xece(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1148 <single_tax+0x38>
cvtss2sd %xmm0,%xmm0
mulsd  0xf1d(%rip),%xmm0
jmp    11e5 <single_tax+0xd5>
movss  0xeb4(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1173 <single_tax+0x63>
addss  0xebf(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
jmp    11e5 <single_tax+0xd5>
movss  0xe8d(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    119e <single_tax+0x8e>
addss  0xe90(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeac(%rip),%xmm0
addsd  0xeac(%rip),%xmm0
jmp    11e5 <single_tax+0xd5>
movss  0xe66(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11c9 <single_tax+0xb9>
addss  0xe61(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe71(%rip),%xmm0
addsd  0xe71(%rip),%xmm0
jmp    11e5 <single_tax+0xd5>
addss  0xe3f(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe43(%rip),%xmm0
addsd  0xe43(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [57 x i8] c"The income can not be nagetive number.The data is wrong!\00"
define float @single_tax(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
store float 0.000000e+00, float* %2
br label %49
8: ; preds = %1
%9 = load float, float* %3
%10 = fcmp olt float %9, 2.335000e+04
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fmul double %13, 1.500000e-01
%15 = fptrunc double %14 to float
store float %15, float* %2
br label %49
16: ; preds = %8
%17 = load float, float* %3
%18 = fcmp olt float %17, 5.655000e+04
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = load float, float* %3
%21 = fsub float %20, 2.335000e+04
%22 = fpext float %21 to double
%23 = call double @llvm.fmuladd.f64(double 2.800000e-01, double %22, double 3.502500e+03)
%24 = fptrunc double %23 to float
store float %24, float* %2
br label %49
25: ; preds = %16
%26 = load float, float* %3
%27 = fcmp olt float %26, 1.179500e+05
br i1 %27, label %28, label %34
28: ; preds = %25
%29 = load float, float* %3
%30 = fsub float %29, 5.655000e+04
%31 = fpext float %30 to double
%32 = call double @llvm.fmuladd.f64(double 3.100000e-01, double %31, double 1.279850e+04)
%33 = fptrunc double %32 to float
store float %33, float* %2
br label %49
34: ; preds = %25
%35 = load float, float* %3
%36 = fcmp olt float %35, 2.565000e+05
br i1 %36, label %37, label %43
37: ; preds = %34
%38 = load float, float* %3
%39 = fsub float %38, 1.179500e+05
%40 = fpext float %39 to double
%41 = call double @llvm.fmuladd.f64(double 3.600000e-01, double %40, double 3.183250e+04)
%42 = fptrunc double %41 to float
store float %42, float* %2
br label %49
43: ; preds = %34
%44 = load float, float* %3
%45 = fsub float %44, 2.565000e+05
%46 = fpext float %45 to double
%47 = call double @llvm.fmuladd.f64(double 3.960000e-01, double %46, double 8.171050e+04)
%48 = fptrunc double %47 to float
store float %48, float* %2
br label %49
49: ; preds = %43, %37, %28, %19, %11, %6
%50 = load float, float* %2
ret float %50
}

LLVM IR (-O2):
@.str = [57 x i8] c"The income can not be nagetive number.The data is wrong!\00"
define float @single_tax(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %37
5: ; preds = %1
%6 = fcmp olt float %0, 2.335000e+04
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = fpext float %0 to double
%9 = fmul double %8, 1.500000e-01
%10 = fptrunc double %9 to float
br label %37
11: ; preds = %5
%12 = fcmp olt float %0, 5.655000e+04
br i1 %12, label %13, label %18
13: ; preds = %11
%14 = fadd float %0, -2.335000e+04
%15 = fpext float %14 to double
%16 = tail call double @llvm.fmuladd.f64(double %15, double 2.800000e-01, double 3.502500e+03)
%17 = fptrunc double %16 to float
br label %37
18: ; preds = %11
%19 = fcmp olt float %0, 1.179500e+05
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = fadd float %0, -5.655000e+04
%22 = fpext float %21 to double
%23 = tail call double @llvm.fmuladd.f64(double %22, double 3.100000e-01, double 1.279850e+04)
%24 = fptrunc double %23 to float
br label %37
25: ; preds = %18
%26 = fcmp olt float %0, 2.565000e+05
br i1 %26, label %27, label %32
27: ; preds = %25
%28 = fadd float %0, -1.179500e+05
%29 = fpext float %28 to double
%30 = tail call double @llvm.fmuladd.f64(double %29, double 3.600000e-01, double 3.183250e+04)
%31 = fptrunc double %30 to float
br label %37
32: ; preds = %25
%33 = fadd float %0, -2.565000e+05
%34 = fpext float %33 to double
%35 = tail call double @llvm.fmuladd.f64(double %34, double 3.960000e-01, double 8.171050e+04)
%36 = fptrunc double %35 to float
br label %37
37: ; preds = %32, %27, %20, %13, %7, %3
%38 = phi float [ 0.000000e+00, %3 ], [ %10, %7 ], [ %17, %13 ], [ %24, %20 ], [ %31, %27 ], [ %36, %32 ]
ret float %38
}