// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: lh_record_insert
static int lh_record_insert(
	  unqlite_kv_engine *pKv,         /* KV store */
	  const void *pKey,sxu32 nKeyLen, /* Payload: Key */
	  const void *pData,unqlite_int64 nDataLen, /* Payload: data */
	  int is_append /* True for an append operation */
	  )
{
	lhash_kv_engine *pEngine = (lhash_kv_engine *)pKv;
	lhash_bmap_rec *pRec;
	unqlite_page *pRaw;
	lhpage *pPage;
	lhcell *pCell;
	pgno iBucket;
	sxu32 nHash;
	int iCnt;
	int rc;

	/* Acquire the first page (DB hash Header) so that everything gets loaded autmatically */
	rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,0);
	if( rc != UNQLITE_OK ){
		return rc;
	}
	iCnt = 0;
	/* Compute the hash of the key first */
	nHash = pEngine->xHash(pKey,(sxu32)nKeyLen);
retry:
	/* Extract the logical bucket number */
	iBucket = nHash & (pEngine->nmax_split_nucket - 1);
	if( iBucket >= pEngine->split_bucket + pEngine->max_split_bucket ){
		/* Low mask */
		iBucket = nHash & (pEngine->max_split_bucket - 1);
	}
	/* Map the logical bucket number to real page number */
	pRec = lhMapFindBucket(pEngine,iBucket);
	if( pRec == 0 ){
		/* Request a new page */
		rc = lhAcquirePage(pEngine,&pRaw);
		if( rc != UNQLITE_OK ){
			return rc;
		}
		/* Initialize the page */
		pPage = lhNewPage(pEngine,pRaw,0);
		if( pPage == 0 ){
			return UNQLITE_NOMEM;
		}
		/* Mark as an empty page */
		rc = lhSetEmptyPage(pPage);
		if( rc != UNQLITE_OK ){
			pEngine->pIo->xPageUnref(pRaw); /* pPage will be released during this call */
			return rc;
		}
		/* Store the cell */
		rc = lhStoreCell(pPage,pKey,nKeyLen,pData,nDataLen,nHash,1);
		if( rc == UNQLITE_OK ){
			/* Install and write the logical map record */
			rc = lhMapWriteRecord(pEngine,iBucket,pRaw->iPage);
		}
		pEngine->pIo->xPageUnref(pRaw);
		return rc;
	}else{
		/* Load the page */
		rc = lhLoadPage(pEngine,pRec->iReal,0,&pPage,0);
		if( rc != UNQLITE_OK ){
			/* IO error, unlikely scenario */
			return rc;
		}
		/* Do not add this page to the hot dirty list */
		pEngine->pIo->xDontMkHot(pPage->pRaw);
		/* Lookup for the cell */
		pCell = lhFindCell(pPage,pKey,(sxu32)nKeyLen,nHash);
		if( pCell == 0 ){
			/* Create the record */
			rc = lhRecordInstall(pPage,nHash,pKey,nKeyLen,pData,nDataLen);
			if( rc == SXERR_RETRY && iCnt++ < 2 ){
				rc = UNQLITE_OK;
				goto retry;
			}
		}else{
			if( is_append ){
				/* Append operation */
				rc = lhRecordAppend(pCell,pData,nDataLen);
			}else{
				/* Overwrite old value */
				rc = lhRecordOverwrite(pCell,pData,nDataLen);
			}
		}
		pEngine->pIo->xPageUnref(pPage->pRaw);
	}
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %r9d, -0x88(%rbp)
movq %r8, -0x58(%rbp)
movq %rcx, %r14
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rax
movq (%rax), %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq *0x10(%rax)
testl %eax, %eax
je 0x2f904
movl %eax, %r13d
jmp 0x2ff64
movq %r14, -0x40(%rbp)
movq %r15, -0x80(%rbp)
movq %r15, %rdi
movl %ebx, -0x48(%rbp)
movl %ebx, %esi
callq *0xc0(%r12)
movl %eax, %edx
movq %r12, -0xa8(%rbp)
xorl %ebx, %ebx
movq %rdx, -0x30(%rbp)
movl 0x130(%r12), %eax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
addl %esi, %eax
andl %edx, %eax
movq 0x128(%r12), %r14
movq 0x120(%r12), %rcx
addq %r14, %rcx
addl %esi, %r14d
andl %edx, %r14d
cmpq %rcx, %rax
cmovbq %rax, %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x30610
testq %rax, %rax
je 0x2fdec
movq 0x8(%rax), %rsi
movq %r12, %rdi
xorl %edx, %edx
leaq -0x90(%rbp), %rcx
callq 0x30b50
testl %eax, %eax
jne 0x2f8fc
movq %rbx, %r15
movq (%r12), %rax
movq -0x90(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *0x40(%rax)
movq -0x90(%rbp), %rdi
movq -0x80(%rbp), %r14
movq %r14, %rsi
movl -0x48(%rbp), %ebx
movl %ebx, %edx
movq -0x30(%rbp), %r13
movl %r13d, %ecx
callq 0x30ddc
testq %rax, %rax
jne 0x2fe39
movq -0x90(%rbp), %r12
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
movq -0x40(%rbp), %rcx
movq -0x58(%rbp), %r8
movl %r13d, %r9d
callq 0x307cd
movl %eax, %r13d
cmpl $-0x49, %eax
movq %r15, %rbx
jne 0x2fa43
movq (%r12), %r14
movq 0x120(%r14), %rsi
movq %r14, %rdi
callq 0x30610
pushq $-0x18
popq %r13
testq %rax, %rax
je 0x2fa43
movq 0x8(%rax), %rsi
movq %r14, %rdi
xorl %edx, %edx
leaq -0x98(%rbp), %rcx
callq 0x30b50
testl %eax, %eax
jne 0x2fa40
movq %r14, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3064e
testl %eax, %eax
je 0x2fa68
movl %eax, %r13d
cmpl $-0x21, %r13d
jne 0x2ff4c
incl %ebx
cmpl $0x3, %ebx
movq -0xa8(%rbp), %r12
movq -0x30(%rbp), %rdx
jne 0x2f92b
jmp 0x2fe79
movq -0xb8(%rbp), %rsi
movq %r14, %rdi
movq %rsi, -0xa0(%rbp)
xorl %edx, %edx
callq 0x306e9
pushq $-0x1
popq %r13
testq %rax, %rax
je 0x2fa43
movq %rax, %r15
movq %rax, %rdi
callq 0x30756
testl %eax, %eax
movq %r15, -0xb0(%rbp)
jne 0x2fac4
movq 0x128(%r14), %rsi
addq 0x120(%r14), %rsi
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x30972
testl %eax, %eax
je 0x2fadd
movl %eax, %r13d
movq (%r14), %rax
movq -0xb0(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *0x50(%rax)
jmp 0x2fa43
movq 0x8(%r12), %rax
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x120(%r14), %rsi
movq 0x130(%r14), %r8
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addq %rcx, %r8
movq (%rax), %rcx
addq $0x8, %rcx
leaq -0x70(%rbp), %rdx
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movq %rcx, -0x78(%rbp)
andl $0x0, -0x60(%rbp)
movq 0x28(%rax), %rcx
movq %rsi, -0xd8(%rbp)
movq %r8, -0xd0(%rbp)
testq %rcx, %rcx
je 0x2fcf4
movq %rcx, %rdi
movl (%rcx), %eax
andl %r8d, %eax
movq 0x60(%rcx), %rcx
cmpq %rsi, %rax
je 0x2fb44
cmpq $0x0, 0x18(%rdi)
movq %rdi, -0xa0(%rbp)
movq %rcx, -0xe0(%rbp)
je 0x2fc44
movq -0xb0(%rbp), %r13
movq %r13, -0x38(%rbp)
movq %r13, %rdi
pushq $0x1a
popq %rsi
leaq -0x4a(%rbp), %rdx
callq 0x30e98
testl %eax, %eax
je 0x2fbbb
movq -0xb0(%rbp), %rdi
pushq $0x1a
popq %rsi
leaq -0x4a(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x31802
movl %eax, %r13d
testl %eax, %eax
jne 0x2fcc9
movq -0x38(%rbp), %r13
movq (%r13), %rdi
movq %r13, %rsi
callq 0x31189
pushq $-0x1
popq %r13
testq %rax, %rax
je 0x2fcc9
movq %rax, %r15
movzwl -0x4a(%rbp), %eax
movw %ax, 0x28(%r15)
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, 0x8(%r15)
movl 0x4(%rcx), %eax
movl %eax, 0x4(%r15)
movq 0x18(%rcx), %rax
movq %rax, 0x18(%r15)
movzwl 0x38(%rcx), %eax
movw %ax, 0x38(%r15)
movq 0x30(%rcx), %rax
movq %rax, 0x30(%r15)
movl (%rcx), %eax
movl %eax, (%r15)
leaq 0x40(%rcx), %rdi
movq %r15, %rsi
addq $0x40, %rsi
callq 0x31d24
movq %r15, %rdi
callq 0x311e2
testl %eax, %eax
jne 0x2fcc9
movq %r15, %rdi
callq 0x31771
xorl %r13d, %r13d
jmp 0x2fcc9
andl $0x0, -0x68(%rbp)
movl -0x60(%rbp), %eax
testb $0x4, %al
je 0x2fc5e
andq $0x0, -0x70(%rbp)
andl $0x0, -0x64(%rbp)
andl $-0x5, %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, 0x50(%rdi)
jne 0x2fc85
leaq 0x40(%rdi), %rdx
leaq -0x50e6(%rip), %rsi     # 0x2ab89
xorl %ecx, %ecx
callq 0x31968
movq -0xa0(%rbp), %rdi
testl %eax, %eax
jne 0x2fd45
leaq -0x5103(%rip), %rsi     # 0x2ab89
leaq -0x78(%rbp), %rdx
movq %rdi, %r15
callq 0x31b3e
testl %eax, %eax
jne 0x2fd45
movq 0x48(%r15), %rsi
movl 0x50(%r15), %edx
movq -0x70(%rbp), %rcx
movl -0x68(%rbp), %r8d
movl (%r15), %r9d
movl $0x1, (%rsp)
movq -0xb0(%rbp), %rdi
callq 0x307cd
movl %eax, %r13d
testl %r13d, %r13d
jne 0x2fcf7
movq -0xa0(%rbp), %rdi
callq 0x31c8a
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %r8
movq -0xe0(%rbp), %rcx
jmp 0x2fb44
xorl %r13d, %r13d
leaq -0x78(%rbp), %rdi
callq 0x2a72f
testl %r13d, %r13d
jne 0x2fac7
incq 0x120(%r14)
movq (%r14), %rax
movq 0xd0(%r14), %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x2fa40
movq 0x120(%r14), %rsi
cmpq 0x128(%r14), %rsi
jae 0x2fd4a
movq 0xd0(%r14), %rax
movq (%rax), %rdi
addq $0x10, %rdi
jmp 0x2fd90
movl %eax, %r13d
jmp 0x2fcf7
andq $0x0, 0x120(%r14)
movq 0x130(%r14), %rax
movq %rax, 0x128(%r14)
addq %rax, %rax
movq %rax, 0x130(%r14)
je 0x2fdd0
movq 0xd0(%r14), %rax
movq (%rax), %rax
andq $0x0, 0x10(%rax)
movq 0xd0(%r14), %rax
movq 0x128(%r14), %rsi
movq (%rax), %rdi
addq $0x18, %rdi
callq 0x2f66d
movq -0xc0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
je 0x2fa4d
movl $0x1, (%rsp)
movq %r12, %rdi
movq -0x80(%rbp), %rsi
movl -0x48(%rbp), %edx
movq -0x40(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x307cd
jmp 0x2fa40
movq (%r14), %rax
movq (%rax), %rdi
leaq 0x33afa(%rip), %rsi     # 0x638d7
callq *0x80(%rax)
pushq $-0x7
popq %r13
jmp 0x2fa43
leaq -0x78(%rbp), %rsi
movq %r12, %rdi
callq 0x3064e
testl %eax, %eax
jne 0x2f8fc
movq %r12, %rdi
movq -0x78(%rbp), %r12
movq %r12, %rsi
xorl %edx, %edx
callq 0x306e9
movq %rax, -0x90(%rbp)
testq %rax, %rax
je 0x2ff79
movq %rax, %rdi
callq 0x30756
testl %eax, %eax
je 0x3006e
movl %eax, %r13d
jmp 0x3009f
movq %rax, %r12
movq 0x20(%rax), %rbx
movq (%rbx), %r14
cmpl $0x0, -0x88(%rbp)
movq %r14, -0x30(%rbp)
je 0x2fe82
movq 0x8(%r12), %rcx
movq (%r14), %rax
movq -0x58(%rbp), %r15
addq %r15, %rcx
jae 0x2ff3e
movq (%rax), %rdi
leaq 0x339f6(%rip), %rsi     # 0x63865
callq *0x80(%rax)
pushq $-0x7
jmp 0x2fe7b
pushq $-0x21
popq %r13
jmp 0x2ff4c
movq (%r14), %rax
movq 0x8(%rbx), %rdi
callq *0x28(%rax)
testl %eax, %eax
movq -0x58(%rbp), %r15
jne 0x2ff49
cmpq $0x0, 0x18(%r12)
je 0x300b1
movq (%r14), %rax
movq (%rax), %rdi
movq 0x30(%r12), %rsi
leaq -0x78(%rbp), %rdx
callq *0x10(%rax)
testl %eax, %eax
jne 0x2ff49
movq %rbx, -0x88(%rbp)
movq -0x78(%rbp), %rbx
movq (%rbx), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2f685
leaq -0x38(%rbp), %r15
movq %rbx, (%r15)
movq -0xb8(%rbp), %rsi
testq %rsi, %rsi
je 0x3022b
movq -0x30(%rbp), %rbx
movq (%rbx), %rax
movq (%rax), %rdi
movq %r15, %rdx
callq *0x10(%rax)
movq -0x78(%rbp), %r13
testl %eax, %eax
jne 0x30233
movq -0x38(%rbp), %r14
movq (%r14), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2f685
cmpq %r13, %r14
je 0x2fedf
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31e54
movq (%rbx), %rax
movq -0x38(%rbp), %rdi
callq *0x50(%rax)
jmp 0x2fedf
movq 0x8(%rbx), %rdi
callq *0x28(%rax)
testl %eax, %eax
je 0x2ff7f
movl %eax, %r13d
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq -0x90(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *0x50(%rax)
movl %r13d, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %r13
jmp 0x2ff64
cmpq $0x0, 0x18(%r12)
je 0x300ea
movq (%r14), %rax
movq (%rax), %rdi
movq 0x30(%r12), %rsi
leaq -0x78(%rbp), %rdx
callq *0x10(%rax)
testl %eax, %eax
jne 0x2ff49
movq -0x78(%rbp), %r13
movq (%r13), %r15
leaq -0x98(%rbp), %rsi
movq %r15, %rdi
callq 0x2f685
movq %r15, %rsi
movzwl 0x38(%r12), %ecx
movq %r14, %rax
leaq (%rcx,%r15), %r14
movslq 0x110(%rax), %rax
addq %rax, %rsi
movq 0x8(%r12), %r8
subl %ecx, %eax
cmpq %rsi, %r14
jb 0x30055
movq -0x98(%rbp), %rsi
movq -0x30(%rbp), %r14
movq (%r14), %rax
movq (%rax), %rdi
testq %rsi, %rsi
je 0x30528
movq %rbx, %r15
movq %r8, %rbx
leaq -0x38(%rbp), %rdx
callq *0x10(%rax)
testl %eax, %eax
jne 0x2ff49
movq -0x38(%rbp), %rax
movq (%rax), %rdi
leaq -0x98(%rbp), %rsi
callq 0x2f685
movq (%r14), %rax
movq -0x78(%rbp), %rdi
callq *0x50(%rax)
movq -0x38(%rbp), %r13
movq (%r13), %rsi
leaq 0x8(%rsi), %r14
movq 0x20(%r12), %rax
movq (%rax), %rax
movslq 0x110(%rax), %rax
addq %rax, %rsi
addl $-0x8, %eax
movq %r13, -0x78(%rbp)
movq %rbx, %r8
movq %r15, %rbx
movl %eax, %edx
movq %r8, %rcx
subq %rdx, %rcx
jb 0x303b0
addq %rdx, %r14
movq %rcx, %r8
jmp 0x2ffd9
movq -0x90(%rbp), %rdi
movl $0x1, (%rsp)
movq -0x80(%rbp), %rsi
movl -0x48(%rbp), %edx
movq -0x40(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x307cd
movl %eax, %r13d
testl %eax, %eax
je 0x301af
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq %r12, %rdi
jmp 0x2ff61
movq 0x8(%rbx), %rcx
movzwl 0x28(%r12), %eax
movl 0x4(%r12), %edx
leal (%rdx,%rax), %esi
addl $0x1a, %esi
movl %edx, %eax
addl $0x1a, %eax
addq (%rcx), %rsi
cmpq %r15, 0x8(%r12)
jne 0x301c8
movq -0x40(%rbp), %rdi
movl %r15d, %edx
callq 0x2d3b0
jmp 0x30608
leaq -0x38(%rbp), %rdx
andw $0x0, (%rdx)
movl 0x4(%r12), %eax
addl $0x1a, %eax
movq 0x8(%r12), %rsi
addq %r15, %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x30e98
testl %eax, %eax
je 0x30337
movq 0x8(%rbx), %rax
movq (%rax), %rax
movzwl 0x28(%r12), %ecx
leaq (%rax,%rcx), %rsi
addq $0x1a, %rsi
addq $0x1a, %rcx
movl 0x4(%r12), %edx
addl %edx, %ecx
addq %rax, %rcx
movq 0x8(%r12), %r8
andq $0x0, 0x8(%rsp)
movq %r15, (%rsp)
movq %r12, %rdi
movq -0x40(%rbp), %r9
xorl %eax, %eax
callq 0x31360
movl %eax, %r13d
testl %eax, %eax
jne 0x2ff4c
movq 0x8(%rbx), %rax
movq (%rax), %rax
movzwl 0x28(%r12), %ecx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%r12), %rsi
addq %r15, %rsi
callq 0x2f66d
movl 0x8(%r12), %edx
movl 0x28(%r12), %esi
addl 0x4(%r12), %edx
addl $0x1a, %esi
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %esi
andl %eax, %edx
movq %rbx, %rdi
callq 0x31d73
addq %r15, 0x8(%r12)
jmp 0x30608
movq 0x10(%r12), %rdx
movq -0xa8(%rbp), %rdi
movq %r14, %rsi
callq 0x30972
jmp 0x2fe31
jbe 0x304a1
movq -0x40(%rbp), %rdi
movl %r15d, %edx
callq 0x2d3b0
movq 0x8(%rbx), %rax
movq (%rax), %rax
movzwl 0x28(%r12), %ecx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x2f66d
movl 0x8(%r12), %edx
movl 0x28(%r12), %eax
addl 0x4(%r12), %eax
leal (%r15,%rax), %esi
addl $0x1a, %esi
subl %r15d, %edx
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %esi
andl %eax, %edx
movq %rbx, %rdi
callq 0x31d73
movq %r15, 0x8(%r12)
jmp 0x30608
movq -0x78(%rbp), %r13
movq -0x30(%rbp), %rbx
movq (%r13), %rax
movq %rax, -0x80(%rbp)
movzwl 0x38(%r12), %r15d
movslq 0x110(%rbx), %r14
movq (%rbx), %rax
movq %r13, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x2ff49
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rbx
leaq (%rbx,%rax), %rcx
movq -0x80(%rbp), %rax
addq %rax, %r14
movq %r14, -0x48(%rbp)
addq %rax, %r15
movq -0x78(%rbp), %rax
movq (%rax), %rax
andq $0x0, (%rax)
movq %rcx, -0x80(%rbp)
cmpq %rcx, %rbx
jae 0x3053c
movq %rbx, %r14
movq -0x48(%rbp), %rcx
cmpq %rcx, %r15
jb 0x30300
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
callq 0x3064e
testl %eax, %eax
jne 0x2ff49
movq (%rbx), %rax
movq -0x98(%rbp), %r15
movq %r15, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x2ff49
movq -0x78(%rbp), %rax
movq (%rax), %rdi
movq 0x10(%r15), %rsi
callq 0x2f66d
movq (%rbx), %rax
movq -0x78(%rbp), %rdi
callq *0x50(%rax)
movq (%r15), %rax
andq $0x0, (%rax)
movq %r15, -0x78(%rbp)
movq (%r15), %rax
leaq 0x8(%rax), %r15
movslq 0x110(%rbx), %rcx
addq %rax, %rcx
movq %rcx, -0x48(%rbp)
movl %ecx, %eax
subl %r15d, %eax
movq -0x80(%rbp), %r13
movq %r14, %rbx
subl %ebx, %r13d
cmpl %eax, %r13d
cmovael %eax, %r13d
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x2d3b0
addq %r13, %rbx
addq %r13, %r15
movq -0x80(%rbp), %rcx
jmp 0x30282
movq %rbx, %rcx
movzwl 0x28(%r12), %ebx
movq %r14, %rax
movl 0x8(%r12), %r14d
addq $0x8, %rax
xorps %xmm0, %xmm0
leaq -0x78(%rbp), %rdi
movups %xmm0, 0x8(%rdi)
movq %rax, (%rdi)
andl $0x0, 0x18(%rdi)
movq %rcx, -0x88(%rbp)
movq 0x8(%rcx), %rax
movl 0x4(%r12), %ecx
leal (%rbx,%rcx), %esi
addl $0x1a, %esi
addq (%rax), %rsi
movl %r14d, %edx
callq 0x2e250
testl %eax, %eax
jne 0x3039f
movq %rbx, -0x30(%rbp)
leaq -0x78(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl %r15d, %edx
callq 0x2e250
testl %eax, %eax
je 0x305ca
movl %eax, %r13d
leaq -0x78(%rbp), %rdi
callq 0x2a72f
jmp 0x2ff4c
movq %rsi, %r15
movq %r8, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %r13, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x2ff49
movq %rbx, -0x88(%rbp)
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rbx
addq %rbx, %rax
addq -0x48(%rbp), %r14
movq %rax, -0x48(%rbp)
movq %r15, %rcx
movq %rbx, -0x40(%rbp)
cmpq %rax, %rbx
jae 0x3058b
cmpq %rcx, %r14
jb 0x30467
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
leaq -0x38(%rbp), %rsi
callq 0x3064e
testl %eax, %eax
jne 0x2ff49
movq (%rbx), %rax
movq -0x38(%rbp), %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x2ff49
movq -0x78(%rbp), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x2f66d
movq (%rbx), %rax
movq -0x78(%rbp), %rdi
callq *0x50(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rax
andq $0x0, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
movq (%rax), %rax
leaq 0x8(%rax), %r14
movslq 0x110(%rbx), %rcx
addq %rax, %rcx
movl %ecx, %eax
subl %r14d, %eax
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
subl %ebx, %r13d
cmpl %eax, %r13d
cmovael %eax, %r13d
movq %rcx, %r15
movq %rbx, %rdi
movq %r14, %rsi
movl %r13d, %edx
callq 0x2d3b0
movq %r15, %rcx
addq %r13, %rbx
addq %r13, %r14
movq -0x48(%rbp), %rax
jmp 0x303e9
leaq -0x78(%rbp), %rdx
andw $0x0, (%rdx)
movl %eax, %esi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x30e98
testl %eax, %eax
je 0x30550
movq 0x8(%rbx), %rax
movq (%rax), %rax
movzwl 0x28(%r12), %ecx
leaq (%rax,%rcx), %rsi
addq $0x1a, %rsi
movl 0x4(%r12), %edx
movq %r12, %rdi
movq -0x40(%rbp), %rcx
movq %r15, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x31360
testl %eax, %eax
jne 0x2ff49
movq 0x8(%rbx), %rax
movq (%rax), %rax
movzwl 0x28(%r12), %ecx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x2f66d
movl 0x8(%r12), %edx
movl 0x28(%r12), %esi
addl 0x4(%r12), %edx
addl $0x1a, %esi
jmp 0x30210
leaq 0x333d5(%rip), %rsi     # 0x63904
callq *0x80(%rax)
pushq $-0x18
jmp 0x2fe7b
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rdi
callq *0x50(%rax)
movq -0x58(%rbp), %rsi
jmp 0x305a2
movzwl 0x28(%r12), %r14d
movq %rbx, %r13
movl 0x8(%r12), %ebx
movzwl -0x78(%rbp), %esi
movq %r12, %rdi
movq -0x40(%rbp), %rdx
movq %r15, %rcx
callq 0x31db7
movl 0x4(%r12), %eax
addl %ebx, %eax
addl $0x1a, %eax
movzwl %ax, %edx
movq %r13, %rdi
movl %r14d, %esi
callq 0x31d73
jmp 0x30608
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rdi
callq *0x50(%rax)
movq -0x58(%rbp), %rsi
addq 0x8(%r12), %rsi
movq %rsi, 0x8(%r12)
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movzwl 0x28(%r12), %ecx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
callq 0x2f66d
jmp 0x30608
movzwl -0x38(%rbp), %esi
leaq -0x78(%rbp), %r15
movq 0x8(%r15), %rdx
movl 0x10(%r15), %ecx
movq %r12, %rdi
callq 0x31db7
movl 0x4(%r12), %eax
addl %r14d, %eax
addl $0x1a, %eax
movzwl %ax, %edx
movzwl -0x30(%rbp), %esi
movq -0x88(%rbp), %rdi
callq 0x31d73
movq %r15, %rdi
callq 0x2a72f
xorl %r13d, %r13d
jmp 0x2ff4c