// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: analysisLoader
static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
  analysisInfo *pInfo = (analysisInfo*)pData;
  Index *pIndex;
  Table *pTable;
  const char *z;

  assert( argc==3 );
  UNUSED_PARAMETER2(NotUsed, argc);

  if( argv==0 || argv[0]==0 || argv[2]==0 ){
    return 0;
  }
  pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
  if( pTable==0 ){
    return 0;
  }
  if( argv[1]==0 ){
    pIndex = 0;
  }else if( sqlite3_stricmp(argv[0],argv[1])==0 ){
    pIndex = sqlite3PrimaryKeyIndex(pTable);
  }else{
    pIndex = sqlite3FindIndex(pInfo->db, argv[1], pInfo->zDatabase);
  }
  z = argv[2];

  if( pIndex ){
    tRowcnt *aiRowEst = 0;
    int nCol = pIndex->nKeyCol+1;
#ifdef SQLITE_ENABLE_STAT4
    /* Index.aiRowEst may already be set here if there are duplicate
    ** sqlite_stat1 entries for this index. In that case just clobber
    ** the old data with the new instead of allocating a new array.  */
    if( pIndex->aiRowEst==0 ){
      pIndex->aiRowEst = (tRowcnt*)sqlite3MallocZero(sizeof(tRowcnt) * nCol);
      if( pIndex->aiRowEst==0 ) sqlite3OomFault(pInfo->db);
    }
    aiRowEst = pIndex->aiRowEst;
#endif
    pIndex->bUnordered = 0;
    decodeIntArray((char*)z, nCol, aiRowEst, pIndex->aiRowLogEst, pIndex);
    pIndex->hasStat1 = 1;
    if( pIndex->pPartIdxWhere==0 ){
      pTable->nRowLogEst = pIndex->aiRowLogEst[0];
      pTable->tabFlags |= TF_HasStat1;
    }
  }else{
    Index fakeIdx;
    fakeIdx.szIdxRow = pTable->szTabRow;
#ifdef SQLITE_ENABLE_COSTMULT
    fakeIdx.pTable = pTable;
#endif
    decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
    pTable->szTabRow = fakeIdx.szIdxRow;
    pTable->tabFlags |= TF_HasStat1;
  }

  return 0;
}

// Assembly:
testq %rdx, %rdx
je 0x2af986
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r14
movq (%rdx), %rsi
testq %rsi, %rsi
je 0x2af97d
cmpq $0x0, 0x10(%r14)
je 0x2af97d
movq %rdi, %r15
movq (%rdi), %rdi
movq 0x8(%r15), %rdx
callq 0x28ad59
testq %rax, %rax
je 0x2af97d
movq %rax, %rbx
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x2af913
movq (%r14), %rax
testq %rax, %rax
je 0x2af902
xorl %ecx, %ecx
leaq 0x12b185(%rip), %rdx    # 0x3daa60
movzbl (%rax,%rcx), %edi
movzbl (%rsi,%rcx), %r8d
cmpb %r8b, %dil
jne 0x2af8f3
testq %rdi, %rdi
jne 0x2af8fd
jmp 0x2af989
movb (%rdi,%rdx), %dil
cmpb (%r8,%rdx), %dil
jne 0x2af902
incq %rcx
jmp 0x2af8db
movq (%r15), %rdi
movq 0x8(%r15), %rdx
callq 0x2af701
movq %rax, %r15
jmp 0x2af916
xorl %r15d, %r15d
movq 0x10(%r14), %rdi
testq %r15, %r15
je 0x2af950
movzwl 0x5e(%r15), %esi
incl %esi
andb $-0x5, 0x63(%r15)
movq 0x10(%r15), %rdx
movq %r15, %rcx
callq 0x2afa50
orb $-0x80, 0x63(%r15)
cmpq $0x0, 0x48(%r15)
jne 0x2af97d
movq 0x10(%r15), %rax
movzwl (%rax), %eax
movw %ax, 0x4a(%rbx)
jmp 0x2af979
movzwl 0x4c(%rbx), %eax
movq %rsp, %r14
movw %ax, 0x5c(%r14)
movq %rbx, %rdx
addq $0x4a, %rdx
movl $0x1, %esi
movq %r14, %rcx
callq 0x2afa50
movzwl 0x5c(%r14), %eax
movw %ax, 0x4c(%rbx)
orb $0x10, 0x40(%rbx)
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
xorl %eax, %eax
retq
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x2af916
movzwl 0x63(%r15), %eax
andl $0x3, %eax
cmpw $0x2, %ax
je 0x2af916
movq 0x28(%r15), %r15
jmp 0x2af98d