	.file	"extr_network.c_alloc_socket.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	alloc_socket, @function
alloc_socket:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR netsocket_sem[rip]
	call	LWP_SemWait@PLT
	mov	rdx, QWORD PTR NUM_SOCKETS[rip]
	test	rdx, rdx
	je	.L2
	mov	rax, QWORD PTR sockets[rip]
	xor	r12d, r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	add	r12, 1
	add	rax, 56
	cmp	rdx, r12
	je	.L2
.L5:
	cmp	QWORD PTR 48[rax], 0
	jne	.L3
	mov	QWORD PTR 48[rax], rbx
	mov	edi, DWORD PTR netsocket_sem[rip]
	mov	QWORD PTR 40[rax], 0
	mov	QWORD PTR 32[rax], 0
	mov	QWORD PTR 24[rax], 0
	mov	DWORD PTR [rax], 1
	mov	QWORD PTR 16[rax], 0
	mov	QWORD PTR 8[rax], 0
	call	LWP_SemPost@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR netsocket_sem[rip]
	mov	r12, -1
	call	LWP_SemPost@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	alloc_socket, .-alloc_socket
	.comm	sockets,8,8
	.comm	netsocket_sem,4,4
	.comm	NUM_SOCKETS,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_network.c_alloc_socket.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alloc_socket, %function
alloc_socket:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r5, .L12
	mov	r6, r0
	ldr	r0, [r5]
	bl	LWP_SemWait
	ldr	r3, .L12+4
	ldr	r1, [r3]
	cmp	r1, #0
	beq	.L2
	ldr	r3, .L12+8
	mov	r4, #0
	ldr	r3, [r3]
	b	.L5
.L3:
	add	r4, r4, #1
	cmp	r1, r4
	add	r3, r3, #28
	beq	.L2
.L5:
	ldr	r2, [r3, #24]
	cmp	r2, #0
	bne	.L3
	mov	r1, #1
	ldr	r0, [r5]
	str	r6, [r3, #24]
	str	r2, [r3, #20]
	str	r2, [r3, #16]
	str	r2, [r3, #12]
	str	r2, [r3, #8]
	str	r2, [r3, #4]
	str	r1, [r3]
	bl	LWP_SemPost
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L2:
	mvn	r4, #0
	ldr	r0, [r5]
	bl	LWP_SemPost
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L13:
	.align	2
.L12:
	.word	netsocket_sem
	.word	NUM_SOCKETS
	.word	sockets
	.size	alloc_socket, .-alloc_socket
	.comm	sockets,4,4
	.comm	netsocket_sem,4,4
	.comm	NUM_SOCKETS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
