	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cma_alloc_any_port
_cma_alloc_any_port:                    ## @cma_alloc_any_port
	.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	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%edi, %r12d
	movq	(%rsi), %r15
	leaq	-44(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_inet_get_local_port_range
	movl	-48(%rbp), %r14d
	movl	-44(%rbp), %r13d
	movl	%r14d, %ebx
	subl	%r13d, %ebx
	incl	%ebx
	leaq	-52(%rbp), %rdi
	movl	$4, %esi
	callq	_get_random_bytes
	movl	-52(%rbp), %eax
	cltd
	idivl	%ebx
	movl	%edx, %ebx
	addl	-44(%rbp), %ebx
	subl	%r14d, %r13d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	cmpl	%ebx, _cma_alloc_any_port.last_used_port(%rip)
	je	LBB0_6
	.p2align	4, 0x90
LBB0_2:
	movzwl	%bx, %edx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_cma_ps_find
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movl	%r12d, %edi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_cma_alloc_port
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	%ebx, _cma_alloc_any_port.last_used_port(%rip)
LBB0_5:
	movq	_EADDRNOTAVAIL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	jne	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incl	%ebx
	cmpl	-48(%rbp), %ebx
	movl	-44(%rbp), %eax
	movl	%ebx, %ecx
	cmoval	%eax, %ecx
	cmpl	%eax, %ebx
	cmovbl	%eax, %ecx
	incl	%r13d
	movl	%ecx, %ebx
	cmpl	%ebx, _cma_alloc_any_port.last_used_port(%rip)
	jne	LBB0_2
	jmp	LBB0_6
LBB0_8:
	xorl	%eax, %eax
	movq	_EADDRNOTAVAIL@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_cma_alloc_any_port.last_used_port,4,2 ## @cma_alloc_any_port.last_used_port
	.comm	_EADDRNOTAVAIL,4,2              ## @EADDRNOTAVAIL
	.no_dead_strip	_cma_alloc_any_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cma_alloc_any_port
_cma_alloc_any_port:                    ; @cma_alloc_any_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x1]
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x21
	bl	_inet_get_local_port_range
	ldp	w23, w24, [sp, #8]
	sub	w8, w23, w24
	add	w22, w8, #1
	add	x0, sp, #4
	mov	w1, #4
	bl	_get_random_bytes
	ldr	w8, [sp, #4]
	sdiv	w9, w8, w22
	msub	w8, w9, w22, w8
	ldr	w9, [sp, #12]
	add	w22, w9, w8
	sub	w23, w24, w23
	adrp	x25, _cma_alloc_any_port.last_used_port@PAGE
Lloh0:
	adrp	x24, _EADDRNOTAVAIL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _EADDRNOTAVAIL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25, _cma_alloc_any_port.last_used_port@PAGEOFF]
	cmp	w8, w22
	b.eq	LBB0_6
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	and	w2, w22, #0xffff
	mov	x0, x21
	mov	x1, x20
	bl	_cma_ps_find
	cbnz	w0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_cma_alloc_port
	cbnz	w0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	str	w22, [x25, _cma_alloc_any_port.last_used_port@PAGEOFF]
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	cbz	w23, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w22, #1
	ldp	w10, w9, [sp, #8]
	cmp	w8, w10
	ccmp	w8, w9, #0, ls
	csinc	w22, w9, w22, lo
	add	w23, w23, #1
	b	LBB0_1
LBB0_8:
	ldr	w8, [x24]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_cma_alloc_any_port.last_used_port,4,2 ; @cma_alloc_any_port.last_used_port
	.comm	_EADDRNOTAVAIL,4,2              ; @EADDRNOTAVAIL
	.no_dead_strip	_cma_alloc_any_port
.subsections_via_symbols
