// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_declare_vtab
SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
  VtabCtx *pCtx;
  Parse *pParse;
  int rc = SQLITE_OK;
  Table *pTab;
  char *zErr = 0;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) || zCreateTable==0 ){
    return SQLITE_MISUSE_BKPT;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  pCtx = db->pVtabCtx;
  if( !pCtx || pCtx->bDeclared ){
    sqlite3Error(db, SQLITE_MISUSE);
    sqlite3_mutex_leave(db->mutex);
    return SQLITE_MISUSE_BKPT;
  }
  pTab = pCtx->pTab;
  assert( (pTab->tabFlags & TF_Virtual)!=0 );

  pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
  if( pParse==0 ){
    rc = SQLITE_NOMEM;
  }else{
    pParse->declareVtab = 1;
    pParse->db = db;
    pParse->nQueryLoop = 1;
  
    if( SQLITE_OK==sqlite3RunParser(pParse, zCreateTable, &zErr) 
     && pParse->pNewTable
     && !db->mallocFailed
     && !pParse->pNewTable->pSelect
     && (pParse->pNewTable->tabFlags & TF_Virtual)==0
    ){
      if( !pTab->aCol ){
        pTab->aCol = pParse->pNewTable->aCol;
        pTab->nCol = pParse->pNewTable->nCol;
        pParse->pNewTable->nCol = 0;
        pParse->pNewTable->aCol = 0;
      }
      pCtx->bDeclared = 1;
    }else{
      sqlite3ErrorWithMsg(db, SQLITE_ERROR, (zErr ? "%s" : 0), zErr);
      sqlite3DbFree(db, zErr);
      rc = SQLITE_ERROR;
    }
    pParse->declareVtab = 0;
  
    if( pParse->pVdbe ){
      sqlite3VdbeFinalize(pParse->pVdbe);
    }
    sqlite3DeleteTable(db, pParse->pNewTable);
    sqlite3ParserReset(pParse);
    sqlite3StackFree(db, pParse);
  }

  assert( (rc&0xff)==rc );
  rc = sqlite3ApiExit(db, rc);
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb550
movq -0x10(%rbp), %rax
movq 0x1c0(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1aa4c
movq -0x20(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x1aa79
movq -0x10(%rbp), %rdi
movl $0x15, %esi
callq 0x114f0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb4f0
movl $0x1cf0d, %edi          # imm = 0x1CF0D
callq 0xc850
movl %eax, -0x4(%rbp)
jmp 0x1ac50
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl $0x290, %esi            # imm = 0x290
callq 0x15b80
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1aaaa
movl $0x7, -0x2c(%rbp)
jmp 0x1ac2e
movq -0x28(%rbp), %rax
movb $0x1, 0x1ee(%rax)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0x1d4(%rax)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x1ac60
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1aba2
movq -0x28(%rbp), %rax
cmpq $0x0, 0x220(%rax)
je 0x1aba2
movq -0x10(%rbp), %rax
cmpb $0x0, 0x51(%rax)
jne 0x1aba2
movq -0x28(%rbp), %rax
movq 0x220(%rax), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1aba2
movq -0x28(%rbp), %rax
movq 0x220(%rax), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x1aba2
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1ab95
movq -0x28(%rbp), %rax
movq 0x220(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x220(%rax), %rax
movw 0x3e(%rax), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x3e(%rax)
movq -0x28(%rbp), %rax
movq 0x220(%rax), %rax
movw $0x0, 0x3e(%rax)
movq -0x28(%rbp), %rax
movq 0x220(%rax), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x18(%rax)
jmp 0x1abe1
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x8b107(%rip), %rax     # 0xa5cbc
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movq -0x40(%rbp), %rcx
movl $0x1, %esi
movb $0x0, %al
callq 0x11390
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xd260
movl $0x1, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movb $0x0, 0x1ee(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1ac04
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x13b90
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x220(%rax), %rsi
callq 0xd000
movq -0x28(%rbp), %rdi
callq 0x18650
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xd260
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x13be0
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb4f0
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)