// File: /workspace/github_c_makefile_star2_O1/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 0x36175
testl %eax, %eax
je 0x44d0b
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0x44d7b
cmpl $0x0, 0x8(%r12)
je 0x44da7
leaq -0x28(%rbp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x45ec1
testl %eax, %eax
js 0x44cfe
movq 0x20(%rbx), %rcx
movl %eax, %eax
shlq $0x5, %rax
movq (%rcx,%rax), %r12
movq -0x28(%rbp), %rsi
movq %rbx, %rdi
callq 0x45df3
testq %rax, %rax
je 0x44cfe
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x3375e
testq %rax, %rax
jne 0x44df5
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
jmp 0x44e0b
cmpl $0x0, 0x28(%rbx)
jle 0x44cfe
xorl %r15d, %r15d
cmpl $0x1, %r15d
je 0x44d99
movq %r14, %rdi
movl %r15d, %esi
callq 0x624c5
incl %r15d
cmpl 0x28(%rbx), %r15d
jl 0x44d88
jmp 0x44cfe
movq %rbx, %rdi
movq %r15, %rsi
callq 0x46175
testl %eax, %eax
js 0x44dcc
movq %r14, %rdi
movl %eax, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x624c5
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45df3
testq %rax, %rax
je 0x44cfe
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3375e
testq %rax, %rax
je 0x44e01
movq 0x18(%rax), %rsi
movq %r14, %rdi
movq %rax, %rdx
jmp 0x44e1d
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x11689
testq %rax, %rax
je 0x44e22
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x62579
movq %rbx, %rdi
movq %r15, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9c3a