// File: /workspace/github_c_makefile_star2_O1/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 0x917b
movq 0x28(%rbx), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %r14
movq %r14, %rdx
callq 0x9c29
movq (%r14), %rsi
movq 0x70(%rbx), %rax
leaq 0x4(%rax), %r14
cmpq %rsi, %r14
seta %cl
ja 0x9154
movq 0x20(%rsp), %rdx
cmpl $0xa0d0a0d, (%rdx,%rax) # imm = 0xA0D0A0D
je 0x9150
addq %rax, %rdx
incq %rdx
addq $0x5, %rax
movq %rax, %r14
addq $-0x4, %rax
movq %rax, 0x70(%rbx)
cmpq %rsi, %r14
seta %cl
ja 0x9154
cmpl $0xa0d0a0d, (%rdx)      # imm = 0xA0D0A0D
leaq 0x1(%rdx), %rdx
leaq 0x1(%r14), %rax
jne 0x912d
testb %cl, %cl
je 0x91cc
cmpq $0x10001, %rsi          # imm = 0x10001
jb 0x919f
leaq 0x8dd9(%rip), %rdi      # 0x11f3d
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x58ab
callq 0x3040
movl $0x0, (%rax)
movq 0x68(%rbx), %rdi
xorl %esi, %esi
callq *0x60(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x8f5d
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rbx), %rdi
incq %rsi
leaq -0xda(%rip), %rdx       # 0x90d3
movq %rbx, %rcx
callq 0x9c42
testl %eax, %eax
je 0x9270
movq %rbx, %rdi
callq 0x8f5d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x918e
movq 0x20(%rsp), %r15
movq %r14, 0x78(%rbx)
movq %r14, %rdi
callq 0x34c0
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x91bd
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3280
movq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x9eb4
movq $0x0, 0xb0(%rbx)
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x9277
movq 0x80(%rbx), %rcx
movq 0xb0(%rbx), %rsi
xorl %eax, %eax
movq %r14, %rdx
subq %rax, %rdx
cmpq $0x2, %rdx
jb 0x9258
leaq (%rcx,%rax), %rdi
xorl %r8d, %r8d
cmpw $0xa0d, (%rdi,%r8)      # imm = 0xA0D
je 0x9255
leaq 0x1(%r8), %r9
addq $0x3, %r8
cmpq %rdx, %r8
movq %r9, %r8
jbe 0x923a
jmp 0x9258
movq %r8, %rdx
incq %rsi
movq %rsi, 0xb0(%rbx)
addq %rdx, %rax
addq $0x2, %rax
cmpq %r14, %rax
jb 0x9227
jmp 0x927e
xorl %ebp, %ebp
jmp 0x918e
movq 0x8(%rsp), %rdx
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0xb0(%rbx), %r15
cmpq $0x1, %r15
jbe 0x95d0
addq $-0x2, %r15
movq %r15, 0xb0(%rbx)
je 0x92ba
movq %r15, %rax
shrq $0x3c, %rax
je 0x92be
callq 0x3040
movl $0xc, (%rax)
xorl %eax, %eax
jmp 0x92ca
movq %r15, %rdi
shlq $0x4, %rdi
callq 0x34c0
testq %r15, %r15
sete %cl
movq %rax, 0xb8(%rbx)
testq %rax, %rax
setne %al
orb %cl, %al
je 0x91bd
leaq 0x10(%rsp), %rdx
movq $0x0, (%rdx)
movq 0x80(%rbx), %rdi
leaq 0x8(%rsp), %r12
movq %r14, %rsi
movq %r12, %rcx
callq 0x960e
movq %rax, %r15
movq %rax, %rdi
callq 0x3190
cmpq (%r12), %rax
jae 0x932c
leaq 0x8c98(%rip), %rdi      # 0x11fb8
xorl %eax, %eax
callq 0x58ab
jmp 0x9170
leaq 0xa8(%rbx), %r14
leaq 0x8c9c(%rip), %rsi      # 0x11fd6
leaq 0x1c(%rsp), %rdx
leaq 0x2c(%rsp), %rcx
movq %r15, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x3350
cmpl $0x2, %eax
jg 0x936c
leaq 0x8c88(%rip), %rdi      # 0x11fe5
movq %r15, %rsi
xorl %eax, %eax
callq 0x58ab
jmp 0x9170
cmpl $0x1, 0x1c(%rsp)
jne 0x938f
movl (%r14), %esi
leal -0x258(%rsi), %eax
cmpl $0xfffffe0c, %eax       # imm = 0xFFFFFE0C
jae 0x9398
leaq 0x8c9e(%rip), %rdi      # 0x12028
jmp 0x9169
leaq 0x8c6c(%rip), %rdi      # 0x12002
jmp 0x9320
movq 0xb0(%rbx), %rsi
testq %rsi, %rsi
je 0x946d
xorl %r15d, %r15d
movq 0x78(%rbx), %rsi
movq 0x80(%rbx), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x960e
movq %rax, %r13
movq %rax, %rdi
callq 0x3190
cmpq 0x8(%rsp), %rax
jb 0x94f0
testq %rax, %rax
je 0x93fb
movzbl -0x1(%r13,%rax), %ecx
cmpl $0x20, %ecx
je 0x93f0
cmpl $0x9, %ecx
jne 0x93fb
movb $0x0, -0x1(%r13,%rax)
decq %rax
jne 0x93e0
movq %r13, %rdi
leaq 0x8c59(%rip), %rsi      # 0x1205e
callq 0x3070
movq 0xb8(%rbx), %rcx
movq %r15, %rbp
shlq $0x4, %rbp
movq %r13, (%rcx,%rbp)
movq %r13, %rdx
addq %rax, %rdx
cmpb $0x1, (%r13,%rax)
sbbq $-0x1, %rdx
movq %rdx, 0x8(%rcx,%rbp)
movb $0x0, (%r13,%rax)
movq 0xb8(%rbx), %r12
movq 0x8(%r12,%rbp), %r13
movq %r13, %rdi
leaq 0x8c13(%rip), %rsi      # 0x12060
callq 0x3180
addq %r13, %rax
movq %rax, 0x8(%r12,%rbp)
incq %r15
movq 0xb0(%rbx), %rsi
cmpq %rsi, %r15
jb 0x93ab
movq 0x10(%rsp), %rax
addq $0x2, %rax
cmpq 0x78(%rbx), %rax
jne 0x95ef
movl (%r14), %eax
leal -0x64(%rax), %ecx
cmpl $0x63, %ecx
ja 0x94c4
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 0x90d3
movl %eax, %ebp
jmp 0x918e
cmpl $0x0, 0x30(%rbx)
je 0x94fc
xorps %xmm0, %xmm0
movups %xmm0, 0xc0(%rbx)
movq 0x68(%rbx), %rdi
movq %r14, %rsi
callq *0x60(%rbx)
movl %eax, %ebp
movq $0x0, 0xc8(%rbx)
jmp 0x9186
leaq 0x8b4e(%rip), %rdi      # 0x12045
jmp 0x9320
cmpl $0x130, %eax            # imm = 0x130
je 0x94ca
cmpl $0xcc, %eax
je 0x94ca
movq 0xb8(%rbx), %rdi
leaq 0x8b68(%rip), %rdx      # 0x12080
callq 0x9033
testq %rax, %rax
je 0x954f
leaq 0x8b69(%rip), %rsi      # 0x12092
movq %rax, %rdi
callq 0x30c0
testq %rax, %rax
je 0x954f
movl $0x1, 0x88(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9684
jmp 0x94bd
movq 0xb0(%rbx), %rsi
movq 0xb8(%rbx), %rdi
leaq 0x8b36(%rip), %rdx      # 0x1209a
callq 0x9033
testq %rax, %rax
je 0x95b1
movq %rax, %r14
callq 0x3040
movq %rax, %r15
movl $0x0, (%rax)
movq %r14, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x9858
cmpl $0x0, (%r15)
je 0x95c0
leaq 0x8b0e(%rip), %rdi      # 0x120a9
movq %r14, %rsi
xorl %eax, %eax
callq 0x578c
movl $0x0, (%r15)
jmp 0x917b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x98e8
jmp 0x94bd
movq %rbx, %rdi
movq %rax, %rsi
callq 0x98c2
jmp 0x94bd
leaq 0x8994(%rip), %rdi      # 0x11f6b
leaq 0x884b(%rip), %rsi      # 0x11e29
leaq 0x899b(%rip), %rcx      # 0x11f80
movl $0x1d8, %edx            # imm = 0x1D8
callq 0x3200
leaq 0x8a6d(%rip), %rdi      # 0x12063
leaq 0x882c(%rip), %rsi      # 0x11e29
leaq 0x897c(%rip), %rcx      # 0x11f80
movl $0x217, %edx            # imm = 0x217
callq 0x3200