LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_shutdown
static lso_nargs_t lso_shutdown(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	int how, error;

	switch (luaL_checkoption(L, 2, "rw", (const char *[]){ "r", "w", "rw", "wr", 0 })) {
	case 0:
		how = SHUT_RD;

		break;
	case 1:
		how = SHUT_WR;

		break;
	default:
		how = SHUT_RDWR;

		break;
	} /* switch() */

	if ((error = so_shutdown(S->socket, how))) {
		lua_pushboolean(L, 0);
		lua_pushinteger(L, error);

		return 2;
	} else {
		lua_pushboolean(L, 1);

		return 1;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
callq 0x184cf
movq %rax, %r14
movups 0x2c306(%rip), %xmm0    # 0x44278
movq %rsp, %rcx
movaps %xmm0, (%rcx)
movups 0x2c309(%rip), %xmm0    # 0x44288
movaps %xmm0, 0x10(%rcx)
movq 0x2c30e(%rip), %rax     # 0x44298
movq %rax, 0x20(%rcx)
leaq 0x1d778(%rip), %rdx     # 0x3570d
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
callq 0xfbc0
xorl %esi, %esi
cmpl $0x1, %eax
setne %sil
incl %esi
testl %eax, %eax
cmovel %eax, %esi
movq 0x128(%r14), %rdi
callq 0x104b0
testl %eax, %eax
je 0x17fe1
movl %eax, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0xf910
jmp 0x17ff3
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_eof
static lso_nargs_t lso_eof(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	const char *which = luaL_optstring(L, 2, "rw");
	int nret = 0;

	for (; *which; which++) {
		switch (*which) {
		case 'r':
			lua_pushboolean(L, S->ibuf.eof);
			nret++;

			break;
		case 'w':
			lua_pushboolean(L, S->obuf.eof);
			nret++;

			break;
		}
	} /* for() */

	return nret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x184cf
movq %rax, %r14
leaq 0x1d6f4(%rip), %rdx     # 0x3570d
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x2, %esi
xorl %ecx, %ecx
callq 0xf8b0
movq %rax, %r12
leaq 0xf8(%r14), %r13
addq $0x90, %r14
movzbl (%r12), %eax
movq %r14, %rcx
cmpl $0x72, %eax
je 0x18057
cmpl $0x77, %eax
je 0x18054
testl %eax, %eax
jne 0x18065
jmp 0x1806a
movq %r13, %rcx
movzbl (%rcx), %esi
movq %rbx, %rdi
callq 0x10800
incl %r15d
incq %r12
jmp 0x1803c
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_accept
static lso_nargs_t lso_accept(lua_State *L) {
	struct luasocket *A = lso_checkself(L, 1), *S;
	struct so_options opts;
	int fd = -1, error;

	if (lua_istable(L, 2)) {
		opts = lso_checkopts(L, 2);
	} else {
		opts = *so_opts();
	}

	S = lso_newsocket(L, A->type);

	opts.fd_close.arg = S;
	opts.fd_close.cb = &lso_closefd;

	so_clear(A->socket);

	if (-1 == (fd = so_accept(A->socket, 0, 0, &error)))
		goto error;

	if ((error = lso_prepsocket(S)))
		goto error;

	if (!(S->socket = so_fdopen(fd, &opts, &error)))
		goto error;

	return 1;
error:
	cqs_closefd(&fd);
	lua_pushnil(L);
	lua_pushinteger(L, error);

	return 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
callq 0x184cf
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0xf260
cmpl $0x5, %eax
jne 0x180b2
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x19c85
jmp 0x18103
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movw $0x100, 0x20(%rsp)      # imm = 0x100
xorl %eax, %eax
movl %eax, 0x22(%rsp)
movw $0x0, 0x26(%rsp)
movups %xmm0, 0x2f(%rsp)
movups %xmm0, 0x3f(%rsp)
movb $0x0, 0x4f(%rsp)
movl %eax, 0x59(%rsp)
movl %eax, 0x5c(%rsp)
movl %eax, 0x28(%rsp)
movw $0x101, 0x2c(%rsp)      # imm = 0x101
movb $0x1, %al
movb %al, 0x2e(%rsp)
movq $0x1, 0x50(%rsp)
movb %al, 0x58(%rsp)
movl 0x120(%r14), %esi
movq %rbx, %rdi
callq 0x15ead
movq %rax, %r15
movq %rax, 0x38(%rsp)
leaq -0x215d(%rip), %rax     # 0x15fc4
movq %rax, 0x40(%rsp)
movq 0x128(%r14), %rdi
callq 0xf840
movq 0x128(%r14), %rdi
leaq 0xc(%rsp), %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0xffd0
cmpl $-0x1, %eax
je 0x18165
movl %eax, %ebp
movq %r15, %rdi
callq 0x163df
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x1818a
movl %ebp, %edi
callq 0x10a10
movq %rbx, %rdi
callq 0xf980
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
movl %ebp, %edi
callq 0xf2f0
movq %rax, %rcx
movq %rax, 0x128(%r15)
movl $0x1, %eax
testq %rcx, %rcx
jne 0x1817f
jmp 0x1815e
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_peername
static lso_nargs_t lso_peername(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	struct sockaddr_storage ss;
	socklen_t salen = sizeof ss;
	int error;

	memset(&ss, 0, sizeof ss);

	if ((error = so_remoteaddr(S->socket, &ss, &salen))) {
		lua_pushnil(L);
		lua_pushinteger(L, error);

		return 2;
	}

	return lso_pushname(L, &ss, salen);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
callq 0x184cf
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movq 0x128(%rax), %rdi
callq 0xf950
testl %eax, %eax
je 0x18220
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf980
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
jmp 0x18231
movl 0xc(%rsp), %edx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1a4e8
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_peereid
static lso_nargs_t lso_peereid(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	uid_t uid;
	gid_t gid;
	int error;

	if ((error = so_peereid(S->socket, &uid, &gid))) {
		lua_pushnil(L);
		lua_pushinteger(L, error);

		return 2;
	}

	lua_pushinteger(L, uid);
	lua_pushinteger(L, gid);

	return 2;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x184cf
movq 0x128(%rax), %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x108b0
testl %eax, %eax
je 0x1826d
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf980
movslq %ebp, %rsi
jmp 0x1827c
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xf910
movl (%rsp), %esi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_peerpid
static lso_nargs_t lso_peerpid(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	pid_t pid;
	int error;

	if ((error = so_peerpid(S->socket, &pid))) {
		lua_pushnil(L);
		lua_pushinteger(L, error);

		return 2;
	}

	lua_pushinteger(L, pid);

	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x184cf
movq 0x128(%rax), %rdi
leaq 0xc(%rsp), %rsi
callq 0x10940
testl %eax, %eax
je 0x182c7
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf980
movl $0x2, %r14d
jmp 0x182d1
movl $0x1, %r14d
movl 0xc(%rsp), %ebp
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_localname
static lso_nargs_t lso_localname(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	struct sockaddr_storage ss;
	socklen_t salen = sizeof ss;
	int error;

	memset(&ss, 0, sizeof ss);

	if ((error = so_localaddr(S->socket, &ss, &salen))) {
		lua_pushnil(L);
		lua_pushinteger(L, error);

		return 2;
	}

	return lso_pushname(L, &ss, salen);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
callq 0x184cf
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movq 0x128(%rax), %rdi
callq 0x100b0
testl %eax, %eax
je 0x18357
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf980
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
jmp 0x18368
movl 0xc(%rsp), %edx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1a4e8
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_stat
static lso_nargs_t lso_stat(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	const struct so_stat *st = so_stat(S->socket);

	lua_newtable(L);

	lua_newtable(L);
	lua_pushinteger(L, st->sent.count);
	lua_setfield(L, -2, "count");
	lua_pushboolean(L, st->sent.eof);
	lua_setfield(L, -2, "eof");
	lua_pushinteger(L, st->sent.time);
	lua_setfield(L, -2, "time");
	lua_setfield(L, -2, "sent");

	lua_newtable(L);
	lua_pushinteger(L, st->rcvd.count);
	lua_setfield(L, -2, "count");
	lua_pushboolean(L, st->rcvd.eof);
	lua_setfield(L, -2, "eof");
	lua_pushinteger(L, st->rcvd.time);
	lua_setfield(L, -2, "time");
	lua_setfield(L, -2, "rcvd");

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x184cf
movq 0x128(%rax), %rdi
callq 0xff00
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xf910
leaq 0x1cdcd(%rip), %r15     # 0x35189
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movzbl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x10800
leaq 0x1d2a7(%rip), %r12     # 0x35687
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0xf530
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
leaq 0x1d4df(%rip), %r13     # 0x358e2
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r13, %rdx
callq 0xf530
leaq 0x1d4cd(%rip), %rdx     # 0x358e7
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movzbl 0x20(%r14), %esi
movq %rbx, %rdi
callq 0x10800
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0xf530
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r13, %rdx
callq 0xf530
leaq 0x1d45d(%rip), %rdx     # 0x358ec
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_checktodo
static lso_error_t lso_checktodo(struct luasocket *S) {
	int todo, error;

	while ((todo = (S->todo & ~S->done))) {
		if (todo & LSO_DO_FLUSH) {
			so_clear(S->socket);

			if ((error = lso_doflush(S, LSO_NOBUF)))
				return error;

			S->done |= LSO_DO_FLUSH;
		} else if (todo & LSO_DO_STARTTLS) {
			so_clear(S->socket);

			if (!S->tls.once) {
				S->tls.once = 1;

				if (S->ibuf.mode & LSO_PUSHBACK)
					fifo_rvec(&S->ibuf.fifo, &S->tls.config.pushback, 1);

				error = so_starttls(S->socket, &S->tls.config);

				if (S->ibuf.mode & LSO_PUSHBACK) {
					fifo_purge(&S->ibuf.fifo);
					S->ibuf.eom = 0;
				}
			} else {
				error = so_starttls(S->socket, NULL);
			}

			if (S->tls.config.instance) {
				SSL_free(S->tls.config.instance);
				S->tls.config.instance = NULL;
			}

			if (S->tls.config.context) {
				SSL_CTX_free(S->tls.config.context);
				S->tls.config.context = NULL;
			}

			if (error)
				return error;

			S->done |= LSO_DO_STARTTLS;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x4(%rdi), %eax
movl %eax, %ecx
notl %ecx
andl (%rdi), %ecx
je 0x1865c
movq %rdi, %rbx
leaq 0x58(%rdi), %r14
leaq 0x28(%rdi), %r15
leaq 0x10(%rdi), %r12
leaq 0x78(%rdi), %r13
testb $0x1, %cl
jne 0x185ab
testb $0x2, %cl
je 0x18650
movq 0x128(%rbx), %rdi
callq 0xf840
cmpb $0x0, 0x8(%rbx)
je 0x185cd
movq 0x128(%rbx), %rdi
xorl %esi, %esi
callq 0x10480
movl %eax, %ebp
jmp 0x18615
movq 0x128(%rbx), %rdi
callq 0xf840
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1866f
movl %eax, %ebp
movl $0x1, %eax
jmp 0x18646
movb $0x1, 0x8(%rbx)
testb $0x40, 0x40(%rbx)
je 0x185e7
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x187c1
movq 0x128(%rbx), %rdi
movq %r12, %rsi
callq 0x10480
movl %eax, %ebp
testb $0x40, 0x40(%rbx)
je 0x18615
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movl $0x0, 0x10(%r13)
movb $0x0, 0x91(%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x1862b
callq 0xf770
movq $0x0, 0x20(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x18641
callq 0xf0f0
movq $0x0, 0x18(%rbx)
movl $0x2, %eax
testl %ebp, %ebp
jne 0x1865e
orl 0x4(%rbx), %eax
movl %eax, 0x4(%rbx)
movl %eax, %ecx
notl %ecx
andl (%rbx), %ecx
jne 0x18579
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_doflush
static lso_error_t lso_doflush(struct luasocket *S, int mode) {
	size_t amount = 0, n;
	struct iovec iov;
	int error;

	if (mode & LSO_LINEBUF) {
		if (S->obuf.eol > 0) {
			amount = S->obuf.eol;
		} else if (fifo_rlen(&S->obuf.fifo) >= S->obuf.maxline) {
			amount = S->obuf.maxline;
		}
	} else if (mode & LSO_FULLBUF) {
		amount = fifo_rlen(&S->obuf.fifo);
		amount -= amount % S->obuf.bufsiz;
	} else if (mode & LSO_NOBUF) {
		amount = fifo_rlen(&S->obuf.fifo);
	}

	while (amount) {
		if (!fifo_slice(&S->obuf.fifo, &iov, 0, amount))
			break; /* should never happen */

		if (!(n = so_write(S->socket, iov.iov_base, iov.iov_len, &error)))
			goto error;

		fifo_discard(&S->obuf.fifo, n);
		amount -= n;
		S->obuf.eol -= MIN(S->obuf.eol, n);
	}

	return 0;
error:
	switch (error) {
	case EPIPE:
		S->obuf.eof = 1;

		break;
	} /* switch() */

	return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testb $0x1, %sil
jne 0x1869e
testb $0x2, %sil
jne 0x186bf
testb $0x4, %sil
je 0x1879a
movq 0xe8(%rbx), %r14
jmp 0x186d5
movq 0x100(%rbx), %r14
testq %r14, %r14
jne 0x186de
movq 0xb0(%rbx), %r14
cmpq %r14, 0xe8(%rbx)
jae 0x186d5
jmp 0x1879a
movq 0xe8(%rbx), %r14
movq %r14, %rax
xorl %edx, %edx
divq 0xb8(%rbx)
subq %rdx, %r14
testq %r14, %r14
je 0x1879a
leaq 0xc0(%rbx), %r15
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1881b
testq %rax, %rax
je 0x1879a
movq 0x128(%rbx), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq 0xf3e0
testq %rax, %rax
je 0x187aa
movq %rax, %rcx
movq 0xe8(%rbx), %rsi
cmpq %rax, %rsi
movq %rax, %rdi
cmovbq %rsi, %rdi
movq 0xe0(%rbx), %rax
addq %rdi, %rax
xorl %edx, %edx
divq 0xd8(%rbx)
movq %rsi, %rax
subq %rdi, %rax
movq %rdx, 0xe0(%rbx)
movq %rax, 0xe8(%rbx)
cmpq %rcx, %rsi
ja 0x18773
movq $0x0, 0xe0(%rbx)
movq 0x100(%rbx), %rdx
xorl %eax, %eax
subq %rcx, %rdx
movl $0x0, %esi
cmovaeq %rdx, %rsi
movq %rsi, 0x100(%rbx)
subq %rcx, %r14
jne 0x186ef
jmp 0x1879c
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl 0xc(%rsp), %eax
cmpl $0x20, %eax
jne 0x1879c
movb $0x1, 0xf8(%rbx)
movl $0x20, %eax
jmp 0x1879c
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/fifo.h
// Function: fifo_rvec
static size_t fifo_rvec(struct fifo *fifo, struct iovec *iov, _Bool realign) {
	if (fifo->head + fifo->count > fifo->size && realign)
		fifo_realign(fifo);

	iov->iov_base = &fifo->base[fifo->head];
	iov->iov_len  = FIFO_MIN(fifo->size - fifo->head, fifo->count);

	return iov->iov_len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorb $0x1, %dl
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %rcx
leaq (%rcx,%rsi), %rdi
cmpq %rax, %rdi
setbe %dil
orb %dl, %dil
jne 0x187fe
movq %r14, %rdi
callq 0x164c7
movq 0x18(%r14), %rax
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rcx
subq %rsi, %rax
addq 0x10(%r14), %rsi
movq %rsi, (%rbx)
cmpq %rcx, %rax
cmovaeq %rcx, %rax
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_setvbuf_
static lso_nargs_t lso_setvbuf_(struct lua_State *L, struct luasocket *S, int modeidx, int bufidx) {
	lso_pushmode(L, S->obuf.mode, LSO_WRMASK, 1);
	lua_pushinteger(L, S->obuf.bufsiz);

	S->obuf.mode = lso_checkvbuf(L, modeidx) | (S->obuf.mode & ~LSO_ALLBUF);

	if (S->obuf.mode & (LSO_LINEBUF|LSO_FULLBUF))
		S->obuf.bufsiz = lso_optsize(L, bufidx, LSO_BUFSIZ);

	return 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl 0xa8(%rsi), %esi
movl $0x1, %r12d
movl $0xffffffbf, %edx       # imm = 0xFFFFFFBF
movl $0x1, %ecx
callq 0x18943
movq 0xb8(%rbx), %rsi
movq %r14, %rdi
callq 0xf910
movq 0x2b9a9(%rip), %rax     # 0x44270
movq %rsp, %rcx
movq %rax, 0x20(%rcx)
movups 0x2b98b(%rip), %xmm0    # 0x44260
movaps %xmm0, 0x10(%rcx)
movups 0x2b970(%rip), %xmm0    # 0x44250
movaps %xmm0, (%rcx)
leaq 0x1cfb4(%rip), %rdx     # 0x3589e
movq %r14, %rdi
movl %r15d, %esi
callq 0xfbc0
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
leal 0x2(,%rcx,2), %ecx
testl %eax, %eax
cmovel %r12d, %ecx
movl 0xa8(%rbx), %eax
andl $-0x8, %eax
orl %ecx, %eax
movl %eax, 0xa8(%rbx)
testb $0x3, %cl
je 0x18936
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movl %ebp, %esi
callq 0x18a14
movq %rax, 0xb8(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_pushmode
static void lso_pushmode(lua_State *L, int mode, int mask, _Bool libc) {
	if (libc) {
		if (mode & LSO_NOBUF)
			lua_pushstring(L, "no");
		else if (mode & LSO_LINEBUF)
			lua_pushstring(L, "line");
		else if (mode & LSO_FULLBUF)
			lua_pushstring(L, "full");
		else
			lua_pushnil(L); /* XXX: shouldn't happen */
	} else {
		char flag[8], *p = flag;

		if (mode & LSO_TEXT)
			*p++ = 't';
		else if (mode & LSO_BINARY)
			*p++ = 'b';
		else
			*p++ = '-';

		if (mode & LSO_NOBUF)
			*p++ = 'n';
		else if (mode & LSO_LINEBUF)
			*p++ = 'l';
		else if (mode & LSO_FULLBUF)
			*p++ = 'f';
		else
			*p++ = '-';

		if (mask & LSO_AUTOFLUSH)
			*p++ = (mode & LSO_AUTOFLUSH)? 'a' : 'A';

		if (mask & LSO_PUSHBACK)
			*p++ = (mode & LSO_PUSHBACK)? 'p' : 'P';

		lua_pushlstring(L, flag, p - flag);
	}
}

// Assembly:
testl %ecx, %ecx
je 0x18962
testb $0x4, %sil
jne 0x18975
testb $0x1, %sil
jne 0x18987
testb $0x2, %sil
jne 0x18a08
jmp 0xf980
pushq %rax
testb $0x8, %sil
jne 0x18981
testb $0x10, %sil
jne 0x18993
movb $0x2d, (%rsp)
jmp 0x18997
leaq 0x1d6c4(%rip), %rsi     # 0x36040
jmp 0xfbd0
movb $0x74, (%rsp)
jmp 0x18997
leaq 0x1cf10(%rip), %rsi     # 0x3589e
jmp 0xfbd0
movb $0x62, (%rsp)
testb $0x4, %sil
jne 0x189bd
testb $0x1, %sil
jne 0x189c1
testb $0x2, %sil
leaq 0x2(%rsp), %rax
movl $0x2d, %r8d
movl $0x66, %ecx
cmovel %r8d, %ecx
jmp 0x189c8
movb $0x6e, %cl
jmp 0x189c3
movb $0x6c, %cl
leaq 0x2(%rsp), %rax
movb %cl, 0x1(%rsp)
testb $0x20, %dl
je 0x189e1
movl %esi, %ecx
andb $0x20, %cl
orb $0x41, %cl
leaq 0x3(%rsp), %rax
movb %cl, -0x1(%rax)
testb $0x40, %dl
je 0x189f8
movzbl %sil, %ecx
shrl $0x6, %ecx
shlb $0x5, %cl
orb $0x50, %cl
movb %cl, (%rax)
incq %rax
movq %rsp, %rsi
subq %rsi, %rax
movq %rax, %rdx
callq 0xf4c0
popq %rax
retq
leaq 0x1ccd2(%rip), %rsi     # 0x356e1
jmp 0xfbd0
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_optsize
static size_t lso_optsize(struct lua_State *L, int index, size_t def) {
	lua_Number size;

	if (lua_isnoneornil(L, index))
		return def;

	size = luaL_checknumber(L, index);

	if (size < 0 || isinf(size))
		return LSO_INFSIZ;

	return (size > 0)? (size_t)size : def;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0xf260
testl %eax, %eax
jle 0x18ac8
movq %r14, %rdi
movl %ebp, %esi
callq 0x10920
movq %xmm0, %rax
testq %rax, %rax
sets %cl
btrq $0x3f, %rax
leaq -0x1(%rax), %rdx
movabsq $0xfffffffffffff, %rsi  # imm = 0xFFFFFFFFFFFFF
cmpq %rsi, %rdx
setb %dl
andb %cl, %dl
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
cmpq %rsi, %rax
sete %sil
orb %dl, %sil
movabsq $-0x10000000000000, %rdx # imm = 0xFFF0000000000000
addq %rax, %rdx
shrq $0x35, %rdx
cmpl $0x3ff, %edx            # imm = 0x3FF
setb %al
andb %cl, %al
orb %sil, %al
movq $-0x1, %rax
jne 0x18acb
cvttsd2si %xmm0, %rax
movq %rax, %rcx
movapd %xmm0, %xmm1
subsd 0x1c583(%rip), %xmm1    # 0x35030
sarq $0x3f, %rcx
cvttsd2si %xmm1, %rdx
andq %rcx, %rdx
orq %rax, %rdx
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
cmovaq %rdx, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_setmode_
static lso_nargs_t lso_setmode_(struct lua_State *L, struct luasocket *S, int ridx, int widx) {
	lso_pushmode(L, S->ibuf.mode, LSO_RDMASK, 0);
	lso_pushmode(L, S->obuf.mode, LSO_WRMASK, 0);

	if (!lua_isnil(L, ridx))
		S->ibuf.mode = LSO_RDMASK & lso_imode(luaL_checkstring(L, ridx), LSO_INITMODE);

	if (!lua_isnil(L, widx))
		S->obuf.mode = LSO_WRMASK & lso_imode(luaL_checkstring(L, widx), LSO_INITMODE);

	return 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl 0x40(%rsi), %esi
movl $0xffffffd8, %edx       # imm = 0xFFFFFFD8
xorl %ecx, %ecx
callq 0x18943
movl 0xa8(%rbx), %esi
movq %r14, %rdi
movl $0xffffffbf, %edx       # imm = 0xFFFFFFBF
xorl %ecx, %ecx
callq 0x18943
movq %r14, %rdi
movl %r15d, %esi
callq 0xf260
testl %eax, %eax
je 0x18b35
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %rdi
movl $0x69, %esi
callq 0x18b70
andl $-0x28, %eax
movl %eax, 0x40(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0xf260
testl %eax, %eax
je 0x18b65
movq %r14, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %rdi
movl $0x69, %esi
callq 0x18b70
andl $-0x41, %eax
movl %eax, 0xa8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_imode
static int lso_imode(const char *str, int init) {
	int mode = init, ch;

	while ((ch = *str++)) {
		switch (ch) {
		case 'n':
			mode = LSO_NOBUF | (mode & ~LSO_ALLBUF);
			break;
		case 'l':
			mode = LSO_LINEBUF | (mode & ~LSO_ALLBUF);
			break;
		case 'f':
			mode = LSO_FULLBUF | (mode & ~LSO_ALLBUF);
			break;
		case 't':
			mode = LSO_TEXT | (mode & ~LSO_BINARY);
			break;
		case 'b':
			mode = LSO_BINARY | (mode & ~LSO_TEXT);
			break;
		case 'a':
			mode |= LSO_AUTOFLUSH;
			break;
		case 'A':
			mode &= ~LSO_AUTOFLUSH;
			break;
		case 'p':
			mode |= LSO_PUSHBACK;
			break;
		case 'P':
			mode &= ~LSO_PUSHBACK;
			break;
		} /* switch() */
	} /* while() */

	return mode;
}

// Assembly:
movl %esi, %eax
leaq 0x1c9c7(%rip), %rcx     # 0x35540
movzbl (%rdi), %edx
incq %rdi
cmpl $0x61, %edx
jle 0x18b9c
leal -0x6c(%rdx), %esi
cmpl $0x8, %esi
ja 0x18bb0
movslq (%rcx,%rsi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
andl $-0x8, %eax
incl %eax
jmp 0x18b79
cmpl $0x4f, %edx
jle 0x18bc2
cmpl $0x50, %edx
je 0x18bcc
cmpl $0x61, %edx
jne 0x18b79
orl $0x20, %eax
jmp 0x18b79
cmpl $0x62, %edx
je 0x18be6
cmpl $0x66, %edx
jne 0x18b79
andl $-0x8, %eax
orl $0x2, %eax
jmp 0x18b79
cmpl $0x41, %edx
jne 0x18bee
andl $-0x21, %eax
jmp 0x18b79
andl $-0x41, %eax
jmp 0x18b79
orl $0x40, %eax
jmp 0x18b79
andl $-0x19, %eax
orl $0x8, %eax
jmp 0x18b79
andl $-0x8, %eax
orl $0x4, %eax
jmp 0x18b79
andl $-0x19, %eax
orl $0x10, %eax
jmp 0x18b79
testl %edx, %edx
jne 0x18b79
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_setbufsiz_
static lso_nargs_t lso_setbufsiz_(struct lua_State *L, struct luasocket *S, int ridx, int widx) {
	lso_pushsize(L, S->ibuf.bufsiz);
	lso_pushsize(L, S->obuf.bufsiz);

	S->ibuf.bufsiz = lso_optsize(L, ridx, S->ibuf.bufsiz);
	S->obuf.bufsiz = lso_optsize(L, widx, S->obuf.bufsiz);

	return 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
movq 0x50(%rsi), %rsi
callq 0x18c53
movq 0xb8(%rbx), %rsi
movq %r15, %rdi
callq 0x18c53
movq 0x50(%rbx), %rdx
movq %r15, %rdi
movl %r14d, %esi
callq 0x18a14
movq %rax, 0x50(%rbx)
movq 0xb8(%rbx), %rdx
movq %r15, %rdi
movl %ebp, %esi
callq 0x18a14
movq %rax, 0xb8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_setmaxline_
static lso_nargs_t lso_setmaxline_(struct lua_State *L, struct luasocket *S, int ridx, int widx) {
	lso_pushsize(L, S->ibuf.maxline);
	lso_pushsize(L, S->obuf.maxline);

	S->ibuf.maxline = lso_optsize(L, ridx, S->ibuf.maxline);
	S->obuf.maxline = lso_optsize(L, widx, S->obuf.maxline);

	return 2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
movq 0x48(%rsi), %rsi
callq 0x18c53
movq 0xb0(%rbx), %rsi
movq %r15, %rdi
callq 0x18c53
movq 0x48(%rbx), %rdx
movq %r15, %rdi
movl %r14d, %esi
callq 0x18a14
movq %rax, 0x48(%rbx)
movq 0xb0(%rbx), %rdx
movq %r15, %rdi
movl %ebp, %esi
callq 0x18a14
movq %rax, 0xb0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_settimeout_
static lso_nargs_t lso_settimeout_(struct lua_State *L, struct luasocket *S, int index) {
	double timeout;

	if (isnormal(S->timeout) || S->timeout == 0) {
		lua_pushnumber(L, S->timeout);
	} else {
		lua_pushnil(L);
	}

	timeout = luaL_optnumber(L, index, NAN);

	S->timeout = (isnormal(timeout) || timeout == 0)? timeout : NAN;

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x140(%rsi), %xmm0
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $-0x10000000000000, %r15 # imm = 0xFFF0000000000000
addq %r15, %rax
shrq $0x35, %rax
cmpl $0x3ff, %eax            # imm = 0x3FF
jb 0x18d19
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x18d0f
jnp 0x18d19
movq %r14, %rdi
callq 0xf980
jmp 0x18d21
movq %r14, %rdi
callq 0xf2c0
movq 0x1c2df(%rip), %xmm0    # 0x35008
movq %r14, %rdi
movl %ebp, %esi
callq 0xf780
movq %xmm0, %rax
btrq $0x3f, %rax
addq %r15, %rax
shrq $0x35, %rax
cmpl $0x3ff, %eax            # imm = 0x3FF
jb 0x18d68
xorpd %xmm1, %xmm1
cmpeqsd %xmm0, %xmm1
andpd %xmm1, %xmm0
movsd 0x1c2a8(%rip), %xmm2    # 0x35008
andnpd %xmm2, %xmm1
orpd %xmm1, %xmm0
movsd %xmm0, 0x140(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_seterror_
static lso_nargs_t lso_seterror_(struct lua_State *L, struct luasocket *S, const char *what, int error) {
	int nret = 0;

	for (; *what; what++) {
		switch (*what) {
		case 'r':
			lso_pusherror(L, S->ibuf.error);
			nret++;

			if (!(S->ibuf.error = error))
				S->ibuf.numerrs = 0;

			break;
		case 'w':
			lso_pusherror(L, S->obuf.error);
			nret++;

			if (!(S->obuf.error = error))
				S->obuf.numerrs = 0;

			break;
		default:
			return luaL_argerror(L, 2, lua_pushfstring(L, "%s: %c: only `r' or `w' accepted", what, *what));
		} /* switch() */
	} /* for() */

	return nret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x110(%rsi), %rax
movq %rax, (%rsp)
leaq 0x98(%rsi), %r13
xorl %r15d, %r15d
movzbl (%r14,%r15), %eax
cmpl $0x72, %eax
je 0x18dd3
cmpl $0x77, %eax
jne 0x18dfe
movl 0x108(%r12), %esi
movq %rbx, %rdi
callq 0x18e4c
movl %ebp, 0x108(%r12)
movq (%rsp), %rax
jmp 0x18dee
movl 0x94(%r12), %esi
movq %rbx, %rdi
callq 0x18e4c
movl %ebp, 0x94(%r12)
movq %r13, %rax
testl %ebp, %ebp
jne 0x18df9
movq $0x0, (%rax)
incq %r15
jmp 0x18da6
testl %eax, %eax
jne 0x18e14
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl %al, %ecx
addq %r15, %r14
leaq 0x1c8cb(%rip), %rsi     # 0x356ec
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xfff0
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf3f0
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_setmaxerrs_
static lso_nargs_t lso_setmaxerrs_(struct lua_State *L, struct luasocket *S, int index) {
	const char *what = "rw";
	int nret = 0;

	if (lua_type(L, index) == LUA_TSTRING) {
		what = luaL_checkstring(L, index);
		index++;
	}

	for (; *what; what++) {
		switch (*what) {
		case 'r':
			lua_pushinteger(L, S->ibuf.maxerrs);
			nret++;

			S->ibuf.maxerrs = luaL_optunsigned(L, index, S->ibuf.maxerrs);

			break;
		case 'w':
			lua_pushinteger(L, S->obuf.maxerrs);
			nret++;

			S->obuf.maxerrs = luaL_optunsigned(L, index, S->obuf.maxerrs);

			break;
		default:
			return luaL_argerror(L, 1, lua_pushfstring(L, "%s: %c: only `r' or `w' accepted", what, *what));
		}
	}

	return nret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %esi
callq 0xf260
cmpl $0x4, %eax
jne 0x18e8e
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %r15
incl %ebp
jmp 0x18e95
leaq 0x1c878(%rip), %r15     # 0x3570d
leaq 0x118(%r14), %rax
movq %rax, (%rsp)
addq $0xa0, %r14
xorl %r12d, %r12d
movzbl (%r15,%r12), %eax
movq %r14, %r13
cmpl $0x72, %eax
je 0x18ec0
movq (%rsp), %r13
cmpl $0x77, %eax
jne 0x18ee3
movq (%r13), %rsi
movq %rbx, %rdi
callq 0xf910
movq (%r13), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf400
movq %rax, (%r13)
incq %r12
jmp 0x18eaa
testl %eax, %eax
jne 0x18ef9
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl %al, %ecx
addq %r12, %r15
leaq 0x1c7e6(%rip), %rsi     # 0x356ec
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfff0
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf3f0
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_onerror_
static lso_nargs_t lso_onerror_(struct lua_State *L, struct luasocket *S, int fidx) {
	cqs_getref(L, S->onerror);

	if (lua_gettop(L) > fidx) {
		if (!lua_isnil(L, fidx))
			luaL_checktype(L, fidx, LUA_TFUNCTION);
		lua_pushvalue(L, fidx);
		cqs_ref(L, &S->onerror);
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x130(%rsi), %rdx
cmpq $-0x2, %rdx
jne 0x18f51
callq 0xf980
jmp 0x18f5b
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf450
movq %r14, %rdi
callq 0xf920
cmpl %ebp, %eax
jle 0x18fc3
movq %r14, %rdi
movl %ebp, %esi
callq 0xf260
testl %eax, %eax
je 0x18f84
movq %r14, %rdi
movl %ebp, %esi
movl $0x6, %edx
callq 0xf6c0
movq %r14, %rdi
movl %ebp, %esi
callq 0xf9c0
movl 0x130(%rbx), %edx
cmpl $-0x2, %edx
je 0x18fb0
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xfad0
movl $0xfffffffe, 0x130(%rbx) # imm = 0xFFFFFFFE
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x10930
movl %eax, 0x130(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_preprcv
static lso_error_t lso_preprcv(lua_State *L, struct luasocket *S) {
	int error;

	if ((error = lso_checkrcverrs(L, S)))
		return error;

	if ((error = lso_checktodo(S)))
		return error;

	so_clear(S->socket);

	if (S->obuf.mode & LSO_AUTOFLUSH) {
		switch ((error = lso_doflush(S, LSO_NOBUF))) {
		case EAGAIN:
			break;
		case EPIPE:
			break;
		default:
			return error;
		}
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movl 0x94(%rsi), %eax
testl %eax, %eax
je 0x1904f
movq 0x98(%rbx), %rcx
incq %rcx
movq %rcx, 0x98(%rbx)
cmpq 0xa0(%rbx), %rcx
jbe 0x19089
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x80, %edx
movl %eax, %edi
callq 0xf250
leaq 0x1c6ef(%rip), %rsi     # 0x35727
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfd60
movl 0x94(%rbx), %eax
testl %eax, %eax
jne 0x19089
movq %rbx, %rdi
callq 0x1854c
testl %eax, %eax
jne 0x19089
movq 0x128(%rbx), %rdi
callq 0xf840
testb $0x20, 0xa8(%rbx)
je 0x19087
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1866f
cmpl $0x20, %eax
je 0x19087
cmpl $0xb, %eax
jne 0x19089
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_fill
static lso_error_t lso_fill(struct luasocket *S, size_t limit) {
	struct iovec iov;
	size_t prepbuf, count;
	int error;

	if (S->ibuf.eom && fifo_rlen(&S->ibuf.fifo) > 0)
		return 0;

	prepbuf = (S->type == SOCK_DGRAM)? (SO_MIN(limit, 65536)) : 1;

	while (fifo_rlen(&S->ibuf.fifo) < limit) {
		if ((error = fifo_wbuf(&S->ibuf.fifo, &iov, prepbuf)))
			return error;

		if ((count = so_read(S->socket, iov.iov_base, iov.iov_len, &error))) {
			fifo_update(&S->ibuf.fifo, count);

			if (S->type == SOCK_DGRAM || S->type == SOCK_SEQPACKET) {
				S->ibuf.eom = 1;

				return 0;
			}
		} else {
			if (error == EPIPE)
				S->ibuf.eof = 1;

			return error;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x80(%rdi), %rsi
cmpb $0x1, 0x91(%rdi)
jne 0x190c6
xorl %r14d, %r14d
testq %rsi, %rsi
jne 0x19202
xorl %esi, %esi
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r15
cmovbq %r15, %rax
cmpl $0x2, 0x120(%rbx)
movl $0x1, %r13d
cmoveq %rax, %r13
leaq 0x58(%rbx), %r12
xorl %r14d, %r14d
leaq 0x4(%rsp), %rbp
cmpq %r15, %rsi
jae 0x19202
movq 0x70(%rbx), %rcx
movq %rcx, %rax
subq %rsi, %rax
cmpq %r13, %rax
jae 0x1912b
addq %r13, %rsi
jb 0x191f7
movq %r12, %rdi
callq 0x16418
testl %eax, %eax
jne 0x191ff
movq 0x70(%rbx), %rcx
movq 0x80(%rbx), %rsi
testq %rcx, %rcx
je 0x1913e
movq 0x78(%rbx), %rax
addq %rsi, %rax
xorl %edx, %edx
divq %rcx
jmp 0x19140
xorl %edx, %edx
movq %rcx, %rax
subq %rsi, %rax
subq %rdx, %rcx
addq 0x68(%rbx), %rdx
movq %rdx, 0x8(%rsp)
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rsp)
cmpq %r13, %rcx
jae 0x1917f
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0x1, %edx
callq 0x197b6
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movl $0x0, 0x4(%rsp)
movq 0x128(%rbx), %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %rbp, %rcx
callq 0xf3b0
testq %rax, %rax
je 0x191dd
movq 0x70(%rbx), %rsi
movq 0x80(%rbx), %rcx
subq %rcx, %rsi
cmpq %rax, %rsi
cmovaeq %rax, %rsi
addq %rcx, %rsi
movq %rsi, 0x80(%rbx)
movl 0x120(%rbx), %eax
cmpl $0x5, %eax
je 0x191d4
cmpl $0x2, %eax
jne 0x190ef
movb $0x1, 0x91(%rbx)
jmp 0x19202
movl 0x4(%rsp), %r14d
cmpl $0x20, %r14d
jne 0x19202
movb $0x1, 0x90(%rbx)
movl $0x20, %r14d
jmp 0x19202
movl $0x4b, %r14d
jmp 0x19202
movl %eax, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: iov_trimcr
static size_t iov_trimcr(struct iovec *iov, _Bool chomp) {
	char *p, *pe;

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

	if (chomp) {
		if (pe - p >= 2 && pe[-1] == '\n' && pe[-2] == '\r')
			*(--pe - 1) = '\n';
	} else {
		while (p < pe && (p = memchr(p, '\r', pe - p))) {
			if (++p >= pe) {
				break;
			} else if (*p == '\n') {
				memmove(p - 1, p, pe - p);
				--pe;
			}
		}
	}

	return iov->iov_len = pe - (char *)iov->iov_base;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %rax
leaq (%r14,%rax), %r15
testl %esi, %esi
je 0x19249
cmpq $0x2, %rax
jl 0x1928e
cmpb $0xa, -0x1(%r15)
jne 0x1928e
cmpb $0xd, -0x2(%r15)
jne 0x1928e
movb $0xa, -0x2(%r15)
decq %r15
jmp 0x1928e
testq %rax, %rax
jle 0x1928e
movq %r15, %rdx
subq %r14, %rdx
movq %r14, %rdi
movl $0xd, %esi
callq 0xfe90
testq %rax, %rax
je 0x1928e
leaq 0x1(%rax), %r14
cmpq %r15, %r14
jae 0x1928e
cmpb $0xa, (%r14)
jne 0x19289
movq %r15, %rdx
subq %r14, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x105f0
decq %r15
cmpq %r15, %r14
jb 0x1924e
subq (%rbx), %r15
movq %r15, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_getline
static lso_error_t lso_getline(struct luasocket *S, struct iovec *iov) {
	int error;

	while (!fifo_lvec(&S->ibuf.fifo, iov)) {
		error = lso_fill(S, S->ibuf.maxline);

		if (fifo_lvec(&S->ibuf.fifo, iov))
			break;

		if (fifo_rlen(&S->ibuf.fifo) > 0 && lso_nomore(S, S->ibuf.maxline)) {
			fifo_slice(&S->ibuf.fifo, iov, 0, S->ibuf.maxline);

			break;
		}

		return lso_asserterror(error);
	}

	iov->iov_len = MIN(iov->iov_len, S->ibuf.maxline);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x58(%rdi), %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rdi), %rax
movq 0x80(%rdi), %r15
movq 0x68(%rdi), %r12
movq 0x70(%rdi), %rbx
leaq (%r12,%rax), %rbp
movq %rbp, (%rsi)
subq %rax, %rbx
cmpq %r15, %rbx
movq %r15, %r13
cmovbq %rbx, %r13
movq %rsi, (%rsp)
movq %r13, 0x8(%rsi)
testq %r13, %r13
je 0x19373
movq %rbp, %rdi
movl $0xa, %esi
movq %r13, %rdx
callq 0xfe90
testq %rax, %rax
je 0x1931b
subq %rbp, %rax
incq %rax
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
testq %rax, %rax
jne 0x1948b
jmp 0x19373
cmpq %r15, %rbx
jae 0x19367
subq %r13, %r15
movq (%rsp), %rax
movq %r15, 0x8(%rax)
movq %r12, (%rax)
movq %r12, %rdi
movl $0xa, %esi
movq %r15, %rdx
callq 0xfe90
testq %rax, %rax
je 0x19367
subq %r12, %rbx
addq %rbx, %rax
incq %rax
movq (%rsp), %rbx
movq %rax, 0x8(%rbx)
movq %r12, (%rbx)
movq 0x10(%rsp), %rdi
callq 0x164c7
movq 0x8(%rbx), %rax
jmp 0x19310
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x48(%r14), %rsi
movq %r14, %rdi
callq 0x19094
movl %eax, %esi
movq 0x78(%r14), %rax
movq 0x80(%r14), %rbp
movq 0x68(%r14), %r12
movq 0x70(%r14), %rbx
leaq (%r12,%rax), %r15
movq (%rsp), %rcx
movq %r15, (%rcx)
subq %rax, %rbx
cmpq %rbp, %rbx
movq %rbp, %r13
cmovbq %rbx, %r13
movq %r13, 0x8(%rcx)
testq %r13, %r13
je 0x19452
movl %esi, 0xc(%rsp)
movq %r15, %rdi
movl $0xa, %esi
movq %r13, %rdx
callq 0xfe90
testq %rax, %rax
je 0x193f6
subq %r15, %rax
incq %rax
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
testq %rax, %rax
movl 0xc(%rsp), %esi
jne 0x1948b
movq 0x80(%r14), %rbp
jmp 0x19452
cmpq %rbp, %rbx
jae 0x19442
movq %rbp, %rdx
subq %r13, %rdx
movq (%rsp), %rax
movq %rdx, 0x8(%rax)
movq %r12, (%rax)
movq %r12, %rdi
movl $0xa, %esi
callq 0xfe90
testq %rax, %rax
je 0x19442
subq %r12, %rbx
addq %rbx, %rax
incq %rax
movq (%rsp), %rbx
movq %rax, 0x8(%rbx)
movq %r12, (%rbx)
movq 0x10(%rsp), %rdi
callq 0x164c7
movq 0x8(%rbx), %rax
jmp 0x193e0
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movl 0xc(%rsp), %esi
testq %rbp, %rbp
je 0x194a2
movq 0x48(%r14), %rdx
cmpb $0x0, 0x90(%r14)
jne 0x19476
cmpq %rdx, %rbp
setae %al
orb 0x91(%r14), %al
cmpb $0x1, %al
jne 0x194a2
movq 0x10(%rsp), %rdi
movq (%rsp), %rbx
movq %rbx, %rsi
callq 0x1881b
movq 0x8(%rbx), %rax
movq 0x48(%r14), %rcx
cmpq %rcx, %rax
cmovbq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rax)
xorl %eax, %eax
jmp 0x194ac
testl %esi, %esi
movl $0xe, %eax
cmovnel %esi, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_getheader
static lso_error_t lso_getheader(struct luasocket *S, struct iovec *iov) {
	size_t eoh;
	int error;

	fifo_slice(&S->ibuf.fifo, iov, 0, S->ibuf.maxline);

	if ((size_t)-1 == (eoh = iov_eoh(iov, lso_nomore(S, S->ibuf.maxline), 0, &error)))
		goto error;

	if (!eoh || eoh > iov->iov_len) {
		error = lso_fill(S, S->ibuf.maxline);

		fifo_slice(&S->ibuf.fifo, iov, 0, S->ibuf.maxline);

		if ((size_t)-1 == (eoh = iov_eoh(iov, lso_nomore(S, S->ibuf.maxline), 0, &error)))
			goto error;
		else if (!eoh)
			goto nomore;
		else if (eoh > iov->iov_len)
			goto error; /* lso_fill should have returned error */
	}

	iov->iov_len = eoh;

	return 0;
nomore:
	iov->iov_len = 0;

	return 0;
error:
	return lso_asserterror(error);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x58(%rdi), %r15
movq 0x48(%rdi), %rdx
movq %r15, %rdi
callq 0x1881b
movb $0x1, %al
cmpb $0x0, 0x90(%r14)
jne 0x194fe
cmpb $0x0, 0x91(%r14)
jne 0x194fe
movq 0x48(%r14), %rax
cmpq %rax, 0x80(%r14)
setae %al
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movzbl %al, %edx
leaq 0xc(%rsp), %rcx
callq 0x19824
cmpq $-0x1, %rax
je 0x1959d
testq %rax, %rax
je 0x1952b
cmpq 0x8(%rbx), %rax
jbe 0x195ad
movq 0x48(%r14), %rsi
movq %r14, %rdi
callq 0x19094
movl %eax, 0xc(%rsp)
movq 0x48(%r14), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1881b
movb $0x1, %al
cmpb $0x0, 0x90(%r14)
jne 0x1956e
cmpb $0x0, 0x91(%r14)
jne 0x1956e
movq 0x48(%r14), %rax
cmpq %rax, 0x80(%r14)
setae %al
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movzbl %al, %edx
leaq 0xc(%rsp), %rcx
callq 0x19824
cmpq $-0x1, %rax
je 0x1959d
testq %rax, %rax
jne 0x19597
movq $0x0, 0x8(%rbx)
jmp 0x195b1
cmpq 0x8(%rbx), %rax
jbe 0x195ad
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
movl $0xe, %eax
cmovnel %ecx, %eax
jmp 0x195b3
movq %rax, 0x8(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: iov_trimcrlf
static size_t iov_trimcrlf(struct iovec *iov, _Bool chomp) {
	char *sp, *p, *pe;

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

	if (chomp) {
		if (p < pe && pe[-1] == '\n') {
			--pe;

			if (p < pe && pe[-1] == '\r')
				--pe;
		}
	} else {
		while (p < pe && (p = memchr(p, '\n', pe - p))) {
			if (p > sp && p[-1] == '\r') {
				++p;
				memmove(p - 2, p, pe - p);
				pe -= 2;
			} else {
				memmove(p, p + 1, pe - p - 1);
				--pe;
			}
		}
	}

	return iov->iov_len = pe - (char *)iov->iov_base;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x8(%rdi), %rax
leaq (%r15,%rax), %r12
testl %esi, %esi
je 0x1960a
testq %rax, %rax
jle 0x1967e
cmpb $0xa, -0x1(%r12)
jne 0x1967e
leaq -0x1(%r12), %rax
cmpq %rax, %r15
jae 0x19605
cmpb $0xd, -0x2(%r12)
leaq -0x2(%r12), %rcx
cmoveq %rcx, %rax
movq %rax, %r12
jmp 0x1967e
testq %rax, %rax
jle 0x1967e
movq %r15, %r14
movq %r12, %rdx
subq %r14, %rdx
movq %r14, %rdi
movl $0xa, %esi
callq 0xfe90
testq %rax, %rax
je 0x1967b
movq %rax, %r14
cmpq %r15, %rax
jbe 0x19657
cmpb $0xd, -0x1(%r14)
jne 0x19657
leaq -0x1(%r14), %rdi
incq %r14
movq %r12, %rdx
subq %r14, %rdx
movq %r14, %rsi
callq 0x105f0
movq $-0x2, %rax
jmp 0x19673
leaq 0x1(%r14), %rsi
movq %r14, %rdx
notq %rdx
addq %r12, %rdx
movq %r14, %rdi
callq 0x105f0
movq $-0x1, %rax
addq %rax, %r12
cmpq %r12, %r14
jb 0x19612
movq (%rbx), %r15
subq %r15, %r12
movq %r12, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: lso_getblock
static lso_error_t lso_getblock(struct luasocket *S, struct iovec *iov, size_t minbuf, size_t maxbuf, int mode) {
	int error;

	if (mode & LSO_TEXT) {
		size_t fillsz = maxbuf, n;

		do {
			error = lso_fill(S, fillsz);

			fifo_slice(&S->ibuf.fifo, iov, 0, -1);

			if ((size_t)-1 == (n = iov_eot(iov, minbuf, maxbuf, (S->ibuf.eof || S->ibuf.eom), &error))) {
				goto error;
			} else if (n > iov->iov_len) {
				if (fillsz < n)
					error = 0;

				fillsz = n;
			} else {
				iov->iov_len = n;

				return 0;
			}
		} while (!error);
	} else {
		error = lso_fill(S, maxbuf);

		if (fifo_slice(&S->ibuf.fifo, iov, 0, maxbuf) >= minbuf)
			return 0;

		if ((S->ibuf.eof || S->ibuf.eom) && iov->iov_len > 0)
			return 0;
	}

error:
	return lso_asserterror(error);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
testb $0x8, %r8b
jne 0x19704
movq %r14, %rdi
movq %rbp, %rsi
callq 0x19094
movl %eax, %r15d
leaq 0x58(%r14), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1881b
movq %rax, %rcx
xorl %eax, %eax
cmpq %r12, %rcx
jae 0x197a7
cmpb $0x0, 0x90(%r14)
jne 0x196f4
cmpb $0x1, 0x91(%r14)
jne 0x19793
cmpq $0x0, 0x8(%rbx)
jne 0x197a7
jmp 0x19793
movq %r12, 0x10(%rsp)
leaq 0x58(%r14), %r13
movq %rbp, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x19094
movl %eax, 0xc(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq $-0x1, %rdx
callq 0x1881b
movb $0x1, %al
cmpb $0x0, 0x90(%r14)
jne 0x19744
movb 0x91(%r14), %al
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movzbl %al, %r8d
movq 0x10(%rsp), %rdx
movq %rbp, %rcx
leaq 0xc(%rsp), %r9
callq 0x1995b
cmpq $-0x1, %rax
je 0x1978e
cmpq 0x8(%rbx), %rax
jbe 0x197a1
cmpq %rax, %r12
jae 0x1977f
movl $0x0, 0xc(%rsp)
movq %rax, %r12
jmp 0x19710
movl 0xc(%rsp), %r15d
movq %rax, %r12
testl %r15d, %r15d
je 0x19710
jmp 0x19793
movl 0xc(%rsp), %r15d
testl %r15d, %r15d
movl $0xe, %eax
cmovnel %r15d, %eax
jmp 0x197a7
movq %rax, 0x8(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/fifo.h
// Function: fifo_wvec
static size_t fifo_wvec(struct fifo *fifo, struct iovec *iov, _Bool realign) {
	size_t tail, count;

	if (fifo->head + fifo->count < fifo->size && realign)
		fifo_realign(fifo);

	tail  = (fifo->size)? ((fifo->head + fifo->count) % fifo->size) : 0;
	count = fifo_wlen(fifo);

	iov->iov_base	= &fifo->base[tail];
	iov->iov_len	= FIFO_MIN(fifo->size - tail, count);

	return iov->iov_len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorb $0x1, %dl
movq 0x18(%rdi), %rcx
movq 0x28(%rdi), %rsi
movq 0x20(%rdi), %rax
addq %rsi, %rax
cmpq %rcx, %rax
setae %al
orb %dl, %al
jne 0x197ec
movq %r14, %rdi
callq 0x164c7
movq 0x18(%r14), %rcx
movq 0x28(%r14), %rsi
testq %rcx, %rcx
je 0x197ff
movq 0x20(%r14), %rax
addq %rsi, %rax
xorl %edx, %edx
divq %rcx
jmp 0x19801
xorl %edx, %edx
movq %rcx, %rax
subq %rsi, %rax
subq %rdx, %rcx
addq 0x10(%r14), %rdx
movq %rdx, (%rbx)
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/socket.c
// Function: iov_eoh
static size_t iov_eoh(const struct iovec *iov, _Bool eof, int flags, int *_error) {
	const char *tp, *p, *pe;
	size_t n;
	int error;

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

	while (p < pe && mime_isfname(*p))
		p++;

	if (p == tp && p < pe && !(flags & IOV_F_EMPTYFNAME))
		return 0; /* not allowing empty field names */

	while (p < pe && mime_isblank(*p))
		p++;

	if (p < pe && *p != ':')
		return 0; /* not a valid field name */

	while (p < pe && (p = memchr(p, '\n', pe - p))) {
		if (++p < pe && !mime_isblank(*p))
			return p - tp; /* found */
	}

	if (eof)
		return 0; /* do not allow truncated headers */

	if ((error = iov_addzu(&n, iov->iov_len, 1)))
		goto error;

	return n; /* need more */
error:
	*_error = error;

	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
leaq (%rdi,%rsi), %r12
movq %rdi, %rax
testq %rsi, %rsi
jle 0x19881
xorl %eax, %eax
movb (%r15,%rax), %cl
cmpb $0x3a, %cl
je 0x19867
addb $-0x21, %cl
cmpb $0x5d, %cl
ja 0x19867
leaq (%r15,%rax), %rcx
incq %rcx
incq %rax
cmpq %r12, %rcx
jb 0x19845
jmp 0x1986c
testq %rax, %rax
je 0x198dd
addq %r15, %rax
jmp 0x19881
movzbl (%rax), %ecx
cmpl $0x9, %ecx
je 0x1987e
cmpl $0x20, %ecx
jne 0x198d8
incq %rax
cmpq %r12, %rax
jb 0x19871
cmpq %r12, %rax
jae 0x198bd
movq %r12, %rdx
subq %rax, %rdx
movq %rax, %rdi
movl $0xa, %esi
callq 0xfe90
testq %rax, %rax
je 0x198bd
incq %rax
cmpq %r12, %rax
jae 0x198bd
movzbl (%rax), %ecx
cmpl $0x9, %ecx
je 0x19886
cmpl $0x20, %ecx
je 0x19886
subq %r15, %rax
jmp 0x198e7
testb %bpl, %bpl
jne 0x198dd
cmpq $-0x2, %rbx
jb 0x198e1
movl $0x4b, (%r14)
movq $-0x1, %rax
jmp 0x198e7
cmpl $0x3a, %ecx
je 0x19886
xorl %eax, %eax
jmp 0x198e7
incq %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq