// File: /workspace/github_c_makefile_star2_O3/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
jne 0x8fd3
movq 0x28(%rbx), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %r14
movq %r14, %rdx
callq 0x9ab5
movq (%r14), %rsi
movq 0x70(%rbx), %rax
leaq 0x4(%rax), %r14
cmpq %rsi, %r14
jbe 0x8ff7
cmpq $0x10001, %rsi          # imm = 0x10001
jb 0x911e
leaq 0x8df9(%rip), %rdi      # 0x11db5
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x58d7
callq 0x3040
movl $0x0, (%rax)
movq 0x68(%rbx), %rdi
xorl %esi, %esi
callq *0x60(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x8df7
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rsp), %r15
cmpl $0xa0d0a0d, (%r15,%rax) # imm = 0xA0D0A0D
je 0x9031
leaq (%rax,%r15), %rcx
incq %rcx
addq $0x5, %rax
movq %rax, %r14
addq $-0x4, %rax
movq %rax, 0x70(%rbx)
cmpq %rsi, %r14
ja 0x8fa8
cmpl $0xa0d0a0d, (%rcx)      # imm = 0xA0D0A0D
leaq 0x1(%rcx), %rcx
leaq 0x1(%r14), %rax
jne 0x9011
movq %r14, 0x78(%rbx)
movq %r14, %rdi
callq 0x34c0
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x9138
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3280
movq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x9d46
movq $0x0, 0xb0(%rbx)
movq 0x78(%rbx), %r15
testq %r15, %r15
je 0x945e
leaq 0xa8(%rbx), %r14
movq 0x80(%rbx), %rax
xorl %esi, %esi
xorl %ecx, %ecx
movq %rsi, %rdi
movq %r15, %rdx
subq %rcx, %rdx
cmpq $0x2, %rdx
jb 0x90c5
leaq (%rax,%rcx), %rsi
xorl %r8d, %r8d
cmpw $0xa0d, (%rsi,%r8)      # imm = 0xA0D
je 0x90c2
leaq 0x1(%r8), %r9
addq $0x3, %r8
cmpq %rdx, %r8
movq %r9, %r8
jbe 0x90a7
jmp 0x90c5
movq %r8, %rdx
leaq 0x1(%rdi), %rsi
movq %rsi, 0xb0(%rbx)
addq %rdx, %rcx
addq $0x2, %rcx
cmpq %r15, %rcx
jb 0x9091
movq %rdx, (%rsp)
cmpq $0x1, %rsi
jbe 0x945e
decq %rdi
movq %rdi, 0xb0(%rbx)
je 0x9151
movq %rdi, %rax
shrq $0x3c, %rax
leaq 0xb8(%rbx), %rbp
testq %rax, %rax
je 0x9165
callq 0x3040
movl $0xc, (%rax)
movq $0x0, (%rbp)
jmp 0x9138
movq 0x28(%rbx), %rdi
incq %rsi
leaq -0x1bf(%rip), %rdx      # 0x8f6d
movq %rbx, %rcx
callq 0x9ace
testl %eax, %eax
je 0x914a
movq %rbx, %rdi
callq 0x8df7
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x8fe6
xorl %ebp, %ebp
jmp 0x8fe6
leaq 0xb8(%rbx), %rbp
movq $0x0, 0xb8(%rbx)
jmp 0x9177
shlq $0x4, %rdi
callq 0x34c0
movq %rax, (%rbp)
testq %rax, %rax
je 0x9138
leaq 0x10(%rsp), %rdx
movq $0x0, (%rdx)
movq 0x80(%rbx), %rdi
movq %rsp, %r12
movq %r15, %rsi
movq %r12, %rcx
callq 0x949c
movq %rax, %r15
movq %rax, %rdi
callq 0x3190
cmpq (%r12), %rax
jae 0x91bc
leaq 0x8c80(%rip), %rdi      # 0x11e30
xorl %eax, %eax
callq 0x58d7
jmp 0x8fc8
leaq 0x8c8b(%rip), %rsi      # 0x11e4e
leaq 0xc(%rsp), %rdx
leaq 0x2c(%rsp), %rcx
movq %r15, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x3350
cmpl $0x2, %eax
jg 0x91f5
leaq 0x8c77(%rip), %rdi      # 0x11e5d
movq %r15, %rsi
xorl %eax, %eax
callq 0x58d7
jmp 0x8fc8
cmpl $0x1, 0xc(%rsp)
jne 0x9218
movl (%r14), %esi
leal -0x258(%rsi), %eax
cmpl $0xfffffe0c, %eax       # imm = 0xFFFFFE0C
jae 0x9221
leaq 0x8c8d(%rip), %rdi      # 0x11ea0
jmp 0x8fc1
leaq 0x8c5b(%rip), %rdi      # 0x11e7a
jmp 0x91b0
movq %r14, 0x18(%rsp)
cmpq $0x0, 0xb0(%rbx)
je 0x92f8
xorl %r12d, %r12d
movq 0x78(%rbx), %rsi
movq 0x80(%rbx), %rdi
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
callq 0x949c
movq %rax, %r13
movq %rax, %rdi
callq 0x3190
cmpq (%rsp), %rax
jb 0x9381
testq %rax, %rax
je 0x9284
movzbl -0x1(%r13,%rax), %ecx
cmpl $0x20, %ecx
je 0x9279
cmpl $0x9, %ecx
jne 0x9284
movb $0x0, -0x1(%r13,%rax)
decq %rax
jne 0x9269
movq %r13, %rdi
leaq 0x8c48(%rip), %rsi      # 0x11ed6
callq 0x3070
movq 0xb8(%rbx), %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 0xb8(%rbx), %r14
movq 0x8(%r14,%r15), %r13
movq %r13, %rdi
leaq 0x8c02(%rip), %rsi      # 0x11ed8
callq 0x3180
addq %r13, %rax
movq %rax, 0x8(%r14,%r15)
incq %r12
movq 0xb0(%rbx), %rsi
cmpq %rsi, %r12
jb 0x9237
jmp 0x92fa
xorl %esi, %esi
movq 0x10(%rsp), %rax
addq $0x2, %rax
cmpq 0x78(%rbx), %rax
jne 0x947d
movq 0x18(%rsp), %rdx
movl (%rdx), %eax
leal -0x64(%rax), %ecx
cmpl $0x63, %ecx
ja 0x9355
movq 0x80(%rbx), %rdi
callq 0x3450
movq 0xb8(%rbx), %rdi
callq 0x3450
xorl %eax, %eax
movq %rax, 0x80(%rbx)
movq %rax, 0xb8(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8f6d
movl %eax, %ebp
jmp 0x8fe6
cmpl $0x0, 0x30(%rbx)
je 0x938d
xorps %xmm0, %xmm0
movups %xmm0, 0xc0(%rbx)
movq 0x68(%rbx), %rdi
movq %rdx, %rsi
callq *0x60(%rbx)
movl %eax, %ebp
movq $0x0, 0xc8(%rbx)
jmp 0x8fde
leaq 0x8b35(%rip), %rdi      # 0x11ebd
jmp 0x91b0
cmpl $0x130, %eax            # imm = 0x130
je 0x935b
cmpl $0xcc, %eax
je 0x935b
movq (%rbp), %rdi
leaq 0x8b52(%rip), %rdx      # 0x11ef8
callq 0x8ecd
testq %rax, %rax
je 0x93dd
leaq 0x8b53(%rip), %rsi      # 0x11f0a
movq %rax, %rdi
callq 0x30c0
testq %rax, %rax
je 0x93dd
movl $0x1, 0x88(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9512
jmp 0x934e
movq 0xb0(%rbx), %rsi
movq 0xb8(%rbx), %rdi
leaq 0x8b20(%rip), %rdx      # 0x11f12
callq 0x8ecd
testq %rax, %rax
je 0x943f
movq %rax, %r14
callq 0x3040
movq %rax, %r15
movl $0x0, (%rax)
movq %r14, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x96dc
cmpl $0x0, (%r15)
je 0x944e
leaq 0x8af8(%rip), %rdi      # 0x11f21
movq %r14, %rsi
xorl %eax, %eax
callq 0x57b8
movl $0x0, (%r15)
jmp 0x8fd3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x976c
jmp 0x934e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9746
jmp 0x934e
leaq 0x897e(%rip), %rdi      # 0x11de3
leaq 0x8835(%rip), %rsi      # 0x11ca1
leaq 0x8985(%rip), %rcx      # 0x11df8
movl $0x1d8, %edx            # imm = 0x1D8
callq 0x3200
leaq 0x8a57(%rip), %rdi      # 0x11edb
leaq 0x8816(%rip), %rsi      # 0x11ca1
leaq 0x8966(%rip), %rcx      # 0x11df8
movl $0x217, %edx            # imm = 0x217
callq 0x3200