// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: convertToWithoutRowidTable
static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
  Index *pIdx;
  Index *pPk;
  int nPk;
  int i, j;
  sqlite3 *db = pParse->db;
  Vdbe *v = pParse->pVdbe;

  /* Convert the OP_CreateTable opcode that would normally create the
  ** root-page for the table into an OP_CreateIndex opcode.  The index
  ** created will become the PRIMARY KEY index.
  */
  if( pParse->addrCrTab ){
    assert( v );
    sqlite3VdbeChangeOpcode(v, pParse->addrCrTab, OP_CreateIndex);
  }

  /* Locate the PRIMARY KEY index.  Or, if this table was originally
  ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. 
  */
  if( pTab->iPKey>=0 ){
    ExprList *pList;
    Token ipkToken;
    ipkToken.z = pTab->aCol[pTab->iPKey].zName;
    ipkToken.n = sqlite3Strlen30(ipkToken.z);
    pList = sqlite3ExprListAppend(pParse, 0, 
                  sqlite3ExprAlloc(db, TK_ID, &ipkToken, 0));
    if( pList==0 ) return;
    pList->a[0].sortOrder = pParse->iPkSortOrder;
    assert( pParse->pNewTable==pTab );
    pPk = sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0);
    if( pPk==0 ) return;
    pPk->idxType = SQLITE_IDXTYPE_PRIMARYKEY;
    pTab->iPKey = -1;
  }else{
    pPk = sqlite3PrimaryKeyIndex(pTab);

    /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master
    ** table entry. This is only required if currently generating VDBE
    ** code for a CREATE TABLE (not when parsing one as part of reading
    ** a database schema).  */
    if( v ){
      assert( db->init.busy==0 );
      sqlite3VdbeChangeOpcode(v, pPk->tnum, OP_Goto);
    }

    /*
    ** Remove all redundant columns from the PRIMARY KEY.  For example, change
    ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)".  Later
    ** code assumes the PRIMARY KEY contains no repeated columns.
    */
    for(i=j=1; i<pPk->nKeyCol; i++){
      if( hasColumn(pPk->aiColumn, j, pPk->aiColumn[i]) ){
        pPk->nColumn--;
      }else{
        pPk->aiColumn[j++] = pPk->aiColumn[i];
      }
    }
    pPk->nKeyCol = j;
  }
  pPk->isCovering = 1;
  assert( pPk!=0 );
  nPk = pPk->nKeyCol;

  /* Make sure every column of the PRIMARY KEY is NOT NULL.  (Except,
  ** do not enforce this for imposter tables.) */
  if( !db->init.imposterTable ){
    for(i=0; i<nPk; i++){
      pTab->aCol[pPk->aiColumn[i]].notNull = OE_Abort;
    }
    pPk->uniqNotNull = 1;
  }

  /* The root page of the PRIMARY KEY is the table root page */
  pPk->tnum = pTab->tnum;

  /* Update the in-memory representation of all UNIQUE indices by converting
  ** the final rowid column into one or more columns of the PRIMARY KEY.
  */
  for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
    int n;
    if( IsPrimaryKeyIndex(pIdx) ) continue;
    for(i=n=0; i<nPk; i++){
      if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ) n++;
    }
    if( n==0 ){
      /* This index is a superset of the primary key */
      pIdx->nColumn = pIdx->nKeyCol;
      continue;
    }
    if( resizeIndexObject(db, pIdx, pIdx->nKeyCol+n) ) return;
    for(i=0, j=pIdx->nKeyCol; i<nPk; i++){
      if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ){
        pIdx->aiColumn[j] = pPk->aiColumn[i];
        pIdx->azColl[j] = pPk->azColl[i];
        j++;
      }
    }
    assert( pIdx->nColumn>=pIdx->nKeyCol+n );
    assert( pIdx->nColumn>=j );
  }

  /* Add all table columns to the PRIMARY KEY index
  */
  if( nPk<pTab->nCol ){
    if( resizeIndexObject(db, pPk, pTab->nCol) ) return;
    for(i=0, j=nPk; i<pTab->nCol; i++){
      if( !hasColumn(pPk->aiColumn, j, i) ){
        assert( j<pPk->nColumn );
        pPk->aiColumn[j] = i;
        pPk->azColl[j] = sqlite3StrBINARY;
        j++;
      }
    }
    assert( pPk->nColumn==j );
    assert( pTab->nCol==j );
  }else{
    pPk->nColumn = pTab->nCol;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1d0(%rax)
je 0x739ef
movq -0x40(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x1d0(%rax), %esi
movl $0x7a, %edx
callq 0x74810
movq -0x10(%rbp), %rax
movswl 0x3c(%rax), %eax
cmpl $0x0, %eax
jl 0x73aee
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movswq 0x3c(%rcx), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc6c0
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rdi
movl $0x1b, %esi
leaq -0x58(%rbp), %rdx
xorl %ecx, %ecx
callq 0x74850
movq -0x68(%rbp), %rdi
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x613a0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x73a67
jmp 0x73e63
movq -0x8(%rbp), %rax
movb 0x1ec(%rax), %cl
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movb %cl, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %r8
movq -0x10(%rbp), %rax
movzbl 0x47(%rax), %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %eax, %eax
movq %rcx, %rsi
movq %rcx, %rdx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
callq 0x5d5d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x73acf
jmp 0x73e63
movq -0x20(%rbp), %rax
movb 0x63(%rax), %cl
andb $-0x4, %cl
orb $0x2, %cl
movb %cl, 0x63(%rax)
movq -0x10(%rbp), %rax
movw $0xffff, 0x3c(%rax)     # imm = 0xFFFF
jmp 0x73bb0
movq -0x10(%rbp), %rdi
callq 0x52e70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x73b17
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x58(%rax), %esi
movl $0xe, %edx
callq 0x74810
movl $0x1, -0x2c(%rbp)
movl $0x1, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x73ba2
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %edx
callq 0x749d0
cmpl $0x0, %eax
je 0x73b6b
movq -0x20(%rbp), %rax
movw 0x60(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x60(%rax)
jmp 0x73b95
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x2c(%rbp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x73b97
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x73b25
movl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x20(%rbp), %rax
movw %cx, 0x5e(%rax)
movq -0x20(%rbp), %rax
movb 0x63(%rax), %cl
andb $-0x21, %cl
orb $0x20, %cl
movb %cl, 0x63(%rax)
movq -0x20(%rbp), %rax
movzwl 0x5e(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rax
cmpb $0x0, 0xa3(%rax)
jne 0x73c26
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x73c16
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x28(%rbp), %rdx
movswq (%rcx,%rdx,2), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb $0x2, 0x28(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x73bdf
movq -0x20(%rbp), %rax
movb 0x63(%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, 0x63(%rax)
movq -0x10(%rbp), %rax
movl 0x38(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x73da8
movq -0x18(%rbp), %rax
movb 0x63(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x73c61
jmp 0x73d97
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x73cb7
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movzwl 0x5e(%rax), %esi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %edx
callq 0x749d0
cmpl $0x0, %eax
jne 0x73caa
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x73cac
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x73c6f
cmpl $0x0, -0x5c(%rbp)
jne 0x73cd2
movq -0x18(%rbp), %rax
movw 0x5e(%rax), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x60(%rax)
jmp 0x73d97
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movzwl 0x5e(%rax), %edx
addl -0x5c(%rbp), %edx
callq 0x74a20
cmpl $0x0, %eax
je 0x73cf4
jmp 0x73e63
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x5e(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x73d95
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movzwl 0x5e(%rax), %esi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %edx
callq 0x749d0
cmpl $0x0, %eax
jne 0x73d85
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x73d87
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x73d06
jmp 0x73d97
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x73c40
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x73e53
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movswl 0x3e(%rax), %edx
callq 0x74a20
cmpl $0x0, %eax
je 0x73dda
jmp 0x73e63
movl $0x0, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x73e51
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x2c(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x749d0
cmpl $0x0, %eax
jne 0x73e44
movl -0x28(%rbp), %eax
movw %ax, %dx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x2c(%rbp), %rcx
leaq 0x2f16c(%rip), %rdx     # 0xa2fa3
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x73e46
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x73de7
jmp 0x73e63
movq -0x10(%rbp), %rax
movw 0x3e(%rax), %cx
movq -0x20(%rbp), %rax
movw %cx, 0x60(%rax)
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)