LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqlitePagerAcquire
static int unqlitePagerAcquire(
  Pager *pPager,      /* The pager open on the database file */
  pgno pgno,          /* Page number to fetch */
  unqlite_page **ppPage,    /* OUT: Acquired page */
  int fetchOnly,      /* Cache lookup only */
  int noContent       /* Do not bother reading content from disk if true */
)
{
	Page *pPage;
	int rc;
	/* Acquire a shared lock (if not yet done) on the database and rollback any hot-journal if present */
	rc = pager_shared_lock(pPager);
	if( rc != UNQLITE_OK ){
		return rc;
	}
	/* Fetch the page from the cache */
	pPage = pager_fetch_page(pPager,pgno);
	if( fetchOnly ){
		if( ppPage ){
			*ppPage = (unqlite_page *)pPage;
		}
		return pPage ? UNQLITE_OK : UNQLITE_NOTFOUND;
	}
	if( pPage == 0 ){
		/* Allocate a new page */
		pPage = pager_alloc_page(pPager,pgno);
		if( pPage == 0 ){
			unqliteGenOutofMem(pPager->pDb);
			return UNQLITE_NOMEM;
		}
		/* Read page contents */
		rc = pager_get_page_contents(pPager,pPage,noContent);
		if( rc != UNQLITE_OK ){
			SyMemBackendPoolFree(pPager->pAllocator,pPage);
			return rc;
		}
		/* Link the page */
		pager_link_page(pPager,pPage);
	}else{
		if( ppPage ){
			page_ref(pPage);
		}
	}
	/* All done, page is loaded in memeory */
	if( ppPage ){
		*ppPage = (unqlite_page *)pPage;
	}
	return UNQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r15
callq 0x33073
movl %eax, %r12d
testl %eax, %eax
jne 0x33026
movq %r15, %rdi
movq %r13, %rsi
callq 0x33485
testl %r14d, %r14d
je 0x32fa2
testq %rbx, %rbx
je 0x32f90
movq %rax, (%rbx)
xorl %ecx, %ecx
testq %rax, %rax
pushq $-0x6
popq %r12
cmovnel %ecx, %r12d
jmp 0x33026
testq %rax, %rax
je 0x32fb1
testq %rbx, %rbx
je 0x33023
incl 0x24(%rax)
jmp 0x33020
movq %r15, %rdi
movq %r13, %rsi
callq 0x334c4
testq %rax, %rax
je 0x33038
movq %rax, %r14
cmpl $0x0, 0x1fc(%r15)
jne 0x32ffe
movq 0x10(%r14), %rcx
cmpq 0x40(%r15), %rcx
jae 0x32ffe
testb $0x1, 0x16d(%r15)
je 0x33047
movq 0x58(%r15), %rax
testq %rax, %rax
je 0x33047
movslq 0x208(%r15), %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, (%r14)
jmp 0x3300d
movq (%r14), %rdi
movl 0x208(%r15), %esi
callq 0x27aea
movq %r15, %rdi
movq %r14, %rsi
callq 0x33528
testq %rbx, %rbx
movq %r14, %rax
je 0x33023
movq %rax, (%rbx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r15), %rdi
callq 0x32825
pushq $-0x1
popq %r12
jmp 0x33026
movq 0x30(%r15), %rdi
movq (%r14), %rsi
movslq 0x208(%r15), %rdx
imulq %rdx, %rcx
movq (%rdi), %rax
callq *0x10(%rax)
testl %eax, %eax
je 0x3300d
movl %eax, %r12d
movq (%r15), %rdi
movq %r14, %rsi
callq 0x27bf8
jmp 0x33026
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_fetch_page
static Page * pager_fetch_page(Pager *pPager,pgno page_num)
{
	Page *pEntry;
	if( pPager->nPage < 1 ){
		/* Don't bother hashing */
		return 0;
	}
	/* Perform the lookup */
	pEntry = pPager->apHash[PAGE_HASH(page_num) & (pPager->nSize - 1)];
	for(;;){
		if( pEntry == 0 ){
			break;
		}
		if( pEntry->iPage == page_num ){
			return pEntry;
		}
		/* Point to the next entry in the colission chain */
		pEntry = pEntry->pNextCollide;
	}
	/* No such page */
	return 0;
}

// Assembly:
cmpl $0x0, 0x254(%rdi)
je 0x334bd
pushq %rbp
movq %rsp, %rbp
movl 0x250(%rdi), %ecx
decl %ecx
movl %esi, %eax
andl %ecx, %eax
shlq $0x3, %rax
addq 0x248(%rdi), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x334c0
cmpq %rsi, 0x10(%rax)
je 0x334c2
addq $0x48, %rax
jmp 0x334a9
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_alloc_page
static Page * pager_alloc_page(Pager *pPager,pgno num_page)
{
	Page *pNew;
	
	pNew = (Page *)SyMemBackendPoolAlloc(pPager->pAllocator,sizeof(Page)+pPager->iPageSize);
	if( pNew == 0 ){
		return 0;
	}
	/* Zero the structure */
	SyZero(pNew,sizeof(Page)+pPager->iPageSize);
	/* Page data */
	pNew->zData = (unsigned char *)&pNew[1];
	/* Fill in the structure */
	pNew->pPager = pPager;
	pNew->nRef = 1;
	pNew->iPage = num_page;
	return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movl 0x208(%r14), %esi
addl $0x68, %esi
callq 0x279f7
movq %rax, %r15
testq %rax, %rax
je 0x3351a
movl 0x208(%r14), %esi
addl $0x68, %esi
movq %r15, %rdi
callq 0x27aea
movq %r15, %rax
addq $0x68, %rax
movq %rax, (%r15)
movq %r14, 0x18(%r15)
movl $0x1, 0x24(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_link_page
static int pager_link_page(Pager *pPager,Page *pPage)
{
	sxu32 nBucket;
	/* Install in the corresponding bucket */
	nBucket = PAGE_HASH(pPage->iPage) & (pPager->nSize - 1);
	pPage->pNextCollide = pPager->apHash[nBucket];
	if( pPager->apHash[nBucket] ){
		pPager->apHash[nBucket]->pPrevCollide = pPage;
	}
	pPager->apHash[nBucket] = pPage;
	/* Link to the list of active pages */
	MACRO_LD_PUSH(pPager->pAll,pPage);
	pPager->nPage++;
	if( (pPager->nPage >= pPager->nSize * 4)  && pPager->nPage < 100000 ){
		/* Grow the hashtable */
		sxu32 nNewSize = pPager->nSize << 1;
		Page *pEntry,**apNew;
		sxu32 n;
		apNew = (Page **)SyMemBackendAlloc(pPager->pAllocator, nNewSize * sizeof(Page *));
		if( apNew ){
			sxu32 iBucket;
			/* Zero the new table */
			SyZero((void *)apNew, nNewSize * sizeof(Page *));
			/* Rehash all entries */
			n = 0;
			pEntry = pPager->pAll;
			for(;;){
				/* Loop one */
				if( n >= pPager->nPage ){
					break;
				}
				pEntry->pNextCollide = pEntry->pPrevCollide = 0;
				/* Install in the new bucket */
				iBucket = PAGE_HASH(pEntry->iPage) & (nNewSize - 1);
				pEntry->pNextCollide = apNew[iBucket];
				if( apNew[iBucket] ){
					apNew[iBucket]->pPrevCollide = pEntry;
				}
				apNew[iBucket] = pEntry;
				/* Point to the next entry */
				pEntry = pEntry->pNext;
				n++;
			}
			/* Release the old table and reflect the change */
			SyMemBackendFree(pPager->pAllocator,(void *)pPager->apHash);
			pPager->apHash = apNew;
			pPager->nSize  = nNewSize;
		}
	}
	return UNQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x250(%rdi), %r12d
leal -0x1(%r12), %eax
andl 0x10(%rsi), %eax
movq 0x248(%rdi), %rcx
movq (%rcx,%rax,8), %rdx
movq %rdx, 0x48(%rsi)
testq %rdx, %rdx
je 0x33560
movq %rsi, 0x50(%rdx)
movq %rsi, (%rcx,%rax,8)
movq 0x228(%rbx), %rax
testq %rax, %rax
je 0x33578
movq %rax, 0x28(%rsi)
movq %rsi, 0x30(%rax)
movq %rsi, 0x228(%rbx)
movl 0x254(%rbx), %eax
incl %eax
movl %eax, 0x254(%rbx)
leal (,%r12,4), %ecx
cmpl %ecx, %eax
setb %cl
cmpl $0x186a0, %eax          # imm = 0x186A0
setae %al
orb %cl, %al
jne 0x33633
movq (%rbx), %rdi
movl %r12d, %r15d
shll $0x4, %r15d
movl %r15d, %esi
callq 0x2ca19
testq %rax, %rax
je 0x33633
movq %rax, %r14
leaq 0x228(%rbx), %r13
addl %r12d, %r12d
movq %rax, %rdi
movl %r15d, %esi
callq 0x27aea
movl 0x254(%rbx), %eax
leal -0x1(%r12), %ecx
xorps %xmm0, %xmm0
subl $0x1, %eax
jb 0x33616
movq (%r13), %r13
movups %xmm0, 0x48(%r13)
movl 0x10(%r13), %edx
andl %ecx, %edx
movq (%r14,%rdx,8), %rsi
movq %rsi, 0x48(%r13)
testq %rsi, %rsi
je 0x3360c
movq %r13, 0x50(%rsi)
movq %r13, (%r14,%rdx,8)
addq $0x28, %r13
jmp 0x335e7
movq (%rbx), %rdi
movq 0x248(%rbx), %rsi
callq 0x2d420
movq %r14, 0x248(%rbx)
movl %r12d, 0x250(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteOsOpen
UNQLITE_PRIVATE int unqliteOsOpen(
  unqlite_vfs *pVfs,
  SyMemBackend *pAlloc,
  const char *zPath, 
  unqlite_file **ppOut, 
  unsigned int flags 
)
{
	unqlite_file *pFile;
	int rc;
	*ppOut = 0;
	if( zPath == 0 ){
		/* May happen if dealing with an in-memory database */
		return SXERR_EMPTY;
	}
	/* Allocate a new instance */
	pFile = (unqlite_file *)SyMemBackendAlloc(pAlloc,sizeof(unqlite_file)+pVfs->szOsFile);
	if( pFile == 0 ){
		return UNQLITE_NOMEM;
	}
	/* Zero the structure */
	SyZero(pFile,sizeof(unqlite_file)+pVfs->szOsFile);
	/* Invoke the xOpen method of the underlying VFS */
	rc = pVfs->xOpen(pVfs, zPath, pFile, flags);
	if( rc != UNQLITE_OK ){
		SyMemBackendFree(pAlloc,pFile);
		pFile = 0;
	}
	*ppOut = pFile;
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
andq $0x0, (%rcx)
testq %rdx, %rdx
je 0x336b8
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r13
movl %r8d, -0x2c(%rbp)
movl 0xc(%rdi), %esi
addl $0x8, %esi
movq %r14, %rdi
callq 0x2ca19
testq %rax, %rax
je 0x336bc
movq %rax, %r15
movl 0xc(%r13), %esi
addl $0x8, %esi
movq %rax, %rdi
callq 0x27aea
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl -0x2c(%rbp), %ecx
callq *0x18(%r13)
movl %eax, %r12d
testl %eax, %eax
je 0x336b3
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d420
xorl %r15d, %r15d
movq %r15, (%rbx)
jmp 0x336c0
pushq $-0x3
jmp 0x336be
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_wait_on_lock
static int pager_wait_on_lock(Pager *pPager, int locktype){
  int rc;                              /* Return code */
  do {
    rc = pager_lock_db(pPager,locktype);
  }while( rc==UNQLITE_BUSY && pPager->xBusyHandler && pPager->xBusyHandler(pPager->pBusyHandlerArg) );
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x33bf8
movl %eax, %r15d
cmpl $-0xe, %eax
jne 0x3370c
movq 0x178(%r14), %rax
testq %rax, %rax
je 0x3370c
movq 0x180(%r14), %rdi
callq *%rax
testl %eax, %eax
jne 0x336e1
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_unlock_db
static int pager_unlock_db(Pager *pPager, int eLock)
{
  int rc = UNQLITE_OK;
  if( pPager->iLock != NO_LOCK ){
    rc = unqliteOsUnlock(pPager->pfd,eLock);
    pPager->iLock = eLock;
  }
  return rc;
}

// Assembly:
cmpl $0x0, 0x1f4(%rdi)
je 0x33bf7
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x30(%rdi), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movl %ebx, 0x1f4(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_lock_db
static int pager_lock_db(Pager *pPager, int eLock){
  int rc = UNQLITE_OK;
  if( pPager->iLock < eLock || pPager->iLock == NO_LOCK ){
    rc = unqliteOsLock(pPager->pfd, eLock);
    if( rc==UNQLITE_OK ){
      pPager->iLock = eLock;
    }else{
		unqliteGenError(pPager->pDb,
			rc == UNQLITE_BUSY ? "Another process or thread hold the requested lock" : "Error while requesting database lock"
			);
	}
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
cmpl %esi, 0x1f4(%rdi)
jge 0x33c4e
movl %esi, %r15d
movq %rdi, %r14
movq 0x30(%rdi), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
testl %eax, %eax
je 0x33c47
movl %eax, %r12d
movq 0x8(%r14), %rdi
cmpl $-0xe, %eax
leaq 0x2fe9a(%rip), %rax     # 0x63acc
leaq 0x2fec5(%rip), %rsi     # 0x63afe
cmoveq %rax, %rsi
callq 0x2a542
movl %r12d, %ebx
jmp 0x33c4e
movl %r15d, 0x1f4(%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteOsCloseFree
UNQLITE_PRIVATE int unqliteOsCloseFree(SyMemBackend *pAlloc,unqlite_file *pId)
{
	int rc = UNQLITE_OK;
	if( pId ){
		rc = pId->pMethods->xClose(pId);
		SyMemBackendFree(pAlloc,pId);
	}
	return rc;
}

// Assembly:
testq %rsi, %rsi
je 0x33c93
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x8(%rax)
movl %eax, %r15d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2d420
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_cksum
static sxu32 pager_cksum(Pager *pPager,const unsigned char *zData)
{
  sxu32 cksum = pPager->cksumInit;         /* Checksum value to return */
  int i = pPager->iPageSize-200;          /* Loop counter */
  while( i>0 ){
    cksum += zData[i];
    i -= 200;
  }
  return cksum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x168(%rdi), %eax
movl 0x208(%rdi), %ecx
cmpl $0xc9, %ecx
jl 0x33d29
movzbl -0xc8(%rsi,%rcx), %edx
addq $-0xc8, %rcx
addl %edx, %eax
jmp 0x33d0e
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: SyDosTimeFormat
JX9_PRIVATE void SyDosTimeFormat(sxu32 nDosDate, Sytm *pOut)
{
	sxu16 nDate;
	sxu16 nTime;
	nDate = nDosDate >> 16;
	nTime = nDosDate & 0xFFFF;
	pOut->tm_isdst  = 0;
	pOut->tm_year 	= 1980 + (nDate >> 9);
	pOut->tm_mon	= (nDate % (1<<9))>>5;
	pOut->tm_mday	= (nDate % (1<<9))&0x1F;
	pOut->tm_hour	= nTime >> 11;
	pOut->tm_min	= (nTime % (1<<11)) >> 5;
	pOut->tm_sec	= ((nTime % (1<<11))& 0x1F )<<1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %eax
shrl $0x10, %eax
andl $0x0, 0x20(%rsi)
movl %edi, %ecx
shrl $0x19, %ecx
addl $0x7bc, %ecx            # imm = 0x7BC
movl %ecx, 0x14(%rsi)
movl %edi, %ecx
shrl $0x15, %ecx
andl $0xf, %ecx
movl %ecx, 0x10(%rsi)
andl $0x1f, %eax
movl %eax, 0xc(%rsi)
movl %edi, %eax
shrl $0xb, %eax
andl $0x1f, %eax
movl %eax, 0x8(%rsi)
movl %edi, %eax
shrl $0x5, %eax
andl $0x3f, %eax
movl %eax, 0x4(%rsi)
addl %edi, %edi
andl $0x3e, %edi
movl %edi, (%rsi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteFinalizeJournal
static int unqliteFinalizeJournal(Pager *pPager,int *pRetry,int close_jrnl)
{
	int rc;
	*pRetry = 0;
	/* Grab the exclusive lock first */
	rc = pager_lock_db(pPager,EXCLUSIVE_LOCK);
	if( rc != UNQLITE_OK ){
		/* Retry the excusive lock process */
		*pRetry = 1;
		rc = UNQLITE_OK;
	}
	if( pPager->no_jrnl ){
		/* Journaling is omitted, return immediately */
		return UNQLITE_OK;
	}
	/* Write the total number of database records */
	rc = WriteInt32(pPager->pjfd,pPager->nRec,8 /* sizeof(aJournalRec) */);
	if( rc != UNQLITE_OK ){
		if( pPager->nRec > 0 ){
			return rc;
		}else{
			/* Not so fatal */
			rc = UNQLITE_OK;
		}
	}
	/* Sync the journal and close it */
	rc = unqliteOsSync(pPager->pjfd,UNQLITE_SYNC_NORMAL);
	if( close_jrnl ){
		/* close the journal file */
		if( UNQLITE_OK != unqliteOsCloseFree(pPager->pAllocator,pPager->pjfd) ){
			if( rc != UNQLITE_OK /* unqliteOsSync */ ){
				return rc;
			}
		}
		pPager->pjfd = 0;
	}
	if( (*pRetry) == 1 ){
		if( pager_lock_db(pPager,EXCLUSIVE_LOCK) == UNQLITE_OK ){
			/* Got exclusive lock */
			*pRetry = 0;
		}
	}
	return UNQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
andl $0x0, (%rsi)
pushq $0x4
popq %rsi
callq 0x33bf8
testl %eax, %eax
je 0x33da3
movl $0x1, (%r14)
xorl %ebx, %ebx
cmpl $0x0, 0x204(%r15)
je 0x33dc0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%r15), %rdi
movl 0x60(%r15), %esi
pushq $0x8
popq %rdx
callq 0x33e37
testl %eax, %eax
je 0x33ddf
cmpl $0x0, 0x60(%r15)
je 0x33ddf
movl %eax, %ebx
jmp 0x33daf
movq 0x38(%r15), %rdi
movq (%rdi), %rax
pushq $0x2
popq %rsi
callq *0x28(%rax)
testl %r12d, %r12d
je 0x33e19
movl %eax, %r13d
movq (%r15), %rdi
movq 0x38(%r15), %rsi
callq 0x33c59
testl %eax, %eax
setne %al
testl %r13d, %r13d
setne %cl
testb %cl, %al
je 0x33e14
movl %r13d, %ebx
jmp 0x33daf
andq $0x0, 0x38(%r15)
cmpl $0x1, (%r14)
jne 0x33daf
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x33bf8
testl %eax, %eax
jne 0x33daf
andl $0x0, (%r14)
jmp 0x33daf
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: WriteInt32
static int WriteInt32(unqlite_file *pFd,sxu32 iNum,sxi64 iOfft)
{
	unsigned char zBuf[4];
	int rc;
	SyBigEndianPack32(zBuf,iNum);
	rc = unqliteOsWrite(pFd,zBuf,sizeof(zBuf),iOfft);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdx, %rcx
bswapl %esi
leaq -0x4(%rbp), %rax
movl %esi, (%rax)
movq (%rdi), %r8
pushq $0x4
popq %rdx
movq %rax, %rsi
callq *0x18(%r8)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: page_merge_hot
static Page * page_merge_hot(Page *pA, Page *pB)
{
	Page result, *pTail;
    /* Prevent compiler warning */
	result.pNextHot = result.pPrevHot = 0;
	pTail = &result;
	while( pA && pB ){
		if( pA->iPage < pB->iPage ){
			pTail->pPrevHot = pA;
			pA->pNextHot = pTail;
			pTail = pA;
			pA = pA->pPrevHot;
		}else{
			pTail->pPrevHot = pB;
			pB->pNextHot = pTail;
			pTail = pB;
			pB = pB->pPrevHot;
		}
	}
	if( pA ){
		pTail->pPrevHot = pA;
		pA->pNextHot = pTail;
	}else if( pB ){
		pTail->pPrevHot = pB;
		pB->pNextHot = pTail;
	}else{
		pTail->pPrevHot = pTail->pNextHot = 0;
	}
	return result.pPrevHot;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm0, %xmm0
leaq -0x68(%rbp), %rax
movups %xmm0, 0x58(%rax)
movq %rax, %rcx
movq %rdi, %rax
testq %rax, %rax
je 0x33ea5
testq %rsi, %rsi
je 0x33ea5
movq 0x10(%rax), %rdx
cmpq 0x10(%rsi), %rdx
jb 0x33e97
movq %rsi, 0x60(%rcx)
movq %rcx, 0x58(%rsi)
movq %rsi, %rcx
movq 0x60(%rsi), %rsi
jmp 0x33e72
movq %rax, 0x60(%rcx)
movq %rcx, 0x58(%rax)
movq 0x60(%rax), %rdi
jmp 0x33e6c
testq %rax, %rax
je 0x33eb4
movq %rax, 0x60(%rcx)
movq %rcx, 0x58(%rax)
jmp 0x33eca
testq %rsi, %rsi
je 0x33ec3
movq %rsi, 0x60(%rcx)
movq %rcx, 0x58(%rsi)
jmp 0x33eca
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rcx)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_unlink_page
static int pager_unlink_page(Pager *pPager,Page *pPage)
{
	if( pPage->pNextCollide ){
		pPage->pNextCollide->pPrevCollide = pPage->pPrevCollide;
	}
	if( pPage->pPrevCollide ){
		pPage->pPrevCollide->pNextCollide = pPage->pNextCollide;
	}else{
		sxu32 nBucket = PAGE_HASH(pPage->iPage) & (pPager->nSize - 1);
		pPager->apHash[nBucket] = pPage->pNextCollide;
	}
	MACRO_LD_REMOVE(pPager->pAll,pPage);
	pPager->nPage--;
	return UNQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x48(%rsi), %rax
movq 0x50(%rsi), %rcx
testq %rax, %rax
je 0x33ee5
movq %rcx, 0x50(%rax)
testq %rcx, %rcx
je 0x33ef0
addq $0x48, %rcx
jmp 0x33f06
movl 0x250(%rdi), %ecx
decl %ecx
andl 0x10(%rsi), %ecx
shlq $0x3, %rcx
addq 0x248(%rdi), %rcx
movq %rax, (%rcx)
movq 0x228(%rdi), %rax
cmpq %rsi, %rax
jne 0x33f20
movq 0x28(%rax), %rax
movq %rax, 0x228(%rdi)
movq 0x28(%rsi), %rax
movq 0x30(%rsi), %rcx
testq %rcx, %rcx
je 0x33f31
movq %rax, 0x28(%rcx)
testq %rax, %rax
je 0x33f3a
movq %rcx, 0x30(%rax)
decl 0x254(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_release_page
static int pager_release_page(Pager *pPager,Page *pPage)
{
	int rc = UNQLITE_OK;
	if( !(pPage->flags & PAGE_DIRTY)){
		/* Invoke the unpin callback if available */
		if( pPager->xPageUnpin && pPage->pUserData ){
			pPager->xPageUnpin(pPage->pUserData);
		}
		pPage->pUserData = 0;
		SyMemBackendPoolFree(pPager->pAllocator,pPage);
	}else{
		/* Dirty page, it will be released later when a dirty commit
		 * or the final commit have been applied.
		 */
		rc = UNQLITE_LOCKED;
	}
	return rc;
}

// Assembly:
testb $0x2, 0x20(%rsi)
jne 0x33f80
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x188(%rdi), %rax
testq %rax, %rax
je 0x33f6c
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x33f6c
callq *%rax
andq $0x0, 0x8(%rbx)
movq (%r14), %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x27bf8
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBitvecSet
UNQLITE_PRIVATE int unqliteBitvecSet(Bitvec *p,pgno i)
{
	bitvec_rec *pRec;
	sxi32 iBuck;
	/* Allocate a new instance */
	pRec = (bitvec_rec *)SyMemBackendPoolAlloc(p->pAlloc,sizeof(bitvec_rec));
	if( pRec == 0 ){
		return UNQLITE_NOMEM;
	}
	/* Zero the structure */
	SyZero(pRec,sizeof(bitvec_rec));
	/* Fill-in */
	pRec->iPage = i;
	iBuck = i & (p->nSize - 1);
	pRec->pNextCol = p->apRec[iBuck];
	p->apRec[iBuck] = pRec;
	pRec->pNext = p->pList;
	p->pList = pRec;
	p->nRec++;
	if( p->nRec >= (p->nSize * 3) && p->nRec < 100000 ){
		/* Grow the hashtable */
		sxu32 nNewSize = p->nSize << 1;
		bitvec_rec *pEntry,**apNew;
		sxu32 n;
		apNew = (bitvec_rec **)SyMemBackendAlloc(p->pAlloc, nNewSize * sizeof(bitvec_rec *));
		if( apNew ){
			sxu32 iBucket;
			/* Zero the new table */
			SyZero((void *)apNew, nNewSize * sizeof(bitvec_rec *));
			/* Rehash all entries */
			n = 0;
			pEntry = p->pList;
			for(;;){
				/* Loop one */
				if( n >= p->nRec ){
					break;
				}
				pEntry->pNextCol = 0;
				/* Install in the new bucket */
				iBucket = pEntry->iPage & (nNewSize - 1);
				pEntry->pNextCol = apNew[iBucket];
				apNew[iBucket] = pEntry;
				/* Point to the next entry */
				pEntry = pEntry->pNext;
				n++;
			}
			/* Release the old table and reflect the change */
			SyMemBackendFree(p->pAlloc,(void *)p->apRec);
			p->apRec = apNew;
			p->nSize  = nNewSize;
		}
	}
	return UNQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
pushq $0x18
popq %rsi
callq 0x279f7
testq %rax, %rax
je 0x340cb
movq %rax, %r15
pushq $0x18
popq %rsi
movq %rax, %rdi
callq 0x27aea
movq %r14, (%r15)
movl 0xc(%rbx), %r12d
leal -0x1(%r12), %eax
andl %eax, %r14d
movq 0x10(%rbx), %rax
movslq %r14d, %rcx
movq (%rax,%rcx,8), %rdx
movq %rdx, 0x10(%r15)
movq %r15, (%rax,%rcx,8)
movq 0x18(%rbx), %rax
movq %rax, 0x8(%r15)
movq %r15, 0x18(%rbx)
movl 0x8(%rbx), %eax
incl %eax
movl %eax, 0x8(%rbx)
leal (%r12,%r12,2), %ecx
cmpl %ecx, %eax
setb %cl
cmpl $0x186a0, %eax          # imm = 0x186A0
setae %al
orb %cl, %al
jne 0x340cb
movq (%rbx), %rdi
movl %r12d, %r15d
shll $0x4, %r15d
movl %r15d, %esi
callq 0x2ca19
testq %rax, %rax
je 0x340cb
movq %rax, %r14
leaq 0x18(%rbx), %r13
addl %r12d, %r12d
movq %rax, %rdi
movl %r15d, %esi
callq 0x27aea
movl 0x8(%rbx), %eax
leal -0x1(%r12), %ecx
subl $0x1, %eax
jb 0x340b7
movq (%r13), %r13
andq $0x0, 0x10(%r13)
movl (%r13), %edx
andl %ecx, %edx
movq (%r14,%rdx,8), %rsi
movq %rsi, 0x10(%r13)
movq %r13, (%r14,%rdx,8)
addq $0x8, %r13
jmp 0x34091
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
callq 0x2d420
movq %r14, 0x10(%rbx)
movl %r12d, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_page_to_dirty_list
static void pager_page_to_dirty_list(Pager *pPager,Page *pPage)
{
	if( pPage->flags & PAGE_DIRTY ){
		/* Already set */
		return;
	}
	/* Mark the page as dirty */
	pPage->flags |= PAGE_DIRTY|PAGE_NEED_SYNC|PAGE_IN_JOURNAL;
	/* Link to the list */
	pPage->pDirtyPrev = 0;
	pPage->pDirtyNext = pPager->pDirty;
	if( pPager->pDirty ){
		pPager->pDirty->pDirtyPrev = pPage;
	}
	pPager->pDirty = pPage;
	if( pPager->pFirstDirty == 0 ){
		pPager->pFirstDirty = pPage;
	}
}

// Assembly:
movl 0x20(%rsi), %eax
testb $0x2, %al
jne 0x3411d
pushq %rbp
movq %rsp, %rbp
orl $0x26, %eax
movl %eax, 0x20(%rsi)
andq $0x0, 0x40(%rsi)
movq 0x220(%rdi), %rax
movq %rax, 0x38(%rsi)
testq %rax, %rax
je 0x34104
movq %rsi, 0x40(%rax)
movq %rsi, 0x220(%rdi)
cmpq $0x0, 0x218(%rdi)
jne 0x3411c
movq %rsi, 0x218(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: SyBlobNullAppend
JX9_PRIVATE sxi32 SyBlobNullAppend(SyBlob *pBlob)
{
	sxi32 rc;
	sxu32 n;
	n = pBlob->nByte;
	rc = SyBlobAppend(&(*pBlob), (const void *)"\0", sizeof(char));
	if (rc == SXRET_OK ){
		pBlob->nByte = n;
	}
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %r14d
leaq 0x2ea6c(%rip), %rsi     # 0x62bb4
pushq $0x1
popq %rdx
callq 0x2e250
testl %eax, %eax
jne 0x34158
movl %r14d, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBitvecDestroy
UNQLITE_PRIVATE void unqliteBitvecDestroy(Bitvec *p)
{
	bitvec_rec *pNext,*pRec = p->pList;
	SyMemBackend *pAlloc = p->pAlloc;
	
	for(;;){
		if( p->nRec < 1 ){
			break;
		}
		pNext = pRec->pNext;
		SyMemBackendPoolFree(pAlloc,(void *)pRec);
		pRec = pNext;
		p->nRec--;

		if( p->nRec < 1 ){
			break;
		}
		pNext = pRec->pNext;
		SyMemBackendPoolFree(pAlloc,(void *)pRec);
		pRec = pNext;
		p->nRec--;


		if( p->nRec < 1 ){
			break;
		}
		pNext = pRec->pNext;
		SyMemBackendPoolFree(pAlloc,(void *)pRec);
		pRec = pNext;
		p->nRec--;


		if( p->nRec < 1 ){
			break;
		}
		pNext = pRec->pNext;
		SyMemBackendPoolFree(pAlloc,(void *)pRec);
		pRec = pNext;
		p->nRec--;
	}
	SyMemBackendFree(pAlloc,(void *)p->apRec);
	SyMemBackendFree(pAlloc,p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %r15
movq (%rdi), %r14
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x341d0
movq 0x8(%r15), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x27bf8
decl 0x8(%rbx)
je 0x341d0
movq 0x8(%r12), %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x27bf8
decl 0x8(%rbx)
je 0x341d0
movq 0x8(%r15), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x27bf8
decl 0x8(%rbx)
je 0x341d0
movq 0x8(%r12), %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x27bf8
movl 0x8(%rbx), %eax
decl %eax
movl %eax, 0x8(%rbx)
jmp 0x34175
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x2d420
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2d420
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_collection_exists
static int unqliteBuiltin_collection_exists(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	/* Extract collection name */
	if( argc < 1 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Perform the lookup */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	/* Lookup result */
	jx9_result_bool(pCtx,pCol ? 1 : 0);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x342a4
movq (%rdx), %rdi
leaq -0x14(%rbp), %r14
movq %r14, %rsi
callq 0x297ed
movl (%r14), %ecx
testl %ecx, %ecx
jle 0x342ad
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
xorl %esi, %esi
testq %rax, %rax
setne %sil
movq %rbx, %rdi
jmp 0x342c4
leaq 0x2fc99(%rip), %rdx     # 0x63f44
jmp 0x342b4
leaq 0x2fca8(%rip), %rdx     # 0x63f5c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_collection_create
static int unqliteBuiltin_collection_create(jx9_context *pCtx,int argc,jx9_value **argv)
{
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	int rc;
	/* Extract collection name */
	if( argc < 1 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Try to create the collection */
	rc = unqliteCreateCollection(pVm,&sName);
	/* Return the result to the caller */
	jx9_result_bool(pCtx,rc == UNQLITE_OK ? 1 : 0);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x34346
movq (%rdx), %rdi
leaq -0x24(%rbp), %r14
movq %r14, %rsi
callq 0x297ed
movl (%r14), %r14d
testl %r14d, %r14d
jle 0x3434f
movq %rax, %r15
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movl %r14d, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %r12
movq %r12, %rdi
callq 0x350f6
xorl %esi, %esi
testq %rax, %rax
jne 0x34341
pushq $0x1
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x351a1
xorl %esi, %esi
testl %eax, %eax
sete %sil
movq %rbx, %rdi
jmp 0x34366
leaq 0x2fbf7(%rip), %rdx     # 0x63f44
jmp 0x34356
leaq 0x2fc06(%rip), %rdx     # 0x63f5c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_fetch_next
static int unqliteBuiltin_db_fetch_next(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	int rc;
	/* Extract collection name */
	if( argc < 1 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name");
		/* Return null */
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return null */
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol ){
		/* Fetch the current record */
		jx9_value *pValue;
		pValue = jx9_context_new_scalar(pCtx);
		if( pValue == 0 ){
			jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Jx9 is running out of memory");
			jx9_result_null(pCtx);
			return JX9_OK;
		}else{
			rc = unqliteCollectionFetchNextRecord(pCol,pValue);
			if( rc == UNQLITE_OK ){
				jx9_result_value(pCtx,pValue);
				/* pValue will be automatically released as soon we return from this function */
			}else{
				/* Return null */
				jx9_result_null(pCtx);
			}
		}
	}else{
		/* No such collection, return null */
		jx9_result_null(pCtx);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x343ee
movq (%rdx), %rdi
leaq -0x1c(%rbp), %r14
movq %r14, %rsi
callq 0x297ed
movl (%r14), %ecx
testl %ecx, %ecx
jle 0x343f7
leaq -0x30(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x34412
movq %rax, %r15
movq %rbx, %rdi
callq 0x2a26a
testq %rax, %rax
je 0x34400
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x37e33
testl %eax, %eax
jne 0x34412
movq %rbx, %rdi
movq %r14, %rsi
callq 0x299d3
jmp 0x3441a
leaq 0x2fb4f(%rip), %rdx     # 0x63f44
jmp 0x34407
leaq 0x2fb5e(%rip), %rdx     # 0x63f5c
jmp 0x34407
leaq 0x2fc94(%rip), %rdx     # 0x6409b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
callq 0x298e8
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_fetch_by_id
static int unqliteBuiltin_db_fetch_by_id(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	jx9_int64 nId;
	int nByte;
	int rc;
	/* Extract collection name */
	if( argc < 2 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name and/or record ID");
		/* Return NULL */
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return NULL */
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	/* Extract the record ID */
	nId = jx9_value_to_int(argv[1]);
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol ){
		/* Fetch the desired record */
		jx9_value *pValue;
		pValue = jx9_context_new_scalar(pCtx);
		if( pValue == 0 ){
			jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Jx9 is running out of memory");
			jx9_result_null(pCtx);
			return JX9_OK;
		}else{
			rc = unqliteCollectionFetchRecordById(pCol,nId,pValue);
			if( rc == UNQLITE_OK ){
				jx9_result_value(pCtx,pValue);
				/* pValue will be automatically released as soon we return from this function */
			}else{
				/* No such record, return null */
				jx9_result_null(pCtx);
			}
		}
	}else{
		/* No such collection, return null */
		jx9_result_null(pCtx);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jg 0x3444a
leaq 0x2fc8d(%rip), %rdx     # 0x640d2
jmp 0x344d2
movq %rdx, %r14
movq (%rdx), %rdi
leaq -0x24(%rbp), %r12
movq %r12, %rsi
callq 0x297ed
cmpl $0x0, (%r12)
jle 0x344c2
movq %rax, %r15
movq 0x8(%r14), %rdi
callq 0x29772
movl %eax, %r14d
leaq -0x38(%rbp), %rsi
movq %r15, (%rsi)
movl -0x24(%rbp), %eax
movl %eax, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x344dd
movq %rax, %r12
movq %rbx, %rdi
callq 0x2a26a
testq %rax, %rax
je 0x344cb
movq %rax, %r15
movslq %r14d, %rsi
movq %r12, %rdi
movq %rax, %rdx
callq 0x37e83
testl %eax, %eax
jne 0x344dd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x299d3
jmp 0x344e5
leaq 0x2fa93(%rip), %rdx     # 0x63f5c
jmp 0x344d2
leaq 0x2fbc9(%rip), %rdx     # 0x6409b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
callq 0x298e8
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_last_record_id
static int unqliteBuiltin_db_last_record_id(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	/* Extract collection name */
	if( argc < 1 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol ){
		jx9_result_int64(pCtx,unqliteCollectionLastRecordId(pCol));
	}else{
		/* No such collection, return FALSE */
		jx9_result_bool(pCtx,0);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x346db
movq (%rdx), %rdi
leaq -0x14(%rbp), %r14
movq %r14, %rsi
callq 0x297ed
movl (%r14), %ecx
testl %ecx, %ecx
jle 0x346e4
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x346f6
movq 0xa8(%rax), %rax
xorl %esi, %esi
subq $0x1, %rax
cmovaeq %rax, %rsi
movq %rbx, %rdi
callq 0x29897
jmp 0x34700
leaq 0x2f862(%rip), %rdx     # 0x63f44
jmp 0x346eb
leaq 0x2f871(%rip), %rdx     # 0x63f5c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_total_records
static int unqliteBuiltin_db_total_records(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	/* Extract collection name */
	if( argc < 1 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol ){
		unqlite_int64 nRec;
		nRec = unqliteCollectionTotalRecords(pCol);
		jx9_result_int64(pCtx,nRec);
	}else{
		/* No such collection */
		jx9_result_bool(pCtx,0);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x34866
movq (%rdx), %rdi
leaq -0x14(%rbp), %r14
movq %r14, %rsi
callq 0x297ed
movl (%r14), %ecx
testl %ecx, %ecx
jle 0x3486f
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x34881
movq 0xb8(%rax), %rsi
movq %rbx, %rdi
callq 0x29897
jmp 0x3488b
leaq 0x2f6d7(%rip), %rdx     # 0x63f44
jmp 0x34876
leaq 0x2f6e6(%rip), %rdx     # 0x63f5c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_creation_date
static int unqliteBuiltin_db_creation_date(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	/* Extract collection name */
	if( argc < 1 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol ){
		Sytm *pTm = &pCol->sCreation;
		jx9_result_string_format(pCtx,"%d-%d-%d %02d:%02d:%02d",
			pTm->tm_year,pTm->tm_mon,pTm->tm_mday,
			pTm->tm_hour,pTm->tm_min,pTm->tm_sec
			);
	}else{
		/* No such collection */
		jx9_result_bool(pCtx,0);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x3491a
movq (%rdx), %rdi
leaq -0x14(%rbp), %r14
movq %r14, %rsi
callq 0x297ed
movl (%r14), %ecx
testl %ecx, %ecx
jle 0x34923
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x34935
movl 0xf4(%rax), %edx
movl 0xf0(%rax), %ecx
movl 0xec(%rax), %r8d
movl 0xe8(%rax), %r9d
movl 0xe0(%rax), %r10d
movl 0xe4(%rax), %r11d
leaq 0x2fc81(%rip), %rsi     # 0x64589
movq %rbx, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x3bdad
popq %rax
popq %rcx
jmp 0x3493f
leaq 0x2f623(%rip), %rdx     # 0x63f44
jmp 0x3492a
leaq 0x2f632(%rip), %rdx     # 0x63f5c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_store
static int unqliteBuiltin_db_store(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	int rc;
	int i;
	/* Extract collection name */
	if( argc < 2 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name and/or records");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol == 0 ){
		jx9_context_throw_error_format(pCtx,JX9_CTX_ERR,"No such collection '%z'",&sName);
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	/* Store the given values */
	for( i = 1 ; i < argc ; ++i ){
		rc = unqliteCollectionPut(pCol,argv[i],0);
		if( rc != UNQLITE_OK){
			jx9_context_throw_error_format(pCtx,JX9_CTX_ERR,
				"Error while storing record %d in collection '%z'",i,&sName
				);
			/* Return false */
			jx9_result_bool(pCtx,0);
			return JX9_OK;
		}
	}
	/* All done, return TRUE */
	jx9_result_bool(pCtx,1);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jg 0x3496f
leaq 0x2fc37(%rip), %rdx     # 0x645a1
jmp 0x349f5
movq %rdx, %r14
movl %esi, %r15d
movq (%rdx), %rdi
leaq -0x2c(%rbp), %r12
movq %r12, %rsi
callq 0x297ed
movl (%r12), %ecx
testl %ecx, %ecx
jle 0x349ee
leaq -0x40(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x34a1b
movq %rax, %r12
movl %r15d, %r13d
pushq $0x1
popq %r15
cmpq %r15, %r13
je 0x34a35
movq (%r14,%r15,8), %rsi
testb $0x40, 0x8(%rsi)
je 0x349dd
movq (%rsi), %rax
testb $0x1, 0x40(%rax)
jne 0x349dd
movq %rsi, %rdi
leaq 0x7529(%rip), %rsi      # 0x3befc
movq %r12, %rdx
callq 0x29c1e
jmp 0x349e5
movq %r12, %rdi
callq 0x3bf06
testl %eax, %eax
jne 0x34a3d
incq %r15
jmp 0x349b1
leaq 0x2f567(%rip), %rdx     # 0x63f5c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2fba6(%rip), %rdx     # 0x645c8
pushq $0x1
popq %rsi
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3be68
jmp 0x34a00
pushq $0x1
popq %rsi
movq %rbx, %rdi
jmp 0x34a05
leaq 0x2fb9c(%rip), %rdx     # 0x645e0
pushq $0x1
popq %rsi
leaq -0x40(%rbp), %r8
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3be68
jmp 0x34a00
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_drop_record
static int unqliteBuiltin_db_drop_record(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	jx9_int64 nId;
	int nByte;
	int rc;
	/* Extract collection name */
	if( argc < 2 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name and/or records");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol == 0 ){
		jx9_context_throw_error_format(pCtx,JX9_CTX_ERR,"No such collection '%z'",&sName);
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	/* Extract the record ID */
	nId = jx9_value_to_int64(argv[1]);
	/* Drop the record */
	rc = unqliteCollectionDropRecord(pCol,nId,1,1);
	/* Processing result */
	jx9_result_bool(pCtx,rc == UNQLITE_OK);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jg 0x34cec
leaq 0x2f8b7(%rip), %rdx     # 0x645a1
jmp 0x34d50
movq %rdx, %r14
movq (%rdx), %rdi
leaq -0x1c(%rbp), %r15
movq %r15, %rsi
callq 0x297ed
movl (%r15), %ecx
testl %ecx, %ecx
jle 0x34d49
leaq -0x30(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x34d72
movq %rax, %r15
movq 0x8(%r14), %rdi
callq 0x297ae
pushq $0x1
popq %rcx
movq %r15, %rdi
movq %rax, %rsi
movl %ecx, %edx
callq 0x3c116
xorl %esi, %esi
testl %eax, %eax
sete %sil
movq %rbx, %rdi
jmp 0x34d60
leaq 0x2f20c(%rip), %rdx     # 0x63f5c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f84f(%rip), %rdx     # 0x645c8
pushq $0x1
popq %rsi
leaq -0x30(%rbp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3be68
jmp 0x34d5b
// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteBuiltin_db_set_schema
static int unqliteBuiltin_db_set_schema(jx9_context *pCtx,int argc,jx9_value **argv)
{
	unqlite_col *pCol;
	const char *zName;
	unqlite_vm *pVm;
	SyString sName;
	int nByte;
	int rc;
	/* Extract collection name */
	if( argc < 2 ){
		/* Missing arguments */
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Missing collection name and/or db scheme");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	if( !jx9_value_is_json_object(argv[1]) ){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection scheme");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	zName = jx9_value_to_string(argv[0],&nByte);
	if( nByte < 1){
		jx9_context_throw_error(pCtx,JX9_CTX_ERR,"Invalid collection name");
		/* Return false */
		jx9_result_bool(pCtx,0);
		return JX9_OK;
	}
	SyStringInitFromBuf(&sName,zName,nByte);
	pVm = (unqlite_vm *)jx9_context_user_data(pCtx);
	/* Fetch the collection */
	rc = UNQLITE_NOOP;
	pCol = unqliteCollectionFetch(pVm,&sName,UNQLITE_VM_AUTO_LOAD);
	if( pCol ){
		/* Set the collection scheme */
		rc = unqliteCollectionSetSchema(pCol,argv[1]);
	}else{
		jx9_context_throw_error_format(pCtx,JX9_CTX_WARNING,
			"No such collection '%z'",
			&sName
			);
	}
	/* Processing result */
	jx9_result_bool(pCtx,rc == UNQLITE_OK);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jg 0x34daa
leaq 0x2f9bd(%rip), %rdx     # 0x64765
jmp 0x34dc7
movq %rdx, %r14
movq 0x8(%rdx), %rax
testb $0x40, 0x8(%rax)
je 0x34dc0
movq (%rax), %rax
testb $0x1, 0x40(%rax)
jne 0x34de9
leaq 0x2f9c7(%rip), %rdx     # 0x6478e
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x298b2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
leaq -0x1c(%rbp), %r15
movq %r15, %rsi
callq 0x297ed
movl (%r15), %ecx
testl %ecx, %ecx
jle 0x34e4c
leaq -0x30(%rbp), %rsi
movq %rax, (%rsi)
movl %ecx, 0x8(%rsi)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x350f6
testq %rax, %rax
je 0x34e58
movq 0x8(%r14), %r8
xorl %r14d, %r14d
testb $0x40, 0x8(%r8)
je 0x34e73
movq (%r8), %rcx
testb $0x1, 0x40(%rcx)
je 0x34e73
pushq $-0x1
popq %rcx
xorl %edi, %edi
movq %rax, %rsi
movq %rcx, %rdx
callq 0x357a9
xorl %r14d, %r14d
testl %eax, %eax
sete %r14b
jmp 0x34e73
leaq 0x2f109(%rip), %rdx     # 0x63f5c
jmp 0x34dc7
leaq 0x2f769(%rip), %rdx     # 0x645c8
xorl %r14d, %r14d
pushq $0x2
popq %rsi
leaq -0x30(%rbp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3be68
movq %rbx, %rdi
movl %r14d, %esi
jmp 0x34dd7