	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function choose_port_ctxt
_choose_port_ctxt:                      ## @choose_port_ctxt
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movq	16(%r12), %rax
	movslq	%edx, %rbx
	leaq	(%rax,%rbx,4), %rdi
	addq	$-4, %rdi
	callq	_usable
	testq	%rax, %rax
	je	LBB0_21
## %bb.3:
	movq	16(%r12), %rax
	leaq	(%rax,%rbx,4), %r13
	addq	$-4, %r13
	jmp	LBB0_4
LBB0_1:
	xorl	%r13d, %r13d
LBB0_4:
	movl	(%r12), %ebx
	movslq	4(%r12), %rax
	cmpl	%eax, %ebx
	jge	LBB0_9
## %bb.5:
	movslq	%ebx, %rcx
	leaq	(,%rcx,8), %rdx
	addq	24(%r12), %rdx
	movq	%rax, %rsi
	subq	%rcx, %rsi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rdx,%rcx,8)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%rcx
	cmpq	%rcx, %rsi
	jne	LBB0_6
	jmp	LBB0_10
LBB0_8:
	addl	%ebx, %ecx
	movl	%ecx, %ebx
LBB0_9:
	cmpl	%eax, %ebx
	jne	LBB0_11
LBB0_10:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_22
LBB0_11:
	testq	%r13, %r13
	jne	LBB0_24
## %bb.12:
	movl	%ebx, %eax
	cltd
	idivl	8(%r12)
	movslq	%edx, %r13
	shlq	$2, %r13
	movq	16(%r12), %rdi
	addq	%r13, %rdi
	callq	_usable
	testq	%rax, %rax
	je	LBB0_13
## %bb.23:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	addq	16(%r12), %r13
LBB0_20:
	testq	%r13, %r13
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_21
LBB0_24:
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	movq	%r14, %rcx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_setup_ctxt                     ## TAILCALL
LBB0_13:
	cmpl	$0, 8(%r12)
	jle	LBB0_21
## %bb.14:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %r14d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rdi
	addq	%r15, %rdi
	callq	_usable
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	16(%r12), %r13
	addq	%r15, %r13
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_15 Depth=1
	xorl	%r13d, %r13d
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=1
	movslq	8(%r12), %rax
	cmpq	%rax, %r14
	jge	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	addq	$4, %r15
	incq	%r14
	testq	%r13, %r13
	je	LBB0_15
	jmp	LBB0_20
LBB0_21:
	movq	_ENETDOWN@GOTPCREL(%rip), %rcx
LBB0_22:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENETDOWN,4,2                   ## @ENETDOWN
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_choose_port_ctxt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function choose_port_ctxt
_choose_port_ctxt:                      ; @choose_port_ctxt
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x21, x1
	mov	x20, x0
	cbz	w2, LBB0_3
; %bb.1:
	mov	x22, x2
	ldr	x8, [x21, #16]
	add	x8, x8, w2, sxtw #2
	sub	x0, x8, #4
	bl	_usable
	cbz	x0, LBB0_20
; %bb.2:
	sxtw	x8, w22
	ldr	x9, [x21, #16]
	add	x8, x9, x8, lsl #2
	sub	x0, x8, #4
	b	LBB0_4
LBB0_3:
	mov	x0, #0
LBB0_4:
	ldp	w22, w8, [x21]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	cmp	w22, w8
	b.ge	LBB0_8
; %bb.5:
	sxtw	x10, w22
	ldr	x9, [x21, #24]
	add	x9, x9, x10, lsl #3
	sub	x10, x8, x10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9]
	cbz	x11, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w22, w22, #1
	add	x9, x9, #8
	subs	x10, x10, #1
	b.ne	LBB0_6
	b	LBB0_9
LBB0_8:
	cmp	w22, w8
	b.ne	LBB0_10
LBB0_9:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_21
LBB0_10:
	cbnz	x0, LBB0_14
; %bb.11:
	ldr	w8, [x21, #8]
	sdiv	w9, w22, w8
	msub	w23, w9, w8, w22
	ldr	x8, [x21, #16]
	add	x0, x8, w23, sxtw #2
	bl	_usable
	cbz	x0, LBB0_15
; %bb.12:
	sxtw	x8, w23
	ldr	x9, [x21, #16]
	add	x0, x9, x8, lsl #2
LBB0_13:
	cbz	x0, LBB0_20
LBB0_14:
	mov	x1, x22
	mov	x2, x20
	mov	x3, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_setup_ctxt
LBB0_15:
	ldr	w8, [x21, #8]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.16:
	mov	x23, #0
	mov	w24, #1
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	ldrsw	x8, [x21, #8]
	add	x23, x23, #4
	cmp	x24, x8
	add	x24, x24, #1
	ccmp	x0, #0, #0, lt
	b.ne	LBB0_13
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #16]
	add	x0, x8, x23
	bl	_usable
	cbz	x0, LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x8, [x21, #16]
	add	x0, x8, x23
	b	LBB0_17
LBB0_20:
Lloh2:
	adrp	x8, _ENETDOWN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENETDOWN@GOTPAGEOFF]
LBB0_21:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_ENETDOWN,4,2                   ; @ENETDOWN
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_choose_port_ctxt
.subsections_via_symbols
