#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, float *);
double single_tax(float);
int main(void) {
  float income;
  puts("\n\tI.R.S. tax calculator\n");
  puts("Hello Sir!");
  printf("What was your taxable income last year?\n\t");
  scanf("%f", &income);
  puts("\nNice!");
  printf("Looks like you owe us.. $%.2f !", single_tax(income));
  printf("\n\tCa-ching!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb7(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <single_tax@plt>
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
movss  0x4(%rsp),%xmm0
call   1030 <single_tax@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\09I.R.S. tax calculator\0A\00"
@.str.1 = [11 x i8] c"Hello Sir!\00"
@.str.2 = [42 x i8] c"What was your taxable income last year?\0A\09\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [7 x i8] c"\0ANice!\00"
@.str.5 = [32 x i8] c"Looks like you owe us.. $%.2f !\00"
@.str.6 = [14 x i8] c"\0A\09Ca-ching!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%7 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%8 = load float, float* %2
%9 = call double @single_tax(float %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\09I.R.S. tax calculator\0A\00"
@.str.1 = [11 x i8] c"Hello Sir!\00"
@.str.2 = [42 x i8] c"What was your taxable income last year?\0A\09\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [7 x i8] c"\0ANice!\00"
@.str.5 = [32 x i8] c"Looks like you owe us.. $%.2f !\00"
@str = [13 x i8] c"\0A\09Ca-ching!\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%8 = load float, float* %1
%9 = call double @single_tax(float %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}