#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*/ PreOrderGoster(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
void PostOrderGoster(int node, int *BST, int elemanSayisi) {
  if (node < elemanSayisi) {
    PreOrderGoster(2 * node + 1, BST, elemanSayisi);
    PreOrderGoster(2 * node + 2, BST, elemanSayisi);
    if (BST[node] != -1)
      printf("%d  ", BST[node]);
  }
}


x86 assembly (clang, -O0):
<PostOrderGoster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1196 <PostOrderGoster+0x76>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <PreOrderGoster@plt>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <PreOrderGoster@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1191 <PostOrderGoster+0x71>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
jmp    1196 <PostOrderGoster+0x76>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PostOrderGoster>:
cmp    %edx,%edi
jge    1166 <PostOrderGoster+0x46>
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%edi
add    $0x1,%edi
call   1030 <PreOrderGoster@plt>
lea    (%rbx,%rbx,1),%edi
add    $0x2,%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <PreOrderGoster@plt>
movslq %ebx,%rax
mov    (%r14,%rax,4),%esi
cmp    $0xffffffff,%esi
pop    %rbx
pop    %r14
pop    %rbp
je     1166 <PostOrderGoster+0x46>
lea    0xe9f(%rip),%rdi
jmp    1040 <printf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d \00"
define void @PostOrderGoster(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %3
%11 = load i32, i32* %4
%12 = mul nsw i32 2, %11
%13 = add nsw i32 %12, 1
%14 = load i32*, i32** %5
%15 = load i32, i32* %6
%16 = call i32 @PreOrderGoster(i32 %13, i32* %14, i32 %15)
%17 = load i32, i32* %4
%18 = mul nsw i32 2, %17
%19 = add nsw i32 %18, 2
%20 = load i32*, i32** %5
%21 = load i32, i32* %6
%22 = call i32 @PreOrderGoster(i32 %19, i32* %20, i32 %21)
%23 = load i32*, i32** %5
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, -1
br i1 %28, label %29, label %36
29: ; preds = %10
%30 = load i32*, i32** %5
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
%34 = load i32, i32* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %29, %10
br label %37
37: ; preds = %36, %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \00"
define void @PostOrderGoster(i32 %0, i32* %1, i32 %2) {
%4 = icmp slt i32 %0, %2
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = shl nsw i32 %0, 1
%7 = or i32 %6, 1
%8 = tail call i32 @PreOrderGoster(i32 %7, i32* %1, i32 %2)
%9 = add nsw i32 %6, 2
%10 = tail call i32 @PreOrderGoster(i32 %9, i32* %1, i32 %2)
%11 = sext i32 %0 to i64
%12 = getelementptr inbounds i32, i32* %1, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, -1
br i1 %14, label %17, label %15
15: ; preds = %5
%16 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %17
17: ; preds = %5, %15, %3
ret void
}