// File: /workspace/github_c_makefile_star2_O1/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 0x36175
testl %eax, %eax
je 0x44b5b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r12, %r12
je 0x44bb2
testq %r15, %r15
je 0x44b6b
cmpq $0x0, (%r15)
jne 0x44bd5
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x45df3
testq %rax, %rax
je 0x44b4c
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 0x4b4a6
testq %rax, %rax
je 0x44bca
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6230f
movq %r14, %rdi
movq %r13, %rsi
jmp 0x44c3f
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6230f
movq %r14, %rdi
movq %r13, %rsi
callq 0x9c3a
leaq -0x30(%rbp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x45ec1
testl %eax, %eax
js 0x44b4c
movl %eax, %r15d
movq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0x45df3
testq %rax, %rax
je 0x44b4c
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 0x33aab
testq %rax, %rax
je 0x44c52
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x6237d
movq %r14, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9c3a
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3375e
movq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x9c3a
testq %r13, %r13
je 0x44cbb
movq 0x1d8(%rbx), %r14
testq %r14, %r14
cmoveq %rbx, %r14
movq %rbx, %rdi
movl %r15d, %esi
callq 0x45ff7
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 0x4bcd4
leaq 0x37b60(%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 0x11724