// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeRecordUnpack
SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
  KeyInfo *pKeyInfo,     /* Information about the record format */
  int nKey,              /* Size of the binary record */
  const void *pKey,      /* The binary record */
  UnpackedRecord *p      /* Populate this structure before returning. */
){
  const unsigned char *aKey = (const unsigned char *)pKey;
  int d; 
  u32 idx;                        /* Offset in aKey[] to read from */
  u16 u;                          /* Unsigned loop counter */
  u32 szHdr;
  Mem *pMem = p->aMem;

  p->flags = 0;
  assert( EIGHT_BYTE_ALIGNMENT(pMem) );
  idx = getVarint32(aKey, szHdr);
  d = szHdr;
  u = 0;
  while( idx<szHdr && u<p->nField && d<=nKey ){
    u32 serial_type;

    idx += getVarint32(&aKey[idx], serial_type);
    pMem->enc = pKeyInfo->enc;
    pMem->db = pKeyInfo->db;
    /* pMem->flags = 0; // sqlite3VdbeSerialGet() will set this for us */
    pMem->zMalloc = 0;
    d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem);
    pMem++;
    u++;
  }
  assert( u<=pKeyInfo->nField + 1 );
  p->nField = u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, 0xa(%rax)
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x80, %eax
jge 0x3d225
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3d238
movq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2c290
movzbl %al, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movzbl %al, %eax
movl %eax, -0x30(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x2c(%rbp)
movw $0x0, -0x32(%rbp)
movl -0x30(%rbp), %ecx
xorl %eax, %eax
cmpl -0x38(%rbp), %ecx
movb %al, -0x49(%rbp)
jae 0x3d27b
movzwl -0x32(%rbp), %ecx
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x49(%rbp)
jge 0x3d27b
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
setle %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x3d287
jmp 0x3d338
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x80, %eax
jge 0x3d2b1
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
movl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x3d2ca
movq -0x28(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
leaq -0x44(%rbp), %rsi
callq 0x2c290
movzbl %al, %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movzbl %al, %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movb 0x8(%rax), %cl
movq -0x40(%rbp), %rax
movb %cl, 0x27(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x28(%rbp), %rdi
movslq -0x2c(%rbp), %rax
addq %rax, %rdi
movl -0x44(%rbp), %esi
movq -0x40(%rbp), %rdx
callq 0x3b930
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x40(%rbp)
movw -0x32(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x32(%rbp)
jmp 0x3d24d
movw -0x32(%rbp), %cx
movq -0x20(%rbp), %rax
movw %cx, 0x8(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)