// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VtabBeginParse
SQLITE_PRIVATE void sqlite3VtabBeginParse(
  Parse *pParse,        /* Parsing context */
  Token *pName1,        /* Name of new table, or database name */
  Token *pName2,        /* Name of new table or NULL */
  Token *pModuleName,   /* Name of the module for the virtual table */
  int ifNotExists       /* No error if the table already exists */
){
  int iDb;              /* The database the table is being created in */
  Table *pTable;        /* The new virtual table */
  sqlite3 *db;          /* Database connection */

  sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, ifNotExists);
  pTable = pParse->pNewTable;
  if( pTable==0 ) return;
  assert( 0==pTable->pIndex );

  db = pParse->db;
  iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
  assert( iDb>=0 );

  pTable->tabFlags |= TF_Virtual;
  pTable->nModuleArg = 0;
  addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName));
  addModuleArgument(db, pTable, 0);
  addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName));
  pParse->sNameToken.n = (int)(&pModuleName->z[pModuleName->n] - pName1->z);

#ifndef SQLITE_OMIT_AUTHORIZATION
  /* Creating a virtual table invokes the authorization callback twice.
  ** The first invocation, to obtain permission to INSERT a row into the
  ** sqlite_master table, has already been made by sqlite3StartTable().
  ** The second call, to obtain permission to create the table, is made now.
  */
  if( pTable->azModuleArg ){
    sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName, 
            pTable->azModuleArg[0], pParse->db->aDb[iDb].zName);
  }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl %r8d, (%rsp)
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x393b1
movq 0x238(%rbx), %r12
testq %r12, %r12
je 0x45b48
movq (%rbx), %r13
movq 0x68(%r12), %rax
testq %rax, %rax
movq %r14, -0x30(%rbp)
je 0x45a9d
movl 0x28(%r13), %ecx
testl %ecx, %ecx
jle 0x45aa5
movq 0x20(%r13), %rdx
addq $0x18, %rdx
xorl %r14d, %r14d
cmpq %rax, (%rdx)
je 0x45aa8
incq %r14
addq $0x20, %rdx
cmpq %r14, %rcx
jne 0x45a87
movl %ecx, %r14d
jmp 0x45aa8
movl $0xfff0bdc0, %r14d      # imm = 0xFFF0BDC0
jmp 0x45aa8
xorl %r14d, %r14d
orb $0x10, 0x46(%r12)
movl $0x0, 0x4c(%r12)
movq %r13, %rdi
movq %r15, %rsi
callq 0x45df3
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x63660
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x63660
movq (%r12), %rsi
movq %r13, %rdi
callq 0x1010d
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x63660
movl (%r15), %eax
addl 0x8(%r15), %eax
movq -0x30(%rbp), %rcx
subl (%rcx), %eax
movl %eax, 0x258(%rbx)
movq 0x50(%r12), %rax
testq %rax, %rax
je 0x45b48
movq (%r12), %rdx
movq (%rax), %rcx
movq (%rbx), %rax
movq 0x20(%rax), %rax
movslq %r14d, %rsi
shlq $0x5, %rsi
movq (%rax,%rsi), %r8
movq %rbx, %rdi
movl $0x1d, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x45d75
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq