// File: /workspace/github_c_makefile_star2_O2/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 0x226b77
movq %r15, %rdi
callq 0x24d8f7
testl %eax, %eax
jne 0x226be5
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22beb2
testq %rax, %rax
je 0x226b9c
movq %rax, %r12
cmpl $0x0, 0x54(%rax)
je 0x226be8
cmpb $0x0, 0x25(%r15)
jne 0x226bae
jmp 0x226be8
cmpb $0x0, 0x25(%r15)
je 0x226c13
testb $0x2, %bpl
jne 0x226be5
movb $0x1, 0x1d(%r15)
testb $0x1, %bpl
leaq 0x1506b5(%rip), %rax    # 0x37726e
leaq 0x1506a1(%rip), %rdx    # 0x377261
cmoveq %rax, %rdx
testq %r14, %r14
je 0x226bfa
leaq 0x1506ac(%rip), %rsi    # 0x37727c
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x226dce
jmp 0x226be8
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe24e7(%rip), %rsi     # 0x3090e8
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x226dce
jmp 0x226be8
leaq 0x1f0(%r13), %rdi
movq %rbx, %rsi
callq 0x24a8e6
testq %rax, %rax
je 0x226d55
movq (%rax), %rcx
andq $0x0, 0x8(%rsp)
movq 0x28(%rax), %r12
testq %r12, %r12
jne 0x226be8
movq %rax, %r12
movq (%r15), %r13
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0x226c56
cmpq 0x10(%rcx), %rax
jne 0x226ba3
movl $0x80, %esi
movq %r13, %rdi
movq %rcx, 0x10(%rsp)
callq 0x2258ed
testq %rax, %rax
je 0x226ba3
movq %r13, %rcx
movq %rax, %r13
movq %r12, (%rsp)
movq 0x8(%r12), %rsi
movq %rcx, %r12
movq %rcx, %rdi
callq 0x22572a
movq %rax, (%r13)
testq %rax, %rax
je 0x226db1
movq (%rsp), %rcx
movq %r13, 0x28(%rcx)
movl $0x1, 0x3c(%r13)
movq 0x20(%r12), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x70(%r13)
orw $-0x1, 0x44(%r13)
movq %r12, %rdi
movq %rax, %rsi
callq 0x22572a
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x24dff8
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x24dff8
movq (%r13), %rsi
movq %r12, %rdi
callq 0x22572a
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x24dff8
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
leaq 0x8(%rsp), %r8
movq %r12, %rdi
movq %r13, %rsi
movq (%rsp), %rdx
callq 0x24cab6
testl %eax, %eax
je 0x226dc1
movq 0x8(%rsp), %r13
leaq 0x14217d(%rip), %rsi    # 0x368ea9
movq %r15, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x226dce
movq %r12, %rdi
movq %r13, %rsi
callq 0x21f26b
movq %r12, %rdi
movq (%rsp), %rsi
callq 0x24dab6
jmp 0x226ba3
leaq 0x1504fd(%rip), %rsi    # 0x377259
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x2217ad
testl %eax, %eax
jne 0x226ba3
leaq 0x7(%rbx), %rdi
callq 0x24d93e
testq %rax, %rax
je 0x226ba3
testb $0x30, 0x9(%rax)
je 0x226ba3
leaq 0x20ee3e(%rip), %rdx    # 0x435bd0
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x24d9c0
testq %rax, %rax
jne 0x226c2b
jmp 0x226ba3
movq %r12, %rdi
movq %r13, %rsi
callq 0x22d0fc
jmp 0x226ba3
movq (%rsp), %rax
movq 0x28(%rax), %r12
jmp 0x226be8