// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/socket.c
// Function: lso_checkrcvop
static struct lso_rcvop lso_checkrcvop(lua_State *L, int index, int mode) {
	struct lso_rcvop op = { index, LSO_NONE, mode };
	lua_Number size;

	if (!lua_isnumber(L, index)) {
		size_t len;
		const char *fmt = luaL_optlstring(L, index, "*l", &len);

		if (fmt[0] == '*' && len == 2) {
			switch (fmt[1]) {
			case 'n':
				op.type = LSO_NUMBER;
				break;
			case 'a':
				op.type = LSO_SLURP;
				break;
			case 'l':
				op.type = LSO_CHOMP;
				break;
			case 'L':
				op.type = LSO_LINE;
				break;
			case 'h':
				op.type = LSO_FIELD;
				break;
			case 'H':
				op.type = LSO_HEADER;
				break;
			}
		} else if (fmt[0] == '-' && fmt[1] == '-') {
			op.type = LSO_BODY;
			op.body.eob = fmt;
			op.body.eoblen = len;
		}
	} else {
		if ((size = luaL_checknumber(L, index)) < 0) {
			op.type = LSO_LIMIT;
			op.size = -size;
		} else {
			op.type = LSO_BLOCK;
			op.size = size;
		}
	}

	if (op.type == LSO_NONE)
		luaL_argerror(L, index, lua_pushfstring(L, "invalid format %s", luaL_checkstring(L, index)));

	return op;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x38(%rbp)
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, (%rdi)
movl $0x0, 0x4(%rdi)
movl -0x10(%rbp), %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xf7d0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xfc70
cmpl $0x0, %eax
jne 0x1d175
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x2b87d(%rip), %rdx     # 0x4891f
leaq -0x20(%rbp), %rcx
callq 0xf940
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x1d13a
cmpq $0x2, -0x20(%rbp)
jne 0x1d13a
movq -0x28(%rbp), %rax
movsbl 0x1(%rax), %eax
addl $-0x48, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x26, %eax
ja 0x1d138
movq -0x40(%rbp), %rax
leaq 0x2b589(%rip), %rcx     # 0x4866c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rax
movl $0x1, 0x4(%rax)
jmp 0x1d138
movq -0x38(%rbp), %rax
movl $0x2, 0x4(%rax)
jmp 0x1d138
movq -0x38(%rbp), %rax
movl $0x3, 0x4(%rax)
jmp 0x1d138
movq -0x38(%rbp), %rax
movl $0x4, 0x4(%rax)
jmp 0x1d138
movq -0x38(%rbp), %rax
movl $0x5, 0x4(%rax)
jmp 0x1d138
movq -0x38(%rbp), %rax
movl $0x6, 0x4(%rax)
jmp 0x1d170
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1d16e
movq -0x28(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
jne 0x1d16e
movq -0x38(%rbp), %rax
movl $0x7, 0x4(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x1d170
jmp 0x1d215
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x10b20
movaps %xmm0, %xmm1
movsd %xmm1, -0x18(%rbp)
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1d1d9
movq -0x38(%rbp), %rax
movl $0x9, 0x4(%rax)
movaps 0x2b58c(%rip), %xmm0    # 0x48730
movsd -0x18(%rbp), %xmm1
pxor %xmm0, %xmm1
movaps %xmm1, %xmm0
cvttsd2si %xmm1, %rcx
movq %rcx, %rsi
sarq $0x3f, %rsi
movsd 0x2ae7c(%rip), %xmm1    # 0x48040
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rdx
andq %rsi, %rdx
orq %rdx, %rcx
movq %rcx, 0x10(%rax)
jmp 0x1d213
movq -0x38(%rbp), %rax
movl $0x8, 0x4(%rax)
movsd -0x18(%rbp), %xmm0
movsd 0x2ae4f(%rip), %xmm2    # 0x48040
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rdx
cvttsd2si %xmm0, %rcx
movq %rcx, %rsi
sarq $0x3f, %rsi
andq %rsi, %rdx
orq %rdx, %rcx
movq %rcx, 0x10(%rax)
jmp 0x1d215
movq -0x38(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x1d269
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xf6a0
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x2b6cf(%rip), %rsi     # 0x48922
movb $0x0, %al
callq 0x10130
movq -0x50(%rbp), %rdi
movl -0x44(%rbp), %esi
movq %rax, %rdx
callq 0xf440
movq -0x30(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)