// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/socket.c
// Function: lso_unpack2
static lso_nargs_t lso_unpack2(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	unsigned long long value;
	unsigned count;
	int error;

	if ((error = lso_preprcv(L, S)))
		goto error;

	lua_settop(L, 2);

	count = luaL_optunsigned(L, 2, 32);

	if (fifo_rbits(&S->ibuf.fifo) < count) {
		size_t rem = ((count - fifo_rbits(&S->ibuf.fifo)) + 7U) / 8U;

		if ((error = lso_fill(S, rem))) {
			if (fifo_rbits(&S->ibuf.fifo) < count)
				goto error;
		}
	}

	value = fifo_unpack(&S->ibuf.fifo, count);

	if (value == (unsigned long long)(lua_Integer)value)
		lua_pushinteger(L, (lua_Integer)value);
	else if (value == (unsigned long long)(lua_Number)value)
		lua_pushnumber(L, (lua_Number)value);
	else
		goto range;

	return 1;
range:
	error = ERANGE;
error:
	lua_pushnil(L);
	lua_pushinteger(L, error);

	return 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x1bba0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1cf90
movl %eax, -0x28(%rbp)
cmpl $0x0, %eax
je 0x1b008
jmp 0x1b17a
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x107f0
movq -0x10(%rbp), %rdi
movl $0x2, %esi
movl $0x20, %edx
callq 0xf450
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
addq $0x40, %rdi
addq $0x18, %rdi
callq 0x1ef60
movl -0x24(%rbp), %ecx
cmpq %rcx, %rax
jae 0x1b0aa
movl -0x24(%rbp), %eax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
addq $0x40, %rdi
addq $0x18, %rdi
callq 0x1ef60
movq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
addq $0x7, %rax
shrq $0x3, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1d280
movl %eax, -0x28(%rbp)
cmpl $0x0, %eax
je 0x1b0a8
movq -0x18(%rbp), %rdi
addq $0x40, %rdi
addq $0x18, %rdi
callq 0x1ef60
movl -0x24(%rbp), %ecx
cmpq %rcx, %rax
jae 0x1b0a6
jmp 0x1b17a
jmp 0x1b0a8
jmp 0x1b0aa
movq -0x18(%rbp), %rdi
addq $0x40, %rdi
addq $0x18, %rdi
movl -0x24(%rbp), %esi
callq 0x1efa0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x1b0de
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xf9a0
jmp 0x1b16a
movq -0x20(%rbp), %rax
movq %rax, %xmm0
movaps 0x2d622(%rip), %xmm1    # 0x48710
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2d626(%rip), %xmm1    # 0x48720
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rsi
sarq $0x3f, %rsi
movsd 0x2cf20(%rip), %xmm1    # 0x48040
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rdx
andq %rsi, %rdx
orq %rdx, %rcx
cmpq %rcx, %rax
jne 0x1b166
movq -0x10(%rbp), %rdi
movaps 0x2d5d1(%rip), %xmm1    # 0x48710
movq -0x20(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2d5d0(%rip), %xmm1    # 0x48720
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0xf300
jmp 0x1b168
jmp 0x1b173
jmp 0x1b16a
movl $0x1, -0x4(%rbp)
jmp 0x1b197
movl $0x22, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xfa10
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0xf9a0
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq