#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*/ PreOrderAl(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void PostOrderAl(int node, int *BST, int elemanSayisi) {
  if (node < elemanSayisi) {
    PreOrderAl(2 * node + 1, BST, elemanSayisi);
    PreOrderAl(2 * node + 2, BST, elemanSayisi);
    printf("%d. elemani girin> ", node);
    scanf("%d", &BST[node]);
  }
}


x86 assembly (clang, -O0):
<PostOrderAl>:
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    11a2 <PostOrderAl+0x72>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <PreOrderAl@plt>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <PreOrderAl@plt>
mov    -0x4(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe77(%rip),%rdi
call   1040 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PostOrderAl>:
cmp    %edx,%edi
jge    117f <PostOrderAl+0x4f>
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%edi
add    $0x1,%edi
call   1050 <PreOrderAl@plt>
lea    (%rbx,%rbx,1),%edi
add    $0x2,%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <PreOrderAl@plt>
lea    0xe9f(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rsi
lea    0xe9e(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <scanf@plt>
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%d. elemani girin> \00"
@.str.1 = [3 x i8] c"%d\00"
define void @PostOrderAl(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 %30
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 @PreOrderAl(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 @PreOrderAl(i32 %19, i32* %20, i32 %21)
%23 = load i32, i32* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32*, i32** %5
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %28)
br label %30
30: ; preds = %10, %3
ret void
}

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