#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*/ extractList_il(void *, unsigned int, unsigned int **,
                                  unsigned int *);
int /*<<< orphan*/ free(unsigned int *);
int fsearchUnc(void *ail, unsigned int id, unsigned int value) {
  unsigned int *list;
  register unsigned int i;
  unsigned int len;
  extractList_il(ail, id, &list, &len);
  for (i = 0; i < len; i++) {
    if (list[i] == value) {
      free(list);
      return 1;
    }
  }
  free(list);
  return 0;
}


x86 assembly (clang, -O0):
<fsearchUnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <extractList_il@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jae    1194 <fsearchUnc+0x74>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1181 <fsearchUnc+0x61>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <fsearchUnc+0x84>
jmp    1186 <fsearchUnc+0x66>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <fsearchUnc+0x2d>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsearchUnc>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1040 <extractList_il@plt>
mov    0x4(%rsp),%eax
mov    0x8(%rsp),%rdi
test   %rax,%rax
je     115e <fsearchUnc+0x3e>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cmp    %ebx,(%rdi,%rcx,4)
je     1167 <fsearchUnc+0x47>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1150 <fsearchUnc+0x30>
call   1030 <free@plt>
xor    %eax,%eax
jmp    1171 <fsearchUnc+0x51>
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fsearchUnc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @extractList_il(i8* %11, i32 %12, i32** %8, i32* %10)
store i32 0, i32* %9
br label %14
14: ; preds = %30, %3
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = icmp ult i32 %15, %16
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load i32*, i32** %8
%20 = load i32, i32* %9
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %7
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %18
%27 = load i32*, i32** %8
%28 = call i32 @free(i32* %27)
store i32 1, i32* %4
br label %36
29: ; preds = %18
br label %30
30: ; preds = %29
%31 = load i32, i32* %9
%32 = add i32 %31, 1
store i32 %32, i32* %9
br label %14
33: ; preds = %14
%34 = load i32*, i32** %8
%35 = call i32 @free(i32* %34)
store i32 0, i32* %4
br label %36
36: ; preds = %33, %26
%37 = load i32, i32* %4
ret i32 %37
}

LLVM IR (-O2):
define i32 @fsearchUnc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = bitcast i32** %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 @extractList_il(i8* %0, i32 %1, i32** %4, i32* %5)
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
%11 = load i32*, i32** %4
br i1 %10, label %24, label %12
12: ; preds = %3
%13 = zext i32 %9 to i64
br label %16
14: ; preds = %16
%15 = icmp eq i64 %21, %13
br i1 %15, label %24, label %16
16: ; preds = %12, %14
%17 = phi i64 [ 0, %12 ], [ %21, %14 ]
%18 = getelementptr inbounds i32, i32* %11, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, %2
%21 = add nuw nsw i64 %17, 1
br i1 %20, label %22, label %14
22: ; preds = %16
%23 = call i32 @free(i32* %11)
br label %26
24: ; preds = %14, %3
%25 = call i32 @free(i32* %11)
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ 1, %22 ], [ 0, %24 ]
ret i32 %27
}