#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ pobieranie(int *, int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sortowanie(int *, int **);
int /*<<< orphan*/ stderr;
scalar_t__ utworzTab(int *, int **);
int /*<<< orphan*/ wyswietl(int *, int **);
int main() {
  int ilosc;
  int *TabLiczb = NULL;
  if (utworzTab(&ilosc, &TabLiczb) != 0) {
    fprintf(stderr, ":( Brak pamieci. Tablica liczb nie zostala utworzona\n");
    return 1;
  } else {
    pobieranie(&ilosc, &TabLiczb);
    sortowanie(&ilosc, &TabLiczb);
    wyswietl(&ilosc, &TabLiczb);
  }
  printf("Koniec dzialania programu.\n");
  free(TabLiczb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <utworzTab@plt>
cmp    $0x0,%rax
je     11bf <main+0x4f>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1202 <main+0x92>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <pobieranie@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <sortowanie@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1090 <wyswietl@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
lea    0x14(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1070 <utworzTab@plt>
test   %rax,%rax
je     11b0 <main+0x40>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    0xe5c(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%eax
jmp    11f3 <main+0x83>
lea    0x14(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <pobieranie@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <sortowanie@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <wyswietl@plt>
lea    0xe54(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c":( Brak pamieci. Tablica liczb nie zostala utworzona\0A\00"
@.str.1 = [28 x i8] c"Koniec dzialania programu.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %3
%4 = call i64 @utworzTab(i32* %2, i32** %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %17
9: ; preds = %0
%10 = call i32 @pobieranie(i32* %2, i32** %3)
%11 = call i32 @sortowanie(i32* %2, i32** %3)
%12 = call i32 @wyswietl(i32* %2, i32** %3)
br label %13
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32*, i32** %3
%16 = call i32 @free(i32* %15)
store i32 0, i32* %1
br label %17
17: ; preds = %13, %6
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c":( Brak pamieci. Tablica liczb nie zostala utworzona\0A\00"
@str = [27 x i8] c"Koniec dzialania programu.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32** %2 to i8*
store i32* null, i32** %2
%5 = call i64 @utworzTab(i32* %1, i32** %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
br label %17
10: ; preds = %0
%11 = call i32 @pobieranie(i32* %1, i32** %2)
%12 = call i32 @sortowanie(i32* %1, i32** %2)
%13 = call i32 @wyswietl(i32* %1, i32** %2)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%15 = load i32*, i32** %2
%16 = call i32 @free(i32* %15)
br label %17
17: ; preds = %10, %7
%18 = phi i32 [ 1, %7 ], [ 0, %10 ]
ret i32 %18
}