// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3LocateTable
SQLITE_PRIVATE Table *sqlite3LocateTable(
  Parse *pParse,         /* context in which to report errors */
  u32 flags,             /* LOCATE_VIEW or LOCATE_NOERR */
  const char *zName,     /* Name of the table we are looking for */
  const char *zDbase     /* Name of the database.  Might be NULL */
){
  Table *p;
  sqlite3 *db = pParse->db;

  /* Read the database schema. If an error occurs, leave an error message
  ** and code in pParse and return NULL. */
  if( (db->mDbFlags & DBFLAG_SchemaKnownOk)==0
   && SQLITE_OK!=sqlite3ReadSchema(pParse)
  ){
    return 0;
  }

  p = sqlite3FindTable(db, zName, zDbase);
  if( p==0 ){
#ifndef SQLITE_OMIT_VIRTUALTABLE
    /* If zName is the not the name of a table in the schema created using
    ** CREATE, then check to see if it is the name of an virtual table that
    ** can be an eponymous virtual table. */
    if( pParse->disableVtab==0 ){
      Module *pMod = (Module*)sqlite3HashFind(&db->aModule, zName);
      if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){
        pMod = sqlite3PragmaVtabRegister(db, zName);
      }
      if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){
        return pMod->pEpoTab;
      }
    }
#endif
    if( flags & LOCATE_NOERR ) return 0;
    pParse->checkSchema = 1;
  }else if( IsVirtual(p) && pParse->disableVtab ){
    p = 0;
  }

  if( p==0 ){
    const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table";
    if( zDbase ){
      sqlite3ErrorMsg(pParse, "%s: %s.%s", zMsg, zDbase, zName);
    }else{
      sqlite3ErrorMsg(pParse, "%s: %s", zMsg, zName);
    }
  }

  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movq (%rdi), %r13
testb $0x10, 0x2c(%r13)
jne 0x27b1f6
movq %r15, %rdi
callq 0x2a8804
testl %eax, %eax
jne 0x27b264
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2811f8
testq %rax, %rax
je 0x27b21b
movq %rax, %r12
cmpl $0x0, 0x54(%rax)
je 0x27b267
cmpb $0x0, 0x25(%r15)
jne 0x27b22d
jmp 0x27b267
cmpb $0x0, 0x25(%r15)
je 0x27b292
testb $0x2, %bpl
jne 0x27b264
movb $0x1, 0x1d(%r15)
testb $0x1, %bpl
leaq 0x15bc16(%rip), %rax    # 0x3d6e4e
leaq 0x15bc02(%rip), %rdx    # 0x3d6e41
cmoveq %rax, %rdx
testq %r14, %r14
je 0x27b279
leaq 0x15bc0d(%rip), %rsi    # 0x3d6e5c
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x27b48d
jmp 0x27b267
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xedf0c(%rip), %rsi     # 0x36918c
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x27b48d
jmp 0x27b267
leaq 0x1f0(%r13), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2a547e
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x27b403
movq (%rax), %rcx
movq $0x0, 0x10(%rsp)
movq 0x28(%rax), %r12
testq %r12, %r12
jne 0x27b267
movq %rax, (%rsp)
movq (%r15), %r12
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0x27b2df
cmpq 0x10(%rcx), %rax
jne 0x27b222
movl $0x80, %esi
movq %r12, %rdi
movq %rcx, 0x8(%rsp)
callq 0x279b27
testq %rax, %rax
je 0x27b222
movq %rax, %r13
movq (%rsp), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
callq 0x279928
movq %rax, (%r13)
testq %rax, %rax
je 0x27b470
movq (%rsp), %rcx
movq %r13, 0x28(%rcx)
movl $0x1, 0x3c(%r13)
movq 0x20(%r12), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x70(%r13)
movw $0xffff, 0x44(%r13)     # imm = 0xFFFF
movq %r12, %rdi
movq %rax, %rsi
callq 0x279928
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2a9015
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2a9015
movq (%r13), %rsi
movq %r12, %rdi
callq 0x279928
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2a9015
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
leaq 0x10(%rsp), %r8
movq %r12, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq (%rsp), %rdx
callq 0x2a78df
testl %eax, %eax
je 0x27b480
movq 0x10(%rsp), %r12
leaq 0x14d6f5(%rip), %rsi    # 0x3c8aa9
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27b48d
testq %r12, %r12
je 0x27b3d3
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x282904
movq (%rsp), %rax
movq 0x28(%rax), %rsi
testq %rsi, %rsi
movq 0x8(%rsp), %rdi
je 0x27b222
orb $0x2, 0x40(%rsi)
callq 0x272447
movq (%rsp), %rax
movq $0x0, 0x28(%rax)
jmp 0x27b222
testq %rbx, %rbx
je 0x27b222
xorl %ecx, %ecx
leaq 0x155ecb(%rip), %rax    # 0x3d12e0
leaq 0x15ba1d(%rip), %rdx    # 0x3d6e39
movzbl (%rbx,%rcx), %esi
testq %rsi, %rsi
je 0x27b441
movzbl (%rsi,%rax), %esi
movzbl (%rcx,%rdx), %edi
movb (%rdi,%rax), %dil
cmpb %dil, %sil
jne 0x27b44b
incq %rcx
cmpq $0x7, %rcx
jne 0x27b41c
jmp 0x27b457
movzbl (%rcx,%rdx), %ecx
movb (%rcx,%rax), %dil
xorl %esi, %esi
movzbl %dil, %eax
cmpl %eax, %esi
jne 0x27b222
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2a884b
testq %rax, %rax
jne 0x27b2b0
jmp 0x27b222
movq %r12, %rdi
movq %r13, %rsi
callq 0x282904
jmp 0x27b222
movq (%rsp), %rax
movq 0x28(%rax), %r12
jmp 0x27b267