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


x86 assembly (clang, -O0):
<InOrderGoster>:
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    1191 <InOrderGoster+0x71>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%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     117c <InOrderGoster+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <PreOrderGoster@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InOrderGoster>:
cmp    %edx,%edi
jge    1173 <InOrderGoster+0x53>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0x0(%rbp,%rbp,1),%r15d
lea    0x1(%rbp,%rbp,1),%edi
call   1030 <PreOrderGoster@plt>
movslq %ebp,%rax
mov    (%r14,%rax,4),%esi
cmp    $0xffffffff,%esi
je     1158 <InOrderGoster+0x38>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
add    $0x2,%r15d
mov    %r15d,%edi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <PreOrderGoster@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d \00"
define void @InOrderGoster(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** %5
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, -1
br i1 %22, label %23, label %30
23: ; preds = %10
%24 = load i32*, i32** %5
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %23, %10
%31 = load i32, i32* %4
%32 = mul nsw i32 2, %31
%33 = add nsw i32 %32, 2
%34 = load i32*, i32** %5
%35 = load i32, i32* %6
%36 = call i32 @PreOrderGoster(i32 %33, i32* %34, i32 %35)
br label %37
37: ; preds = %30, %3
ret void
}

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