#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*/ oblicz_brutto(float *, int *, float *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ wczyt_netto(float *, int);
int /*<<< orphan*/ wczyt_vat(int *, int);
int /*<<< orphan*/ wypisz_ceny(float *, int);
int main(void) {
  int i;
  printf("Podaj ilosc towarow: ");
  scanf("%d", &i);
  float netto[i];
  int vat[i];
  float ceny[i];
  wczyt_netto(netto, i);
  wczyt_vat(vat, i);
  oblicz_brutto(netto, vat, ceny, i);
  wypisz_ceny(ceny, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1060 <printf@plt>
lea    0xe94(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x40(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%esi
call   1050 <wczyt_netto@plt>
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <wczyt_vat@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x8(%rbp),%ecx
call   1030 <oblicz_brutto@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1080 <wypisz_ceny@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe8a(%rip),%rdi
call   1060 <printf@plt>
lea    0xe94(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <scanf@plt>
mov    %rsp,%r12
mov    -0x24(%rbp),%eax
mov    %rsp,%r14
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    -0x24(%rbp),%esi
mov    %rsp,%rbx
lea    0xf(,%rsi,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %r14,%rdi
call   1050 <wczyt_netto@plt>
mov    -0x24(%rbp),%esi
mov    %rbx,%rdi
call   1040 <wczyt_vat@plt>
mov    -0x24(%rbp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <oblicz_brutto@plt>
mov    -0x24(%rbp),%esi
mov    %r15,%rdi
call   1080 <wypisz_ceny@plt>
mov    %r12,%rsp
xor    %eax,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Podaj ilosc towarow: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = alloca float, i64 %10
store i64 %10, i64* %4
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = alloca i32, i64 %14
store i64 %14, i64* %5
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = alloca float, i64 %17
store i64 %17, i64* %6
%19 = load i32, i32* %2
%20 = call i32 @wczyt_netto(float* %12, i32 %19)
%21 = load i32, i32* %2
%22 = call i32 @wczyt_vat(i32* %15, i32 %21)
%23 = load i32, i32* %2
%24 = call i32 @oblicz_brutto(float* %12, i32* %15, float* %18, i32 %23)
%25 = load i32, i32* %2
%26 = call i32 @wypisz_ceny(float* %18, i32 %25)
store i32 0, i32* %1
%27 = load i8*, i8** %3
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [22 x i8] c"Podaj ilosc towarow: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
%8 = alloca float, i64 %6
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = alloca i32, i64 %10
%12 = alloca float, i64 %10
%13 = call i32 @wczyt_netto(float* %8, i32 %9)
%14 = load i32, i32* %1
%15 = call i32 @wczyt_vat(i32* %11, i32 %14)
%16 = load i32, i32* %1
%17 = call i32 @oblicz_brutto(float* %8, i32* %11, float* %12, i32 %16)
%18 = load i32, i32* %1
%19 = call i32 @wypisz_ceny(float* %12, i32 %18)
ret i32 0
}