#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 getHieght(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {-1, 0, 1, 6, 6, 0, 0, 2, 7};
  int h = getHieght(arr, 9);
  printf("%d\n", h);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x30(%rbp)
movl   $0x1,-0x28(%rbp)
movl   $0x6,-0x24(%rbp)
movl   $0x6,-0x20(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x7,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <getHieght@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0xffffffff,(%rsp)
movabs $0x600000001,%rax
mov    %rax,0x8(%rsp)
movl   $0x6,0x10(%rsp)
movl   $0x2,0x1c(%rsp)
movl   $0x7,0x20(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <getHieght@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca i32
%3 = bitcast [9 x i32]* %1 to i8*
%4 = bitcast i8* %3 to [9 x i32]*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i32 0, i32 0
store i32 -1, i32* %5
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i32 0, i32 2
store i32 1, i32* %6
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i32 0, i32 3
store i32 6, i32* %7
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i32 0, i32 4
store i32 6, i32* %8
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i32 0, i32 7
store i32 2, i32* %9
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i32 0, i32 8
store i32 7, i32* %10
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%12 = call i32 @getHieght(i32* %11, i32 9)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
store i32 -1, i32* %3
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 2
store i32 1, i32* %4
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 3
store i32 6, i32* %5
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 4
store i32 6, i32* %6
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 7
store i32 2, i32* %7
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 8
store i32 7, i32* %8
%9 = call i32 @getHieght(i32* %3, i32 9)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}