// File: /workspace/github_c_makefile_star2_O1/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 0x3f01d
cmpq %r15, 0x8(%rax)
je 0x3f0c7
movq 0x10(%rax), %rax
jmp 0x3f008
movl %edi, -0x5c(%rbp)
movq %rsi, -0x38(%rbp)
movq %rcx, -0x50(%rbp)
movq %rdx, -0x40(%rbp)
movq (%r15), %rdx
leaq 0x3e34d(%rip), %rsi     # 0x7d383
movq %rbx, %rdi
xorl %eax, %eax
callq 0x148c2
movl $0x7, %r12d
testq %rax, %rax
je 0x3f400
movq %rax, %r14
movq %r13, -0x70(%rbp)
movl $0x30, %esi
movq %rbx, %rdi
callq 0x144ee
testq %rax, %rax
je 0x3f3f5
movq %rax, %r13
movq %rax, %r8
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movups %xmm0, 0x20(%r13)
movups %xmm0, 0x10(%r13)
movq %rbx, (%r13)
movq -0x40(%rbp), %r9
movq %r9, 0x8(%r13)
movq 0x68(%r15), %rcx
testq %rcx, %rcx
movq %rbx, -0x30(%rbp)
movq %r14, -0x48(%rbp)
je 0x3f0ea
movl 0x28(%rbx), %edx
testl %edx, %edx
jle 0x3f0f1
movq 0x20(%rbx), %rsi
addq $0x18, %rsi
xorl %eax, %eax
cmpq %rcx, (%rsi)
je 0x3f0f3
incq %rax
addq $0x20, %rsi
cmpq %rax, %rdx
jne 0x3f0b2
movl %edx, %eax
jmp 0x3f0f3
movq (%r15), %rdx
leaq 0x3f515(%rip), %rsi     # 0x7e5e6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x148c2
movq %rax, (%r13)
movl $0x6, %r12d
jmp 0x3f400
movl $0xfff0bdc0, %eax       # imm = 0xFFF0BDC0
jmp 0x3f0f3
xorl %eax, %eax
movq -0x30(%rbp), %r14
movq 0x20(%r14), %rcx
cltq
shlq $0x5, %rax
movq (%rcx,%rax), %rax
movq 0x50(%r15), %rcx
movq %rax, 0x8(%rcx)
leaq -0x90(%rbp), %rbx
movq %r15, 0x8(%rbx)
movq %r8, -0x68(%rbp)
movq %r8, (%rbx)
movq 0x1c0(%r14), %rax
movq %rax, 0x10(%rbx)
movl $0x0, 0x18(%rbx)
movq %rbx, 0x1c0(%r14)
movq 0x10(%r9), %rsi
addq $0x10, %r13
leaq -0x58(%rbp), %r9
movq %r14, %rdi
movl -0x5c(%rbp), %edx
movq -0x38(%rbp), %rcx
movq %r13, %r8
callq *-0x50(%rbp)
movl %eax, %r12d
movq 0x10(%rbx), %rax
movq %rax, 0x1c0(%r14)
testl %r12d, %r12d
je 0x3f1ac
cmpl $0x7, %r12d
movq -0x30(%rbp), %rbx
movq -0x48(%rbp), %r14
movq -0x70(%rbp), %r15
jne 0x3f17d
movb $0x1, 0x51(%rbx)
movq -0x58(%rbp), %rdx
testq %rdx, %rdx
je 0x3f3d2
leaq 0x3e1f2(%rip), %rsi     # 0x7d383
movq %rbx, %rdi
xorl %eax, %eax
callq 0x148c2
movq %rax, (%r15)
movq -0x58(%rbp), %rdi
callq 0xa620
jmp 0x3f3e9
movq (%r13), %rax
xorl %r12d, %r12d
testq %rax, %rax
movq -0x48(%rbp), %r14
je 0x3f412
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x68(%rbp), %r8
movq 0x10(%r8), %rcx
movq %rax, (%rcx)
movl $0x1, 0x18(%r8)
cmpl $0x0, -0x78(%rbp)
movq -0x30(%rbp), %rbx
je 0x3f418
movq 0x58(%r15), %rax
movq %rax, 0x28(%r8)
movq %r8, 0x58(%r15)
cmpw $0x0, 0x3e(%r15)
jle 0x3f3f5
xorl %r14d, %r14d
leaq 0x3b0f8(%rip), %r13     # 0x7a310
xorl %edx, %edx
movq 0x8(%r15), %rax
leaq (%r14,%r14,2), %rcx
shlq $0x4, %rcx
movq 0x18(%rax,%rcx), %r12
testq %r12, %r12
je 0x3f3b0
movq %rdx, -0x50(%rbp)
movq %rcx, -0x40(%rbp)
movq %r12, %rdi
callq 0xa190
movl %eax, %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
leaq 0x6(%r12), %rdx
movl $0x6, %esi
leaq 0x3f400(%rip), %rdi     # 0x7e65d
movq %r12, %r8
movzbl (%rdi), %r9d
movb (%r9,%r13), %r9b
movzbl (%r8), %r10d
cmpb (%r10,%r13), %r9b
jne 0x3f288
incq %r8
incq %rdi
decq %rsi
jne 0x3f260
xorl %esi, %esi
leaq 0x3f3dd(%rip), %rdi     # 0x7e663
jmp 0x3f28b
movq %r8, %rdx
testl %esi, %esi
jle 0x3f29f
movzbl (%rdi), %esi
movb (%rsi,%r13), %sil
movzbl (%rdx), %edx
cmpb (%rdx,%r13), %sil
jne 0x3f2ae
movzbl 0x6(%r12), %edx
testb $-0x21, %dl
je 0x3f33a
testl %ecx, %ecx
je 0x3f33a
movl %ecx, -0x38(%rbp)
movl %eax, %esi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
xorl %edx, %edx
leaq (%r12,%rdx), %rdi
leaq (%r12,%rdx), %r8
addq $0x7, %r8
movl $0x7, %r9d
leaq 0x3f380(%rip), %r10     # 0x7e65c
movq %rdi, %r11
movzbl (%r10), %ecx
movb (%rcx,%r13), %cl
movzbl (%r11), %ebx
cmpb (%rbx,%r13), %cl
jne 0x3f308
incq %r11
incq %r10
decq %r9
jne 0x3f2df
xorl %r9d, %r9d
leaq 0x3f35d(%rip), %r10     # 0x7e663
jmp 0x3f30b
movq %r11, %r8
testl %r9d, %r9d
jle 0x3f322
movzbl (%r10), %ecx
movb (%rcx,%r13), %cl
movzbl (%r8), %r8d
cmpb (%r8,%r13), %cl
jne 0x3f32b
movzbl 0x7(%rdi), %ecx
testb $-0x21, %cl
je 0x3f33e
incq %rdx
cmpq %rsi, %rdx
jne 0x3f2c3
movl -0x38(%rbp), %ecx
movl %ecx, %edx
jmp 0x3f343
xorl %edx, %edx
jmp 0x3f343
incl %edx
movl -0x38(%rbp), %ecx
cmpl %ecx, %edx
jge 0x3f3ac
movslq %edx, %rsi
cmpb $0x1, 0x6(%r12,%rsi)
movl $0x7, %edi
sbbl $0x0, %edi
movl %ecx, %r8d
leal (%rdx,%rdi), %ecx
cmpl %r8d, %ecx
jg 0x3f388
movl %edi, %ecx
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
leaq (%r12,%rcx), %rdi
movq %rsi, %r8
movb (%rdi,%r8), %r9b
movb %r9b, (%r12,%r8)
leaq (%rcx,%r8), %r9
incq %r9
incq %r8
cmpq %rax, %r9
jbe 0x3f371
testl %edx, %edx
jle 0x3f39b
cmpb $0x0, (%r12,%rsi)
jne 0x3f39b
movl %edx, %eax
movb $0x0, -0x1(%r12,%rax)
movq 0x8(%r15), %rax
movq -0x40(%rbp), %rcx
orb $0x2, 0x2b(%rax,%rcx)
movb $-0x80, %dl
jmp 0x3f3b4
movq -0x50(%rbp), %rdx
orb %dl, 0x46(%r15)
incq %r14
movswq 0x3e(%r15), %rax
cmpq %rax, %r14
jl 0x3f21a
xorl %r12d, %r12d
movq -0x30(%rbp), %rbx
movq -0x48(%rbp), %r14
jmp 0x3f3f5
leaq 0x3f237(%rip), %rsi     # 0x7e610
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x148c2
movq %rax, (%r15)
movq %rbx, %rdi
movq -0x68(%rbp), %rsi
callq 0xb6df
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb6df
movl %r12d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rbx
jmp 0x3f3f5
movq (%r15), %rdx
leaq 0x3f20c(%rip), %rsi     # 0x7e62e
movq %rbx, %rdi
xorl %eax, %eax
movq %r8, %r15
callq 0x148c2
movq -0x70(%rbp), %rcx
movq %rax, (%rcx)
movq %r15, %rdi
callq 0x289bd
movl $0x1, %r12d
jmp 0x3f3f5