// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %rdi, -0x90(%rbp)
movl 0x10(%rsi), %ebx
testl %ebx, %ebx
movq %rsi, -0x78(%rbp)
je 0x47471
decl %ebx
imull 0x18(%rsi), %ebx
addq 0x8(%rsi), %rbx
jmp 0x47473
xorl %ebx, %ebx
leaq -0x88(%rbp), %r15
movq $-0x4, %rax
movl $0x0, -0x54(%rbp,%rax)
addq $0x4, %rax
cmpq $0x1c, %rax
jb 0x47481
movq -0x90(%rbp), %rdi
movq %r15, %rsi
callq 0x47e0b
movl %eax, %r13d
testl %eax, %eax
setne %al
movl -0x80(%rbp), %r12d
testl %r12d, %r12d
sete %cl
testb %cl, %al
jne 0x47841
testl %r12d, %r12d
je 0x4781a
movq -0x88(%rbp), %r14
testq %rbx, %rbx
je 0x475a0
movzbl -0x1(%r14), %eax
cmpl $0x20, %eax
je 0x474e8
cmpl $0x9, %eax
jne 0x475a0
movq %r14, -0x38(%rbp)
movl %r13d, -0x2c(%rbp)
movl 0x18(%rbx), %r14d
testl %r14d, %r14d
je 0x4752f
movq 0x10(%rbx), %r15
incq %r15
decl %r14d
movsbq -0x1(%r15), %r13
cmpq $-0x41, %r13
ja 0x4752f
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
je 0x4752f
movl %r14d, 0x18(%rbx)
movq %r15, 0x10(%rbx)
incq %r15
addl $-0x1, %r14d
jb 0x47503
movl 0x18(%rbx), %r14d
testl %r14d, %r14d
je 0x4763f
movq 0x10(%rbx), %r15
decl %r14d
movsbq (%r15,%r14), %r13
cmpq $-0x41, %r13
ja 0x4758c
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
je 0x4758c
movl %r14d, 0x18(%rbx)
testl %r14d, %r14d
je 0x4763f
movl %r14d, %ecx
leal -0x1(%rcx), %r14d
movsbq (%r15,%r14), %rdx
cmpq $-0x41, %rdx
ja 0x47584
testb $0x20, 0x1(%rax,%rdx,2)
jne 0x4755e
testl %ecx, %ecx
je 0x4763f
movl %r12d, %eax
movq -0x38(%rbp), %rcx
addl %eax, %ecx
subl %r15d, %ecx
movl %ecx, %r12d
jmp 0x47647
movq %r14, %rdi
movl %r12d, %esi
movl $0x3a, %edx
leaq -0x6c(%rbp), %rcx
callq 0x4838e
testl %eax, %eax
jne 0x4781a
movq %r14, -0x58(%rbp)
movl -0x6c(%rbp), %r10d
movl %r10d, -0x50(%rbp)
testl %r10d, %r10d
movq %r14, %r9
movq %r14, -0x38(%rbp)
movq %r10, -0x68(%rbp)
je 0x4766e
movl -0x50(%rbp), %ebx
movq -0x58(%rbp), %r15
movsbq (%r9), %r14
cmpq $-0x41, %r14
ja 0x47667
callq 0xc170
movq -0x68(%rbp), %r10
movq -0x38(%rbp), %r9
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
je 0x47667
leal -0x1(%r10), %esi
leaq (%r9,%rsi), %rcx
incq %rcx
leaq 0x1(%r9), %rdx
movq %r9, %r15
movl %r10d, %ebx
movl %esi, %edi
subl $0x1, %edi
jb 0x4765b
movsbq (%rdx), %r8
cmpq $-0x41, %r8
ja 0x47662
incq %r15
incq %rdx
decl %ebx
testb $0x20, 0x1(%rax,%r8,2)
movl %edi, %esi
jne 0x4761c
jmp 0x47667
movq -0x38(%rbp), %rax
movq %rax, 0x10(%rbx)
leaq -0x88(%rbp), %r15
movl %r12d, 0x18(%rbx)
movl -0x2c(%rbp), %r13d
jmp 0x4781a
xorl %ebx, %ebx
movq %rcx, %r15
jmp 0x47667
movq %rdx, %r15
movl %esi, %ebx
movl %ebx, -0x50(%rbp)
movq %r15, -0x58(%rbp)
movl -0x50(%rbp), %ebx
testq %rbx, %rbx
movl %r13d, -0x2c(%rbp)
je 0x476ec
movq -0x58(%rbp), %rcx
movl -0x50(%rbp), %r15d
leaq -0x1(%rbx), %r14
movl %r14d, %eax
movsbq (%rcx,%rax), %r13
cmpq $-0x41, %r13
ja 0x476e4
movq %rcx, -0x60(%rbp)
callq 0xc170
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %r10
movq -0x38(%rbp), %r9
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
movl -0x2c(%rbp), %r13d
je 0x476e8
addq $-0x2, %rbx
testl %r14d, %r14d
je 0x4782c
movl %r14d, %r15d
movl %ebx, %ecx
movsbq (%rdx,%rcx), %rcx
cmpq $-0x41, %rcx
ja 0x476e8
decq %r14
decq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x476bc
jmp 0x476e8
movl -0x2c(%rbp), %r13d
movl %r15d, -0x50(%rbp)
leal 0x1(%r10), %ecx
leaq (%r9,%rcx), %rax
movq %rax, -0x48(%rbp)
movl %r10d, %r14d
notl %r14d
addl %r12d, %r14d
movl %r14d, -0x40(%rbp)
je 0x47783
movl -0x40(%rbp), %ebx
movq -0x48(%rbp), %r15
movsbq (%rax), %r13
cmpq $-0x41, %r13
ja 0x47778
movq %rcx, -0x60(%rbp)
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
movl -0x2c(%rbp), %r13d
je 0x4777c
movq -0x38(%rbp), %rcx
movq -0x60(%rbp), %rdx
addq %rcx, %rdx
incq %rdx
subl -0x68(%rbp), %r12d
addl $-0x2, %r12d
movl %r14d, %ebx
movl %r12d, %ecx
movq %rdx, %r15
subl $0x1, %ecx
jb 0x47825
movsbq (%r15), %rsi
cmpq $-0x41, %rsi
ja 0x47839
leaq 0x1(%r15), %rdx
decl %ebx
testb $0x20, 0x1(%rax,%rsi,2)
movl %ecx, %r12d
jne 0x4774c
jmp 0x4777c
movl -0x2c(%rbp), %r13d
movl %ebx, -0x40(%rbp)
movq %r15, -0x48(%rbp)
movl -0x40(%rbp), %ebx
testq %rbx, %rbx
je 0x477e9
movq -0x48(%rbp), %r15
movl -0x40(%rbp), %r14d
leaq -0x1(%rbx), %r12
movl %r12d, %eax
movsbq (%r15,%rax), %r13
cmpq $-0x41, %r13
ja 0x477e1
callq 0xc170
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
movl -0x2c(%rbp), %r13d
je 0x477e5
addq $-0x2, %rbx
testl %r12d, %r12d
je 0x47834
movl %r12d, %r14d
movl %ebx, %ecx
movsbq (%r15,%rcx), %rcx
cmpq $-0x41, %rcx
ja 0x477e5
decq %r12
decq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x477bd
jmp 0x477e5
movl -0x2c(%rbp), %r13d
movl %r14d, -0x40(%rbp)
movq -0x78(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x336fc
testl %eax, %eax
leaq -0x88(%rbp), %r15
jne 0x47841
movq -0x78(%rbp), %rax
movl 0x10(%rax), %ebx
testl %ebx, %ebx
je 0x47818
decl %ebx
imull 0x18(%rax), %ebx
addq 0x8(%rax), %rbx
jmp 0x4781a
xorl %ebx, %ebx
testl %r13d, %r13d
je 0x4747a
jmp 0x47841
xorl %ebx, %ebx
jmp 0x4777c
xorl %r15d, %r15d
jmp 0x476e8
xorl %r14d, %r14d
jmp 0x477e5
movl %r12d, %ebx
jmp 0x4777c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq