	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_socket
_alloc_socket:                          ## @alloc_socket
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_netsocket_sem@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_LWP_SemWait
	movq	_NUM_SOCKETS@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.1:
	movq	_sockets@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 48(%rsi,%rax)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	addq	$56, %rax
	cmpq	%rbx, %rcx
	jne	LBB0_2
LBB0_5:
	movq	$-1, %rbx
	jmp	LBB0_6
LBB0_3:
	movq	%r14, 48(%rsi,%rax)
	movq	(%rdx), %rcx
	movq	$0, 40(%rcx,%rax)
	movq	(%rdx), %rcx
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rcx,%rax)
	movl	$1, (%rcx,%rax)
	movups	%xmm0, 8(%rcx,%rax)
LBB0_6:
	movl	(%r15), %edi
	callq	_LWP_SemPost
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_netsocket_sem,4,2              ## @netsocket_sem
	.comm	_NUM_SOCKETS,8,3                ## @NUM_SOCKETS
	.comm	_sockets,8,3                    ## @sockets
	.no_dead_strip	_alloc_socket
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_socket
_alloc_socket:                          ; @alloc_socket
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x0
Lloh0:
	adrp	x21, _netsocket_sem@GOTPAGE
Lloh1:
	ldr	x21, [x21, _netsocket_sem@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_LWP_SemWait
Lloh2:
	adrp	x8, _NUM_SOCKETS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NUM_SOCKETS@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x8]
	cbz	x10, LBB0_4
; %bb.1:
	mov	x8, #0
	mov	x19, #0
Lloh5:
	adrp	x9, _sockets@GOTPAGE
Lloh6:
	ldr	x9, [x9, _sockets@GOTPAGEOFF]
	ldr	x11, [x9]
	add	x12, x11, #48
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x12, x8]
	cbz	x13, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x19, x19, #1
	add	x8, x8, #56
	cmp	x10, x19
	b.ne	LBB0_2
LBB0_4:
	mov	x19, #-1
	b	LBB0_6
LBB0_5:
	add	x10, x11, x8
	str	x20, [x10, #48]
	ldr	x10, [x9]
	add	x10, x10, x8
	str	xzr, [x10, #40]
	ldr	x9, [x9]
	add	x8, x9, x8
	mov	w9, #1
	str	w9, [x8]
	stp	xzr, xzr, [x8, #24]
	stp	xzr, xzr, [x8, #8]
LBB0_6:
	ldr	w0, [x21]
	bl	_LWP_SemPost
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_netsocket_sem,4,2              ; @netsocket_sem
	.comm	_NUM_SOCKETS,8,3                ; @NUM_SOCKETS
	.comm	_sockets,8,3                    ; @sockets
	.no_dead_strip	_alloc_socket
.subsections_via_symbols
