// File: /workspace/github_c_makefile_star2_O3/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 0x36884
testl %eax, %eax
je 0x450a8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0x45118
cmpl $0x0, 0x8(%r12)
je 0x45147
leaq -0x28(%rbp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x46237
testl %eax, %eax
js 0x4509b
movq 0x20(%rbx), %rcx
movl %eax, %eax
shlq $0x5, %rax
movq (%rcx,%rax), %r12
movq -0x28(%rbp), %rsi
movq %rbx, %rdi
callq 0x46169
testq %rax, %rax
je 0x4509b
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x33e69
testq %rax, %rax
jne 0x45195
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
jmp 0x451ab
movl 0x28(%rbx), %eax
testl %eax, %eax
jle 0x4509b
xorl %r15d, %r15d
cmpl $0x1, %r15d
je 0x4513a
movq %r14, %rdi
movl %r15d, %esi
callq 0x62389
movl 0x28(%rbx), %eax
incl %r15d
cmpl %eax, %r15d
jl 0x45126
jmp 0x4509b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x464ad
testl %eax, %eax
js 0x4516c
movq %r14, %rdi
movl %eax, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x62389
movq %rbx, %rdi
movq %r15, %rsi
callq 0x46169
testq %rax, %rax
je 0x4509b
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x33e69
testq %rax, %rax
je 0x451a1
movq 0x18(%rax), %rsi
movq %r14, %rdi
movq %rax, %rdx
jmp 0x451bd
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x117b5
testq %rax, %rax
je 0x451c2
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x6243d
movq %rbx, %rdi
movq %r15, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4