// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: VmHttpPorcessCookie
static sxi32 VmHttpPorcessCookie(jx9_vm *pVm, SyBlob *pWorker, const char *zIn, sxu32 nByte)
 {
	 const char *zPtr, *zDelimiter, *zEnd = &zIn[nByte];
	 SyString sName, sValue;
	 jx9_value *pCookie;
	 sxu32 nOfft;
	 /* Make sure the $_COOKIE superglobal is available */
	 pCookie = VmExtractSuper(&(*pVm), "_COOKIE", sizeof("_COOKIE")-1);
	 if( pCookie == 0 || (pCookie->iFlags & MEMOBJ_HASHMAP) == 0 ){
		 /* $_COOKIE superglobal not available */
		 return SXERR_NOTFOUND;
	 }	
	 for(;;){
		  /* Jump leading white spaces */
		 while( zIn < zEnd && SyisSpace(zIn[0]) ){
			 zIn++;
		 }
		 if( zIn >= zEnd ){
			 break;
		 }
		  /* Reset the working buffer */
		 SyBlobReset(pWorker);
		 zDelimiter = zIn;
		 /* Delimit the name[=value]; pair */ 
		 while( zDelimiter < zEnd && zDelimiter[0] != ';' ){
			 zDelimiter++;
		 }
		 zPtr = zIn;
		 while( zPtr < zDelimiter && zPtr[0] != '=' ){
			 zPtr++;
		 }
		 /* Decode the cookie */
		 SyUriDecode(zIn, (sxu32)(zPtr-zIn), jx9VmBlobConsumer, pWorker, TRUE);
		 sName.nByte = SyBlobLength(pWorker);
		 zPtr++;
		 sValue.zString = 0;
		 sValue.nByte = 0;
		 if( zPtr < zDelimiter ){
			 /* Got a Cookie value */
			 nOfft = SyBlobLength(pWorker);
			 SyUriDecode(zPtr, (sxu32)(zDelimiter-zPtr), jx9VmBlobConsumer, pWorker, TRUE);
			 SyStringInitFromBuf(&sValue, SyBlobDataAt(pWorker, nOfft), SyBlobLength(pWorker)-nOfft);
		 }
		 /* Synchronize pointers */
		 zIn = &zDelimiter[1];
		 /* Perform the insertion */
		 sName.zString = (const char *)SyBlobData(pWorker);
		 VmHashmapInsert((jx9_hashmap *)pCookie->x.pOther, 
			 sName.zString, (int)sName.nByte, 
			 sValue.zString, (int)sValue.nByte
			 );
	 }
	 return SXRET_OK;
 }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x48abc(%rip), %rsi     # 0xc4acc
movl $0x7, %edx
callq 0x7ab80
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x7c034
movq -0x68(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x7c040
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
jmp 0x7c207
jmp 0x7c042
jmp 0x7c044
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x6d(%rbp)
jae 0x7c077
callq 0xd1f0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %al
testb $0x1, %al
jne 0x7c080
jmp 0x7c08e
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7c044
movq -0x20(%rbp), %rax
cmpq -0x40(%rbp), %rax
jb 0x7c09d
jmp 0x7c200
movq -0x18(%rbp), %rdi
callq 0x65e00
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x6e(%rbp)
jae 0x7c0cd
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
setne %al
movb %al, -0x6e(%rbp)
movb -0x6e(%rbp), %al
testb $0x1, %al
jne 0x7c0d6
jmp 0x7c0e4
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7c0ae
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x38(%rbp), %rcx
movb %al, -0x6f(%rbp)
jae 0x7c10b
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
setne %al
movb %al, -0x6f(%rbp)
movb -0x6f(%rbp), %al
testb $0x1, %al
jne 0x7c114
jmp 0x7c122
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x7c0ec
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
movq -0x18(%rbp), %rcx
leaq -0x10a7e(%rip), %rdx    # 0x6b6c0
movl $0x1, %r8d
callq 0x7d5c0
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x58(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x7c1c8
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
movq -0x18(%rbp), %rcx
leaq -0x10ade(%rip), %rdx    # 0x6b6c0
movl $0x1, %r8d
callq 0x7d5c0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x6c(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
subl -0x6c(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movq -0x50(%rbp), %rsi
movl -0x48(%rbp), %edx
movq -0x60(%rbp), %rcx
movl -0x58(%rbp), %r8d
callq 0x7ac00
jmp 0x7c042
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq