// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: VmHttpExtractHeaders
static sxi32 VmHttpExtractHeaders(SyString *pRequest, SySet *pOut)
 {
	 SyhttpHeader *pLast = 0;
	 SyString sCurrent;
	 SyhttpHeader sHdr;
	 sxu8 bEol;
	 sxi32 rc;
	 if( SySetUsed(pOut) > 0 ){
		 pLast = (SyhttpHeader *)SySetAt(pOut, SySetUsed(pOut)-1);
	 }
	 bEol = FALSE;
	 for(;;){
		 SyZero(&sHdr, sizeof(SyhttpHeader));
		 /* Extract a single line from the raw HTTP request */
		 rc = VmGetNextLine(pRequest, &sCurrent);
		 if(rc != SXRET_OK ){
			 if( sCurrent.nByte < 1 ){
				 break;
			 }
			 bEol = TRUE;
		 }
		 /* Process the header */
		 if( SXRET_OK == VmHttpProcessOneHeader(&sHdr, pLast, sCurrent.zString, sCurrent.nByte)){
			 if( SXRET_OK != SySetPut(pOut, (const void *)&sHdr) ){
				 break;
			 }
			 /* Retrieve the last parsed header so we can handle multi-line header
			  * in case we face one of them.
			  */
			 pLast = (SyhttpHeader *)SySetPeek(pOut);
		 }
		 if( bEol ){
			 break;
		 }
	 } /* for(;;) */
	 return SXRET_OK;
 }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r14
movl 0x10(%rsi), %ebx
testl %ebx, %ebx
movq %rsi, -0x68(%rbp)
je 0x46579
decl %ebx
imull 0x18(%rsi), %ebx
addq 0x8(%rsi), %rbx
jmp 0x4657b
xorl %ebx, %ebx
leaq -0x80(%rbp), %r15
movq %r14, -0x70(%rbp)
movq $-0x4, %rax
movl $0x0, -0x54(%rbp,%rax)
addq $0x4, %rax
cmpq $0x1c, %rax
jb 0x4658a
movq %r14, %rdi
movq %r15, %rsi
callq 0x46dcd
movl %eax, %r12d
testl %eax, %eax
setne %al
movl -0x78(%rbp), %edx
testl %edx, %edx
sete %cl
testb %cl, %al
jne 0x46824
movl %edx, -0x2c(%rbp)
testl %edx, %edx
je 0x4681b
movq -0x80(%rbp), %r13
testq %rbx, %rbx
je 0x46686
movzbl -0x1(%r13), %eax
cmpl $0x20, %eax
je 0x465ea
cmpl $0x9, %eax
jne 0x46686
movq %r13, -0x38(%rbp)
movl %r12d, -0x30(%rbp)
movl 0x18(%rbx), %r14d
testl %r14d, %r14d
je 0x46665
movq 0x10(%rbx), %r15
decl %r14d
movl -0x2c(%rbp), %r12d
addl -0x38(%rbp), %r12d
subl %r15d, %r12d
movsbq (%r15), %r13
cmpq $-0x41, %r13
ja 0x4663d
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
je 0x4663d
movl %r14d, 0x18(%rbx)
incq %r15
movq %r15, 0x10(%rbx)
decl %r12d
addl $-0x1, %r14d
jb 0x4660d
jmp 0x46665
movl %r14d, %eax
movsbq (%r15,%rax), %r13
cmpq $-0x41, %r13
ja 0x46671
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
je 0x46671
movl %r14d, 0x18(%rbx)
addl $-0x1, %r14d
jb 0x4663d
movq -0x38(%rbp), %rax
movq %rax, 0x10(%rbx)
movl -0x2c(%rbp), %r12d
movl %r12d, 0x18(%rbx)
movq -0x70(%rbp), %r14
leaq -0x80(%rbp), %r15
movl -0x30(%rbp), %r12d
jmp 0x4681b
movq %r13, %rdi
movl -0x2c(%rbp), %esi
movl $0x3a, %edx
leaq -0x5c(%rbp), %rcx
callq 0x47327
testl %eax, %eax
jne 0x4681b
movl %r12d, -0x30(%rbp)
movq %r13, -0x58(%rbp)
movl -0x5c(%rbp), %ebx
movl %ebx, -0x50(%rbp)
testl %ebx, %ebx
je 0x46742
movb (%r13), %r15b
movq %r13, %r14
movl %ebx, %eax
cmpb $-0x41, %r15b
ja 0x466fd
callq 0xc170
movq (%rax), %rcx
leal -0x1(%rbx), %eax
leaq (%rax,%r13), %rdx
incq %rdx
movl %ebx, %eax
movq %r13, %r14
movsbq %r15b, %rsi
testb $0x20, 0x1(%rcx,%rsi,2)
je 0x466fd
cmpl $0x1, %eax
je 0x46737
movb 0x1(%r14), %r15b
incq %r14
decl %eax
cmpb $-0x41, %r15b
jbe 0x466de
movl %eax, -0x50(%rbp)
movq %r14, -0x58(%rbp)
movl %eax, %r15d
decq %r15
movl %r15d, %eax
movsbq (%r14,%rax), %r12
cmpq $-0x41, %r12
ja 0x46742
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r12,2)
je 0x46742
movl %r15d, -0x50(%rbp)
decq %r15
cmpl $-0x1, %r15d
jne 0x4670a
jmp 0x46742
movl $0x0, -0x50(%rbp)
movq %rdx, -0x58(%rbp)
leal 0x1(%rbx), %r15d
movq %r13, -0x38(%rbp)
leaq (%r15,%r13), %r14
movq %r14, -0x48(%rbp)
notl %ebx
movl -0x2c(%rbp), %eax
addl %ebx, %eax
movl %eax, -0x40(%rbp)
movl -0x30(%rbp), %r12d
je 0x467e9
movl %eax, %r13d
movb (%r14), %bl
cmpb $-0x41, %bl
ja 0x467a6
callq 0xc170
movq (%rax), %rax
movq -0x38(%rbp), %rcx
leaq (%rcx,%r15), %r14
incq %r14
movsbq %bl, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x467a3
cmpl $0x1, %r13d
je 0x467de
movb (%r14), %bl
incq %r14
decl %r13d
cmpb $-0x41, %bl
jbe 0x46784
decq %r14
movl %r13d, -0x40(%rbp)
movq %r14, -0x48(%rbp)
movl %r13d, %ebx
decq %rbx
movl %ebx, %eax
movsbq (%r14,%rax), %r15
cmpq $-0x41, %r15
ja 0x467e9
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
je 0x467e9
movl %ebx, -0x40(%rbp)
decq %rbx
cmpl $-0x1, %ebx
jne 0x467b4
jmp 0x467e9
movl $0x0, -0x40(%rbp)
movq %r14, -0x48(%rbp)
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x33094
testl %eax, %eax
movq -0x70(%rbp), %r14
leaq -0x80(%rbp), %r15
jne 0x46824
movq -0x68(%rbp), %rax
movl 0x10(%rax), %ebx
testl %ebx, %ebx
je 0x46819
decl %ebx
imull 0x18(%rax), %ebx
addq 0x8(%rax), %rbx
jmp 0x4681b
xorl %ebx, %ebx
testl %r12d, %r12d
je 0x46583
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq