// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3KeyInfoOfIndex
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoOfIndex(Parse *pParse, Index *pIdx){
  int i;
  int nCol = pIdx->nColumn;
  int nKey = pIdx->nKeyCol;
  KeyInfo *pKey;
  if( pParse->nErr ) return 0;
  if( pIdx->uniqNotNull ){
    pKey = sqlite3KeyInfoAlloc(pParse->db, nKey, nCol-nKey);
  }else{
    pKey = sqlite3KeyInfoAlloc(pParse->db, nCol, 0);
  }
  if( pKey ){
    assert( sqlite3KeyInfoIsWriteable(pKey) );
    for(i=0; i<nCol; i++){
      const char *zColl = pIdx->azColl[i];
      pKey->aColl[i] = zColl==sqlite3StrBINARY ? 0 :
                        sqlite3LocateCollSeq(pParse, zColl);
      pKey->aSortFlags[i] = pIdx->aSortOrder[i];
      assert( 0==(pKey->aSortFlags[i] & KEYINFO_ORDER_BIGNULL) );
    }
    if( pParse->nErr ){
      assert( pParse->rc==SQLITE_ERROR_MISSING_COLLSEQ );
      if( pIdx->bNoQuery==0 ){
        /* Deactivate the index because it contains an unknown collating
        ** sequence.  The only way to reactive the index is to reload the
        ** schema.  Adding the missing collating sequence later does not
        ** reactive the index.  The application had the chance to register
        ** the missing index using the collation-needed callback.  For
        ** simplicity, SQLite will not give the application a second chance.
        */
        pIdx->bNoQuery = 1;
        pParse->rc = SQLITE_ERROR_RETRY;
      }
      sqlite3KeyInfoUnref(pKey);
      pKey = 0;
    }
  }
  return pKey;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x60(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x5e(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x42a1dd
movq $0x0, -0x8(%rbp)
jmp 0x42a311
movq -0x18(%rbp), %rax
movw 0x63(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x42a210
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x24(%rbp), %esi
movl -0x20(%rbp), %edx
subl -0x24(%rbp), %edx
callq 0x42a3a0
movq %rax, -0x30(%rbp)
jmp 0x42a225
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x20(%rbp), %esi
xorl %edx, %edx
callq 0x42a3a0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x42a309
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x42a2b3
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
leaq 0x17ca7b(%rip), %rax    # 0x5a6cd5
cmpq %rax, -0x38(%rbp)
jne 0x42a268
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x42a279
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x42a470
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x1c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x42a237
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x42a307
movq -0x18(%rbp), %rax
movw 0x63(%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0x42a2f6
movq -0x18(%rbp), %rax
movw 0x63(%rax), %cx
andw $0xfeff, %cx            # imm = 0xFEFF
orw $0x100, %cx             # imm = 0x100
movw %cx, 0x63(%rax)
movq -0x10(%rbp), %rax
movl $0x201, 0x18(%rax)      # imm = 0x201
movq -0x30(%rbp), %rdi
callq 0x3eb5a0
movq $0x0, -0x30(%rbp)
jmp 0x42a309
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)