#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(void) {
  int item_number = 0, month = 0, day = 0, year = 0;
  float unit_price = 0.0;
  printf("enter item number:\n");
  scanf("%d", &item_number);
  printf("enter unit price:\n");
  scanf("%f", &unit_price);
  printf("enter purchase date (mm/dd/yyyy):\n");
  scanf("%d/%d/%d", &month, &day, &year);
  printf("Item\t\tUnit\t\tPurchase\n");
  printf("    \t\tPrice\t\tDate\n");
  printf("%d\t\t", item_number);
  printf("$%.2f\t\t", unit_price);
  printf("%d/%d/%d\n", month, day, year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe72(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe56(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    0x14(%rsp),%esi
lea    0xe26(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe13(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0xe01(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"enter item number:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"enter unit price:\0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [35 x i8] c"enter purchase date (mm/dd/yyyy):\0A\00"
@.str.5 = [9 x i8] c"%d/%d/%d\00"
@.str.6 = [22 x i8] c"Item\09\09Unit\09\09Purchase\0A\00"
@.str.7 = [19 x i8] c" \09\09Price\09\09Date\0A\00"
@.str.8 = [5 x i8] c"%d\09\09\00"
@.str.9 = [8 x i8] c"$%.2f\09\09\00"
@.str.10 = [10 x i8] c"%d/%d/%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store float 0.000000e+00, float* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %15)
%17 = load float, float* %6
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), double %18)
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %20, i32 %21, i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.5 = [9 x i8] c"%d/%d/%d\00"
@.str.8 = [5 x i8] c"%d\09\09\00"
@.str.9 = [8 x i8] c"$%.2f\09\09\00"
@.str.10 = [10 x i8] c"%d/%d/%d\0A\00"
@str = [19 x i8] c"enter item number:\00"
@str.11 = [18 x i8] c"enter unit price:\00"
@str.12 = [34 x i8] c"enter purchase date (mm/dd/yyyy):\00"
@str.13 = [21 x i8] c"Item\09\09Unit\09\09Purchase\00"
@str.14 = [18 x i8] c" \09\09Price\09\09Date\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%7 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%10 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, 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* %5)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.12, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.13, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.14, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %19)
%21 = load float, float* %5
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), double %22)
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %24, i32 %25, i32 %26)
ret i32 0
}