	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cnic_cm_alloc_mem
_cnic_cm_alloc_mem:                     ## @cnic_cm_alloc_mem
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	_MAX_CM_SK_TBL_SZ@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kvcalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	cmpl	$0, (%r15)
	jle	LBB0_5
## %bb.2:
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	cmpl	$2, (%r15)
	jl	LBB0_5
## %bb.3:
	movl	$1, %r13d
	movl	$4, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rdi
	addq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	incq	%r13
	movslq	(%r15), %rax
	addq	$4, %rbx
	cmpq	%rax, %r13
	jl	LBB0_4
LBB0_5:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_prandom_u32
	movq	_CNIC_LOCAL_PORT_RANGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cltd
	idivl	%esi
	movl	%edx, %ecx
	movq	_CNIC_LOCAL_PORT_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_cnic_init_id_tbl
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%r14, %rdi
	callq	_cnic_cm_free_mem
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_CM_SK_TBL_SZ,4,2           ## @MAX_CM_SK_TBL_SZ
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CNIC_LOCAL_PORT_RANGE,4,2      ## @CNIC_LOCAL_PORT_RANGE
	.comm	_CNIC_LOCAL_PORT_MIN,4,2        ## @CNIC_LOCAL_PORT_MIN
	.no_dead_strip	_cnic_cm_alloc_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cnic_cm_alloc_mem
_cnic_cm_alloc_mem:                     ; @cnic_cm_alloc_mem
	.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, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x21, _MAX_CM_SK_TBL_SZ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MAX_CM_SK_TBL_SZ@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kvcalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_7
; %bb.1:
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	w1, #0
	bl	_atomic_set
	ldr	w8, [x21]
	cmp	w8, #2
	b.lt	LBB0_5
; %bb.3:
	mov	w22, #1
	mov	w23, #4
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x0, x8, x23
	mov	w1, #0
	bl	_atomic_set
	add	x22, x22, #1
	ldrsw	x8, [x21]
	add	x23, x23, #4
	cmp	x22, x8
	b.lt	LBB0_4
LBB0_5:
	bl	_prandom_u32
Lloh5:
	adrp	x8, _CNIC_LOCAL_PORT_RANGE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CNIC_LOCAL_PORT_RANGE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	sdiv	w8, w0, w1
	msub	w3, w8, w1, w0
Lloh8:
	adrp	x8, _CNIC_LOCAL_PORT_MIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CNIC_LOCAL_PORT_MIN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_cnic_init_id_tbl
	cbz	x0, LBB0_8
; %bb.6:
	mov	x0, x19
	bl	_cnic_cm_free_mem
LBB0_7:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_CM_SK_TBL_SZ,4,2           ; @MAX_CM_SK_TBL_SZ
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CNIC_LOCAL_PORT_RANGE,4,2      ; @CNIC_LOCAL_PORT_RANGE
	.comm	_CNIC_LOCAL_PORT_MIN,4,2        ; @CNIC_LOCAL_PORT_MIN
	.no_dead_strip	_cnic_cm_alloc_mem
.subsections_via_symbols
