// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3Analyze
SQLITE_PRIVATE void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){
  sqlite3 *db = pParse->db;
  int iDb;
  int i;
  char *z, *zDb;
  Table *pTab;
  Index *pIdx;
  Token *pTableName;

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

  assert( pName2!=0 || pName1==0 );
  if( pName1==0 ){
    /* Form 1:  Analyze everything */
    for(i=0; i<db->nDb; i++){
      if( i==1 ) continue;  /* Do not analyze the TEMP database */
      analyzeDatabase(pParse, i);
    }
  }else if( pName2->n==0 ){
    /* Form 2:  Analyze the database or table named */
    iDb = sqlite3FindDb(db, pName1);
    if( iDb>=0 ){
      analyzeDatabase(pParse, iDb);
    }else{
      z = sqlite3NameFromToken(db, pName1);
      if( z ){
        if( (pIdx = sqlite3FindIndex(db, z, 0))!=0 ){
          analyzeTable(pParse, pIdx->pTable, pIdx);
        }else if( (pTab = sqlite3LocateTable(pParse, 0, z, 0))!=0 ){
          analyzeTable(pParse, pTab, 0);
        }
        sqlite3DbFree(db, z);
      }
    }
  }else{
    /* Form 3: Analyze the fully qualified table name */
    iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pTableName);
    if( iDb>=0 ){
      zDb = db->aDb[iDb].zName;
      z = sqlite3NameFromToken(db, pTableName);
      if( z ){
        if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){
          analyzeTable(pParse, pIdx->pTable, pIdx);
        }else if( (pTab = sqlite3LocateTable(pParse, 0, z, zDb))!=0 ){
          analyzeTable(pParse, pTab, 0);
        }
        sqlite3DbFree(db, z);
      }
    }   
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rbx
callq 0x31240
testl %eax, %eax
je 0x41c35
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0x41c9d
cmpl $0x0, 0x8(%r12)
je 0x41cbc
leaq -0x28(%rbp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x42278
testl %eax, %eax
js 0x41c28
movq 0x20(%rbx), %rcx
movl %eax, %eax
shlq $0x5, %rax
movq (%rcx,%rax), %r12
movq -0x28(%rbp), %rsi
movq %rbx, %rdi
callq 0x421eb
testq %rax, %rax
je 0x41c28
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x2ecfe
testq %rax, %rax
jne 0x41d0a
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
jmp 0x41d20
xorl %r15d, %r15d
cmpl 0x28(%rbx), %r15d
jge 0x41c28
cmpl $0x1, %r15d
je 0x41cb7
movq %r14, %rdi
movl %r15d, %esi
callq 0x5719f
incl %r15d
jmp 0x41ca0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x424c3
testl %eax, %eax
js 0x41ce1
movq %r14, %rdi
movl %eax, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5719f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x421eb
testq %rax, %rax
je 0x41c28
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2ecfe
testq %rax, %rax
je 0x41d16
movq 0x18(%rax), %rsi
movq %r14, %rdi
movq %rax, %rdx
jmp 0x41d32
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x10449
testq %rax, %rax
je 0x41d37
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x57233
movq %rbx, %rdi
movq %r15, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x968b