// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: vdbeUnbind
static int vdbeUnbind(Vdbe *p, int i){
  Mem *pVar;
  if( vdbeSafetyNotNull(p) ){
    return SQLITE_MISUSE_BKPT;
  }
  sqlite3_mutex_enter(p->db->mutex);
  if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){
    sqlite3Error(p->db, SQLITE_MISUSE, 0);
    sqlite3_mutex_leave(p->db->mutex);
    sqlite3_log(SQLITE_MISUSE, 
        "bind on a busy prepared statement: [%s]", p->zSql);
    return SQLITE_MISUSE_BKPT;
  }
  if( i<1 || i>p->nVar ){
    sqlite3Error(p->db, SQLITE_RANGE, 0);
    sqlite3_mutex_leave(p->db->mutex);
    return SQLITE_RANGE;
  }
  i--;
  pVar = &p->aVar[i];
  sqlite3VdbeMemRelease(pVar);
  pVar->flags = MEM_Null;
  sqlite3Error(p->db, SQLITE_OK, 0);

  /* If the bit corresponding to this variable in Vdbe.expmask is set, then 
  ** binding a new value to this variable invalidates the current query plan.
  **
  ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host
  ** parameter in the WHERE clause might influence the choice of query plan
  ** for a statement, then the statement will be automatically recompiled,
  ** as if there had been a schema change, on the first sqlite3_step() call
  ** following any change to the bindings of that parameter.
  */
  if( p->isPrepareV2 &&
     ((i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff)
  ){
    p->expired = 1;
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11320
cmpl $0x0, %eax
je 0x1244f
movl $0xfb2b, %edi           # imm = 0xFB2B
callq 0x9420
movl %eax, -0x4(%rbp)
jmp 0x1259e
movq -0x10(%rbp), %rax
cmpl $0xbdf20da3, 0x50(%rax) # imm = 0xBDF20DA3
jne 0x12469
movq -0x10(%rbp), %rax
cmpl $0x0, 0x90(%rax)
jl 0x124b0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x15, %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xd720
movq -0x10(%rbp), %rax
movq 0xe0(%rax), %rdx
movl $0x15, %edi
leaq 0x9cfee(%rip), %rsi     # 0xaf485
movb $0x0, %al
callq 0xc5f0
movl $0xfb33, %edi           # imm = 0xFB33
callq 0x9420
movl %eax, -0x4(%rbp)
jmp 0x1259e
cmpl $0x1, -0x14(%rbp)
jl 0x124c8
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x88(%rcx), %ecx
cmpl %ecx, %eax
jle 0x124eb
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x19, %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xd720
movl $0x19, -0x4(%rbp)
jmp 0x1259e
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10190
movq -0x20(%rbp), %rax
movw $0x1, 0x24(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xd720
movq -0x10(%rbp), %rax
movw 0x9a(%rax), %ax
shrw $0xa, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x12597
cmpl $0x20, -0x14(%rbp)
jge 0x12570
movq -0x10(%rbp), %rax
movl 0x104(%rax), %eax
movl -0x14(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x1257d
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x104(%rax)
jne 0x12597
movq -0x10(%rbp), %rax
movw 0x9a(%rax), %cx
andw $-0x21, %cx
orw $0x20, %cx
movw %cx, 0x9a(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)