// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x3cb4ff
movq -0x10(%rbp), %rdi
callq 0x4109b0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x3cb4ff
movq $0x0, -0x8(%rbp)
jmp 0x3cb656
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x3d38b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3cb5c4
movq -0x10(%rbp), %rax
movzbl 0x25(%rax), %eax
cmpl $0x0, %eax
jne 0x3cb5a2
movq -0x38(%rbp), %rdi
addq $0x1f0, %rdi            # imm = 0x1F0
movq -0x20(%rbp), %rsi
callq 0x40ad70
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x3cb576
movq -0x20(%rbp), %rdi
leaq 0x1e0d74(%rip), %rsi    # 0x5ac2ca
movl $0x7, %edx
callq 0x3c3ef0
cmpl $0x0, %eax
jne 0x3cb576
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x410a40
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x3cb5a0
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x410ac0
cmpl $0x0, %eax
je 0x3cb5a0
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x3cb656
jmp 0x3cb5a2
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3cb5ba
movq $0x0, -0x8(%rbp)
jmp 0x3cb656
movq -0x10(%rbp), %rax
movb $0x1, 0x1d(%rax)
jmp 0x3cb5e5
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x3cb5e3
movq -0x10(%rbp), %rax
movzbl 0x25(%rax), %eax
cmpl $0x0, %eax
je 0x3cb5e3
movq $0x0, -0x30(%rbp)
jmp 0x3cb5e5
cmpq $0x0, -0x30(%rbp)
jne 0x3cb64e
movl -0x14(%rbp), %edx
andl $0x1, %edx
leaq 0x1e0ce6(%rip), %rax    # 0x5ac2df
leaq 0x1e0cd2(%rip), %rcx    # 0x5ac2d2
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x3cb632
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq 0x1e0cc4(%rip), %rsi    # 0x5ac2ed
movb $0x0, %al
callq 0x3cb660
jmp 0x3cb64c
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x16efb3(%rip), %rsi    # 0x53a5f8
movb $0x0, %al
callq 0x3cb660
jmp 0x3cb64e
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq