// File: /workspace/github_c_makefile_star2_O0/skeeto[P]flappy/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 */
){
  Vdbe *v = pParse->pVdbe;
  int j;
  Table *pTab = pIdx->pTable;
  int regBase;
  int nCol;
  Index *pPk;

  if( piPartIdxLabel ){
    if( pIdx->pPartIdxWhere ){
      *piPartIdxLabel = sqlite3VdbeMakeLabel(v);
      pParse->iPartIdxTab = iDataCur;
      sqlite3ExprIfFalse(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, 
                         SQLITE_JUMPIFNULL);
    }else{
      *piPartIdxLabel = 0;
    }
  }
  nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
  regBase = sqlite3GetTempRange(pParse, nCol);
  pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
  for(j=0; j<nCol; j++){
    i16 idx = pIdx->aiColumn[j];
    if( pPk ) idx = sqlite3ColumnOfIndex(pPk, idx);
    if( idx<0 || idx==pTab->iPKey ){
      sqlite3VdbeAddOp2(v, OP_Rowid, iDataCur, regBase+j);
    }else{
      sqlite3VdbeAddOp3(v, OP_Column, iDataCur, idx, regBase+j);
      sqlite3ColumnDefault(v, pTab, pIdx->aiColumn[j], -1);
    }
  }
  if( regOut ){
    const char *zAff;
    if( pTab->pSelect
     || OptimizationDisabled(pParse->db, SQLITE_IdxRealAsInt)
    ){
      zAff = 0;
    }else{
      zAff = sqlite3IndexAffinityStr(v, pIdx);
    }
    sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regOut);
    sqlite3VdbeChangeP4(v, -1, zAff, P4_TRANSIENT);
  }
  sqlite3ReleaseTempRange(pParse, regBase, nCol);
  return regBase;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
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)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x71e3d
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x71e31
movq -0x30(%rbp), %rdi
callq 0x662a0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x68(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
movl $0x8, %ecx
callq 0x67470
jmp 0x71e3b
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
jmp 0x71e3d
cmpl $0x0, -0x1c(%rbp)
je 0x71e64
movq -0x10(%rbp), %rax
movb 0x63(%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x71e64
movq -0x10(%rbp), %rax
movzwl 0x5e(%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0x71e6f
movq -0x10(%rbp), %rax
movzwl 0x60(%rax), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl -0x48(%rbp), %esi
callq 0x66680
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x48(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x71e9c
xorl %eax, %eax
movq %rax, -0x70(%rbp)
jmp 0x71ea9
movq -0x40(%rbp), %rdi
callq 0x4b190
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x71f71
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movw (%rax,%rcx,2), %ax
movw %ax, -0x52(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x71ef0
movq -0x50(%rbp), %rdi
movswl -0x52(%rbp), %esi
callq 0x67b20
movw %ax, -0x52(%rbp)
movswl -0x52(%rbp), %eax
cmpl $0x0, %eax
jl 0x71f09
movswl -0x52(%rbp), %eax
movq -0x40(%rbp), %rcx
movswl 0x40(%rcx), %ecx
cmpl %ecx, %eax
jne 0x71f22
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x44(%rbp), %ecx
addl -0x34(%rbp), %ecx
movl $0x62, %esi
callq 0x63980
jmp 0x71f61
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %edx
movswl -0x52(%rbp), %ecx
movl -0x44(%rbp), %r8d
addl -0x34(%rbp), %r8d
movl $0x2b, %esi
callq 0x639b0
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movswl (%rax,%rcx,2), %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x67b80
jmp 0x71f63
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x71eb8
cmpl $0x0, -0x18(%rbp)
je 0x71fdc
movq -0x40(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x71f95
movq -0x8(%rbp), %rax
movq (%rax), %rax
movzwl 0x4c(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x71f9f
movq $0x0, -0x60(%rbp)
jmp 0x71fb0
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x72130
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %edx
movl -0x48(%rbp), %ecx
movl -0x18(%rbp), %r8d
movl $0x2d, %esi
callq 0x639b0
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x16e40
movq -0x8(%rbp), %rdi
movl -0x44(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x66a70
movl -0x44(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)