// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vtabCallConstructor
static int vtabCallConstructor(
  sqlite3 *db, 
  Table *pTab,
  Module *pMod,
  int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**),
  char **pzErr
){
  VtabCtx sCtx;
  VTable *pVTable;
  int rc;
  const char *const*azArg = (const char *const*)pTab->azModuleArg;
  int nArg = pTab->nModuleArg;
  char *zErr = 0;
  char *zModuleName;
  int iDb;
  VtabCtx *pCtx;

  /* Check that the virtual-table is not already being initialized */
  for(pCtx=db->pVtabCtx; pCtx; pCtx=pCtx->pPrior){
    if( pCtx->pTab==pTab ){
      *pzErr = sqlite3MPrintf(db, 
          "vtable constructor called recursively: %s", pTab->zName
      );
      return SQLITE_LOCKED;
    }
  }

  zModuleName = sqlite3MPrintf(db, "%s", pTab->zName);
  if( !zModuleName ){
    return SQLITE_NOMEM;
  }

  pVTable = sqlite3DbMallocZero(db, sizeof(VTable));
  if( !pVTable ){
    sqlite3DbFree(db, zModuleName);
    return SQLITE_NOMEM;
  }
  pVTable->db = db;
  pVTable->pMod = pMod;

  iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
  pTab->azModuleArg[1] = db->aDb[iDb].zName;

  /* Invoke the virtual table constructor */
  assert( &db->pVtabCtx );
  assert( xConstruct );
  sCtx.pTab = pTab;
  sCtx.pVTable = pVTable;
  sCtx.pPrior = db->pVtabCtx;
  sCtx.bDeclared = 0;
  db->pVtabCtx = &sCtx;
  rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr);
  db->pVtabCtx = sCtx.pPrior;
  if( rc==SQLITE_NOMEM ) db->mallocFailed = 1;
  assert( sCtx.pTab==pTab );

  if( SQLITE_OK!=rc ){
    if( zErr==0 ){
      *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName);
    }else {
      *pzErr = sqlite3MPrintf(db, "%s", zErr);
      sqlite3_free(zErr);
    }
    sqlite3DbFree(db, pVTable);
  }else if( ALWAYS(pVTable->pVtab) ){
    /* Justification of ALWAYS():  A correct vtab constructor must allocate
    ** the sqlite3_vtab object if successful.  */
    memset(pVTable->pVtab, 0, sizeof(pVTable->pVtab[0]));
    pVTable->pVtab->pModule = pMod->pModule;
    pVTable->nRef = 1;
    if( sCtx.bDeclared==0 ){
      const char *zFormat = "vtable constructor did not declare schema: %s";
      *pzErr = sqlite3MPrintf(db, zFormat, pTab->zName);
      sqlite3VtabUnlock(pVTable);
      rc = SQLITE_ERROR;
    }else{
      int iCol;
      u8 oooHidden = 0;
      /* If everything went according to plan, link the new VTable structure
      ** into the linked list headed by pTab->pVTable. Then loop through the 
      ** columns of the table to see if any of them contain the token "hidden".
      ** If so, set the Column COLFLAG_HIDDEN flag and remove the token from
      ** the type string.  */
      pVTable->pNext = pTab->pVTable;
      pTab->pVTable = pVTable;

      for(iCol=0; iCol<pTab->nCol; iCol++){
        char *zType = pTab->aCol[iCol].zType;
        int nType;
        int i = 0;
        if( !zType ){
          pTab->tabFlags |= oooHidden;
          continue;
        }
        nType = sqlite3Strlen30(zType);
        if( sqlite3StrNICmp("hidden", zType, 6)||(zType[6] && zType[6]!=' ') ){
          for(i=0; i<nType; i++){
            if( (0==sqlite3StrNICmp(" hidden", &zType[i], 7))
             && (zType[i+7]=='\0' || zType[i+7]==' ')
            ){
              i++;
              break;
            }
          }
        }
        if( i<nType ){
          int j;
          int nDel = 6 + (zType[i+6] ? 1 : 0);
          for(j=i; (j+nDel)<=nType; j++){
            zType[j] = zType[j+nDel];
          }
          if( zType[i]=='\0' && i>0 ){
            assert(zType[i-1]==' ');
            zType[i-1] = '\0';
          }
          pTab->aCol[iCol].colFlags |= COLFLAG_HIDDEN;
          oooHidden = TF_OOOHidden;
        }else{
          pTab->tabFlags |= oooHidden;
        }
      }
    }
  }

  sqlite3DbFree(db, zModuleName);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x6c(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x1c0(%rax), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x5598f
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x55979
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x515cf(%rip), %rsi     # 0xa6f2b
movb $0x0, %al
callq 0x17940
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x6, -0x4(%rbp)
jmp 0x55e81
jmp 0x5597b
movq -0x90(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x5592f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x5031b(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0x17940
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x559bf
movl $0x7, -0x4(%rbp)
jmp 0x55e81
movq -0x10(%rbp), %rdi
movl $0x30, %esi
callq 0x15b80
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x559f1
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0xd260
movl $0x7, -0x4(%rbp)
jmp 0x55e81
movq -0x10(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x17ab0
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x84(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x1c0(%rax), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
leaq -0x50(%rbp), %rcx
movq %rcx, 0x1c0(%rax)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rsi
movl -0x6c(%rbp), %edx
movq -0x68(%rbp), %rcx
movq -0x58(%rbp), %r8
addq $0x10, %r8
leaq -0x78(%rbp), %r9
callq *%rax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1c0(%rax)
cmpl $0x7, -0x5c(%rbp)
jne 0x55abe
movq -0x10(%rbp), %rax
movb $0x1, 0x51(%rax)
xorl %eax, %eax
cmpl -0x5c(%rbp), %eax
je 0x55b29
cmpq $0x0, -0x78(%rbp)
jne 0x55aee
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rdx
leaq 0x5147a(%rip), %rsi     # 0xa6f55
movb $0x0, %al
callq 0x17940
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x55b17
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rdx
leaq 0x501bf(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0x17940
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x78(%rbp), %rdi
callq 0xb958
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0xd260
jmp 0x55e6e
movq -0x58(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x55e6c
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0xb2b0
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movl $0x1, 0x18(%rax)
cmpl $0x0, -0x38(%rbp)
jne 0x55bb5
leaq 0x513fd(%rip), %rax     # 0xa6f73
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movb $0x0, %al
callq 0x17940
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rdi
callq 0x355f0
movl $0x1, -0x5c(%rbp)
jmp 0x55e6a
movb $0x0, -0x9d(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x58(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x58(%rax)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x55e68
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x9c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0xb0(%rbp)
cmpq $0x0, -0xa8(%rbp)
jne 0x55c46
movzbl -0x9d(%rbp), %edx
movq -0x18(%rbp), %rax
movzbl 0x46(%rax), %ecx
orl %edx, %ecx
movb %cl, 0x46(%rax)
jmp 0x55e54
movq -0xa8(%rbp), %rdi
callq 0xc6c0
movl %eax, -0xac(%rbp)
movq -0xa8(%rbp), %rsi
leaq 0x5133c(%rip), %rdi     # 0xa6fa2
movl $0x6, %edx
callq 0xb850
cmpl $0x0, %eax
jne 0x55c9d
movq -0xa8(%rbp), %rax
movsbl 0x6(%rax), %eax
cmpl $0x0, %eax
je 0x55d44
movq -0xa8(%rbp), %rax
movsbl 0x6(%rax), %eax
cmpl $0x20, %eax
je 0x55d44
movl $0x0, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
cmpl -0xac(%rbp), %eax
jge 0x55d42
movq -0xa8(%rbp), %rsi
movslq -0xb0(%rbp), %rax
addq %rax, %rsi
leaq 0x512d0(%rip), %rdi     # 0xa6fa1
movl $0x7, %edx
callq 0xb850
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x55d2c
movq -0xa8(%rbp), %rax
movl -0xb0(%rbp), %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x55d1b
movq -0xa8(%rbp), %rax
movl -0xb0(%rbp), %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0x55d2c
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x55d42
jmp 0x55d2e
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x55ca7
jmp 0x55d44
movl -0xb0(%rbp), %eax
cmpl -0xac(%rbp), %eax
jge 0x55e3e
movq -0xa8(%rbp), %rax
movl -0xb0(%rbp), %ecx
addl $0x6, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
addl $0x6, %eax
movl %eax, -0xb8(%rbp)
movl -0xb0(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
addl -0xb8(%rbp), %eax
cmpl -0xac(%rbp), %eax
jg 0x55dde
movq -0xa8(%rbp), %rax
movl -0xb4(%rbp), %ecx
addl -0xb8(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0xa8(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x55d8f
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x55e15
cmpl $0x0, -0xb0(%rbp)
jle 0x55e15
movq -0xa8(%rbp), %rax
movl -0xb0(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x9c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movzbl 0x2b(%rax), %ecx
orl $0x2, %ecx
movb %cl, 0x2b(%rax)
movb $-0x80, -0x9d(%rbp)
jmp 0x55e52
movzbl -0x9d(%rbp), %edx
movq -0x18(%rbp), %rax
movzbl 0x46(%rax), %ecx
orl %edx, %ecx
movb %cl, 0x46(%rax)
jmp 0x55e54
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x55be2
jmp 0x55e6a
jmp 0x55e6c
jmp 0x55e6e
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0xd260
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)