#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*/ getchar();
int isalpha(double);
int ispunct(double);
int /*<<< orphan*/ newline();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
char toupper(char);
int main(void) {
  double incomeB4Tax = 0;
  char ansStateTax = '\0';
  double stateTaxRate = 0;
  double stateTax = 0;
  double socialSecurityReq = 65000;
  double socialSecurityRate = .103;
  double cost2SS = 0;
  double TaxBrackReq = 30000;
  double fedTaxRate = .28;
  double fedTaxMin = 3500;
  double fedTax = 0;
  double totalTax = 0;
  double netIncome = 0;
  printf("Welcome to the Tax Calculator !\n");
  printf("Congratulations on your job offer!\n");
  printf("I am here to ensure that you file your taxes correctly based off of "
         "your salary offer.\n");
  newline();
  printf("Please enter your salary offer (enter numerical value): \n");
  scanf("%lf", &incomeB4Tax);
  getchar();
  printf(
      "Does your state you plan to work in have state income tax (Y or N)? \n");
  scanf("%c", &ansStateTax);
  getchar();
  while ((toupper(ansStateTax) == 'Y' || toupper(ansStateTax) != 'N') &&
         (toupper(ansStateTax) != 'Y' || toupper(ansStateTax) == 'N')) {
    printf("Input value invalid, please input a Y or N. \n");
    scanf("%c", &ansStateTax);
    getchar();
  }
  if (toupper(ansStateTax) == 'Y') {
    printf("Please enter your state tax rate (decimal value): \n");
    scanf("%lf", &stateTaxRate);
    getchar();
    while ((stateTaxRate >= 1) |
           (isalpha(stateTaxRate) | ispunct(stateTaxRate))) {
      printf("Please enter state tax rate as a decimal value:\n");
      scanf("%lf", &stateTaxRate);
      getchar();
    }
  }
  if (incomeB4Tax < socialSecurityReq) {
    cost2SS = incomeB4Tax * socialSecurityRate;
  } else {
    cost2SS = (socialSecurityReq * socialSecurityRate);
  }
  newline();
  printf("$%.2f of your salary goes to Social Security.\n", cost2SS);
  if (incomeB4Tax < TaxBrackReq) {
    fedTax = fedTaxMin;
  } else {
    fedTax = fedTaxMin + ((incomeB4Tax - TaxBrackReq) * fedTaxRate);
  }
  printf("You will need to pay $%.2f towards federal income tax.\n", fedTax);
  stateTax = incomeB4Tax * stateTaxRate;
  printf("You will need to pay $%.2f towards state income tax.\n", stateTax);
  totalTax = stateTax + fedTax;
  printf("Total payment towards tax:$%.2f\n", totalTax);
  netIncome = incomeB4Tax - fedTax - stateTax - cost2SS;
  if (netIncome <= 0) {
    printf("You have lost $%.2f this year.\n", netIncome);
  } else {
    printf("Your net income after tax is : $%.2f. \n", netIncome);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe65(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe48(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe1e(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <newline@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
movsbl -0x11(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x59,%eax
je     12ad <main+0x13d>
movsbl -0x11(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x4e,%ecx
mov    %al,-0x71(%rbp)
je     12e2 <main+0x172>
movsbl -0x11(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x59,%ecx
mov    %al,-0x72(%rbp)
jne    12dc <main+0x16c>
movsbl -0x11(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x4e,%eax
sete   %al
mov    %al,-0x72(%rbp)
mov    -0x72(%rbp),%al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    12f2 <main+0x182>
jmp    131e <main+0x1ae>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe4a(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
jmp    127e <main+0x10e>
movsbl -0x11(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x59,%eax
jne    13d3 <main+0x263>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdbf(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xcc1(%rip),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x78(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1080 <isalpha@plt>
mov    %eax,-0x7c(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <ispunct@plt>
mov    -0x7c(%rbp),%ecx
mov    %eax,%edx
mov    -0x78(%rbp),%eax
or     %edx,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     13ce <main+0x25e>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd50(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
jmp    135a <main+0x1ea>
jmp    13d3 <main+0x263>
movsd  -0x10(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    13fb <main+0x28b>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    140a <main+0x29a>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x0,%al
call   1030 <newline@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xdca(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1447 <main+0x2d7>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1468 <main+0x2f8>
movsd  -0x58(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    0xda2(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xdb8(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x28(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
lea    0xdcc(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jb     14fe <main+0x38e>
movsd  -0x70(%rbp),%xmm0
lea    0xdb3(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1511 <main+0x3a1>
movsd  -0x70(%rbp),%xmm0
lea    0xdbb(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
movq   $0x0,0x10(%rsp)
movb   $0x0,0x7(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xfa3(%rip),%rdi
call   1050 <puts@plt>
lea    0xfb7(%rip),%rdi
call   1050 <puts@plt>
lea    0xfce(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1030 <newline@plt>
lea    0x1012(%rip),%rdi
call   1050 <puts@plt>
lea    0xe5f(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
lea    0x1025(%rip),%rdi
lea    0xe42(%rip),%r14
lea    0x7(%rsp),%rbx
lea    0x10ba(%rip),%rbp
xchg   %ax,%ax
call   1050 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
movsbl 0x7(%rsp),%edi
call   1040 <toupper@plt>
cmp    $0x59,%al
je     1245 <main+0xc5>
movsbl 0x7(%rsp),%edi
call   1040 <toupper@plt>
cmp    $0x4e,%al
je     1267 <main+0xe7>
movsbl 0x7(%rsp),%edi
call   1040 <toupper@plt>
mov    %rbp,%rdi
cmp    $0x59,%al
jne    1210 <main+0x90>
movsbl 0x7(%rsp),%edi
call   1040 <toupper@plt>
mov    %rbp,%rdi
cmp    $0x4e,%al
je     1210 <main+0x90>
movsbl 0x7(%rsp),%edi
call   1040 <toupper@plt>
cmp    $0x59,%al
jne    1327 <main+0x1a7>
lea    0xfe5(%rip),%rdi
call   1050 <puts@plt>
lea    0xdb4(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
movsd  0x8(%rsp),%xmm0
xor    %ebp,%ebp
ucomisd 0xd51(%rip),%xmm0
setae  %bpl
call   1090 <isalpha@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1070 <ispunct@plt>
or     %ebp,%ebx
or     %eax,%ebx
je     1327 <main+0x1a7>
lea    0xfc6(%rip),%r14
lea    0xd67(%rip),%r15
lea    0x8(%rsp),%r12
xchg   %ax,%ax
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
movsd  0x8(%rsp),%xmm0
xor    %ebx,%ebx
ucomisd 0xcf4(%rip),%xmm0
setae  %bl
call   1090 <isalpha@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
call   1070 <ispunct@plt>
or     %ebx,%ebp
or     %eax,%ebp
jne    12e0 <main+0x160>
movsd  0x10(%rsp),%xmm2
movsd  0xcd3(%rip),%xmm0
mulsd  %xmm2,%xmm0
cmpltsd 0xcce(%rip),%xmm2
andpd  %xmm2,%xmm0
movsd  0xcca(%rip),%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movapd %xmm2,0x30(%rsp)
xor    %eax,%eax
call   1030 <newline@plt>
lea    0xcdd(%rip),%rdi
movaps 0x30(%rsp),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0xc9c(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  0xc98(%rip),%xmm2
movsd  0xc98(%rip),%xmm1
cmpltsd 0xc97(%rip),%xmm0
addsd  %xmm1,%xmm2
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
lea    0xcb8(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0xcd0(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movapd 0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
lea    0xcec(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
lea    0xcff(%rip),%rax
lea    0xcd8(%rip),%rdi
cmovb  %rax,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Welcome to the Tax Calculator !\0A\00"
@.str.1 = [36 x i8] c"Congratulations on your job offer!\0A\00"
@.str.2 = [88 x i8] c"I am here to ensure that you file your taxes correctly based off of your salary offer.\0A\00"
@.str.3 = [58 x i8] c"Please enter your salary offer (enter numerical value): \0A\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [70 x i8] c"Does your state you plan to work in have state income tax (Y or N)? \0A\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [46 x i8] c"Input value invalid, please input a Y or N. \0A\00"
@.str.8 = [52 x i8] c"Please enter your state tax rate (decimal value): \0A\00"
@.str.9 = [49 x i8] c"Please enter state tax rate as a decimal value:\0A\00"
@.str.10 = [47 x i8] c"$%.2f of your salary goes to Social Security.\0A\00"
@.str.11 = [56 x i8] c"You will need to pay $%.2f towards federal income tax.\0A\00"
@.str.12 = [54 x i8] c"You will need to pay $%.2f towards state income tax.\0A\00"
@.str.13 = [33 x i8] c"Total payment towards tax:$%.2f\0A\00"
@.str.14 = [32 x i8] c"You have lost $%.2f this year.\0A\00"
@.str.15 = [40 x i8] c"Your net income after tax is : $%.2f. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i8
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i8 0, i8* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 6.500000e+04, double* %6
store double 1.030000e-01, double* %7
store double 0.000000e+00, double* %8
store double 3.000000e+04, double* %9
store double 2.800000e-01, double* %10
store double 3.500000e+03, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %14
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (...) @newline()
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %2)
%21 = call i32 (...) @getchar()
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%24 = call i32 (...) @getchar()
br label %25
25: ; preds = %49, %0
%26 = load i8, i8* %3
%27 = call signext i8 @toupper(i8 signext %26)
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 89
br i1 %29, label %35, label %30
30: ; preds = %25
%31 = load i8, i8* %3
%32 = call signext i8 @toupper(i8 signext %31)
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 78
br i1 %34, label %35, label %47
35: ; preds = %30, %25
%36 = load i8, i8* %3
%37 = call signext i8 @toupper(i8 signext %36)
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 89
br i1 %39, label %45, label %40
40: ; preds = %35
%41 = load i8, i8* %3
%42 = call signext i8 @toupper(i8 signext %41)
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 78
br label %45
45: ; preds = %40, %35
%46 = phi i1 [ true, %35 ], [ %44, %40 ]
br label %47
47: ; preds = %45, %30
%48 = phi i1 [ false, %30 ], [ %46, %45 ]
br i1 %48, label %49, label %53
49: ; preds = %47
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%51 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%52 = call i32 (...) @getchar()
br label %25
53: ; preds = %47
%54 = load i8, i8* %3
%55 = call signext i8 @toupper(i8 signext %54)
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 89
br i1 %57, label %58, label %78
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0))
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %4)
%61 = call i32 (...) @getchar()
br label %62
62: ; preds = %73, %58
%63 = load double, double* %4
%64 = fcmp oge double %63, 1.000000e+00
%65 = zext i1 %64 to i32
%66 = load double, double* %4
%67 = call i32 @isalpha(double %66)
%68 = load double, double* %4
%69 = call i32 @ispunct(double %68)
%70 = or i32 %67, %69
%71 = or i32 %65, %70
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %62
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%75 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %4)
%76 = call i32 (...) @getchar()
br label %62
77: ; preds = %62
br label %78
78: ; preds = %77, %53
%79 = load double, double* %2
%80 = load double, double* %6
%81 = fcmp olt double %79, %80
br i1 %81, label %82, label %86
82: ; preds = %78
%83 = load double, double* %2
%84 = load double, double* %7
%85 = fmul double %83, %84
store double %85, double* %8
br label %90
86: ; preds = %78
%87 = load double, double* %6
%88 = load double, double* %7
%89 = fmul double %87, %88
store double %89, double* %8
br label %90
90: ; preds = %86, %82
%91 = call i32 (...) @newline()
%92 = load double, double* %8
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), double %92)
%94 = load double, double* %2
%95 = load double, double* %9
%96 = fcmp olt double %94, %95
br i1 %96, label %97, label %99
97: ; preds = %90
%98 = load double, double* %11
store double %98, double* %12
br label %106
99: ; preds = %90
%100 = load double, double* %11
%101 = load double, double* %2
%102 = load double, double* %9
%103 = fsub double %101, %102
%104 = load double, double* %10
%105 = call double @llvm.fmuladd.f64(double %103, double %104, double %100)
store double %105, double* %12
br label %106
106: ; preds = %99, %97
%107 = load double, double* %12
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), double %107)
%109 = load double, double* %2
%110 = load double, double* %4
%111 = fmul double %109, %110
store double %111, double* %5
%112 = load double, double* %5
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0), double %112)
%114 = load double, double* %5
%115 = load double, double* %12
%116 = fadd double %114, %115
store double %116, double* %13
%117 = load double, double* %13
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), double %117)
%119 = load double, double* %2
%120 = load double, double* %12
%121 = fsub double %119, %120
%122 = load double, double* %5
%123 = fsub double %121, %122
%124 = load double, double* %8
%125 = fsub double %123, %124
store double %125, double* %14
%126 = load double, double* %14
%127 = fcmp ole double %126, 0.000000e+00
br i1 %127, label %128, label %131
128: ; preds = %106
%129 = load double, double* %14
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0), double %129)
br label %134
131: ; preds = %106
%132 = load double, double* %14
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.15, i64 0, i64 0), double %132)
br label %134
134: ; preds = %131, %128
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [4 x i8] c"%lf\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.10 = [47 x i8] c"$%.2f of your salary goes to Social Security.\0A\00"
@.str.11 = [56 x i8] c"You will need to pay $%.2f towards federal income tax.\0A\00"
@.str.12 = [54 x i8] c"You will need to pay $%.2f towards state income tax.\0A\00"
@.str.13 = [33 x i8] c"Total payment towards tax:$%.2f\0A\00"
@.str.14 = [32 x i8] c"You have lost $%.2f this year.\0A\00"
@.str.15 = [40 x i8] c"Your net income after tax is : $%.2f. \0A\00"
@str = [32 x i8] c"Welcome to the Tax Calculator !\00"
@str.16 = [35 x i8] c"Congratulations on your job offer!\00"
@str.17 = [87 x i8] c"I am here to ensure that you file your taxes correctly based off of your salary offer.\00"
@str.18 = [57 x i8] c"Please enter your salary offer (enter numerical value): \00"
@str.19 = [69 x i8] c"Does your state you plan to work in have state income tax (Y or N)? \00"
@str.20 = [51 x i8] c"Please enter your state tax rate (decimal value): \00"
@str.21 = [48 x i8] c"Please enter state tax rate as a decimal value:\00"
@str.22 = [45 x i8] c"Input value invalid, please input a Y or N. \00"
define i32 @main() {
%1 = alloca double
%2 = alloca i8
%3 = alloca double
%4 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
store i8 0, i8* %2
%5 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 (...) @newline()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.18, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %1)
%12 = call i32 (...) @getchar()
br label %13
13: ; preds = %29, %0
%14 = phi i8* [ getelementptr inbounds ([69 x i8], [69 x i8]* @str.19, i64 0, i64 0), %0 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @str.22, i64 0, i64 0), %29 ]
%15 = call i32 @puts(i8* dereferenceable(1) %14)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%17 = call i32 (...) @getchar()
%18 = load i8, i8* %2
%19 = call signext i8 @toupper(i8 signext %18)
%20 = icmp eq i8 %19, 89
br i1 %20, label %25, label %21
21: ; preds = %13
%22 = load i8, i8* %2
%23 = call signext i8 @toupper(i8 signext %22)
%24 = icmp eq i8 %23, 78
br i1 %24, label %34, label %25
25: ; preds = %21, %13
%26 = load i8, i8* %2
%27 = call signext i8 @toupper(i8 signext %26)
%28 = icmp eq i8 %27, 89
br i1 %28, label %30, label %29
29: ; preds = %25, %30
br label %13
30: ; preds = %25
%31 = load i8, i8* %2
%32 = call signext i8 @toupper(i8 signext %31)
%33 = icmp eq i8 %32, 78
br i1 %33, label %29, label %34
34: ; preds = %21, %30
%35 = load i8, i8* %2
%36 = call signext i8 @toupper(i8 signext %35)
%37 = icmp eq i8 %36, 89
br i1 %37, label %38, label %64
38: ; preds = %34
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.20, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %3)
%41 = call i32 (...) @getchar()
%42 = load double, double* %3
%43 = fcmp oge double %42, 1.000000e+00
%44 = zext i1 %43 to i32
%45 = call i32 @isalpha(double %42)
%46 = load double, double* %3
%47 = call i32 @ispunct(double %46)
%48 = or i32 %45, %44
%49 = or i32 %48, %47
%50 = icmp eq i32 %49, 0
br i1 %50, label %64, label %51
51: ; preds = %38, %51
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.21, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %3)
%54 = call i32 (...) @getchar()
%55 = load double, double* %3
%56 = fcmp oge double %55, 1.000000e+00
%57 = zext i1 %56 to i32
%58 = call i32 @isalpha(double %55)
%59 = load double, double* %3
%60 = call i32 @ispunct(double %59)
%61 = or i32 %58, %57
%62 = or i32 %61, %60
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %51
64: ; preds = %51, %38, %34
%65 = load double, double* %1
%66 = fcmp olt double %65, 6.500000e+04
%67 = fmul double %65, 1.030000e-01
%68 = select i1 %66, double %67, double 6.695000e+03
%69 = call i32 (...) @newline()
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), double %68)
%71 = load double, double* %1
%72 = fcmp olt double %71, 3.000000e+04
%73 = fadd double %71, -3.000000e+04
%74 = call double @llvm.fmuladd.f64(double %73, double 2.800000e-01, double 3.500000e+03)
%75 = select i1 %72, double 3.500000e+03, double %74
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), double %75)
%77 = load double, double* %1
%78 = load double, double* %3
%79 = fmul double %77, %78
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0), double %79)
%81 = fadd double %75, %79
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), double %81)
%83 = load double, double* %1
%84 = fsub double %83, %75
%85 = fsub double %84, %79
%86 = fsub double %85, %68
%87 = fcmp ugt double %86, 0.000000e+00
%88 = select i1 %87, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0)
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %88, double %86)
ret i32 0
}