// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: callback_read_header
static int
callback_read_header(void * cookie, int status)
{
	struct http_cookie * H = cookie;
	uint8_t * buf;
	size_t buflen;

	/* Did the read fail?  (EOF during headers counts as failing.) */
	if (status)
		return (fail(H));

	/* Where's the data? */
	netbuf_read_peek(H->R, &buf, &buflen);

	/* Scan forwards looking for \r\n\r\n. */
	for (; H->hepos + 4 <= buflen; H->hepos++) {
		if (memcmp(&buf[H->hepos], "\r\n\r\n", 4) == 0)
			break;
	}

	/* If we've found the end of the headers, handle them. */
	if (H->hepos + 4 <= buflen)
		return (gotheaders(H, buf, H->hepos + 4));

	/* Reject any response with more than 64 kB of headers. */
	if (buflen > MAXHDR) {
		warn0("Dropping connection with >%d bytes of headers", MAXHDR);
		return (fail(H));
	}

	/* Wait until at least one more byte has arrived. */
	if (netbuf_read_wait(H->R, buflen + 1, callback_read_header, H))
		return (die(H));

	/* Success! */
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
testl %esi, %esi
je 0x89ab
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8961
movq 0x28(%rbx), %rdi
leaq 0x30(%rsp), %r14
leaq 0x28(%rsp), %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x93cb
movq (%r15), %rsi
movq 0x70(%rbx), %rax
movq (%r14), %r14
leaq 0x4(%rax), %r15
cmpq %rsi, %r15
ja 0x89ea
cmpl $0xa0d0a0d, (%r14,%rax) # imm = 0xA0D0A0D
je 0x8a0f
incq %rax
movq %rax, 0x70(%rbx)
jmp 0x89ce
cmpq $0x10001, %rsi          # imm = 0x10001
jb 0x8ad0
leaq 0x8387(%rip), %rdi      # 0x10d85
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x553c
jmp 0x8b9a
movq %r15, 0x78(%rbx)
movq %r15, %rdi
callq 0x34d0
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x8aea
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3290
movq 0x28(%rbx), %rdi
movq %r15, %rsi
callq 0x9643
andq $0x0, 0xb0(%rbx)
movq 0x78(%rbx), %r14
pushq $-0x2
popq %r12
pushq $-0x20
popq %r15
xorl %r13d, %r13d
movq %r14, %rsi
subq %r13, %rsi
jbe 0x8a8f
movq 0x80(%rbx), %rdi
addq %r13, %rdi
callq 0x8e5e
leaq 0x3(%r12), %rcx
movq %rcx, 0xb0(%rbx)
addq %rax, %r13
addq $0x2, %r13
incq %r12
addq $0x10, %r15
jmp 0x8a5c
movq %rax, (%rsp)
leaq 0x2(%r12), %rax
cmpq $0x1, %rax
jbe 0x8e20
movq %r12, 0xb0(%rbx)
testq %r12, %r12
je 0x8afa
shrq $0x3c, %r12
leaq 0xb8(%rbx), %rbp
testq %r12, %r12
je 0x8b0b
callq 0x3040
movl $0xc, (%rax)
andq $0x0, (%rbp)
jmp 0x8aea
movq 0x28(%rbx), %rdi
incq %rsi
leaq -0x15b(%rip), %rdx      # 0x8983
movq %rbx, %rcx
callq 0x93e4
testl %eax, %eax
je 0x8b5b
movq %rbx, %rdi
callq 0x881d
pushq $-0x1
popq %rax
jmp 0x8baa
leaq 0xb8(%rbx), %rbp
andq $0x0, 0xb8(%rbx)
jmp 0x8b1c
movq %r15, %rdi
callq 0x34d0
movq %rax, (%rbp)
testq %rax, %rax
je 0x8aea
leaq 0x10(%rsp), %rdx
andq $0x0, (%rdx)
movq 0x80(%rbx), %rdi
movq %rsp, %r12
movq %r14, %rsi
movq %r12, %rcx
callq 0x8e7d
movq %rax, %r15
movq %rax, %rdi
callq 0x3190
cmpq (%r12), %rax
jae 0x8b5f
leaq 0x82ae(%rip), %rdi      # 0x10e00
xorl %eax, %eax
callq 0x553c
jmp 0x8b9a
xorl %eax, %eax
jmp 0x8baa
leaq 0xa8(%rbx), %r14
leaq 0x82b1(%rip), %rsi      # 0x10e1e
leaq 0xc(%rsp), %rdx
leaq 0x24(%rsp), %rcx
movq %r15, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x3360
cmpl $0x2, %eax
jg 0x8bb9
leaq 0x829d(%rip), %rdi      # 0x10e2d
movq %r15, %rsi
xorl %eax, %eax
callq 0x553c
callq 0x3040
andl $0x0, (%rax)
movq %rbx, %rdi
callq 0x8961
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, 0xc(%rsp)
jne 0x8bdc
movl (%r14), %esi
leal -0x258(%rsi), %eax
cmpl $0xfffffe0c, %eax       # imm = 0xFFFFFE0C
jae 0x8be8
leaq 0x8299(%rip), %rdi      # 0x10e70
jmp 0x8a03
leaq 0x8267(%rip), %rdi      # 0x10e4a
jmp 0x8b52
movq %r14, 0x18(%rsp)
xorl %r12d, %r12d
movq 0xb0(%rbx), %rsi
cmpq %rsi, %r12
jae 0x8cb2
movq 0x78(%rbx), %rsi
movq 0x80(%rbx), %rdi
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
callq 0x8e7d
movq %rax, %r13
movq %rax, %rdi
callq 0x3190
cmpq (%rsp), %rax
jb 0x8d0b
movq %rax, %rcx
subq $0x1, %rcx
jb 0x8c51
movzbl -0x1(%r13,%rax), %edx
cmpl $0x20, %edx
je 0x8c46
cmpl $0x9, %edx
jne 0x8c51
movb $0x0, -0x1(%r13,%rax)
movq %rcx, %rax
jmp 0x8c30
movq %r13, %rdi
leaq 0x824b(%rip), %rsi      # 0x10ea6
callq 0x3070
movq (%rbp), %rcx
movq %r12, %r15
shlq $0x4, %r15
movq %r13, (%rcx,%r15)
movq %r13, %rdx
addq %rax, %rdx
cmpb $0x1, (%r13,%rax)
sbbq $-0x1, %rdx
movq %rdx, 0x8(%rcx,%r15)
movb $0x0, (%r13,%rax)
movq (%rbp), %r14
movq 0x8(%r14,%r15), %r13
movq %r13, %rdi
leaq 0x820b(%rip), %rsi      # 0x10ea8
callq 0x3180
addq %r13, %rax
movq %rax, 0x8(%r14,%r15)
incq %r12
jmp 0x8bf0
movq 0x10(%rsp), %rax
addq $0x2, %rax
cmpq 0x78(%rbx), %rax
jne 0x8e3f
movq 0x18(%rsp), %rax
movl (%rax), %eax
leal -0x64(%rax), %ecx
cmpl $0x63, %ecx
ja 0x8d17
movq 0x80(%rbx), %rdi
callq 0x3460
movq 0xb8(%rbx), %rdi
callq 0x3460
andq $0x0, 0x80(%rbx)
andq $0x0, 0xb8(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8983
jmp 0x8baa
leaq 0x817b(%rip), %rdi      # 0x10e8d
jmp 0x8b52
cmpl $0x0, 0x30(%rbx)
je 0x8d34
xorps %xmm0, %xmm0
movups %xmm0, 0xc0(%rbx)
movq %rbx, %rdi
callq 0x8ef0
jmp 0x8baa
cmpl $0x130, %eax            # imm = 0x130
je 0x8d1d
cmpl $0xcc, %eax
je 0x8d1d
movq (%rbp), %rdi
leaq 0x817b(%rip), %rdx      # 0x10ec8
callq 0x88f0
testq %rax, %rax
je 0x8d84
leaq 0x817c(%rip), %rsi      # 0x10eda
movq %rax, %rdi
callq 0x30c0
testq %rax, %rax
je 0x8d84
movl $0x1, 0x88(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8f1f
jmp 0x8baa
movq 0xb0(%rbx), %rsi
movq 0xb8(%rbx), %rdi
leaq 0x8149(%rip), %rdx      # 0x10ee2
callq 0x88f0
testq %rax, %rax
je 0x8dde
movq %rax, %r14
callq 0x3040
movq %rax, %r15
andl $0x0, (%rax)
pushq $0xa
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x907d
cmpl $0x0, (%r15)
je 0x8ded
leaq 0x8126(%rip), %rdi      # 0x10ef1
movq %r14, %rsi
xorl %eax, %eax
callq 0x53ad
andl $0x0, (%r15)
jmp 0x8ba2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x90e7
jmp 0x8baa
cmpq %rax, 0x98(%rbx)
jae 0x8e03
movq %rbx, %rdi
callq 0x919f
jmp 0x8baa
movq %rax, 0x90(%rbx)
andl $0x0, 0x88(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x91c8
jmp 0x8baa
leaq 0x7f8c(%rip), %rdi      # 0x10db3
leaq 0x7e43(%rip), %rsi      # 0x10c71
leaq 0x7f93(%rip), %rcx      # 0x10dc8
movl $0x1d8, %edx            # imm = 0x1D8
callq 0x3210
leaq 0x8065(%rip), %rdi      # 0x10eab
leaq 0x7e24(%rip), %rsi      # 0x10c71
leaq 0x7f74(%rip), %rcx      # 0x10dc8
movl $0x217, %edx            # imm = 0x217
callq 0x3210