#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 *);
double single_tax(float);
int main() {
  float income = 0;
  printf("Sir,Please enter your income.\nI will figure out the number of the "
         "tax that you should turn in.\n\n");
  while (!scanf("%f", &income)) {
    printf("The data you entered is wrong.Please enter again!");
  }
  printf("Your single tax is : %f", single_tax(income));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf4c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117a <main+0x4a>
jmp    118d <main+0x5d>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1155 <main+0x25>
movss  -0x8(%rbp),%xmm0
call   1030 <single_tax@plt>
lea    0xef5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xef2(%rip),%rdi
call   1040 <puts@plt>
lea    0xee3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
test   %eax,%eax
jne    11a9 <main+0x69>
lea    0xe87(%rip),%r14
lea    0xec7(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
je     1190 <main+0x50>
movss  0xc(%rsp),%xmm0
call   1030 <single_tax@plt>
lea    0xe77(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [97 x i8] c"Sir,Please enter your income.\0AI will figure out the number of the tax that you should turn in.\0A\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [50 x i8] c"The data you entered is wrong.Please enter again!\00"
@.str.3 = [24 x i8] c"Your single tax is : %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
br label %4
10: ; preds = %4
%11 = load float, float* %2
%12 = call double @single_tax(float %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [50 x i8] c"The data you entered is wrong.Please enter again!\00"
@.str.3 = [24 x i8] c"Your single tax is : %f\00"
@str = [96 x i8] c"Sir,Please enter your income.\0AI will figure out the number of the tax that you should turn in.\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 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 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %0
%11 = load float, float* %1
%12 = call double @single_tax(float %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %12)
ret i32 0
}