// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3GenerateIndexKey
SQLITE_PRIVATE int sqlite3GenerateIndexKey(
  Parse *pParse,       /* Parsing context */
  Index *pIdx,         /* The index for which to generate a key */
  int iDataCur,        /* Cursor number from which to take column data */
  int regOut,          /* Put the new key into this register if not 0 */
  int prefixOnly,      /* Compute only a unique prefix of the key */
  int *piPartIdxLabel, /* OUT: Jump to this label to skip partial index */
  Index *pPrior,       /* Previously generated index key */
  int regPrior         /* Register holding previous generated key */
){
  Vdbe *v = pParse->pVdbe;
  int j;
  int regBase;
  int nCol;

  if( piPartIdxLabel ){
    if( pIdx->pPartIdxWhere ){
      *piPartIdxLabel = sqlite3VdbeMakeLabel(pParse);
      pParse->iSelfTab = iDataCur + 1;
      sqlite3ExprIfFalseDup(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel,
                            SQLITE_JUMPIFNULL);
      pParse->iSelfTab = 0;
      pPrior = 0; /* Ticket a9efb42811fa41ee 2019-11-02;
                  ** pPartIdxWhere may have corrupted regPrior registers */
    }else{
      *piPartIdxLabel = 0;
    }
  }
  nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
  regBase = sqlite3GetTempRange(pParse, nCol);
  if( pPrior && (regBase!=regPrior || pPrior->pPartIdxWhere) ) pPrior = 0;
  for(j=0; j<nCol; j++){
    if( pPrior
     && pPrior->aiColumn[j]==pIdx->aiColumn[j]
     && pPrior->aiColumn[j]!=XN_EXPR
    ){
      /* This column was already computed by the previous index */
      continue;
    }
    sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iDataCur, j, regBase+j);
    /* If the column affinity is REAL but the number is an integer, then it
    ** might be stored in the table as an integer (using a compact
    ** representation) then converted to REAL by an OP_RealAffinity opcode.
    ** But we are getting ready to store this value back into an index, where
    ** it should be converted by to INTEGER again.  So omit the OP_RealAffinity
    ** opcode if it is present */
    sqlite3VdbeDeletePriorOpcode(v, OP_RealAffinity);
  }
  if( regOut ){
    sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regOut);
    if( pIdx->pTable->pSelect ){
      const char *zAff = sqlite3IndexAffinityStr(pParse->db, pIdx);
      sqlite3VdbeChangeP4(v, -1, zAff, P4_TRANSIENT);
    }
  }
  sqlite3ReleaseTempRange(pParse, regBase, nCol);
  return regBase;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x43da6e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x43da62
movq -0x8(%rbp), %rdi
callq 0x42d540
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
movl $0x10, %ecx
callq 0x43dd60
movq -0x8(%rbp), %rax
movl $0x0, 0x40(%rax)
movq $0x0, 0x10(%rbp)
jmp 0x43da6c
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
jmp 0x43da6e
cmpl $0x0, -0x1c(%rbp)
je 0x43da99
movq -0x10(%rbp), %rax
movw 0x63(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x43da99
movq -0x10(%rbp), %rax
movzwl 0x5e(%rax), %eax
movl %eax, -0x4c(%rbp)
jmp 0x43daa4
movq -0x10(%rbp), %rax
movzwl 0x60(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x42cb30
movl %eax, -0x38(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x43dadb
movl -0x38(%rbp), %eax
cmpl 0x18(%rbp), %eax
jne 0x43dad3
movq 0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x43dadb
movq $0x0, 0x10(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x43db60
cmpq $0x0, 0x10(%rbp)
je 0x43db2c
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x34(%rbp), %rdx
movswl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jne 0x43db2c
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
cmpl $-0x2, %eax
je 0x43db2c
jmp 0x43db55
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x34(%rbp), %ecx
movl -0x38(%rbp), %r8d
addl -0x34(%rbp), %r8d
callq 0x43ddd0
movq -0x30(%rbp), %rdi
movl $0x53, %esi
callq 0x43de70
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x43dae2
cmpl $0x0, -0x18(%rbp)
je 0x43dbb7
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl -0x18(%rbp), %r8d
movl $0x5b, %esi
callq 0x410130
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x43dbb5
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x43def0
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
movq -0x48(%rbp), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x3cbc30
jmp 0x43dbb7
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x42d0c0
movl -0x38(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop