// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/socket.c
// Function: iov_eot
static size_t iov_eot(const struct iovec *iov, size_t minbuf, size_t maxbuf, _Bool eof, int *_error) {
	const char *p, *pe;
	size_t n = 0, eot;
	int lc = -1, error;

	p = iov->iov_base;
	pe = p + iov->iov_len;

	for (; p < pe && n < maxbuf; ++n) {
		lc = *p++;

		if (lc == '\r' && p < pe && *p == '\n') {
			lc = *p++; /* skip \n so we don't ++n */
		}
	}

	if ((size_t)-1 == (eot = p - (char *)iov->iov_base)) {
		error = EOVERFLOW;
		goto error;
	}

	if (n < maxbuf) {
		if (!eof) {
			if (n >= minbuf && lc != '\r') {
				/*
				 * just continue as we're not splitting a
				 * \r\n pair
				 */
				(void)0;
			} else if (n > minbuf && lc == '\r') {
				/*
				 * just exclude it. we might end up
				 * returning a trailing \r, but we know for
				 * a fact it's not part of a \r\n pair.
				 */
				--eot;
			} else if ((error = iov_addzu(&eot, eot, maxbuf - n))) {
				goto error;
			}
		}
	} else if (lc == '\r') {
		if (n > minbuf) {
			--eot; /* see comment ~10 lines above */
		} else if ((error = iov_addzu(&eot, eot, 1))) {
			goto error;
		}
	}

	return eot;
error:
	*_error = error;

	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x48(%rbp)
movl $0xffffffff, -0x54(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
addq 0x8(%rcx), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x59(%rbp)
jae 0x1e6e6
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
setb %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x1e6ef
jmp 0x1e745
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movsbl (%rax), %eax
movl %eax, -0x54(%rbp)
cmpl $0xd, -0x54(%rbp)
jne 0x1e735
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x1e735
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x1e735
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movsbl (%rax), %eax
movl %eax, -0x54(%rbp)
jmp 0x1e737
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x1e6c9
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
subq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq $-0x1, %rax
cmpq %rcx, %rax
jne 0x1e76f
movl $0x4b, -0x58(%rbp)
jmp 0x1e820
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1e7d6
testb $0x1, -0x21(%rbp)
jne 0x1e7d4
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x1e791
cmpl $0xd, -0x54(%rbp)
je 0x1e791
jmp 0x1e7d2
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x1e7af
cmpl $0xd, -0x54(%rbp)
jne 0x1e7af
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x1e7d0
movq -0x50(%rbp), %rsi
movq -0x20(%rbp), %rdx
subq -0x48(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x1e490
movl %eax, -0x58(%rbp)
cmpl $0x0, %eax
je 0x1e7ce
jmp 0x1e820
jmp 0x1e7d0
jmp 0x1e7d2
jmp 0x1e7d4
jmp 0x1e816
cmpl $0xd, -0x54(%rbp)
jne 0x1e814
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x1e7f4
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x1e812
movq -0x50(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
callq 0x1e490
movl %eax, -0x58(%rbp)
cmpl $0x0, %eax
je 0x1e810
jmp 0x1e820
jmp 0x1e812
jmp 0x1e814
jmp 0x1e816
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1e831
movl -0x58(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq $-0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)