#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 /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float income;
  printf("What is your taxable income?: ");
  scanf("%f", &income);
  printf("Tax amount due is: ");
  if (income <= 750.00f) {
    printf("%.2f\n", income * 0.01f);
  } else if (income <= 2250.00f) {
    printf("%.2f\n", 7.50f + ((income - 750.00f) * 0.02f));
  } else if (income <= 3750.00f) {
    printf("%.2f\n", 37.50f + ((income - 2250.00f) * 0.03f));
  } else if (income <= 5250.00f) {
    printf("%.2f\n", 82.50f + ((income - 3750.00f) * 0.04f));
  } else if (income <= 7000.00f) {
    printf("%.2f\n", 142.50f + ((income - 5250.00f) * 0.05f));
  } else {
    printf("%.2f\n", 230.00f + ((income - 7000.00f) * 0.06f));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe9d(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1191 <main+0x71>
movss  0xec7(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xef1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1328 <main+0x208>
movss  0xe6b(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11e3 <main+0xc3>
movss  -0x8(%rbp),%xmm0
movss  0xe50(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe78(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe70(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1323 <main+0x203>
movss  0xe1d(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1235 <main+0x115>
movss  -0x8(%rbp),%xmm0
movss  0xe02(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe1e(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe16(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131e <main+0x1fe>
movss  0xdcf(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1287 <main+0x167>
movss  -0x8(%rbp),%xmm0
movss  0xdb4(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xdc4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xdbc(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1319 <main+0x1f9>
movss  0xd81(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     12d9 <main+0x1b9>
movss  -0x8(%rbp),%xmm0
movss  0xd66(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xd6a(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xd62(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xda9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1314 <main+0x1f4>
movss  -0x8(%rbp),%xmm0
movss  0xd2a(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xd22(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xd1a(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd69(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1319 <main+0x1f9>
jmp    131e <main+0x1fe>
jmp    1323 <main+0x203>
jmp    1328 <main+0x208>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf2c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xf2f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
movss  0xea4(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11af <main+0x8f>
movss  0xe9f(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11b9 <main+0x99>
movss  0xea2(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11d3 <main+0xb3>
movss  0xea5(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11ed <main+0xcd>
movss  0xea8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1207 <main+0xe7>
addss  0xeab(%rip),%xmm0
mulss  0xea7(%rip),%xmm0
addss  0xea3(%rip),%xmm0
jmp    121f <main+0xff>
mulss  0xe4d(%rip),%xmm0
jmp    121f <main+0xff>
addss  0xe4b(%rip),%xmm0
mulss  0xe47(%rip),%xmm0
addss  0xe43(%rip),%xmm0
jmp    121f <main+0xff>
addss  0xe41(%rip),%xmm0
mulss  0xe3d(%rip),%xmm0
addss  0xe39(%rip),%xmm0
jmp    121f <main+0xff>
addss  0xe37(%rip),%xmm0
mulss  0xe33(%rip),%xmm0
addss  0xe2f(%rip),%xmm0
jmp    121f <main+0xff>
addss  0xe2d(%rip),%xmm0
mulss  0xe29(%rip),%xmm0
addss  0xe25(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe60(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"What is your taxable income?: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"Tax amount due is: \00"
@.str.3 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = load float, float* %2
%7 = fcmp ole float %6, 7.500000e+02
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load float, float* %2
%10 = fmul float %9, 0x3F847AE140000000
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %11)
br label %59
13: ; preds = %0
%14 = load float, float* %2
%15 = fcmp ole float %14, 2.250000e+03
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load float, float* %2
%18 = fsub float %17, 7.500000e+02
%19 = call float @llvm.fmuladd.f32(float %18, float 0x3F947AE140000000, float 7.500000e+00)
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %20)
br label %58
22: ; preds = %13
%23 = load float, float* %2
%24 = fcmp ole float %23, 3.750000e+03
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = load float, float* %2
%27 = fsub float %26, 2.250000e+03
%28 = call float @llvm.fmuladd.f32(float %27, float 0x3F9EB851E0000000, float 3.750000e+01)
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %29)
br label %57
31: ; preds = %22
%32 = load float, float* %2
%33 = fcmp ole float %32, 5.250000e+03
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load float, float* %2
%36 = fsub float %35, 3.750000e+03
%37 = call float @llvm.fmuladd.f32(float %36, float 0x3FA47AE140000000, float 8.250000e+01)
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %38)
br label %56
40: ; preds = %31
%41 = load float, float* %2
%42 = fcmp ole float %41, 7.000000e+03
br i1 %42, label %43, label %49
43: ; preds = %40
%44 = load float, float* %2
%45 = fsub float %44, 5.250000e+03
%46 = call float @llvm.fmuladd.f32(float %45, float 0x3FA99999A0000000, float 1.425000e+02)
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %47)
br label %55
49: ; preds = %40
%50 = load float, float* %2
%51 = fsub float %50, 7.000000e+03
%52 = call float @llvm.fmuladd.f32(float %51, float 0x3FAEB851E0000000, float 2.300000e+02)
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %53)
br label %55
55: ; preds = %49, %43
br label %56
56: ; preds = %55, %34
br label %57
57: ; preds = %56, %25
br label %58
58: ; preds = %57, %16
br label %59
59: ; preds = %58, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"What is your taxable income?: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"Tax amount due is: \00"
@.str.3 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = load float, float* %1
%7 = fcmp ugt float %6, 7.500000e+02
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = fmul float %6, 0x3F847AE140000000
br label %33
10: ; preds = %0
%11 = fcmp ugt float %6, 2.250000e+03
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = fadd float %6, -7.500000e+02
%14 = call float @llvm.fmuladd.f32(float %13, float 0x3F947AE140000000, float 7.500000e+00)
br label %33
15: ; preds = %10
%16 = fcmp ugt float %6, 3.750000e+03
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = fadd float %6, -2.250000e+03
%19 = call float @llvm.fmuladd.f32(float %18, float 0x3F9EB851E0000000, float 3.750000e+01)
br label %33
20: ; preds = %15
%21 = fcmp ugt float %6, 5.250000e+03
br i1 %21, label %25, label %22
22: ; preds = %20
%23 = fadd float %6, -3.750000e+03
%24 = call float @llvm.fmuladd.f32(float %23, float 0x3FA47AE140000000, float 8.250000e+01)
br label %33
25: ; preds = %20
%26 = fcmp ugt float %6, 7.000000e+03
br i1 %26, label %30, label %27
27: ; preds = %25
%28 = fadd float %6, -5.250000e+03
%29 = call float @llvm.fmuladd.f32(float %28, float 0x3FA99999A0000000, float 1.425000e+02)
br label %33
30: ; preds = %25
%31 = fadd float %6, -7.000000e+03
%32 = call float @llvm.fmuladd.f32(float %31, float 0x3FAEB851E0000000, float 2.300000e+02)
br label %33
33: ; preds = %12, %22, %30, %27, %17, %8
%34 = phi float [ %14, %12 ], [ %24, %22 ], [ %32, %30 ], [ %29, %27 ], [ %19, %17 ], [ %9, %8 ]
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %35)
ret i32 0
}