	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function npc_mcam_rsrcs_init
_npc_mcam_rsrcs_init:                   ## @npc_mcam_rsrcs_init
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_rvu_get_nixlf_count
	movl	%eax, %r12d
	movq	8(%r14), %r15
	movq	_NPC_AF_CONST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_rvu_read64
	sarl	$28, %eax
	movzwl	%ax, %eax
	movl	%eax, 12(%r15)
	xorl	%r13d, %r13d
	xorl	%edi, %edi
	callq	_NPC_AF_INTFX_KEX_CFG
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rvu_read64
	movl	8(%r15), %ebx
	callq	_BIT_ULL
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	imull	12(%r15), %eax
	movl	%eax, 16(%r15)
	movl	$1, 24(%r15)
	movq	_RSVD_MCAM_ENTRIES_PER_NIXLF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%r12d, %ecx
	movq	8(%r14), %rdx
	movl	(%rdx), %edx
	decl	%edx
	movq	_RSVD_MCAM_ENTRIES_PER_PF@GOTPCREL(%rip), %rsi
	imull	(%rsi), %edx
	addl	%ecx, %edx
	movl	%eax, %edi
	subl	%edx, %edi
	jle	LBB0_1
## %bb.2:
	movl	%edi, 28(%r15)
	movl	%edi, 32(%r15)
	addl	%edi, %r12d
	movl	%r12d, 36(%r15)
	movl	(%r14), %ebx
	callq	_BITS_TO_LONGS
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	$8, %edx
	callq	_devm_kcalloc
	movq	%rax, 112(%r15)
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movl	(%r14), %ebx
	movl	28(%r15), %edi
	callq	_BITS_TO_LONGS
	movl	(%r12), %ecx
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	$8, %edx
	callq	_devm_kcalloc
	movq	%rax, 104(%r15)
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movl	28(%r15), %esi
	movl	%esi, 40(%r15)
	movl	(%r14), %edi
	movl	(%r12), %ecx
	movl	$4, %edx
	callq	_devm_kcalloc
	movq	%rax, 96(%r15)
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	leaq	60(%r15), %rbx
	movl	28(%r15), %ecx
	leal	7(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$3, %eax
	movl	%eax, 44(%r15)
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cmpl	%esi, %eax
	jle	LBB0_7
## %bb.6:
	movl	%eax, %edi
	callq	_round_down
	movl	%eax, 44(%r15)
	movl	28(%r15), %ecx
LBB0_7:
	subl	%eax, %ecx
	movl	%ecx, 48(%r15)
	movl	%eax, 52(%r15)
	movl	%eax, 56(%r15)
	movq	%rbx, %rdi
	callq	_rvu_alloc_bitmap
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:
	movl	(%r14), %edi
	movl	60(%r15), %esi
	movl	(%r12), %ecx
	movl	$4, %edx
	callq	_devm_kcalloc
	movq	%rax, 88(%r15)
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movl	(%r14), %edi
	movl	28(%r15), %esi
	movl	(%r12), %ecx
	movl	$4, %edx
	callq	_devm_kcalloc
	movq	%rax, 80(%r15)
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movl	(%r14), %edi
	movl	60(%r15), %esi
	movl	(%r12), %ecx
	movl	$4, %edx
	callq	_devm_kcalloc
	movq	%rax, 72(%r15)
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	addq	$68, %r15
	movq	%r15, %rdi
	callq	_mutex_init
	xorl	%r13d, %r13d
	jmp	LBB0_15
LBB0_1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	movl	64(%r15), %edi
	callq	_kfree
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
LBB0_14:
	subl	(%rax), %r13d
LBB0_15:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NPC_AF_CONST,4,2               ## @NPC_AF_CONST
	.comm	_NPC_MCAM_KEY_X4,4,2            ## @NPC_MCAM_KEY_X4
	.comm	_NPC_MCAM_KEY_X2,4,2            ## @NPC_MCAM_KEY_X2
	.comm	_RSVD_MCAM_ENTRIES_PER_NIXLF,4,2 ## @RSVD_MCAM_ENTRIES_PER_NIXLF
	.comm	_RSVD_MCAM_ENTRIES_PER_PF,4,2   ## @RSVD_MCAM_ENTRIES_PER_PF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Insufficient NPC MCAM size %d for pkt I/O, exiting\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_BITS_PER_LONG,4,2              ## @BITS_PER_LONG
	.no_dead_strip	_npc_mcam_rsrcs_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function npc_mcam_rsrcs_init
_npc_mcam_rsrcs_init:                   ; @npc_mcam_rsrcs_init
	.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	x21, x1
	mov	x19, x0
	bl	_rvu_get_nixlf_count
	mov	x20, x0
	ldr	x22, [x19, #8]
Lloh0:
	adrp	x8, _NPC_AF_CONST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NPC_AF_CONST@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_rvu_read64
	asr	w8, w0, #28
	and	w8, w8, #0xffff
	str	w8, [x22, #12]
	mov	w0, #0
	bl	_NPC_AF_INTFX_KEX_CFG
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_rvu_read64
	ldr	w21, [x22, #8]
	bl	_BIT_ULL
	sdiv	w8, w21, w0
	ldr	w9, [x22, #12]
	mul	w2, w9, w8
	str	w2, [x22, #16]
	mov	w8, #1
	str	w8, [x22, #24]
Lloh3:
	adrp	x8, _RSVD_MCAM_ENTRIES_PER_NIXLF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RSVD_MCAM_ENTRIES_PER_NIXLF@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mul	w8, w8, w20
	ldr	x9, [x19, #8]
	ldr	w9, [x9]
	sub	w9, w9, #1
Lloh6:
	adrp	x10, _RSVD_MCAM_ENTRIES_PER_PF@GOTPAGE
Lloh7:
	ldr	x10, [x10, _RSVD_MCAM_ENTRIES_PER_PF@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	madd	w8, w9, w10, w8
	subs	w0, w2, w8
	b.le	LBB0_11
; %bb.1:
	stp	w0, w0, [x22, #28]
	add	w8, w0, w20
	str	w8, [x22, #36]
	ldr	w20, [x19]
	bl	_BITS_TO_LONGS
	mov	x1, x0
Lloh9:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	x0, x20
	mov	w2, #8
	bl	_devm_kcalloc
	str	x0, [x22, #112]
	cbz	x0, LBB0_12
; %bb.2:
	ldr	w20, [x19]
	ldr	w0, [x22, #28]
	bl	_BITS_TO_LONGS
	mov	x1, x0
	ldr	w3, [x21]
	mov	x0, x20
	mov	w2, #8
	bl	_devm_kcalloc
	str	x0, [x22, #104]
	cbz	x0, LBB0_12
; %bb.3:
	ldr	w1, [x22, #28]
	str	w1, [x22, #40]
	ldr	w0, [x19]
	ldr	w3, [x21]
	mov	w2, #4
	bl	_devm_kcalloc
	str	x0, [x22, #96]
	cbz	x0, LBB0_12
; %bb.4:
	add	x20, x22, #60
	ldr	w8, [x22, #28]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w0, w9, #3
	str	w0, [x22, #44]
Lloh11:
	adrp	x9, _BITS_PER_LONG@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BITS_PER_LONG@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x9]
	cmp	w0, w1
	b.le	LBB0_6
; %bb.5:
	bl	_round_down
	str	w0, [x22, #44]
	ldr	w8, [x22, #28]
LBB0_6:
	sub	w8, w8, w0
	stp	w8, w0, [x22, #48]
	str	w0, [x22, #56]
	mov	x0, x20
	bl	_rvu_alloc_bitmap
	cbnz	w0, LBB0_13
; %bb.7:
	ldr	w0, [x19]
	ldr	w1, [x22, #60]
	ldr	w3, [x21]
	mov	w2, #4
	bl	_devm_kcalloc
	str	x0, [x22, #88]
	cbz	x0, LBB0_14
; %bb.8:
	ldr	w0, [x19]
	ldr	w1, [x22, #28]
	ldr	w3, [x21]
	mov	w2, #4
	bl	_devm_kcalloc
	str	x0, [x22, #80]
	cbz	x0, LBB0_14
; %bb.9:
	ldr	w0, [x19]
	ldr	w1, [x22, #60]
	ldr	w3, [x21]
	mov	w2, #4
	bl	_devm_kcalloc
	str	x0, [x22, #72]
	cbz	x0, LBB0_14
; %bb.10:
	add	x0, x22, #68
	bl	_mutex_init
	mov	w0, #0
	b	LBB0_13
LBB0_11:
	ldr	w0, [x19]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_12:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
LBB0_14:
	ldr	w0, [x22, #64]
	bl	_kfree
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_NPC_AF_CONST,4,2               ; @NPC_AF_CONST
	.comm	_NPC_MCAM_KEY_X4,4,2            ; @NPC_MCAM_KEY_X4
	.comm	_NPC_MCAM_KEY_X2,4,2            ; @NPC_MCAM_KEY_X2
	.comm	_RSVD_MCAM_ENTRIES_PER_NIXLF,4,2 ; @RSVD_MCAM_ENTRIES_PER_NIXLF
	.comm	_RSVD_MCAM_ENTRIES_PER_PF,4,2   ; @RSVD_MCAM_ENTRIES_PER_PF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Insufficient NPC MCAM size %d for pkt I/O, exiting\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_BITS_PER_LONG,4,2              ; @BITS_PER_LONG
	.no_dead_strip	_npc_mcam_rsrcs_init
.subsections_via_symbols
