#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*/ arr;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_even_index(int *, int);
int main() {
  {
    int arr[] = {1, 2, 3, 4, 3, 2, 1};
    int expected = 3;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
  {
    int arr[] = {1, 100, 50, -51, 1, 1};
    int expected = 1;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
  {
    int arr[] = {1, 2, 3, 4, 5, 6};
    int expected = -1;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
  {
    int arr[] = {20, 10, 30, 10, 10, 15, 35};
    int expected = 3;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
  {
    int arr[] = {20, 10, -80, 10, 10, 15, 35};
    int expected = 0;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
  {
    int arr[] = {10, -80, 10, 10, 15, 35, 20};
    int expected = 6;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
  {
    int arr[] = {0, 0, 0, 0, 0};
    int expected = 0;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
  {
    int arr[] = {-1, -2, -3, -4, -3, -2, -1};
    int expected = 3;
    int result = find_even_index(arr, (int)(sizeof(arr) / sizeof(arr[0])));
    assert(expected == result);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    0xebe(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb6(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0xe89(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x1,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0xe5d(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe5a(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe57(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0xffffffff,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x6,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0xe31(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xe2b(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xe25(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe23(%rip),%eax
mov    %eax,-0x78(%rbp)
movl   $0x3,-0x94(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0x98(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x98(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0xde7(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xde1(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xddb(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xdd6(%rip),%eax
mov    %eax,-0xa8(%rbp)
movl   $0x0,-0xc4(%rbp)
lea    -0xc0(%rbp),%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0xc8(%rbp)
mov    -0xc4(%rbp),%eax
cmp    -0xc8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0xd97(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0xd91(%rip),%rax
mov    %rax,-0xe8(%rbp)
mov    0xd8b(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    0xd86(%rip),%eax
mov    %eax,-0xd8(%rbp)
movl   $0x6,-0xf4(%rbp)
lea    -0xf0(%rbp),%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0xf8(%rbp)
mov    -0xf4(%rbp),%eax
cmp    -0xf8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0x0,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x5,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0x118(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0x118(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0xcfa(%rip),%rax
mov    %rax,-0x140(%rbp)
mov    0xcf4(%rip),%rax
mov    %rax,-0x138(%rbp)
mov    0xcee(%rip),%rax
mov    %rax,-0x130(%rbp)
mov    0xce9(%rip),%eax
mov    %eax,-0x128(%rbp)
movl   $0x3,-0x144(%rbp)
lea    -0x140(%rbp),%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
mov    %eax,-0x148(%rbp)
mov    -0x144(%rbp),%eax
cmp    -0x148(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
mov    0xed3(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    0xec1(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
movups 0xeab(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xe93(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
movups 0xe99(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xe81(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
movups 0xe88(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xe70(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1040 <assert@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
movups 0xe4d(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xe35(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <find_even_index@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 3, i32 2, i32 1]
@__const.main.arr.1 = [6 x i32] [i32 1, i32 100, i32 50, i32 -51, i32 1, i32 1]
@__const.main.arr.2 = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.main.arr.3 = [7 x i32] [i32 20, i32 10, i32 30, i32 10, i32 10, i32 15, i32 35]
@__const.main.arr.4 = [7 x i32] [i32 20, i32 10, i32 -80, i32 10, i32 10, i32 15, i32 35]
@__const.main.arr.5 = [7 x i32] [i32 10, i32 -80, i32 10, i32 10, i32 15, i32 35, i32 20]
@__const.main.arr.6 = [7 x i32] [i32 -1, i32 -2, i32 -3, i32 -4, i32 -3, i32 -2, i32 -1]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca [6 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca [6 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca [7 x i32]
%11 = alloca i32
%12 = alloca i32
%13 = alloca [7 x i32]
%14 = alloca i32
%15 = alloca i32
%16 = alloca [7 x i32]
%17 = alloca i32
%18 = alloca i32
%19 = alloca [5 x i32]
%20 = alloca i32
%21 = alloca i32
%22 = alloca [7 x i32]
%23 = alloca i32
%24 = alloca i32
%25 = bitcast [7 x i32]* %1 to i8*
store i32 3, i32* %2
%26 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%27 = call i32 @find_even_index(i32* %26, i32 7)
store i32 %27, i32* %3
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = icmp eq i32 %28, %29
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = bitcast [6 x i32]* %4 to i8*
store i32 1, i32* %5
%34 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%35 = call i32 @find_even_index(i32* %34, i32 6)
store i32 %35, i32* %6
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = icmp eq i32 %36, %37
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = bitcast [6 x i32]* %7 to i8*
store i32 -1, i32* %8
%42 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
%43 = call i32 @find_even_index(i32* %42, i32 6)
store i32 %43, i32* %9
%44 = load i32, i32* %8
%45 = load i32, i32* %9
%46 = icmp eq i32 %44, %45
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = bitcast [7 x i32]* %10 to i8*
store i32 3, i32* %11
%50 = getelementptr inbounds [7 x i32], [7 x i32]* %10, i64 0, i64 0
%51 = call i32 @find_even_index(i32* %50, i32 7)
store i32 %51, i32* %12
%52 = load i32, i32* %11
%53 = load i32, i32* %12
%54 = icmp eq i32 %52, %53
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = bitcast [7 x i32]* %13 to i8*
store i32 0, i32* %14
%58 = getelementptr inbounds [7 x i32], [7 x i32]* %13, i64 0, i64 0
%59 = call i32 @find_even_index(i32* %58, i32 7)
store i32 %59, i32* %15
%60 = load i32, i32* %14
%61 = load i32, i32* %15
%62 = icmp eq i32 %60, %61
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
%65 = bitcast [7 x i32]* %16 to i8*
store i32 6, i32* %17
%66 = getelementptr inbounds [7 x i32], [7 x i32]* %16, i64 0, i64 0
%67 = call i32 @find_even_index(i32* %66, i32 7)
store i32 %67, i32* %18
%68 = load i32, i32* %17
%69 = load i32, i32* %18
%70 = icmp eq i32 %68, %69
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = bitcast [5 x i32]* %19 to i8*
store i32 0, i32* %20
%74 = getelementptr inbounds [5 x i32], [5 x i32]* %19, i64 0, i64 0
%75 = call i32 @find_even_index(i32* %74, i32 5)
store i32 %75, i32* %21
%76 = load i32, i32* %20
%77 = load i32, i32* %21
%78 = icmp eq i32 %76, %77
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = bitcast [7 x i32]* %22 to i8*
store i32 3, i32* %23
%82 = getelementptr inbounds [7 x i32], [7 x i32]* %22, i64 0, i64 0
%83 = call i32 @find_even_index(i32* %82, i32 7)
store i32 %83, i32* %24
%84 = load i32, i32* %23
%85 = load i32, i32* %24
%86 = icmp eq i32 %84, %85
%87 = zext i1 %86 to i32
%88 = call i32 @assert(i32 %87)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 3, i32 2, i32 1]
@__const.main.arr.1 = [6 x i32] [i32 1, i32 100, i32 50, i32 -51, i32 1, i32 1]
@__const.main.arr.2 = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.main.arr.3 = [7 x i32] [i32 20, i32 10, i32 30, i32 10, i32 10, i32 15, i32 35]
@__const.main.arr.4 = [7 x i32] [i32 20, i32 10, i32 -80, i32 10, i32 10, i32 15, i32 35]
@__const.main.arr.5 = [7 x i32] [i32 10, i32 -80, i32 10, i32 10, i32 15, i32 35, i32 20]
@__const.main.arr.6 = [7 x i32] [i32 -1, i32 -2, i32 -3, i32 -4, i32 -3, i32 -2, i32 -1]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
%4 = alloca [7 x i32]
%5 = alloca [7 x i32]
%6 = alloca [7 x i32]
%7 = alloca [5 x i32]
%8 = alloca [7 x i32]
%9 = bitcast [7 x i32]* %1 to i8*
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%11 = call i32 @find_even_index(i32* %10, i32 7)
%12 = icmp eq i32 %11, 3
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = bitcast [6 x i32]* %2 to i8*
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%17 = call i32 @find_even_index(i32* %16, i32 6)
%18 = icmp eq i32 %17, 1
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = bitcast [6 x i32]* %3 to i8*
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%23 = call i32 @find_even_index(i32* %22, i32 6)
%24 = icmp eq i32 %23, -1
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = bitcast [7 x i32]* %4 to i8*
%28 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%29 = call i32 @find_even_index(i32* %28, i32 7)
%30 = icmp eq i32 %29, 3
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = bitcast [7 x i32]* %5 to i8*
%34 = getelementptr inbounds [7 x i32], [7 x i32]* %5, i64 0, i64 0
%35 = call i32 @find_even_index(i32* %34, i32 7)
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = bitcast [7 x i32]* %6 to i8*
%40 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%41 = call i32 @find_even_index(i32* %40, i32 7)
%42 = icmp eq i32 %41, 6
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = bitcast [5 x i32]* %7 to i8*
%46 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%47 = call i32 @find_even_index(i32* %46, i32 5)
%48 = icmp eq i32 %47, 0
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = bitcast [7 x i32]* %8 to i8*
%52 = getelementptr inbounds [7 x i32], [7 x i32]* %8, i64 0, i64 0
%53 = call i32 @find_even_index(i32* %52, i32 7)
%54 = icmp eq i32 %53, 3
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
ret i32 0
}