// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BitvecSet
SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec *p, u32 i){
  u32 h;
  if( p==0 ) return SQLITE_OK;
  assert( i>0 );
  assert( i<=p->iSize );
  i--;
  while((p->iSize > BITVEC_NBIT) && p->iDivisor) {
    u32 bin = i/p->iDivisor;
    i = i%p->iDivisor;
    if( p->u.apSub[bin]==0 ){
      p->u.apSub[bin] = sqlite3BitvecCreate( p->iDivisor );
      if( p->u.apSub[bin]==0 ) return SQLITE_NOMEM;
    }
    p = p->u.apSub[bin];
  }
  if( p->iSize<=BITVEC_NBIT ){
    p->u.aBitmap[i/BITVEC_SZELEM] |= 1 << (i&(BITVEC_SZELEM-1));
    return SQLITE_OK;
  }
  h = BITVEC_HASH(i++);
  /* if there wasn't a hash collision, and this doesn't */
  /* completely fill the hash, then just add it without */
  /* worring about sub-dividing and re-hashing. */
  if( !p->u.aHash[h] ){
    if (p->nSet<(BITVEC_NINT-1)) {
      goto bitvec_set_end;
    } else {
      goto bitvec_set_rehash;
    }
  }
  /* there was a collision, check to see if it's already */
  /* in hash, if not, try to find a spot for it */
  do {
    if( p->u.aHash[h]==i ) return SQLITE_OK;
    h++;
    if( h>=BITVEC_NINT ) h = 0;
  } while( p->u.aHash[h] );
  /* we didn't find it in the hash.  h points to the first */
  /* available free spot. check to see if this is going to */
  /* make our hash too "full".  */
bitvec_set_rehash:
  if( p->nSet>=BITVEC_MXHASH ){
    unsigned int j;
    int rc;
    u32 *aiValues = sqlite3StackAllocRaw(0, sizeof(p->u.aHash));
    if( aiValues==0 ){
      return SQLITE_NOMEM;
    }else{
      memcpy(aiValues, p->u.aHash, sizeof(p->u.aHash));
      memset(p->u.apSub, 0, sizeof(p->u.apSub));
      p->iDivisor = (p->iSize + BITVEC_NPTR - 1)/BITVEC_NPTR;
      rc = sqlite3BitvecSet(p, i);
      for(j=0; j<BITVEC_NINT; j++){
        if( aiValues[j] ) rc |= sqlite3BitvecSet(p, aiValues[j]);
      }
      sqlite3StackFree(0, aiValues);
      return rc;
    }
  }
bitvec_set_end:
  p->nSet++;
  p->u.aHash[h] = i;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x220d2
movl $0x0, -0x4(%rbp)
jmp 0x22356
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0xf80, %rcx            # imm = 0xF80
movb %al, -0x31(%rbp)
jbe 0x220ff
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x22108
jmp 0x22182
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpq $0x0, 0x10(%rax,%rcx,8)
jne 0x2216d
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x22360
movq %rax, %rdx
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, 0x10(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpq $0x0, 0x10(%rax,%rcx,8)
jne 0x2216b
movl $0x7, -0x4(%rbp)
jmp 0x22356
jmp 0x2216d
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
jmp 0x220db
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpq $0xf80, %rax            # imm = 0xF80
ja 0x221c0
movl -0x14(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %esi
shll %cl, %esi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
movzbl 0x10(%rax,%rcx), %edx
orl %esi, %edx
movb %dl, 0x10(%rax,%rcx)
movl $0x0, -0x4(%rbp)
jmp 0x22356
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
shll $0x0, %eax
movl %eax, %eax
movl $0x7c, %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
cmpl $0x0, 0x10(%rax,%rcx,4)
jne 0x22201
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
cmpq $0x7b, %rax
jae 0x221ff
jmp 0x22334
jmp 0x2224a
jmp 0x22203
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl 0x10(%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jne 0x2221f
movl $0x0, -0x4(%rbp)
jmp 0x22356
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpq $0x7c, %rax
jb 0x22238
movl $0x0, -0x18(%rbp)
jmp 0x2223a
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
cmpl $0x0, 0x10(%rax,%rcx,4)
jne 0x22203
jmp 0x2224a
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
cmpq $0x3e, %rax
jb 0x22332
xorl %eax, %eax
movl %eax, %edi
movl $0x1f0, %esi            # imm = 0x1F0
callq 0x134e0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x22280
movl $0x7, -0x4(%rbp)
jmp 0x22356
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movl $0x1f0, %edx            # imm = 0x1F0
callq 0x82f0
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movl $0x1f0, %edx            # imm = 0x1F0
callq 0x8200
movq -0x10(%rbp), %rax
movl (%rax), %eax
addq $0x3e, %rax
subq $0x1, %rax
movl $0x3e, %ecx
xorl %edx, %edx
divq %rcx
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x220b0
movl %eax, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpq $0x7c, %rax
jae 0x2231d
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
je 0x22310
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
movl (%rax,%rcx,4), %esi
callq 0x220b0
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x22312
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x222e1
movq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x9cd0
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22356
jmp 0x22334
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %edx, 0x10(%rax,%rcx,4)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop