// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3TableLock
SQLITE_PRIVATE void sqlite3TableLock(
  Parse *pParse,     /* Parsing context */
  int iDb,           /* Index of the database containing the table to lock */
  Pgno iTab,         /* Root page number of the table to be locked */
  u8 isWriteLock,    /* True for a write lock */
  const char *zName  /* Name of the table to be locked */
){
  Parse *pToplevel = sqlite3ParseToplevel(pParse);
  int i;
  int nBytes;
  TableLock *p;
  assert( iDb>=0 );

  if( iDb==1 ) return;
  if( !sqlite3BtreeSharable(pParse->db->aDb[iDb].pBt) ) return;
  for(i=0; i<pToplevel->nTableLock; i++){
    p = &pToplevel->aTableLock[i];
    if( p->iDb==iDb && p->iTab==iTab ){
      p->isWriteLock = (p->isWriteLock || isWriteLock);
      return;
    }
  }

  nBytes = sizeof(TableLock) * (pToplevel->nTableLock+1);
  pToplevel->aTableLock =
      sqlite3DbReallocOrFree(pToplevel->db, pToplevel->aTableLock, nBytes);
  if( pToplevel->aTableLock ){
    p = &pToplevel->aTableLock[pToplevel->nTableLock++];
    p->iDb = iDb;
    p->iTab = iTab;
    p->isWriteLock = isWriteLock;
    p->zLockName = zName;
  }else{
    pToplevel->nTableLock = 0;
    sqlite3OomFault(pToplevel->db);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x429fba
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x429fc2
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x429fd5
jmp 0x42a14a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x410380
cmpl $0x0, %eax
jne 0x429ffe
jmp 0x42a14a
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x88(%rcx), %eax
jge 0x42a08a
movq -0x28(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x42a07a
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x10(%rbp), %eax
jne 0x42a07a
movq -0x38(%rbp), %rax
movzbl 0x8(%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x41(%rbp)
jne 0x42a064
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, 0x8(%rax)
jmp 0x42a14a
jmp 0x42a07c
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x42a005
movq -0x28(%rbp), %rax
movl 0x88(%rax), %eax
addl $0x1, %eax
cltq
imulq $0x18, %rax, %rax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x90(%rax), %rsi
movslq -0x30(%rbp), %rdx
callq 0x3ee240
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x90(%rax)
je 0x42a130
movq -0x28(%rbp), %rax
movq 0x90(%rax), %rax
movq -0x28(%rbp), %rdx
movl 0x88(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x88(%rdx)
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movb -0x11(%rbp), %cl
movq -0x38(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x42a14a
movq -0x28(%rbp), %rax
movl $0x0, 0x88(%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x3c8ba0
addq $0x50, %rsp
popq %rbp
retq