// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r13
movq %rsi, %r15
movq %rdi, %rbx
movq 0x50(%rsi), %rsi
movl 0x4c(%r15), %edi
movq $0x0, -0x58(%rbp)
movq 0x1c0(%rbx), %rax
testq %rax, %rax
je 0x3e02b
cmpq %r15, 0x8(%rax)
je 0x3e0da
movq 0x10(%rax), %rax
jmp 0x3e016
movl %edi, -0x48(%rbp)
movq %rsi, -0x50(%rbp)
movq %rcx, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq (%r15), %rdx
leaq 0x3d34f(%rip), %rsi     # 0x7b393
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1494e
movl $0x7, %r12d
testq %rax, %rax
je 0x3e3d7
movq %rax, %r14
movq %r13, -0x40(%rbp)
movl $0x30, %esi
movq %rbx, %rdi
callq 0x145aa
testq %rax, %rax
je 0x3e0fd
movq %rax, %r13
movq %r14, -0x60(%rbp)
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r13)
movups %xmm0, 0x10(%r13)
movq %rbx, (%r13)
movq -0x38(%rbp), %rdi
movq %rdi, 0x8(%r13)
movq 0x68(%r15), %r8
testq %r8, %r8
je 0x3e108
movl 0x28(%rbx), %r9d
testl %r9d, %r9d
movq -0x30(%rbp), %r10
movq -0x50(%rbp), %rcx
movl -0x48(%rbp), %edx
jle 0x3e11a
movq 0x20(%rbx), %rsi
addq $0x18, %rsi
xorl %eax, %eax
cmpq %r8, (%rsi)
je 0x3e11c
incq %rax
addq $0x20, %rsi
cmpq %rax, %r9
jne 0x3e0c4
movl %r9d, %eax
jmp 0x3e11c
movq (%r15), %rdx
leaq 0x3e512(%rip), %rsi     # 0x7c5f6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1494e
movq %rax, (%r13)
movl $0x6, %r12d
jmp 0x3e3d7
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x3e3d2
movl $0xfff0bdc0, %eax       # imm = 0xFFF0BDC0
movq -0x30(%rbp), %r10
movq -0x50(%rbp), %rcx
movl -0x48(%rbp), %edx
jmp 0x3e11c
xorl %eax, %eax
movq 0x20(%rbx), %rsi
cltq
shlq $0x5, %rax
movq (%rsi,%rax), %rax
movq 0x50(%r15), %rsi
movq %rax, 0x8(%rsi)
movq %rbx, -0x30(%rbp)
leaq -0x88(%rbp), %rbx
movq %r15, 0x8(%rbx)
movq %r14, (%rbx)
movq -0x30(%rbp), %rax
movq 0x1c0(%rax), %rax
movq %rax, 0x10(%rbx)
movl $0x0, 0x18(%rbx)
movq -0x30(%rbp), %rax
movq %rbx, 0x1c0(%rax)
movq 0x10(%rdi), %rsi
addq $0x10, %r13
leaq -0x58(%rbp), %r9
movq -0x30(%rbp), %rdi
movq %r13, %r8
callq *%r10
movl %eax, %r12d
movq 0x10(%rbx), %rax
movq -0x30(%rbp), %rbx
movq %rax, 0x1c0(%rbx)
testl %r12d, %r12d
je 0x3e1cf
cmpl $0x7, %r12d
movq -0x40(%rbp), %r15
jne 0x3e1a0
movb $0x1, 0x51(%rbx)
movq -0x58(%rbp), %rdx
testq %rdx, %rdx
je 0x3e3a8
leaq 0x3d1df(%rip), %rsi     # 0x7b393
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1494e
movq %rax, (%r15)
movq -0x58(%rbp), %rdi
callq 0xa630
jmp 0x3e3c0
movq (%r13), %rax
xorl %r12d, %r12d
testq %rax, %rax
je 0x3e3cb
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x10(%r14), %rcx
movq %rax, (%rcx)
movl $0x1, 0x18(%r14)
cmpl $0x0, -0x70(%rbp)
je 0x3e3e9
movq 0x58(%r15), %rax
movq %rax, 0x28(%r14)
movq %r14, 0x58(%r15)
movzwl 0x3e(%r15), %ecx
testw %cx, %cx
jle 0x3e3cb
movq 0x8(%r15), %rdx
xorl %r12d, %r12d
leaq 0x3e438(%rip), %r11     # 0x7c66d
leaq 0x3a124(%rip), %rbx     # 0x78360
leaq 0x3e429(%rip), %r13     # 0x7c66c
xorl %esi, %esi
leaq (%r12,%r12,2), %rax
shlq $0x4, %rax
movq 0x18(%rdx,%rax), %r14
testq %r14, %r14
je 0x3e2ff
movq %rsi, -0x40(%rbp)
movq %rax, -0x68(%rbp)
movq %rdx, -0x48(%rbp)
movw %cx, -0x50(%rbp)
movq %r12, -0x38(%rbp)
movq %r14, %rdi
movq %r11, %r12
callq 0xa190
movq %r12, %r11
movl %eax, %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
xorl %edx, %edx
movzbl (%rdx,%r11), %esi
movb (%rsi,%rbx), %sil
movzbl (%r14,%rdx), %edi
cmpb (%rdi,%rbx), %sil
jne 0x3e2ae
incq %rdx
cmpq $0x6, %rdx
jne 0x3e287
movzbl 0x6(%r14), %edx
testb $-0x21, %dl
je 0x3e308
testl %ecx, %ecx
je 0x3e308
movl %eax, %esi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
movq %r14, %rdi
xorl %edx, %edx
movq -0x38(%rbp), %r12
xorl %r8d, %r8d
movzbl (%r8,%r13), %r9d
movb (%r9,%rbx), %r9b
movzbl (%rdi,%r8), %r10d
cmpb (%r10,%rbx), %r9b
jne 0x3e2ef
incq %r8
cmpq $0x7, %r8
jne 0x3e2c6
movzbl 0x7(%r14,%rdx), %r8d
testb $-0x21, %r8b
je 0x3e310
incq %rdx
incq %rdi
cmpq %rsi, %rdx
jne 0x3e2c3
jmp 0x3e37f
orb %sil, 0x46(%r15)
jmp 0x3e38f
xorl %edx, %edx
movq -0x38(%rbp), %r12
jmp 0x3e312
incl %edx
cmpl %ecx, %edx
jge 0x3e37f
movslq %edx, %rsi
cmpb $0x1, 0x6(%r14,%rsi)
movl $0x7, %edi
sbbl $0x0, %edi
leal (%rdx,%rdi), %r8d
cmpl %ecx, %r8d
jg 0x3e355
movl %edi, %ecx
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
leaq (%r14,%rcx), %rdi
movq %rsi, %r8
movb (%rdi,%r8), %r9b
movb %r9b, (%r14,%r8)
leaq (%rcx,%r8), %r9
incq %r9
incq %r8
cmpq %rax, %r9
jbe 0x3e33e
testl %edx, %edx
jle 0x3e368
cmpb $0x0, (%r14,%rsi)
jne 0x3e368
movl %edx, %eax
movb $0x0, -0x1(%r14,%rax)
movq 0x8(%r15), %rdx
movq -0x68(%rbp), %rax
orb $0x2, 0x2b(%rdx,%rax)
movzwl 0x3e(%r15), %ecx
movb $-0x80, %sil
jmp 0x3e38f
movq -0x40(%rbp), %rsi
orb %sil, 0x46(%r15)
movzwl -0x50(%rbp), %ecx
movq -0x48(%rbp), %rdx
incq %r12
movswq %cx, %rax
cmpq %rax, %r12
jl 0x3e245
xorl %r12d, %r12d
movq -0x30(%rbp), %rbx
jmp 0x3e3cb
leaq 0x3e271(%rip), %rsi     # 0x7c620
movq %rbx, %rdi
movq -0x60(%rbp), %rdx
xorl %eax, %eax
callq 0x1494e
movq %rax, (%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb752
movq %rbx, %rdi
movq -0x60(%rbp), %rsi
callq 0xb752
movl %r12d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rdx
leaq 0x3e24b(%rip), %rsi     # 0x7c63e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1494e
movq -0x40(%rbp), %rcx
movq %rax, (%rcx)
movq %r14, %rdi
callq 0x28580
movl $0x1, %r12d
jmp 0x3e3cb