#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*/ array_find_indexo_ui(int, unsigned int *, int,
                                        unsigned int *, unsigned int *);
int /*<<< orphan*/ test_print2(unsigned int, char *);
void test_unit_array_find_index(void) {
  unsigned int pass;
  unsigned int A[10] = {0, 1, 1, 4, 5, 7, 7, 7, 7, 7};
  unsigned int Idx, Len;
  array_find_indexo_ui(10, A, 7, &Idx, &Len);
  pass = 0;
  if (Idx == 5 && Len == 5)
    pass = 1;
  test_print2(pass, "array_find_indexo_ui:");
}


x86 assembly (clang, -O0):
<test_unit_array_find_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rsi
mov    $0xa,%edi
mov    $0x7,%edx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
call   1030 <array_find_indexo_ui@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x34(%rbp)
jne    118a <test_unit_array_find_index+0x5a>
cmpl   $0x5,-0x38(%rbp)
jne    118a <test_unit_array_find_index+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xe94(%rip),%rsi
call   1040 <test_print2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unit_array_find_index>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0xa,%edi
mov    $0x7,%edx
call   1030 <array_find_indexo_ui@plt>
mov    0xc(%rsp),%eax
xor    $0x5,%eax
mov    0x8(%rsp),%ecx
xor    $0x5,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
lea    0xea5(%rip),%rsi
call   1040 <test_print2@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_unit_array_find_index.A = [10 x i32] [i32 0, i32 1, i32 1, i32 4, i32 5, i32 7, i32 7, i32 7, i32 7, i32 7]
@.str = [22 x i8] c"array_find_indexo_ui:\00"
define void @test_unit_array_find_index() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [10 x i32]* %2 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @array_find_indexo_ui(i32 10, i32* %6, i32 7, i32* %3, i32* %4)
store i32 0, i32* %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 5
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 5
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 1, i32* %1
br label %14
14: ; preds = %13, %10, %0
%15 = load i32, i32* %1
%16 = call i32 @test_print2(i32 %15, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test_unit_array_find_index.A = [10 x i32] [i32 0, i32 1, i32 1, i32 4, i32 5, i32 7, i32 7, i32 7, i32 7, i32 7]
@.str = [22 x i8] c"array_find_indexo_ui:\00"
define void @test_unit_array_find_index() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @array_find_indexo_ui(i32 10, i32* %7, i32 7, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 5
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 5
%13 = select i1 %10, i1 %12, i1 false
%14 = zext i1 %13 to i32
%15 = call i32 @test_print2(i32 %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}