#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*/ display(int *);
int /*<<< orphan*/ insert(int *);
int /*<<< orphan*/ search(int *);
int main() {
  int arr[9], i;
  for (i = 0; i < 9; i++) {
    arr[i] = -1;
  }
  for (i = 0; i < 9; i++) {
    insert(arr);
  }
  display(arr);
  search(arr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jge    116a <main+0x3a>
movslq -0x34(%rbp),%rax
movl   $0xffffffff,-0x30(%rbp,%rax,4)
ff
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <main+0x16>
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jge    1192 <main+0x62>
lea    -0x30(%rbp),%rdi
call   1050 <insert@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1171 <main+0x41>
lea    -0x30(%rbp),%rdi
call   1030 <display@plt>
lea    -0x30(%rbp),%rdi
call   1040 <search@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqa %xmm0,(%rsp)
movl   $0xffffffff,0x20(%rsp)
ff
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1030 <display@plt>
mov    %rbx,%rdi
call   1040 <search@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 9
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 %9
store i32 -1, i32* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
store i32 0, i32* %3
br label %15
15: ; preds = %21, %14
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 9
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%20 = call i32 @insert(i32* %19)
br label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %15
24: ; preds = %15
%25 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%26 = call i32 @display(i32* %25)
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%28 = call i32 @search(i32* %27)
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
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
%4 = call i32 @insert(i32* %3)
%5 = call i32 @insert(i32* %3)
%6 = call i32 @insert(i32* %3)
%7 = call i32 @insert(i32* %3)
%8 = call i32 @insert(i32* %3)
%9 = call i32 @insert(i32* %3)
%10 = call i32 @insert(i32* %3)
%11 = call i32 @insert(i32* %3)
%12 = call i32 @insert(i32* %3)
%13 = call i32 @display(i32* %3)
%14 = call i32 @search(i32* %3)
ret i32 0
}