// File: /workspace/github_c_makefile_star2_O2/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 0x31240
testl %eax, %eax
je 0x41aa4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r12, %r12
je 0x41afb
testq %r15, %r15
je 0x41ab4
cmpq $0x0, (%r15)
jne 0x41b1e
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x421eb
testq %rax, %rax
je 0x41a95
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 0x46a5b
testq %rax, %rax
je 0x41b13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x570aa
movq %r14, %rdi
movq %r13, %rsi
jmp 0x41b88
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x570aa
movq %r14, %rdi
movq %r13, %rsi
callq 0x968b
leaq -0x30(%rbp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x42278
testl %eax, %eax
js 0x41a95
movl %eax, %r15d
movq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0x421eb
testq %rax, %rax
je 0x41a95
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 0x2eff6
testq %rax, %rax
je 0x41b9b
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x57110
movq %r14, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x968b
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2ecfe
movq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x968b
testq %r13, %r13
je 0x41be5
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x423f5
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4727d
leaq 0x2cc56(%rip), %rsi     # 0x6e842
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x104d6