// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movq (%rdi), %r13
testb $0x10, 0x2c(%r13)
jne 0x284c43
movq %r15, %rdi
callq 0x2b243b
testl %eax, %eax
jne 0x284e8d
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x28ad59
testq %rax, %rax
je 0x284c73
movq %rax, %r12
cmpl $0x0, 0x54(%rax)
je 0x284e54
xorl %eax, %eax
cmpb $0x0, 0x25(%r15)
cmovneq %rax, %r12
jmp 0x284e54
cmpb $0x0, 0x25(%r15)
jne 0x284e46
leaq 0x1f0(%r13), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2aefdf
movq 0x10(%rax), %r12
testq %r12, %r12
jne 0x284cc3
leaq 0x15b8ef(%rip), %rsi    # 0x3e058e
movq %rbx, %rdi
movl $0x7, %edx
callq 0x27e951
testl %eax, %eax
je 0x284cb5
xorl %r12d, %r12d
jmp 0x284cc3
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2b2482
movq %rax, %r12
movb $0x1, %r13b
testq %r12, %r12
je 0x284e41
movq (%r12), %rdx
movq $0x0, 0x18(%rsp)
cmpq $0x0, 0x28(%r12)
je 0x284cf1
movq 0x28(%r12), %r12
xorl %r13d, %r13d
jmp 0x284e41
movq (%r15), %rcx
movq 0x8(%rdx), %rax
testq %rax, %rax
je 0x284d07
cmpq 0x10(%rdx), %rax
jne 0x284e41
movl $0x80, %esi
movq %rcx, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdx, 0x20(%rsp)
callq 0x283569
movq 0x10(%rsp), %rcx
testq %rax, %rax
je 0x284e41
movq %rax, 0x8(%rsp)
movq 0x8(%r12), %rsi
movq %rcx, %rdi
callq 0x283365
movq 0x8(%rsp), %rsi
movq %rax, (%rsi)
testq %rax, %rax
je 0x284e37
movq %rsi, 0x28(%r12)
movl $0x1, 0x3c(%rsi)
movq 0x10(%rsp), %rdi
movq 0x20(%rdi), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x70(%rsi)
movw $0xffff, 0x44(%rsi)     # imm = 0xFFFF
movq %rax, %rsi
callq 0x283365
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
callq 0x2b2c50
movq %r15, %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x2b2c50
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x10(%rsp), %rdi
callq 0x283365
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
callq 0x2b2c50
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rcx
leaq 0x18(%rsp), %r8
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x2b14f7
testl %eax, %eax
je 0x284ce4
movq 0x18(%rsp), %rdx
movq %rdx, 0x8(%rsp)
leaq 0x14d3db(%rip), %rsi    # 0x3d21d1
movq %r15, %rdi
xorl %eax, %eax
callq 0x284eb8
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0x284e14
movq 0x10(%rsp), %rdi
callq 0x28c3e7
movq 0x28(%r12), %rsi
testq %rsi, %rsi
movq 0x10(%rsp), %rdi
je 0x284e41
orb $0x2, 0x40(%rsi)
callq 0x27bd74
movq $0x0, 0x28(%r12)
jmp 0x284e41
movq 0x10(%rsp), %rdi
callq 0x28c3e7
testb %r13b, %r13b
je 0x284e90
testb $0x2, %bpl
jne 0x284e8d
movb $0x1, 0x1d(%r15)
xorl %r12d, %r12d
testq %r12, %r12
jne 0x284e90
testb $0x1, %bpl
leaq 0x15b73f(%rip), %rax    # 0x3e05a3
leaq 0x15b72b(%rip), %rdx    # 0x3e0596
cmoveq %rax, %rdx
testq %r14, %r14
je 0x284ea2
leaq 0x15b736(%rip), %rsi    # 0x3e05b1
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x284eb8
jmp 0x284e90
xorl %r12d, %r12d
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xed53b(%rip), %rsi     # 0x3723e4
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x284eb8
jmp 0x284e90