#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 print_it(int, int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int id, tran, tot;
  int id1, id2, id3, id4;
  id1 = print_it(id, tot);
  id2 = print_it(id, tot);
  id3 = print_it(id, tot);
  id4 = print_it(id, tot);
  printf("final inventory is \n");
  printf("ID 1-transaction after a week %d\n", id1);
  printf("ID 2-transaction after a week %d\n", id2);
  printf("ID 3-transaction after a week %d\n", id3);
  printf("ID 4-transaction after a week %d\n", id4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <print_it@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <print_it@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <print_it@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <print_it@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
call   1030 <print_it@plt>
mov    %eax,%ebp
call   1030 <print_it@plt>
mov    %eax,%ebx
call   1030 <print_it@plt>
mov    %eax,%r15d
call   1030 <print_it@plt>
mov    %eax,%r14d
lea    0xf2c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe98(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebc(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"final inventory is \0A\00"
@.str.1 = [34 x i8] c"ID 1-transaction after a week %d\0A\00"
@.str.2 = [34 x i8] c"ID 2-transaction after a week %d\0A\00"
@.str.3 = [34 x i8] c"ID 3-transaction after a week %d\0A\00"
@.str.4 = [34 x i8] c"ID 4-transaction after a week %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = call i32 @print_it(i32 %8, i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %1
%12 = load i32, i32* %3
%13 = call i32 @print_it(i32 %11, i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %1
%15 = load i32, i32* %3
%16 = call i32 @print_it(i32 %14, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %1
%18 = load i32, i32* %3
%19 = call i32 @print_it(i32 %17, i32 %18)
store i32 %19, i32* %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %7
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"ID 1-transaction after a week %d\0A\00"
@.str.2 = [34 x i8] c"ID 2-transaction after a week %d\0A\00"
@.str.3 = [34 x i8] c"ID 3-transaction after a week %d\0A\00"
@.str.4 = [34 x i8] c"ID 4-transaction after a week %d\0A\00"
@str = [20 x i8] c"final inventory is \00"
define i32 @main() {
%1 = tail call i32 @print_it(i32 undef, i32 undef)
%2 = tail call i32 @print_it(i32 undef, i32 undef)
%3 = tail call i32 @print_it(i32 undef, i32 undef)
%4 = tail call i32 @print_it(i32 undef, i32 undef)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %4)
ret i32 0
}