LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_fclose
static int jx9Builtin_fclose(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	const jx9_io_stream *pStream;
	io_private *pDev;
	jx9_vm *pVm;
	if( nArg < 1 || !jx9_value_is_resource(apArg[0]) ){
		/* Missing/Invalid arguments, return FALSE */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Expecting an IO handle");
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Extract our private data */
	pDev = (io_private *)jx9_value_to_resource(apArg[0]);
	/* Make sure we are dealing with a valid io_private instance */
	if( IO_PRIVATE_INVALID(pDev) ){
		/*Expecting an IO handle */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Expecting an IO handle");
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Point to the target IO stream device */
	pStream = pDev->pStream;
	if( pStream == 0 ){
		jx9_context_throw_error_format(pCtx, JX9_CTX_WARNING, 
			"IO routine(%s) not implemented in the underlying stream(%s) device, JX9 is returning FALSE", 
			jx9_function_name(pCtx), pStream ? pStream->zName : "null_stream"
			);
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Point to the VM that own this context */
	pVm = pCtx->pVm;
	/* TICKET 1433-62: Keep the STDIN/STDOUT/STDERR handles open */
	if( pDev != pVm->pStdin && pDev != pVm->pStdout && pDev != pVm->pStderr ){
		/* Perform the requested operation */
		jx9StreamCloseHandle(pStream, pDev->pHandle);
		/* Release the IO private structure */
		ReleaseIOPrivate(pCtx, pDev);
		/* Invalidate the resource handle */
		jx9_value_release(apArg[0]);
	}
	/* Return TRUE */
	jx9_result_bool(pCtx, 1);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
jle 0x63591
movq %rdx, %r14
movq (%rdx), %rax
testb $0x1, 0x9(%rax)
je 0x63591
movq (%rax), %r15
testq %r15, %r15
je 0x63591
cmpl $0xfeac14, 0x34(%r15)   # imm = 0xFEAC14
jne 0x63591
movq (%r15), %rax
testq %rax, %rax
je 0x635d8
movq 0x60(%rbx), %rcx
movl $0x1, %r12d
cmpq 0x4d0(%rcx), %r15
je 0x635b0
cmpq 0x4d8(%rcx), %r15
je 0x635b0
cmpq 0x4e0(%rcx), %r15
je 0x635b0
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x6356b
movq 0x8(%r15), %rdi
callq *%rax
leaq 0x10(%r15), %rdi
callq 0x317be
movl $0x2126, 0x34(%r15)     # imm = 0x2126
movq %rbx, %rdi
movq %r15, %rsi
callq 0x313b9
movq (%r14), %rdi
callq 0x30465
jmp 0x635b0
movq (%rbx), %rsi
movq 0x60(%rbx), %rdi
addq $0x8, %rsi
leaq 0x14129(%rip), %rcx     # 0x776cc
movl $0x2, %edx
callq 0x40afa
xorl %r12d, %r12d
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x30465
movq %r12, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x8, %eax
movl %eax, 0x8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rax
movq 0x8(%rax), %rcx
leaq 0x140fd(%rip), %rdx     # 0x776e3
leaq 0x14151(%rip), %r8      # 0x7773e
xorl %r12d, %r12d
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x44ed3
jmp 0x635b0
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_fpassthru
static int jx9Builtin_fpassthru(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	const jx9_io_stream *pStream;
	io_private *pDev;
	jx9_int64 n, nRead;
	char zBuf[8192];
	int rc;
	if( nArg < 1 || !jx9_value_is_resource(apArg[0]) ){
		/* Missing/Invalid arguments, return FALSE */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Expecting an IO handle");
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Extract our private data */
	pDev = (io_private *)jx9_value_to_resource(apArg[0]);
	/* Make sure we are dealing with a valid io_private instance */
	if( IO_PRIVATE_INVALID(pDev) ){
		/*Expecting an IO handle */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Expecting an IO handle");
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Point to the target IO stream device */
	pStream = pDev->pStream;
	if( pStream == 0  ){
		jx9_context_throw_error_format(pCtx, JX9_CTX_WARNING, 
			"IO routine(%s) not implemented in the underlying stream(%s) device, JX9 is returning FALSE", 
			jx9_function_name(pCtx), pStream ? pStream->zName : "null_stream"
			);
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Perform the requested operation */
	nRead = 0;
	for(;;){
		n = StreamRead(pDev, zBuf, sizeof(zBuf));
		if( n < 1 ){
			/* Error or EOF */
			break;
		}
		/* Increment the read counter */
		nRead += n;
		/* Output data */
		rc = jx9_context_output(pCtx, zBuf, (int)nRead /* FIXME: 64-bit issues */);
		if( rc == JX9_ABORT ){
			/* Consumer callback request an operation abort */
			break;
		}
	}
	/* Total number of bytes readen */
	jx9_result_int64(pCtx, nRead);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2000, %rsp           # imm = 0x2000
movq %rdi, %rbx
testl %esi, %esi
jle 0x63a57
movq (%rdx), %rax
testb $0x1, 0x9(%rax)
je 0x63a57
movq (%rax), %r14
testq %r14, %r14
je 0x63a57
cmpl $0xfeac14, 0x34(%r14)   # imm = 0xFEAC14
jne 0x63a57
cmpq $0x0, (%r14)
je 0x63aaa
xorl %r15d, %r15d
leaq -0x2020(%rbp), %r12
movl $0x2000, %edx           # imm = 0x2000
movq %r14, %rdi
movq %r12, %rsi
callq 0x64a10
testq %rax, %rax
jle 0x63a41
addq %rax, %r15
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x30e6e
cmpl $-0xa, %eax
jne 0x63a16
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x30465
movq %r15, (%rbx)
movl $0x2, %eax
jmp 0x63a8b
movq (%rbx), %rsi
movq 0x60(%rbx), %rdi
addq $0x8, %rsi
leaq 0x13c63(%rip), %rcx     # 0x776cc
movl $0x2, %edx
callq 0x40afa
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x30465
movq $0x0, (%rbx)
movl $0x8, %eax
movl $0xfffffe90, %ecx       # imm = 0xFFFFFE90
andl 0x8(%rbx), %ecx
orl %eax, %ecx
movl %ecx, 0x8(%rbx)
xorl %eax, %eax
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rax
movq 0x8(%rax), %rcx
leaq 0x13c2b(%rip), %rdx     # 0x776e3
leaq 0x13c7f(%rip), %r8      # 0x7773e
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x44ed3
jmp 0x63a73
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: StreamRead
static jx9_int64 StreamRead(io_private *pDev, void *pBuf, jx9_int64 nLen)
{
	const jx9_io_stream *pStream = pDev->pStream;
	char *zBuf = (char *)pBuf;
	jx9_int64 n, nRead;
	n = SyBlobLength(&pDev->sBuffer) - pDev->nOfft;
	if( n > 0 ){
		if( n > nLen ){
			n = nLen;
		}
		/* Copy the buffered data */
		SyMemcpy(SyBlobDataAt(&pDev->sBuffer, pDev->nOfft), pBuf, (sxu32)n);
		/* Update the read offset */
		pDev->nOfft += (sxu32)n;
		if( pDev->nOfft >= SyBlobLength(&pDev->sBuffer) ){
			/* Reset the working buffer so that we avoid excessive memory allocation */
			SyBlobReset(&pDev->sBuffer);
			pDev->nOfft = 0;
		}
		nLen -= n;
		if( nLen < 1 ){
			/* All done */
			return n;
		}
		/* Advance the cursor */
		zBuf += n;
	}
	/* Read without buffering */
	nRead = pStream->xRead(pDev->pHandle, zBuf, nLen);
	if( nRead > 0 ){
		n += nRead;
	}else if( n < 1 ){
		/* EOF or IO error */
		return nRead;
	}
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %r13
movl 0x20(%rdi), %ebx
movl 0x30(%rdi), %edi
cmpl %edi, %ebx
jne 0x64a38
xorl %ebx, %ebx
jmp 0x64aa0
subl %edi, %ebx
cmpq %r14, %rbx
cmovgeq %r14, %rbx
addq 0x18(%r12), %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x34893
movl 0x30(%r12), %eax
addl %ebx, %eax
movl %eax, 0x30(%r12)
cmpl 0x20(%r12), %eax
jb 0x64a98
movl $0x0, 0x20(%r12)
movl 0x28(%r12), %eax
testb $0x4, %al
je 0x64a8f
movq $0x0, 0x18(%r12)
movl $0x0, 0x24(%r12)
andl $-0x5, %eax
movl %eax, 0x28(%r12)
movl $0x0, 0x30(%r12)
subq %rbx, %r14
jle 0x64ac0
addq %rbx, %r15
movq 0x8(%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *0x30(%r13)
testq %rax, %rax
jle 0x64ab9
addq %rax, %rbx
jmp 0x64ac0
testq %rbx, %rbx
cmovleq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixDir_Read
static int UnixDir_Read(void *pUserData, jx9_context *pCtx)
{
	DIR *pDir = (DIR *)pUserData;
	struct dirent *pEntry;
	char *zName = 0; /* cc warning */
	sxu32 n = 0;
	for(;;){
		pEntry = readdir(pDir);
		if( pEntry == 0 ){
			/* No more entries to process */
			return -1;
		}
		zName = pEntry->d_name; 
		n = SyStrlen(zName);
		/* Ignore '.' && '..' */
		if( n > sizeof("..")-1 || zName[0] != '.' || ( n == sizeof("..")-1 && zName[1] != '.') ){
			break;
		}
		/* Next entry */
	}
	/* Return the current file name */
	jx9_result_string(pCtx, zName, (int)n);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0xc8a0
testq %rax, %rax
je 0x64f13
xorl %r15d, %r15d
leaq 0x13(%rax), %rsi
movb 0x13(%rax), %cl
testb %cl, %cl
je 0x64f1b
movq %rsi, %rdi
cmpb $0x0, 0x1(%rdi)
je 0x64ee0
cmpb $0x0, 0x2(%rdi)
je 0x64ee5
cmpb $0x0, 0x3(%rdi)
je 0x64eeb
leaq 0x4(%rdi), %rdx
cmpb $0x0, 0x4(%rdi)
movq %rdx, %rdi
jne 0x64ebf
jmp 0x64ef2
incq %rdi
jmp 0x64eef
addq $0x2, %rdi
jmp 0x64eef
addq $0x3, %rdi
movq %rdi, %rdx
subl %esi, %edx
cmpb $0x2e, %cl
jne 0x64f24
cmpl $0x2, %edx
ja 0x64f24
jne 0x64f06
cmpb $0x2e, 0x14(%rax)
jne 0x64f1f
movq %r14, %rdi
callq 0xc8a0
testq %rax, %rax
jne 0x64eb1
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x64f2d
xorl %edx, %edx
jmp 0x64f24
movl $0x2, %edx
movq 0x8(%rbx), %rdi
callq 0x302f6
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixFile_Write
static jx9_int64 UnixFile_Write(void *pUserData, const void *pBuffer, jx9_int64 nWrite)
{
	const char *zData = (const char *)pBuffer;
	int fd = SX_PTR_TO_INT(pUserData);
	jx9_int64 nCount;
	ssize_t nWr;
	nCount = 0;
	for(;;){
		if( nWrite < 1 ){
			break;
		}
		nWr = write(fd, zData, (size_t)nWrite);
		if( nWr < 1 ){
			/* IO error */
			break;
		}
		nWrite -= nWr;
		nCount += nWr;
		zData += nWr;
	}
	if( nWrite > 0 ){
		return -1;
	}
	return nCount;
}

// Assembly:
testq %rdx, %rdx
jle 0x64f8c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xcb50
testq %rax, %rax
jle 0x64f75
addq %rax, %r12
addq %rax, %r14
subq %rax, %rbx
jg 0x64f57
testq %rbx, %rbx
movq $-0x1, %rax
cmovleq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: SyHashDeleteEntry
JX9_PRIVATE sxi32 SyHashDeleteEntry(SyHash *pHash, const void *pKey, sxu32 nKeyLen, void **ppUserData)
{
	SyHashEntry_Pr *pEntry;
	sxi32 rc;
#if defined(UNTRUST)
	if( INVALID_HASH(pHash) ){
		return SXERR_CORRUPT;
	}
#endif
	pEntry = HashGetEntry(&(*pHash), pKey, nKeyLen);
	if( pEntry == 0 ){
		return SXERR_NOTFOUND;
	}
	rc = HashDeleteEntry(&(*pHash), pEntry, ppUserData);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdi, %r14
callq 0x448fa
testq %rax, %rax
je 0x652e9
movq 0x38(%rax), %rcx
movq 0x40(%rax), %rdx
testq %rdx, %rdx
je 0x652f3
addq $0x38, %rdx
jmp 0x65304
movl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
popq %rbx
popq %r14
popq %rbp
retq
movl 0x38(%r14), %edx
decl %edx
andl 0x18(%rax), %edx
shlq $0x3, %rdx
addq 0x30(%r14), %rdx
movq %rcx, (%rdx)
testq %rcx, %rcx
je 0x65314
movq 0x40(%rax), %rdx
movq %rdx, 0x40(%rcx)
movq 0x18(%r14), %rcx
cmpq %rax, %rcx
jne 0x65325
movq 0x28(%rcx), %rcx
movq %rcx, 0x18(%r14)
movq 0x28(%rax), %rcx
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0x65336
movq %rcx, 0x28(%rdx)
testq %rcx, %rcx
je 0x6533f
movq %rdx, 0x30(%rcx)
decl 0x28(%r14)
testq %rbx, %rbx
je 0x6534f
movq 0x10(%rax), %rcx
movq %rcx, (%rbx)
movq (%r14), %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x2e659
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_getcwd
static int UnixVfs_getcwd(jx9_context *pCtx)
{
	char zBuf[4096];
	char *zDir;
	/* Get the current directory */
	zDir = getcwd(zBuf, sizeof(zBuf));
	if( zDir == 0 ){
	  return -1;
    }
	jx9_result_string(pCtx, zDir, -1/*Compute length automatically*/);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdi, %rbx
leaq -0x1010(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0xc410
testq %rax, %rax
je 0x653be
movq 0x8(%rbx), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x302f6
xorl %eax, %eax
jmp 0x653c3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_Realpath
static int UnixVfs_Realpath(const char *zPath, jx9_context *pCtx)
{
#ifndef JX9_UNIX_OLD_LIBC
	char *zReal;
	zReal = realpath(zPath, 0);
	if( zReal == 0 ){
	  return -1;
	}
	jx9_result_string(pCtx, zReal, -1/*Compute length automatically*/);
        /* Release the allocated buffer */
	free(zReal);
	return JX9_OK;
#else
    zPath = 0; /* cc warning */
    pCtx = 0;
    return -1;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xc6b0
testq %rax, %rax
je 0x6547e
movq %rax, %r15
movq 0x8(%r14), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x302f6
movq %r15, %rdi
callq 0xc250
jmp 0x65483
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_Chown
static int UnixVfs_Chown(const char *zPath, const char *zUser)
{
#ifndef JX9_UNIX_STATIC_BUILD
  struct passwd *pwd;
  uid_t uid;
  int rc;
  pwd = getpwnam(zUser);   /* Try getting UID for username */
  if (pwd == 0) {
    return -1;
  }
  uid = pwd->pw_uid;
  rc = chown(zPath, uid, -1);
  return rc == 0 ? JX9_OK : -1;
#else
	SXUNUSED(zPath);
	SXUNUSED(zUser);
	return -1;
#endif /* JX9_UNIX_STATIC_BUILD */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xc7e0
testq %rax, %rax
je 0x6550f
movl 0x10(%rax), %esi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xc540
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x65514
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_Chgrp
static int UnixVfs_Chgrp(const char *zPath, const char *zGroup)
{
#ifndef JX9_UNIX_STATIC_BUILD
  struct group *group;
  gid_t gid;
  int rc;
  group = getgrnam(zGroup);
  if (group == 0) {
    return -1;
  }
  gid = group->gr_gid;
  rc = chown(zPath, -1, gid);
  return rc == 0 ? JX9_OK : -1;
#else
	SXUNUSED(zPath);
	SXUNUSED(zGroup);
	return -1;
#endif /* JX9_UNIX_STATIC_BUILD */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xc6c0
testq %rax, %rax
je 0x6554b
movl 0x10(%rax), %edx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xc540
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x65550
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_Filetype
static int UnixVfs_Filetype(const char *zPath, jx9_context *pCtx)
{
	struct stat st;
	int rc;
    rc = stat(zPath, &st);
	if( rc != 0 ){
	  /* Expand 'unknown' */
	  jx9_result_string(pCtx, "unknown", sizeof("unknown")-1);
	  return -1;
	}
	if(S_ISREG(st.st_mode) ){
		jx9_result_string(pCtx, "file", sizeof("file")-1);
	}else if(S_ISDIR(st.st_mode)){
		jx9_result_string(pCtx, "dir", sizeof("dir")-1);
	}else if(S_ISLNK(st.st_mode)){
		jx9_result_string(pCtx, "link", sizeof("link")-1);
	}else if(S_ISBLK(st.st_mode)){
		jx9_result_string(pCtx, "block", sizeof("block")-1);
    }else if(S_ISSOCK(st.st_mode)){
		jx9_result_string(pCtx, "socket", sizeof("socket")-1);
	}else if(S_ISFIFO(st.st_mode)){
       jx9_result_string(pCtx, "fifo", sizeof("fifo")-1);
	}else{
		jx9_result_string(pCtx, "unknown", sizeof("unknown")-1);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
leaq -0x98(%rbp), %rsi
callq 0xc110
testl %eax, %eax
je 0x65c79
movq 0x8(%rbx), %rdi
leaq 0x1197a(%rip), %rsi     # 0x775df
movl $0x7, %edx
callq 0x302f6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x65cff
movl $0xf000, %eax           # imm = 0xF000
andl -0x80(%rbp), %eax
addl $0xfffff000, %eax       # imm = 0xFFFFF000
shrl $0xc, %eax
movq 0x8(%rbx), %rdi
cmpl $0xb, %eax
ja 0x65cc7
leaq 0xcf07(%rip), %rcx      # 0x72ba0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x11cb6(%rip), %rsi     # 0x7795f
jmp 0x65cf3
leaq 0x11ca0(%rip), %rsi     # 0x77952
movl $0x5, %edx
jmp 0x65cf8
leaq 0x11c98(%rip), %rsi     # 0x77958
movl $0x6, %edx
jmp 0x65cf8
leaq 0x11911(%rip), %rsi     # 0x775df
movl $0x7, %edx
jmp 0x65cf8
leaq 0x11685(%rip), %rsi     # 0x77361
movl $0x3, %edx
jmp 0x65cf8
leaq 0xdf63(%rip), %rsi      # 0x73c4d
jmp 0x65cf3
leaq 0x115fe(%rip), %rsi     # 0x772f1
movl $0x4, %edx
callq 0x302f6
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_Getenv
static int UnixVfs_Getenv(const char *zVar, jx9_context *pCtx)
{
	char *zEnv;
	zEnv = getenv(zVar);
	if( zEnv == 0 ){
	  return -1;
	}
	jx9_result_string(pCtx, zEnv, -1/*Compute length automatically*/);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0xc850
testq %rax, %rax
je 0x65d31
movq 0x8(%rbx), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x302f6
xorl %eax, %eax
jmp 0x65d36
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_Mmap
static int UnixVfs_Mmap(const char *zPath, void **ppMap, jx9_int64 *pSize)
{
	struct stat st;
	void *pMap;
	int fd;
	int rc;
	/* Open the file in a read-only mode */
	fd = open(zPath, O_RDONLY);
	if( fd < 0 ){
		return -1;
	}
	/* stat the handle */
	fstat(fd, &st);
	/* Obtain a memory view of the whole file */
	pMap = mmap(0, st.st_size, PROT_READ, MAP_PRIVATE|MAP_FILE, fd, 0);
	rc = JX9_OK;
	if( pMap == MAP_FAILED ){
		rc = -1;
	}else{
		/* Point to the memory view */
		*ppMap = pMap;
		*pSize = (jx9_int64)st.st_size;
	}
	close(fd);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbx
movq %rsi, %r14
xorl %esi, %esi
xorl %eax, %eax
callq 0xc510
testl %eax, %eax
js 0x65de9
movl %eax, %r15d
leaq -0xb8(%rbp), %r12
movl %eax, %edi
movq %r12, %rsi
callq 0xc9b0
movq 0x30(%r12), %r13
xorl %r12d, %r12d
xorl %edi, %edi
movq %r13, %rsi
movl $0x1, %edx
movl $0x2, %ecx
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0xca70
cmpq $-0x1, %rax
je 0x65df1
movq %rax, (%r14)
movq %r13, (%rbx)
jmp 0x65df7
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x65dff
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r15d, %edi
callq 0xc2b0
movl %r12d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_link
static int UnixVfs_link(const char *zSrc, const char *zTarget, int is_sym)
{
	int rc;
	if( is_sym ){
		/* Symbolic link */
		rc = symlink(zSrc, zTarget);
	}else{
		/* Hard link */
		rc = link(zSrc, zTarget);
	}
	return rc == 0 ? JX9_OK : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %edx, %edx
je 0x65e2d
callq 0xc0b0
jmp 0x65e32
callq 0xc9f0
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_TempDir
static void UnixVfs_TempDir(jx9_context *pCtx)
{
	static const char *azDirs[] = {
     "/var/tmp", 
     "/usr/tmp", 
	 "/usr/local/tmp"
  };
  unsigned int i;
  struct stat buf;
  const char *zDir;
  zDir = getenv("TMPDIR");
  if( zDir && zDir[0] != 0 && !access(zDir, 07) ){
	  jx9_result_string(pCtx, zDir, -1);
	  return;
  }
  for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
	zDir=azDirs[i];
    if( zDir==0 ) continue;
    if( stat(zDir, &buf) ) continue;
    if( !S_ISDIR(buf.st_mode) ) continue;
    if( access(zDir, 07) ) continue;
    /* Got one */
	jx9_result_string(pCtx, zDir, -1);
	return;
  }
  /* Default temp dir */
  jx9_result_string(pCtx, "/tmp", (int)sizeof("/tmp")-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x11b21(%rip), %rdi     # 0x77985
callq 0xc850
testq %rax, %rax
je 0x65e87
movq %rax, %r14
cmpb $0x0, (%rax)
je 0x65e87
movq %r14, %rdi
movl $0x7, %esi
callq 0xc150
testl %eax, %eax
je 0x65ef4
movq %rbx, -0x30(%rbp)
xorl %r12d, %r12d
leaq 0x2da2b(%rip), %r13     # 0x938c0
leaq -0xc0(%rbp), %r14
movl $0xf000, %ebx           # imm = 0xF000
movq (%r12,%r13), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xc110
testl %eax, %eax
jne 0x65ed4
movl -0xa8(%rbp), %eax
andl %ebx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x65ed4
movq %r15, %rdi
movl $0x7, %esi
callq 0xc150
testl %eax, %eax
je 0x65efd
addq $0x8, %r12
cmpq $0x18, %r12
jne 0x65ea1
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x11a93(%rip), %rsi     # 0x77980
movl $0x4, %edx
jmp 0x65f0d
movq 0x8(%rbx), %rdi
movq %r14, %rsi
jmp 0x65f08
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x302f6
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: UnixVfs_Username
static void UnixVfs_Username(jx9_context *pCtx)
{
#ifndef JX9_UNIX_STATIC_BUILD
  struct passwd *pwd;
  uid_t uid;
  uid = getuid();
  pwd = getpwuid(uid);   /* Try getting UID for username */
  if (pwd == 0) {
    return;
  }
  /* Return the username */
  jx9_result_string(pCtx, pwd->pw_name, -1);
#else
  jx9_result_string(pCtx, "Unknown", -1);
#endif /* JX9_UNIX_STATIC_BUILD */
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xc3a0
movl %eax, %edi
callq 0xc270
testq %rax, %rax
je 0x65f72
movq (%rax), %rsi
movq 0x8(%rbx), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x302f6
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_create_header
static int pager_create_header(Pager *pPager)
{
	Page *pHeader;
	int rc;
	/* Allocate a new page */
	pHeader = pager_alloc_page(pPager,0);
	if( pHeader == 0 ){
		return UNQLITE_NOMEM;
	}
	pPager->pHeader = pHeader;
	/* Link the page */
	pager_link_page(pPager,pHeader);
	/* Add to the dirty list */
	pager_page_to_dirty_list(pPager,pHeader);
	/* Write the database header */
	rc = pager_write_db_header(pPager);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %esi, %esi
callq 0x3b1e4
testq %rax, %rax
je 0x6612a
movq %rax, %rbx
movq %rax, 0x1a0(%r14)
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b264
movl 0x20(%rbx), %eax
testb $0x2, %al
jne 0x6607d
orl $0x26, %eax
movl %eax, 0x20(%rbx)
movq $0x0, 0x40(%rbx)
movq 0x220(%r14), %rax
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x66065
movq %rbx, 0x40(%rax)
movq %rbx, 0x220(%r14)
cmpq $0x0, 0x218(%r14)
jne 0x6607d
movq %rbx, 0x218(%r14)
movq 0x10(%r14), %r15
movq 0x1a0(%r14), %rax
movq (%rax), %rbx
leaq 0xdc5b(%rip), %rdi      # 0x73ced
movq %rbx, %rsi
movl $0x7, %edx
callq 0x34893
movl $0x12277cdb, 0x7(%rbx)  # imm = 0x12277CDB
xorps %xmm0, %xmm0
movups %xmm0, 0x1a8(%r14)
movups %xmm0, 0x1b8(%r14)
movups %xmm0, 0x1c8(%r14)
movq $0x0, 0x1d8(%r14)
movq 0x28(%r14), %rdi
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x66134
leaq 0x1a8(%r14), %rsi
callq *%rax
movl 0x1bc(%r14), %edx
movl 0x1b8(%r14), %eax
movl 0x1b0(%r14), %esi
movl 0x1a8(%r14), %ecx
shll $0x9, %edx
shll $0x5, %eax
addl %edx, %eax
addl 0x1b4(%r14), %eax
movl 0x1ac(%r14), %edx
shll $0x10, %eax
shll $0xb, %esi
shll $0x5, %edx
addl %esi, %edx
sarl %ecx
addl %edx, %ecx
addl $0x88000000, %eax       # imm = 0x88000000
jmp 0x6613b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x661d8
xorl %ecx, %ecx
movl $0x88000000, %eax       # imm = 0x88000000
orl %ecx, %eax
rolw $0x8, %cx
movw %cx, 0xd(%rbx)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0xc(%rbx)
shrl $0x18, %eax
movb %al, 0xb(%rbx)
movl 0x20c(%r14), %eax
bswapl %eax
movl %eax, 0xf(%rbx)
movl 0x208(%r14), %eax
bswapl %eax
movl %eax, 0x13(%rbx)
movq (%r15), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
cmpb $0x0, (%rcx)
movq %rcx, %rax
je 0x661b0
leaq 0x2(%rcx), %rax
cmpb $0x0, -0x1(%rax)
je 0x661a8
cmpb $0x0, (%rax)
je 0x661b0
cmpb $0x0, 0x1(%rax)
je 0x661ad
leaq 0x4(%rax), %rdx
cmpb $0x0, 0x2(%rax)
movq %rdx, %rax
jne 0x66181
addq $-0x2, %rdx
movq %rdx, %rax
jmp 0x661b0
decq %rax
jmp 0x661b0
incq %rax
subq %rcx, %rax
movl %eax, %ecx
rolw $0x8, %cx
movw %cx, 0x17(%rbx)
addq $0x19, %rbx
movq (%r15), %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rdi
movzwl %ax, %edx
movq %rbx, %rsi
callq 0x34893
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: pager_write_dirty_pages
static int pager_write_dirty_pages(Pager *pPager,Page *pDirty)
{
	int rc = UNQLITE_OK;
	Page *pNext;
	for(;;){
		if( pDirty == 0 ){
			break;
		}
		/* Point to the next dirty page */
		pNext = pDirty->pDirtyPrev; /* Not a bug: Reverse link */
		if( (pDirty->flags & PAGE_DONT_WRITE) == 0 ){
			rc = unqliteOsWrite(pPager->pfd,pDirty->zData,pPager->iPageSize,pDirty->iPage * pPager->iPageSize);
			if( rc != UNQLITE_OK ){
				/* A rollback should be done */
				break;
			}
		}
		/* Remove stale flags */
		pDirty->flags &= ~(PAGE_DIRTY|PAGE_DONT_WRITE|PAGE_NEED_SYNC|PAGE_IN_JOURNAL|PAGE_HOT_DIRTY);
		if( pDirty->nRef < 1 ){
			/* Unlink the page now it is unused */
			pager_unlink_page(pPager,pDirty);
			/* Release the page */
			pager_release_page(pPager,pDirty);
		}
		/* Point to the next page */
		pDirty = pNext;
	}
	pPager->pDirty = pPager->pFirstDirty = 0;
	pPager->pHotDirty = pPager->pFirstHot = 0;
	pPager->nHot = 0;
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
testq %rsi, %rsi
je 0x6625d
movq %rsi, %r15
movq 0x40(%r15), %r12
movl 0x20(%r15), %eax
testb $0x8, %al
jne 0x6622c
movq 0x30(%rbx), %rdi
movq (%r15), %rsi
movslq 0x208(%rbx), %rdx
movq 0x10(%r15), %rcx
imulq %rdx, %rcx
movq (%rdi), %rax
callq *0x18(%rax)
testl %eax, %eax
jne 0x6625a
movl 0x20(%r15), %eax
andl $-0x6f, %eax
movl %eax, 0x20(%r15)
cmpl $0x0, 0x24(%r15)
jg 0x66250
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3bd82
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3bdf4
movq %r12, %r15
testq %r12, %r12
jne 0x661fc
jmp 0x6625d
movl %eax, %r14d
xorps %xmm0, %xmm0
movups %xmm0, 0x218(%rbx)
movups %xmm0, 0x230(%rbx)
movl $0x0, 0x240(%rbx)
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: page_merge_dirty
static Page * page_merge_dirty(Page *pA, Page *pB)
{
	Page result, *pTail;
    /* Prevent compiler warning */
	result.pDirtyNext = result.pDirtyPrev = 0;
	pTail = &result;
	while( pA && pB ){
		if( pA->iPage < pB->iPage ){
			pTail->pDirtyPrev = pA;
			pA->pDirtyNext = pTail;
			pTail = pA;
			pA = pA->pDirtyPrev;
		}else{
			pTail->pDirtyPrev = pB;
			pB->pDirtyNext = pTail;
			pTail = pB;
			pB = pB->pDirtyPrev;
		}
	}
	if( pA ){
		pTail->pDirtyPrev = pA;
		pA->pDirtyNext = pTail;
	}else if( pB ){
		pTail->pDirtyPrev = pB;
		pB->pDirtyNext = pTail;
	}else{
		pTail->pDirtyPrev = pTail->pDirtyNext = 0;
	}
	return result.pDirtyPrev;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
setne %dl
testq %rsi, %rsi
setne %cl
movl %edx, %eax
andb %cl, %al
xorps %xmm0, %xmm0
movups %xmm0, -0x30(%rbp)
cmpb $0x1, %al
jne 0x662f8
leaq -0x68(%rbp), %rax
movq %rsi, %r8
movq %rdi, %r9
movq 0x10(%r9), %rcx
cmpq 0x10(%r8), %rcx
jae 0x662cb
movq %r9, 0x40(%rax)
movq %rax, 0x38(%r9)
movq 0x40(%r9), %rdi
movq %r8, %rsi
movq %r9, %rax
jmp 0x662dd
movq %r8, 0x40(%rax)
movq %rax, 0x38(%r8)
movq 0x40(%r8), %rsi
movq %r9, %rdi
movq %r8, %rax
testq %rsi, %rsi
setne %cl
testq %rdi, %rdi
setne %dl
je 0x662fc
movq %rsi, %r8
movq %rdi, %r9
testq %rsi, %rsi
jne 0x662ad
jmp 0x662fc
leaq -0x68(%rbp), %rax
testb %dl, %dl
je 0x6630a
movq %rdi, 0x40(%rax)
movq %rax, 0x38(%rdi)
jmp 0x6631f
testb %cl, %cl
je 0x66318
movq %rsi, 0x40(%rax)
movq %rax, 0x38(%rsi)
jmp 0x6631f
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
movq -0x28(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: iobuf_resize
void iobuf_resize(struct iobuf *io, size_t new_size) {
  char *p;
  if ((new_size > io->size || (new_size < io->size && new_size >= io->len)) &&
      (p = (char *) NS_REALLOC(io->buf, new_size)) != NULL) {
    io->size = new_size;
    io->buf = p;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq %rsi, 0x10(%rdi)
jae 0x66354
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xc120
testq %rax, %rax
je 0x6635c
movq %r14, 0x10(%rbx)
movq %rax, (%rbx)
jmp 0x6635c
jbe 0x6635c
cmpq %r14, 0x8(%rbx)
jbe 0x6633b
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: iobuf_append
size_t iobuf_append(struct iobuf *io, const void *buf, size_t len) {
  char *p = NULL;

  assert(io != NULL);
  assert(io->len <= io->size);

  /* check overflow */
  if (len > ~(size_t)0 - (size_t)(io->buf + io->len)) {
    return 0;
  }

  if (len <= 0) {
  } else if (io->len + len <= io->size) {
    memcpy(io->buf + io->len, buf, len);
    io->len += len;
  } else if ((p = (char *) NS_REALLOC(io->buf, io->len + len)) != NULL) {
    io->buf = p;
    memcpy(io->buf + io->len, buf, len);
    io->len += len;
    io->size = io->len;
  } else {
    len = 0;
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x66449
movq %rsi, %r15
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rcx
cmpq %rcx, %rsi
ja 0x66468
movq %rdx, %rbx
movq (%r14), %rdi
leaq (%rdi,%rsi), %rax
negq %rdx
cmpq %rax, %rdx
jbe 0x66427
addq %rbx, %rsi
cmpq %rcx, %rsi
jbe 0x6642b
callq 0xc120
testq %rax, %rax
je 0x66427
movq %rax, (%r14)
movq 0x8(%r14), %r12
addq %r12, %rax
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xc0e0
addq %rbx, %r12
movq %r12, 0x8(%r14)
movq %r12, 0x10(%r14)
jmp 0x6643d
xorl %ebx, %ebx
jmp 0x6643d
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xc0e0
addq %rbx, 0x8(%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11e08(%rip), %rdi     # 0x78258
leaq 0x11e0c(%rip), %rsi     # 0x78263
leaq 0x11e1f(%rip), %rcx     # 0x7827d
movl $0x175, %edx            # imm = 0x175
callq 0xc210
leaq 0x11e48(%rip), %rdi     # 0x782b7
leaq 0x11ded(%rip), %rsi     # 0x78263
leaq 0x11e00(%rip), %rcx     # 0x7827d
movl $0x176, %edx            # imm = 0x176
callq 0xc210
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_avprintf
int ns_avprintf(char **buf, size_t size, const char *fmt, va_list ap) {
  va_list ap_copy;
  int len;

  va_copy(ap_copy, ap);
  len = vsnprintf(*buf, size, fmt, ap_copy);
  va_end(ap_copy);

  if (len < 0) {
    // eCos and Windows are not standard-compliant and return -1 when
    // the buffer is too small. Keep allocating larger buffers until we
    // succeed or out of memory.
    *buf = NULL;
    while (len < 0) {
      if (*buf) NS_FREE(*buf);
      size *= 2;
      if ((*buf = (char *) NS_MALLOC(size)) == NULL) break;
      va_copy(ap_copy, ap);
      len = vsnprintf(*buf, size, fmt, ap_copy);
      va_end(ap_copy);
    }
  } else if (len > (int) size) {
    // Standard-compliant code path. Allocate a buffer that is large enough.
    if ((*buf = (char *) NS_MALLOC(len + 1)) == NULL) {
      len = -1;
    } else {
      va_copy(ap_copy, ap);
      len = vsnprintf(*buf, len + 1, fmt, ap_copy);
      va_end(ap_copy);
    }
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r15
movq 0x10(%rcx), %rax
leaq -0x40(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups (%r14), %xmm0
movaps %xmm0, (%rcx)
movq (%rdi), %rdi
callq 0xcd48
movl %eax, %r12d
testl %eax, %eax
js 0x66538
cmpl %r13d, %r12d
jle 0x66592
incl %r12d
movq %r12, %rdi
callq 0xca00
movq %rax, (%r15)
testq %rax, %rax
je 0x6658c
movq 0x10(%r14), %rax
leaq -0x40(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups (%r14), %xmm0
movaps %xmm0, (%rcx)
movq (%r15), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0xcd48
movl %eax, %r12d
jmp 0x66592
movq $0x0, (%r15)
xorl %edi, %edi
testq %rdi, %rdi
je 0x6654b
callq 0xc250
addq %r13, %r13
movq %r13, %rdi
callq 0xca00
movq %rax, (%r15)
testq %rax, %rax
je 0x66592
movq 0x10(%r14), %rax
movq %rax, -0x30(%rbp)
movups (%r14), %xmm0
movaps %xmm0, -0x40(%rbp)
movq (%r15), %rdi
movq %r13, %rsi
movq %rbx, %rdx
leaq -0x40(%rbp), %rcx
callq 0xcd48
movl %eax, %r12d
testl %eax, %eax
jns 0x66592
movq (%r15), %rdi
jmp 0x66541
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_vprintf
int ns_vprintf(struct ns_connection *nc, const char *fmt, va_list ap) {
  char mem[NS_VPRINTF_BUFFER_SIZE], *buf = mem;
  int len;

  if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) {
    ns_out(nc, buf, len);
  }
  if (buf != mem && buf != NULL) {
    NS_FREE(buf);
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %r15
leaq -0x220(%rbp), %r12
leaq -0x28(%rbp), %r14
movq %r12, (%r14)
movl $0x1f4, %esi            # imm = 0x1F4
movq %r14, %rdi
callq 0x664b7
movl %eax, %ebx
movq (%r14), %r14
testl %eax, %eax
jle 0x665f0
movl %ebx, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x6661a
cmpq %r12, %r14
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x66608
movq %r14, %rdi
callq 0xc250
movl %ebx, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_out
static size_t ns_out(struct ns_connection *nc, const void *buf, size_t len) {
  if (nc->flags & NSF_UDP) {
    long n = sendto(nc->sock, (const char *) buf, len, 0, &nc->sa.sa,
                    sizeof(nc->sa.sin));
    DBG(("%p %d send %ld (%d %s)", nc, nc->sock, n, errno, strerror(errno)));
    return n < 0 ? 0 : n;
  } else {
    return iobuf_append(&nc->send_iobuf, buf, len);
  }
}

// Assembly:
movq %rdi, %r8
testb $0x1, 0xa1(%rdi)
jne 0x66632
addq $0x58, %r8
movq %r8, %rdi
jmp 0x663b3
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x20(%r8), %edi
addq $0x24, %r8
xorl %ebx, %ebx
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0xc840
testq %rax, %rax
cmovleq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_socketpair2
int ns_socketpair2(sock_t sp[2], int sock_type) {
  union socket_address sa;
  sock_t sock;
  socklen_t len = sizeof(sa.sin);
  int ret = 0;

  sp[0] = sp[1] = INVALID_SOCKET;

  (void) memset(&sa, 0, sizeof(sa));
  sa.sin.sin_family = AF_INET;
  sa.sin.sin_port = htons(0);
  sa.sin.sin_addr.s_addr = htonl(0x7f000001);

  if ((sock = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET &&
      !bind(sock, &sa.sa, len) &&
      (sock_type == SOCK_DGRAM || !listen(sock, 1)) &&
      !getsockname(sock, &sa.sa, &len) &&
      (sp[0] = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET &&
      !connect(sp[0], &sa.sa, len) &&
      (sock_type == SOCK_STREAM ||
       (!getsockname(sp[0], &sa.sa, &len) && !connect(sock, &sa.sa, len))) &&
      (sp[1] = (sock_type == SOCK_DGRAM ? sock :
                accept(sock, &sa.sa, &len))) != INVALID_SOCKET) {
    ns_set_close_on_exec(sp[0]);
    ns_set_close_on_exec(sp[1]);
    ret = 1;
  } else {
    if (sp[0] != INVALID_SOCKET) closesocket(sp[0]);
    if (sp[1] != INVALID_SOCKET) closesocket(sp[1]);
    sp[0] = sp[1] = INVALID_SOCKET;
  }
  if (sock_type != SOCK_DGRAM) closesocket(sock);

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
movq %rdi, %r15
movl $0x10, -0x24(%rbp)
movq $-0x1, (%rdi)
movq $0x0, -0x2c(%rbp)
movabsq $0x100007f00000002, %rax # imm = 0x100007F00000002
movq %rax, -0x34(%rbp)
movl $0x2, %edi
xorl %edx, %edx
callq 0xc550
movl %eax, %r14d
cmpl $-0x1, %eax
je 0x66775
leaq -0x34(%rbp), %rsi
movl %r14d, %edi
movl $0x10, %edx
callq 0xca60
testl %eax, %eax
jne 0x66775
cmpl $0x2, %ebx
je 0x66761
movl %r14d, %edi
movl $0x1, %esi
callq 0xcc60
testl %eax, %eax
jne 0x66775
leaq -0x34(%rbp), %rsi
leaq -0x24(%rbp), %rdx
movl %r14d, %edi
callq 0xc070
testl %eax, %eax
je 0x667b7
movl (%r15), %edi
cmpl $-0x1, %edi
je 0x66782
callq 0xc2b0
movl 0x4(%r15), %edi
cmpl $-0x1, %edi
je 0x66790
callq 0xc2b0
movq $-0x1, (%r15)
xorl %r12d, %r12d
cmpl $0x2, %ebx
je 0x667a7
movl %r14d, %edi
callq 0xc2b0
movl %r12d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %edi
movl %ebx, %esi
xorl %edx, %edx
callq 0xc550
movl %eax, (%r15)
cmpl $-0x1, %eax
je 0x66782
movl -0x24(%rbp), %edx
leaq -0x34(%rbp), %rsi
movl %eax, %edi
callq 0xc420
testl %eax, %eax
jne 0x66775
cmpl $0x1, %ebx
jne 0x66835
leaq -0x34(%rbp), %rsi
leaq -0x24(%rbp), %rdx
movl %r14d, %edi
callq 0xc960
movl %eax, 0x4(%r15)
cmpl $-0x1, %eax
je 0x66775
movl (%r15), %edi
movl $0x1, %r12d
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0xc220
movl 0x4(%r15), %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0xc220
jmp 0x6679a
movl (%r15), %edi
leaq -0x34(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0xc070
testl %eax, %eax
jne 0x66775
movl -0x24(%rbp), %edx
leaq -0x34(%rbp), %rsi
movl %r14d, %edi
callq 0xc420
testl %eax, %eax
jne 0x66775
cmpl $0x2, %ebx
jne 0x667e4
movl %r14d, 0x4(%r15)
jmp 0x66801
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_bind
struct ns_connection *ns_bind(struct ns_mgr *srv, const char *str,
                              ns_callback_t callback, void *user_data) {
  union socket_address sa;
  struct ns_connection *nc = NULL;
  int use_ssl, proto;
  char cert[100], ca_cert[100];
  sock_t sock;

  ns_parse_address(str, &sa, &proto, &use_ssl, cert, ca_cert);
  if (use_ssl && cert[0] == '\0') return NULL;

  if ((sock = ns_open_listening_socket(&sa, proto)) == INVALID_SOCKET) {
  } else if ((nc = ns_add_sock(srv, sock, callback, NULL)) == NULL) {
    closesocket(sock);
  } else {
    nc->sa = sa;
    nc->flags |= NSF_LISTENING;
    nc->user_data = user_data;
    nc->callback = callback;

    if (proto == SOCK_DGRAM) {
      nc->flags |= NSF_UDP;
    }

#ifdef NS_ENABLE_SSL
    if (use_ssl) {
      nc->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
      if (ns_use_cert(nc->ssl_ctx, cert) != 0 ||
          ns_use_ca_cert(nc->ssl_ctx, ca_cert) != 0) {
        ns_close_conn(nc);
        nc = NULL;
      }
    }
#endif

    DBG(("%p sock %d/%d ssl %p %p", nc, sock, proto, nc->ssl_ctx, nc->ssl));
  }

  return nc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %r15
leaq -0x44(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x48(%rbp), %r12
leaq -0xb0(%rbp), %r8
leaq -0x120(%rbp), %r9
movq %rax, %rdi
movq %r12, %rcx
callq 0x66a3e
cmpl $0x0, (%r12)
je 0x6691e
cmpb $0x0, -0xb0(%rbp)
je 0x66982
movl -0x2c(%rbp), %r12d
movl $0x10, -0x34(%rbp)
movl $0x1, -0x30(%rbp)
movzwl -0x44(%rbp), %edi
movl %r12d, %esi
xorl %edx, %edx
callq 0xc550
cmpl $-0x1, %eax
je 0x66982
movl %eax, %r13d
leaq -0x30(%rbp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0xc190
testl %eax, %eax
jne 0x6697a
leaq -0x44(%rbp), %rsi
movl %r13d, %edi
movl $0x10, %edx
callq 0xca60
testl %eax, %eax
je 0x66996
movl %r13d, %edi
callq 0xc2b0
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %r12d
je 0x669ad
movl %r13d, %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0xcc60
testl %eax, %eax
jne 0x6697a
movl %r13d, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc220
orl $0x800, %eax            # imm = 0x800
movl %r13d, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0xc220
leaq -0x44(%rbp), %rsi
leaq -0x34(%rbp), %rdx
movl %r13d, %edi
callq 0xc070
movq %r15, %rdi
movl %r13d, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x66c32
testq %rax, %rax
je 0x6697a
movl 0xa0(%rax), %ecx
movl %ecx, %edx
orl $0x80, %edx
movups -0x44(%rbp), %xmm0
movups %xmm0, 0x24(%rax)
movl %edx, 0xa0(%rax)
movq %r14, 0x80(%rax)
movq %rbx, 0x98(%rax)
cmpl $0x2, %r12d
jne 0x66984
orl $0x180, %ecx            # imm = 0x180
movl %ecx, 0xa0(%rax)
jmp 0x66984
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_add_sock
struct ns_connection *ns_add_sock(struct ns_mgr *s, sock_t sock,
                                  ns_callback_t callback, void *user_data) {
  struct ns_connection *conn;
  if ((conn = (struct ns_connection *) NS_MALLOC(sizeof(*conn))) != NULL) {
    memset(conn, 0, sizeof(*conn));
    ns_set_non_blocking_mode(sock);
    ns_set_close_on_exec(sock);
    conn->sock = sock;
    conn->user_data = user_data;
    conn->callback = callback;
    conn->mgr = s;
    conn->last_io_time = time(NULL);
    ns_add_conn(s, conn);
    DBG(("%p %d", conn, sock));
  }
  return conn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %r14
movl $0x1, %edi
movl $0xa8, %esi
callq 0xc980
movq %rax, %rbx
testq %rax, %rax
je 0x66cd4
movl %r13d, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc220
orl $0x800, %eax            # imm = 0x800
movl %r13d, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0xc220
movl %r13d, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0xc220
movl %r13d, 0x20(%rbx)
movq %r12, 0x80(%rbx)
movq %r15, 0x98(%rbx)
movq %r14, 0x18(%rbx)
xorl %edi, %edi
callq 0xc820
movq %rax, 0x90(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
movq %rbx, (%r14)
testq %rax, %rax
je 0x66cd4
movq %rbx, 0x8(%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_sock_to_str
void ns_sock_to_str(sock_t sock, char *buf, size_t len, int flags) {
  union socket_address sa;
  socklen_t slen = sizeof(sa);

  if (buf != NULL && len > 0) {
    buf[0] = '\0';
    memset(&sa, 0, sizeof(sa));
    if (flags & 4) {
      getpeername(sock, &sa.sa, &slen);
    } else {
      getsockname(sock, &sa.sa, &slen);
    }
    if (flags & 1) {
#if defined(NS_ENABLE_IPV6)
      inet_ntop(sa.sa.sa_family, sa.sa.sa_family == AF_INET ?
                (void *) &sa.sin.sin_addr :
                (void *) &sa.sin6.sin6_addr, buf, len);
#elif defined(_WIN32)
      // Only Windoze Vista (and newer) have inet_ntop()
      strncpy(buf, inet_ntoa(sa.sin.sin_addr), len);
#else
      inet_ntop(sa.sa.sa_family, (void *) &sa.sin.sin_addr, buf,(socklen_t)len);
#endif
    }
    if (flags & 2) {
      snprintf(buf + strlen(buf), len - (strlen(buf) + 1), "%s%d",
               flags & 1 ? ":" : "", (int) ntohs(sa.sin.sin_port));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movl $0x10, -0x1c(%rbp)
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x66da0
movq %rdx, %rbx
movq %rsi, %r14
movb $0x0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
testb $0x4, %r15b
jne 0x66d36
callq 0xc070
jmp 0x66d3b
callq 0xccf0
testb $0x1, %r15b
je 0x66d53
leaq -0x2c(%rbp), %rsi
movzwl -0x4(%rsi), %edi
movq %r14, %rdx
movl %ebx, %ecx
callq 0xc2a0
testb $0x2, %r15b
je 0x66da0
movq %r14, %rdi
callq 0xc460
addq %rax, %r14
notq %rax
addq %rax, %rbx
testb $0x1, %r15b
leaq 0x108fd(%rip), %rax     # 0x77672
leaq 0xaef6(%rip), %rcx      # 0x71c72
cmoveq %rax, %rcx
movzwl -0x2e(%rbp), %eax
rolw $0x8, %ax
movzwl %ax, %r8d
leaq 0x11538(%rip), %rdx     # 0x782cb
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xc5d0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq