#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 *, ...);
int main() {
  int a1, a2;
  a1 = a2 = -999;
  float b1, b2, taxRate, tax, tax2, net, net1, net2, gross;
  b1 = b2 = taxRate = tax = net = net1 = net2 = gross = -999.99;
  printf("Please type in how many of the first item you purchased: ");
  scanf(" %d", &a1);
  printf("Please enter the price you paid for the first item: ");
  scanf("%f", &b1);
  printf("Please type in how many of the second item you purchased: ");
  scanf(" %d", &a2);
  printf("Please enter the price you paid for the second item: ");
  scanf("%f", &b2);
  printf("What is the tax rate: ");
  scanf("%f", &taxRate);
  net1 = b1 * a1;
  net2 = b2 * a2;
  net = net1 + net2;
  tax2 = (taxRate / 100);
  tax = (net * tax2);
  gross = net + tax;
  printf("\n\n\t%s\n", "Doc_Heisenburg's_Productive_Chemicals");
  printf(" Invoice #%d\n", 12345);
  printf("Item 1: %d @ $%.2f per item\t$%.2f\n", a1, b1, net1);
  printf("Item 2: %d @ $%.2f per item\t$%.2f\n", a2, b2, net2);
  printf("Tax rate:\t\t\t%.2f\n", taxRate);
  printf("Tax amount:\t\t\t$%.2f\n", tax);
  printf("Total cost:\t\t\t$%.2f\n", gross);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffc19,-0xc(%rbp)
movl   $0xfffffc19,-0x8(%rbp)
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  0xea5(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xe98(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xe8b(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe7e(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe71(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe64(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe48(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe41(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
addss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xd79(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x24(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
lea    0xe51(%rip),%rdi
lea    0xe51(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
mov    $0x3039,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe4f(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe4f(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe56(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movl   $0xfffffc19,0x10(%rsp)
ff
movl   $0xfffffc19,0x14(%rsp)
ff
movl   $0xc479ff5c,0x4(%rsp)
c4
movl   $0xc479ff5c,0x8(%rsp)
c4
movl   $0xc479ff5c,0xc(%rsp)
c4
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%r14
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xefa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xf13(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
cvtsi2ssl 0x14(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
cvtsi2ssl 0x10(%rsp),%xmm1
mulss  0x8(%rsp),%xmm1
movss  %xmm1,0x1c(%rsp)
addss  %xmm1,%xmm0
movss  0x4(%rsp),%xmm1
divss  0xddc(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x20(%rsp)
addss  %xmm1,%xmm0
movss  %xmm0,0x24(%rsp)
lea    0xec3(%rip),%rdi
lea    0xec3(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x18(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xebe(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x1c(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xebb(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Please type in how many of the first item you purchased: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [53 x i8] c"Please enter the price you paid for the first item: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [59 x i8] c"Please type in how many of the second item you purchased: \00"
@.str.5 = [54 x i8] c"Please enter the price you paid for the second item: \00"
@.str.6 = [23 x i8] c"What is the tax rate: \00"
@.str.7 = [7 x i8] c"\0A\0A\09%s\0A\00"
@.str.8 = [38 x i8] c"Doc_Heisenburg's_Productive_Chemicals\00"
@.str.9 = [14 x i8] c" Invoice #%d\0A\00"
@.str.10 = [35 x i8] c"Item 1: %d @ $%.2f per item\09$%.2f\0A\00"
@.str.11 = [35 x i8] c"Item 2: %d @ $%.2f per item\09$%.2f\0A\00"
@.str.12 = [18 x i8] c"Tax rate:\09\09\09%.2f\0A\00"
@.str.13 = [21 x i8] c"Tax amount:\09\09\09$%.2f\0A\00"
@.str.14 = [21 x i8] c"Total cost:\09\09\09$%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store i32 0, i32* %1
store i32 -999, i32* %3
store i32 -999, i32* %2
store float 0xC08F3FEB80000000, float* %12
store float 0xC08F3FEB80000000, float* %11
store float 0xC08F3FEB80000000, float* %10
store float 0xC08F3FEB80000000, float* %9
store float 0xC08F3FEB80000000, float* %7
store float 0xC08F3FEB80000000, float* %6
store float 0xC08F3FEB80000000, float* %5
store float 0xC08F3FEB80000000, float* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %6)
%23 = load float, float* %4
%24 = load i32, i32* %2
%25 = sitofp i32 %24 to float
%26 = fmul float %23, %25
store float %26, float* %10
%27 = load float, float* %5
%28 = load i32, i32* %3
%29 = sitofp i32 %28 to float
%30 = fmul float %27, %29
store float %30, float* %11
%31 = load float, float* %10
%32 = load float, float* %11
%33 = fadd float %31, %32
store float %33, float* %9
%34 = load float, float* %6
%35 = fdiv float %34, 1.000000e+02
store float %35, float* %8
%36 = load float, float* %9
%37 = load float, float* %8
%38 = fmul float %36, %37
store float %38, float* %7
%39 = load float, float* %9
%40 = load float, float* %7
%41 = fadd float %39, %40
store float %41, float* %12
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 12345)
%44 = load i32, i32* %2
%45 = load float, float* %4
%46 = fpext float %45 to double
%47 = load float, float* %10
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %44, double %46, double %48)
%50 = load i32, i32* %3
%51 = load float, float* %5
%52 = fpext float %51 to double
%53 = load float, float* %11
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i32 %50, double %52, double %54)
%56 = load float, float* %6
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), double %57)
%59 = load float, float* %7
%60 = fpext float %59 to double
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), double %60)
%62 = load float, float* %12
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), double %63)
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"Please type in how many of the first item you purchased: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [53 x i8] c"Please enter the price you paid for the first item: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [59 x i8] c"Please type in how many of the second item you purchased: \00"
@.str.5 = [54 x i8] c"Please enter the price you paid for the second item: \00"
@.str.6 = [23 x i8] c"What is the tax rate: \00"
@.str.7 = [7 x i8] c"\0A\0A\09%s\0A\00"
@.str.8 = [38 x i8] c"Doc_Heisenburg's_Productive_Chemicals\00"
@.str.9 = [14 x i8] c" Invoice #%d\0A\00"
@.str.10 = [35 x i8] c"Item 1: %d @ $%.2f per item\09$%.2f\0A\00"
@.str.11 = [35 x i8] c"Item 2: %d @ $%.2f per item\09$%.2f\0A\00"
@.str.12 = [18 x i8] c"Tax rate:\09\09\09%.2f\0A\00"
@.str.13 = [21 x i8] c"Tax amount:\09\09\09$%.2f\0A\00"
@.str.14 = [21 x i8] c"Total cost:\09\09\09$%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
store i32 -999, i32* %2
store i32 -999, i32* %1
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
store float 0xC08F3FEB80000000, float* %5
store float 0xC08F3FEB80000000, float* %4
store float 0xC08F3FEB80000000, float* %3
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%21 = load float, float* %3
%22 = load i32, i32* %1
%23 = sitofp i32 %22 to float
%24 = fmul float %21, %23
%25 = load float, float* %4
%26 = load i32, i32* %2
%27 = sitofp i32 %26 to float
%28 = fmul float %25, %27
%29 = fadd float %24, %28
%30 = load float, float* %5
%31 = fdiv float %30, 1.000000e+02
%32 = fmul float %31, %29
%33 = fadd float %29, %32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 12345)
%36 = load i32, i32* %1
%37 = load float, float* %3
%38 = fpext float %37 to double
%39 = fpext float %24 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %36, double %38, double %39)
%41 = load i32, i32* %2
%42 = load float, float* %4
%43 = fpext float %42 to double
%44 = fpext float %28 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i32 %41, double %43, double %44)
%46 = load float, float* %5
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), double %47)
%49 = fpext float %32 to double
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), double %49)
%51 = fpext float %33 to double
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), double %51)
ret i32 0
}