	.file	"extr_net.c_net_send.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"invalid user data"
.LC1:
	.string	"need port"
.LC2:
	.string	"need IP address"
.LC3:
	.string	"invalid IP address"
.LC4:
	.string	"no data to send"
.LC5:
	.string	"cannot allocate PCB"
.LC6:
	.string	"not connected"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC7:
	.string	"cannot allocate message buffer"
	.text
	.p2align 4
	.globl	net_send
	.type	net_send, @function
net_send:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	net_get_udata@PLT
	test	rax, rax
	je	.L2
	mov	rbx, rax
	mov	rax, QWORD PTR [rax]
	cmp	rax, QWORD PTR TYPE_TCP_SERVER[rip]
	je	.L2
	cmp	rax, QWORD PTR TYPE_UDP_SOCKET[rip]
	mov	r12d, 3
	mov	esi, 2
	mov	QWORD PTR 8[rsp], 0
	je	.L41
.L5:
	lea	rdx, 8[rsp]
	mov	rdi, rbp
	call	luaL_checklstring@PLT
	mov	r15, rax
	test	rax, rax
	je	.L10
	cmp	QWORD PTR 8[rsp], 0
	jne	.L11
.L10:
	lea	rsi, .LC4[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L42
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	esi, r12d
	mov	rdi, rbp
	call	lua_isfunction@PLT
	test	rax, rax
	je	.L12
.L14:
	mov	esi, r12d
	mov	rdi, rbp
	call	lua_pushvalue@PLT
	mov	rdx, QWORD PTR 24[rbx]
	mov	esi, DWORD PTR LUA_REGISTRYINDEX[rip]
	mov	rdi, rbp
	call	luaL_unref@PLT
	mov	esi, DWORD PTR LUA_REGISTRYINDEX[rip]
	mov	rdi, rbp
	call	luaL_ref@PLT
	mov	QWORD PTR 24[rbx], rax
.L13:
	mov	eax, DWORD PTR 40[rbx]
	mov	rcx, QWORD PTR TYPE_UDP_SOCKET[rip]
	cmp	QWORD PTR [rbx], rcx
	je	.L43
.L15:
	test	eax, eax
	je	.L18
	mov	rax, QWORD PTR LUA_NOREF[rip]
	cmp	QWORD PTR 8[rbx], rax
	je	.L18
	mov	rax, QWORD PTR [rbx]
	cmp	rax, QWORD PTR TYPE_UDP_SOCKET[rip]
	je	.L28
	cmp	rax, QWORD PTR TYPE_TCP_CLIENT[rip]
	je	.L44
.L27:
	mov	rsi, r14
	mov	rdi, rbp
	call	lwip_lua_checkerr@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L41:
	mov	QWORD PTR 16[rsp], 0
	mov	rdi, rbp
	call	luaL_checkinteger@PLT
	mov	r13, rax
	test	rax, rax
	je	.L45
	mov	rdi, rbp
	lea	rdx, 16[rsp]
	mov	esi, 3
	call	luaL_checklstring@PLT
	mov	rdi, rax
	test	rax, rax
	je	.L46
	lea	rsi, 4[rsp]
	mov	r12d, 5
	call	ipaddr_aton@PLT
	mov	esi, 4
	test	eax, eax
	jne	.L5
	lea	rsi, .LC3[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	lea	rsi, .LC0[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	mov	esi, r12d
	mov	rdi, rbp
	call	lua_islightfunction@PLT
	test	rax, rax
	jne	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L45:
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L43:
	test	eax, eax
	je	.L47
	mov	rax, QWORD PTR 8[rbx]
	cmp	QWORD PTR LUA_NOREF[rip], rax
	jne	.L28
.L18:
	lea	rsi, .LC6[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edx, DWORD PTR PBUF_RAM[rip]
	mov	rsi, QWORD PTR 8[rsp]
	mov	edi, DWORD PTR PBUF_TRANSPORT[rip]
	call	pbuf_alloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L48
	mov	rdx, QWORD PTR 8[rsp]
	mov	rsi, r15
	mov	rdi, rax
	call	pbuf_take@PLT
	mov	rdi, QWORD PTR 32[rbx]
	mov	rcx, r13
	mov	rsi, r12
	lea	rdx, 4[rsp]
	call	udp_sendto@PLT
	mov	rdi, r12
	mov	r14, rax
	call	pbuf_free@PLT
	mov	rdx, QWORD PTR 24[rbx]
	cmp	rdx, QWORD PTR LUA_NOREF[rip]
	je	.L27
	mov	esi, DWORD PTR LUA_REGISTRYINDEX[rip]
	mov	rdi, rbp
	call	lua_rawgeti@PLT
	mov	rdx, QWORD PTR 8[rbx]
	mov	esi, DWORD PTR LUA_REGISTRYINDEX[rip]
	mov	rdi, rbp
	call	lua_rawgeti@PLT
	xor	edx, edx
	mov	esi, 1
	mov	rdi, rbp
	call	lua_call@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L46:
	lea	rsi, .LC2[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L47:
	xor	eax, eax
	call	udp_new@PLT
	mov	QWORD PTR 32[rbx], rax
	mov	rdi, rax
	test	rax, rax
	je	.L49
	mov	esi, DWORD PTR net_udp_recv_cb[rip]
	mov	rdx, rbx
	call	udp_recv@PLT
	mov	rdi, QWORD PTR 32[rbx]
	xor	edx, edx
	lea	rsi, 16[rsp]
	mov	DWORD PTR 16[rsp], 0
	call	udp_bind@PLT
	cmp	QWORD PTR ERR_OK[rip], rax
	mov	r12, rax
	jne	.L50
	mov	rax, QWORD PTR LUA_NOREF[rip]
	cmp	QWORD PTR 8[rbx], rax
	je	.L51
.L23:
	mov	eax, DWORD PTR 40[rbx]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L44:
	mov	edi, DWORD PTR 16[rbx]
	mov	ecx, DWORD PTR TCP_WRITE_FLAG_COPY[rip]
	mov	rsi, r15
	mov	rdx, QWORD PTR 8[rsp]
	call	tcp_write@PLT
	mov	r14, rax
	jmp	.L27
.L50:
	mov	rdi, QWORD PTR 32[rbx]
	call	udp_remove@PLT
	mov	QWORD PTR 32[rbx], 0
	mov	rsi, r12
	mov	rdi, rbp
	call	lwip_lua_checkerr@PLT
	jmp	.L1
.L48:
	lea	rsi, .LC7[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
	jmp	.L1
.L49:
	lea	rsi, .LC5[rip]
	mov	rdi, rbp
	call	luaL_error@PLT
	jmp	.L1
.L51:
	mov	esi, 1
	mov	rdi, rbp
	call	lua_pushvalue@PLT
	mov	esi, DWORD PTR LUA_REGISTRYINDEX[rip]
	mov	rdi, rbp
	call	luaL_ref@PLT
	mov	QWORD PTR 8[rbx], rax
	jmp	.L23
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	net_send, .-net_send
	.comm	net_udp_recv_cb,4,4
	.comm	TYPE_UDP_SOCKET,8,8
	.comm	TYPE_TCP_SERVER,8,8
	.comm	TYPE_TCP_CLIENT,8,8
	.comm	TCP_WRITE_FLAG_COPY,4,4
	.comm	PBUF_TRANSPORT,4,4
	.comm	PBUF_RAM,4,4
	.comm	LUA_REGISTRYINDEX,4,4
	.comm	LUA_NOREF,8,8
	.comm	ERR_OK,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_net.c_net_send.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"invalid user data\000"
	.align	2
.LC1:
	.ascii	"need port\000"
	.align	2
.LC2:
	.ascii	"need IP address\000"
	.align	2
.LC3:
	.ascii	"invalid IP address\000"
	.align	2
.LC4:
	.ascii	"no data to send\000"
	.align	2
.LC5:
	.ascii	"cannot allocate PCB\000"
	.align	2
.LC6:
	.ascii	"not connected\000"
	.align	2
.LC7:
	.ascii	"cannot allocate message buffer\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	net_send
	.syntax unified
	.arm
	.fpu softvfp
	.type	net_send, %function
net_send:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L52
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r5, r0
	bl	net_get_udata
	subs	r4, r0, #0
	beq	.L2
	ldr	r2, .L52+4
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	mov	r2, #0
	ldr	r9, .L52+8
	str	r2, [sp, #4]
	ldr	r1, [r9]
	cmp	r3, r1
	movne	r10, #3
	movne	r1, #2
	beq	.L41
.L5:
	mov	r0, r5
	add	r2, sp, #4
	bl	luaL_checklstring
	subs	r8, r0, #0
	beq	.L10
	ldr	r3, [sp, #4]
	cmp	r3, #0
	bne	.L11
.L10:
	mov	r0, r5
	ldr	r1, .L52+12
	bl	luaL_error
.L1:
	ldr	r3, .L52
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L42
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	mov	r1, r10
	mov	r0, r5
	bl	lua_isfunction
	cmp	r0, #0
	beq	.L12
.L14:
	ldr	fp, .L52+16
	mov	r1, r10
	mov	r0, r5
	bl	lua_pushvalue
	ldr	r1, [fp]
	ldr	r2, [r4, #12]
	mov	r0, r5
	bl	luaL_unref
	mov	r0, r5
	ldr	r1, [fp]
	bl	luaL_ref
	str	r0, [r4, #12]
.L13:
	ldr	r2, [r4]
	ldr	r3, [r9]
	ldr	r10, [r4, #20]
	cmp	r2, r3
	beq	.L43
.L15:
	cmp	r10, #0
	beq	.L18
	ldr	r10, .L52+20
	ldr	r2, [r4, #4]
	ldr	r3, [r10]
	cmp	r2, r3
	beq	.L18
	ldr	r2, [r9]
	ldr	r3, [r4]
	cmp	r3, r2
	beq	.L28
	ldr	r2, .L52+24
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L44
.L27:
	mov	r1, r7
	mov	r0, r5
	bl	lwip_lua_checkerr
	b	.L1
.L41:
	mov	r1, #2
	mov	r0, r5
	str	r2, [sp, #8]
	bl	luaL_checkinteger
	subs	r6, r0, #0
	beq	.L45
	mov	r1, #3
	mov	r0, r5
	add	r2, sp, #8
	bl	luaL_checklstring
	cmp	r0, #0
	beq	.L46
	mov	r1, sp
	bl	ipaddr_aton
	cmp	r0, #0
	movne	r10, #5
	movne	r1, #4
	bne	.L5
	mov	r0, r5
	ldr	r1, .L52+28
	bl	luaL_error
	b	.L1
.L2:
	mov	r0, r5
	ldr	r1, .L52+32
	bl	luaL_error
	b	.L1
.L12:
	mov	r1, r10
	mov	r0, r5
	bl	lua_islightfunction
	cmp	r0, #0
	bne	.L14
	b	.L13
.L45:
	mov	r0, r5
	ldr	r1, .L52+36
	bl	luaL_error
	b	.L1
.L43:
	cmp	r10, #0
	beq	.L47
	ldr	r10, .L52+20
	ldr	r3, [r4, #4]
	ldr	r2, [r10]
	cmp	r2, r3
	bne	.L28
.L18:
	mov	r0, r5
	ldr	r1, .L52+40
	bl	luaL_error
	b	.L1
.L28:
	ldr	r3, .L52+44
	ldr	r2, .L52+48
	ldr	r0, [r3]
	ldr	r2, [r2]
	ldr	r1, [sp, #4]
	bl	pbuf_alloc
	subs	r9, r0, #0
	beq	.L48
	mov	r1, r8
	ldr	r2, [sp, #4]
	bl	pbuf_take
	mov	r3, r6
	mov	r2, sp
	mov	r1, r9
	ldr	r0, [r4, #16]
	bl	udp_sendto
	mov	r7, r0
	mov	r0, r9
	bl	pbuf_free
	ldr	r3, [r10]
	ldr	r2, [r4, #12]
	cmp	r2, r3
	beq	.L27
	ldr	r6, .L52+16
	mov	r0, r5
	ldr	r1, [r6]
	bl	lua_rawgeti
	ldr	r1, [r6]
	ldr	r2, [r4, #4]
	mov	r0, r5
	bl	lua_rawgeti
	mov	r2, #0
	mov	r1, #1
	mov	r0, r5
	bl	lua_call
	b	.L27
.L46:
	mov	r0, r5
	ldr	r1, .L52+52
	bl	luaL_error
	b	.L1
.L47:
	bl	udp_new
	cmp	r0, #0
	str	r0, [r4, #16]
	beq	.L49
	ldr	r3, .L52+56
	mov	r2, r4
	ldr	r1, [r3]
	bl	udp_recv
	ldr	r0, [r4, #16]
	mov	r2, r10
	add	r1, sp, #8
	str	r10, [sp, #8]
	bl	udp_bind
	ldr	r3, .L52+60
	mov	fp, r0
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L50
	ldr	r3, .L52+20
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L51
.L23:
	ldr	r10, [r4, #20]
	b	.L15
.L44:
	ldr	r3, .L52+64
	mov	r1, r8
	ldr	r0, [r4, #8]
	ldr	r3, [r3]
	ldr	r2, [sp, #4]
	bl	tcp_write
	mov	r7, r0
	b	.L27
.L50:
	ldr	r0, [r4, #16]
	bl	udp_remove
	mov	r1, fp
	mov	r0, r5
	str	r10, [r4, #16]
	bl	lwip_lua_checkerr
	b	.L1
.L48:
	mov	r0, r5
	ldr	r1, .L52+68
	bl	luaL_error
	b	.L1
.L49:
	mov	r0, r5
	ldr	r1, .L52+72
	bl	luaL_error
	b	.L1
.L51:
	mov	r1, #1
	mov	r0, r5
	bl	lua_pushvalue
	ldr	r3, .L52+16
	mov	r0, r5
	ldr	r1, [r3]
	bl	luaL_ref
	str	r0, [r4, #4]
	b	.L23
.L42:
	bl	__stack_chk_fail
.L53:
	.align	2
.L52:
	.word	.LC8
	.word	TYPE_TCP_SERVER
	.word	TYPE_UDP_SOCKET
	.word	.LC4
	.word	LUA_REGISTRYINDEX
	.word	LUA_NOREF
	.word	TYPE_TCP_CLIENT
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC6
	.word	PBUF_TRANSPORT
	.word	PBUF_RAM
	.word	.LC2
	.word	net_udp_recv_cb
	.word	ERR_OK
	.word	TCP_WRITE_FLAG_COPY
	.word	.LC7
	.word	.LC5
	.size	net_send, .-net_send
	.comm	net_udp_recv_cb,4,4
	.comm	TYPE_UDP_SOCKET,4,4
	.comm	TYPE_TCP_SERVER,4,4
	.comm	TYPE_TCP_CLIENT,4,4
	.comm	TCP_WRITE_FLAG_COPY,4,4
	.comm	PBUF_TRANSPORT,4,4
	.comm	PBUF_RAM,4,4
	.comm	LUA_REGISTRYINDEX,4,4
	.comm	LUA_NOREF,4,4
	.comm	ERR_OK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
