// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3Reindex
SQLITE_PRIVATE void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
  CollSeq *pColl;             /* Collating sequence to be reindexed, or NULL */
  char *z;                    /* Name of a table or index */
  const char *zDb;            /* Name of the database */
  Table *pTab;                /* A table in the database */
  Index *pIndex;              /* An index associated with pTab */
  int iDb;                    /* The database index number */
  sqlite3 *db = pParse->db;   /* The database connection */
  Token *pObjName;            /* Name of the table or index to be reindexed */

  /* Read the database schema. If an error occurs, leave an error message
  ** and code in pParse and return NULL. */
  if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
    return;
  }

  if( pName1==0 ){
    reindexDatabases(pParse, 0);
    return;
  }else if( NEVER(pName2==0) || pName2->z==0 ){
    char *zColl;
    assert( pName1->z );
    zColl = sqlite3NameFromToken(pParse->db, pName1);
    if( !zColl ) return;
    pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0);
    if( pColl ){
      reindexDatabases(pParse, zColl);
      sqlite3DbFree(db, zColl);
      return;
    }
    sqlite3DbFree(db, zColl);
  }
  iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pObjName);
  if( iDb<0 ) return;
  z = sqlite3NameFromToken(db, pObjName);
  if( z==0 ) return;
  zDb = db->aDb[iDb].zName;
  pTab = sqlite3FindTable(db, z, zDb);
  if( pTab ){
    reindexTable(pParse, pTab, 0);
    sqlite3DbFree(db, z);
    return;
  }
  pIndex = sqlite3FindIndex(db, z, zDb);
  sqlite3DbFree(db, z);
  if( pIndex ){
    sqlite3BeginWriteOperation(pParse, 0, iDb);
    sqlite3RefillIndex(pParse, pIndex, -1);
    return;
  }
  sqlite3ErrorMsg(pParse, "unable to identify the object to be reindexed");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %r14
callq 0x36884
testl %eax, %eax
je 0x44ef8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r12, %r12
je 0x44f4f
testq %r15, %r15
je 0x44f08
cmpq $0x0, (%r15)
jne 0x44f72
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x46169
testq %rax, %rax
je 0x44ee9
movq %rax, %r13
movq 0x20(%r14), %rax
movq 0x18(%rax), %rax
movzbl 0x71(%rax), %esi
movq %r14, %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x4b5e8
testq %rax, %rax
je 0x44f67
movq %rbx, %rdi
movq %r13, %rsi
callq 0x621ce
movq %r14, %rdi
movq %r13, %rsi
jmp 0x44fdc
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x621ce
movq %r14, %rdi
movq %r13, %rsi
callq 0x9ca4
leaq -0x30(%rbp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x46237
movl %eax, %r15d
testl %eax, %eax
js 0x44ee9
movq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0x46169
testq %rax, %rax
je 0x44ee9
movq %rax, %r12
movq 0x20(%r14), %rax
movl %r15d, %ecx
shlq $0x5, %rcx
movq (%rax,%rcx), %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x341ce
testq %rax, %rax
je 0x44fef
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x62242
movq %r14, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x33e69
movq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x9ca4
testq %r13, %r13
je 0x45058
movq 0x1d8(%rbx), %r14
testq %r14, %r14
cmoveq %rbx, %r14
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4632f
movl $0x1, %eax
movl %r15d, %ecx
shll %cl, %eax
orl %eax, 0x164(%r14)
movq %rbx, %rdi
movq %r13, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4bdfa
leaq 0x377c3(%rip), %rsi     # 0x7c822
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11842