// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/array.c
// Function: arrayFind
BOOL arrayFind(Array a, void *s, int *ip, ArrayOrder *order)
{
  int ord ;
  int i = 0 , j, k ;

  if (!arrayExists (a)) 
    die ("arrayFind called on bad array %lx", (long unsigned int) a) ;

  j = arrayMax(a) ;
  if (!j || (ord = order(s,uArray(a,0))) < 0)
    { if (ip) *ip = -1 ;
      return FALSE ;
    }   /* not found */

  if (ord == 0)
    { if (ip) *ip = 0 ;
      return TRUE ;
    }

  if ((ord = order(s,uArray(a,--j))) > 0)
    { if (ip) *ip = j ;
      return FALSE ;
    }
  
  if (ord == 0)
    { if (ip) *ip = j ;
      return TRUE ;
    }

  while(TRUE)
    { k = i + ((j-i) >> 1) ; /* midpoint */
      if ((ord = order(s, uArray(a,k))) == 0)
	{ if (ip) *ip = k ;
	  return TRUE ;
	}
      if (ord > 0) i = k ;
      else j = k ;
      if (i == (j-1))
        break ;
    }
  if (ip)
    *ip = i ;
  return FALSE ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x79d2
movq -0x10(%rbp), %rax
cmpl $0x881502, (%rax)       # imm = 0x881502
je 0x79e4
movq -0x10(%rbp), %rsi
leaq 0x25d4(%rip), %rdi      # 0x9fb1
movb $0x0, %al
callq 0x8180
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x7a24
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x7700
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movq -0x40(%rbp), %rax
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jge 0x7a3e
cmpq $0x0, -0x20(%rbp)
je 0x7a35
movq -0x20(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x0, -0x1(%rbp)
jmp 0x7b5f
cmpl $0x0, -0x2c(%rbp)
jne 0x7a5e
cmpq $0x0, -0x20(%rbp)
je 0x7a55
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x7b5f
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
addl $-0x1, %esi
movl %esi, -0x34(%rbp)
callq 0x7700
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movq -0x50(%rbp), %rax
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jle 0x7aae
cmpq $0x0, -0x20(%rbp)
je 0x7aa5
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x7b5f
cmpl $0x0, -0x2c(%rbp)
jne 0x7acd
cmpq $0x0, -0x20(%rbp)
je 0x7ac4
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x7b5f
jmp 0x7acf
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
subl -0x30(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x7700
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movq -0x60(%rbp), %rax
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jne 0x7b26
cmpq $0x0, -0x20(%rbp)
je 0x7b20
movl -0x38(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x7b5f
cmpl $0x0, -0x2c(%rbp)
jle 0x7b34
movl -0x38(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x7b3a
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x7b49
jmp 0x7b4b
jmp 0x7acf
cmpq $0x0, -0x20(%rbp)
je 0x7b5b
movl -0x30(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)