#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 */
typedef int /*<<< orphan*/ sequenceTwo;
typedef int /*<<< orphan*/ sequenceThree;
typedef int /*<<< orphan*/ sequenceOne;

/* Variables and functions */
int EXIT_SUCCESS;
int get_larger_neighbors_index(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sequenceOne[] = {1, 3, 4, 5, 1, 0, 5};
  int sequenceTwo[] = {1, 2, 3, 4, 5, 6, 6};
  int sequenceThree[] = {1, 1, 1};
  int lenghtSequenceOne = (sizeof(sequenceOne) / sizeof((sequenceOne)[0]));
  int lenghtSequenceTwo = (sizeof(sequenceTwo) / sizeof((sequenceTwo)[0]));
  int lenghtSequenceThree =
      (sizeof(sequenceThree) / sizeof((sequenceThree)[0]));
  int index_sequenceOne =
      get_larger_neighbors_index(sequenceOne, lenghtSequenceOne);
  printf("index sequenceOne %d\n", index_sequenceOne);
  int index_sequenceTwo =
      get_larger_neighbors_index(sequenceTwo, lenghtSequenceTwo);
  printf("index sequenceTwo %d\n", index_sequenceTwo);
  int index_sequenceThree =
      get_larger_neighbors_index(sequenceThree, lenghtSequenceThree);
  printf("index sequenceThree %d\n", index_sequenceThree);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x28(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x4c(%rbp)
mov    0xeb0(%rip),%eax
mov    %eax,-0x44(%rbp)
movl   $0x7,-0x50(%rbp)
movl   $0x7,-0x54(%rbp)
movl   $0x3,-0x58(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x50(%rbp),%esi
call   1040 <get_larger_neighbors_index@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   1040 <get_larger_neighbors_index@plt>
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x4c(%rbp),%rdi
mov    -0x58(%rbp),%esi
call   1040 <get_larger_neighbors_index@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xee9(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0xeea(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xed7(%rip),%rax
mov    %rax,(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x7,%esi
call   1040 <get_larger_neighbors_index@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x10(%rsp),%rdi
mov    $0x7,%esi
call   1040 <get_larger_neighbors_index@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0x3,%esi
call   1040 <get_larger_neighbors_index@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.sequenceOne = [7 x i32] [i32 1, i32 3, i32 4, i32 5, i32 1, i32 0, i32 5]
@__const.main.sequenceTwo = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 6]
@__const.main.sequenceThree = [3 x i32] [i32 1, i32 1, i32 1]
@.str = [22 x i8] c"index sequenceOne %d\0A\00"
@.str.1 = [22 x i8] c"index sequenceTwo %d\0A\00"
@.str.2 = [24 x i8] c"index sequenceThree %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca [7 x i32]
%4 = alloca [3 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = bitcast [7 x i32]* %2 to i8*
%12 = bitcast [7 x i32]* %3 to i8*
%13 = bitcast [3 x i32]* %4 to i8*
store i32 7, i32* %5
store i32 7, i32* %6
store i32 3, i32* %7
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%15 = load i32, i32* %5
%16 = call i32 @get_larger_neighbors_index(i32* %14, i32 %15)
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%20 = load i32, i32* %6
%21 = call i32 @get_larger_neighbors_index(i32* %19, i32 %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%25 = load i32, i32* %7
%26 = call i32 @get_larger_neighbors_index(i32* %24, i32 %25)
store i32 %26, i32* %10
%27 = load i32, i32* %10
%28 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}

LLVM IR (-O2):
@__const.main.sequenceOne = [7 x i32] [i32 1, i32 3, i32 4, i32 5, i32 1, i32 0, i32 5]
@__const.main.sequenceTwo = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 6]
@__const.main.sequenceThree = [3 x i32] [i32 1, i32 1, i32 1]
@.str = [22 x i8] c"index sequenceOne %d\0A\00"
@.str.1 = [22 x i8] c"index sequenceTwo %d\0A\00"
@.str.2 = [24 x i8] c"index sequenceThree %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [7 x i32]
%3 = alloca [3 x i32]
%4 = bitcast [7 x i32]* %1 to i8*
%5 = bitcast [7 x i32]* %2 to i8*
%6 = bitcast [3 x i32]* %3 to i8*
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = call i32 @get_larger_neighbors_index(i32* %7, i32 7)
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%11 = call i32 @get_larger_neighbors_index(i32* %10, i32 7)
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%14 = call i32 @get_larger_neighbors_index(i32* %13, i32 3)
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}