	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rvu_mbox_handler_npa_lf_alloc  ## -- Begin function rvu_mbox_handler_npa_lf_alloc
	.p2align	4, 0x90
_rvu_mbox_handler_npa_lf_alloc:         ## @rvu_mbox_handler_npa_lf_alloc
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %eax
	movq	_NPA_AURA_SZ_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_8
## %bb.1:
	movq	_NPA_AURA_SZ_0@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_8
## %bb.2:
	movq	%rsi, %r13
	cmpl	$0, 4(%rsi)
	je	LBB0_8
## %bb.3:
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	8(%r13), %r14d
	movl	%r14d, %esi
	callq	_rvu_get_pfvf
	movq	%rax, %r12
	movq	_BLKTYPE_NPA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_rvu_get_blkaddr
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	cmpl	$0, 40(%r12)
	je	LBB0_9
## %bb.4:
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %r15d
	shlq	$2, %r15
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %r15
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_rvu_get_lf
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:
	movl	%eax, %ebx
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_rvu_lf_reset
	testl	%eax, %eax
	je	LBB0_12
## %bb.7:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_NPA_AF_ERR_LF_RESET@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_NPA_AF_ERR_PARAM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_NPA_AF_ERR_AF_LF_INVALID@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movq	_NPA_AF_CONST1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_rvu_read64
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%eax, %ecx
	andb	$15, %cl
	movl	$1, %ebx
	shll	%cl, %ebx
	movl	(%r12), %r15d
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	leaq	8(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	(%r13), %edi
	callq	_NPA_AURA_COUNT
	movl	%r15d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_qmem_alloc
	testl	%eax, %eax
	je	LBB0_15
LBB0_13:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_npa_ctx_free
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
LBB0_14:
	movq	_NPA_AF_CONST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_rvu_read64
	movzbl	%ah, %ecx
	movl	%ecx, (%r14)
	movzbl	%al, %ecx
	movl	%ecx, 4(%r14)
	sarl	$28, %eax
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	%eax, 8(%r14)
	jmp	LBB0_11
LBB0_15:
	movl	(%r13), %edi
	callq	_NPA_AURA_COUNT
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	%eax, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_13
## %bb.16:
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %ecx
	shrb	$4, %cl
	movl	$1, %eax
	shll	%cl, %eax
	movl	(%r12), %edi
	movq	%r14, %rsi
	addq	$24, %rsi
	movl	4(%r13), %edx
	movl	%eax, %ecx
	callq	_qmem_alloc
	testl	%eax, %eax
	jne	LBB0_13
## %bb.17:
	movl	(%r13), %edi
	callq	_NPA_AURA_COUNT
	movl	(%rbx), %edx
	movl	%eax, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_13
## %bb.18:
	movq	_NPA_AF_CONST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_rvu_read64
	sarl	$28, %eax
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	shrl	$8, %ecx
	andb	$15, %cl
	movl	$1, %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	movl	(%r12), %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_qmem_alloc
	testl	%eax, %eax
	jne	LBB0_13
## %bb.19:
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_NPA_AF_LFX_AURAS_CFG
	movq	%r12, %rdi
	movq	%r14, %r12
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_rvu_read64
	movl	%eax, %r15d
	movl	$34, %edi
	callq	_BIT_ULL
	negl	%eax
	andl	%eax, %r15d
	movl	(%r13), %ebx
	shll	$16, %ebx
	movl	$34, %edi
	callq	_BIT_ULL
	orl	%eax, %ebx
	orl	%r15d, %ebx
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_NPA_AF_LFX_AURAS_CFG
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_rvu_write64
	movl	%r15d, %edi
	callq	_NPA_AF_LFX_LOC_AURAS_BASE
	movq	8(%r12), %rcx
	movl	(%rcx), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_rvu_write64
	movl	%r15d, %edi
	callq	_NPA_AF_LFX_QINTS_CFG
	movl	%eax, %ebx
	movl	$36, %edi
	callq	_BIT_ULL
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_rvu_write64
	movl	%r15d, %edi
	callq	_NPA_AF_LFX_QINTS_BASE
	movq	(%r12), %rcx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	(%rcx), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_rvu_write64
	movl	%r14d, %esi
	xorl	%ebx, %ebx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_NPA_AURA_SZ_MAX,4,2            ## @NPA_AURA_SZ_MAX
	.comm	_NPA_AURA_SZ_0,4,2              ## @NPA_AURA_SZ_0
	.comm	_NPA_AF_ERR_PARAM,4,2           ## @NPA_AF_ERR_PARAM
	.comm	_BLKTYPE_NPA,4,2                ## @BLKTYPE_NPA
	.comm	_NPA_AF_ERR_AF_LF_INVALID,4,2   ## @NPA_AF_ERR_AF_LF_INVALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reset NPALF%d\n"

	.comm	_NPA_AF_ERR_LF_RESET,4,2        ## @NPA_AF_ERR_LF_RESET
	.comm	_NPA_AF_CONST1,4,2              ## @NPA_AF_CONST1
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_NPA_AF_CONST,4,2               ## @NPA_AF_CONST
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rvu_mbox_handler_npa_lf_alloc  ; -- Begin function rvu_mbox_handler_npa_lf_alloc
	.p2align	2
_rvu_mbox_handler_npa_lf_alloc:         ; @rvu_mbox_handler_npa_lf_alloc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _NPA_AURA_SZ_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NPA_AURA_SZ_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _NPA_AURA_SZ_0@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NPA_AURA_SZ_0@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, le
	b.eq	LBB0_7
; %bb.1:
	mov	x24, x1
	ldr	w8, [x1, #4]
	cbz	w8, LBB0_7
; %bb.2:
	mov	x19, x2
	mov	x20, x0
	ldr	x25, [x0, #8]
	ldr	w23, [x24, #8]
	mov	x1, x23
	bl	_rvu_get_pfvf
	mov	x22, x0
Lloh6:
	adrp	x8, _BLKTYPE_NPA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BLKTYPE_NPA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x23
	bl	_rvu_get_blkaddr
	ldr	w8, [x22, #40]
	cbz	w8, LBB0_8
; %bb.3:
	mov	x21, x0
	tbnz	w0, #31, LBB0_8
; %bb.4:
	ldr	x8, [x25]
	add	x25, x8, w21, uxtw #2
	mov	x0, x20
	mov	x1, x25
	mov	x2, x23
	mov	w3, #0
	bl	_rvu_get_lf
	tbnz	w0, #31, LBB0_8
; %bb.5:
	mov	x23, x0
	mov	x0, x20
	mov	x1, x25
	mov	x2, x23
	bl	_rvu_lf_reset
	cbz	w0, LBB0_11
; %bb.6:
	ldr	w0, [x20]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_dev_err
Lloh11:
	adrp	x8, _NPA_AF_ERR_LF_RESET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NPA_AF_ERR_LF_RESET@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh13:
	adrp	x8, _NPA_AF_ERR_PARAM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NPA_AF_ERR_PARAM@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh15:
	adrp	x8, _NPA_AF_ERR_AF_LF_INVALID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NPA_AF_ERR_AF_LF_INVALID@GOTPAGEOFF]
LBB0_9:
	ldr	w22, [x8]
LBB0_10:
	mov	x0, x22
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh17:
	adrp	x8, _NPA_AF_CONST1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NPA_AF_CONST1@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_rvu_read64
	mov	x25, x0
	and	w8, w0, #0xf
	mov	w9, #1
	lsl	w26, w9, w8
	ldr	w27, [x20]
	add	x28, x22, #8
	ldr	w0, [x24]
	bl	_NPA_AURA_COUNT
	mov	x2, x0
	mov	x0, x27
	mov	x1, x28
	mov	x3, x26
	bl	_qmem_alloc
Lloh20:
	adrp	x26, _NPA_AF_CONST@GOTPAGE
Lloh21:
	ldr	x26, [x26, _NPA_AF_CONST@GOTPAGEOFF]
	cbz	w0, LBB0_14
LBB0_12:
	mov	x0, x20
	mov	x1, x22
	bl	_npa_ctx_free
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_13:
	ldr	w2, [x26]
	mov	x0, x20
	mov	x1, x21
	bl	_rvu_read64
	ubfx	w8, w0, #8, #8
	and	w9, w0, #0xff
	stp	w8, w9, [x19]
	asr	w8, w0, #28
	and	w8, w8, #0xfff
	str	w8, [x19, #8]
	b	LBB0_10
LBB0_14:
	ldr	w0, [x24]
	bl	_NPA_AURA_COUNT
Lloh25:
	adrp	x27, _GFP_KERNEL@GOTPAGE
Lloh26:
	ldr	x27, [x27, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x27]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x22, #32]
	cbz	x0, LBB0_12
; %bb.15:
	ubfx	w8, w25, #4, #4
	mov	w9, #1
	lsl	w3, w9, w8
	ldr	w0, [x20]
	add	x1, x22, #24
	ldr	w2, [x24, #4]
	bl	_qmem_alloc
	cbnz	w0, LBB0_12
; %bb.16:
	ldr	w0, [x24]
	bl	_NPA_AURA_COUNT
	ldr	w2, [x27]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x22, #16]
	cbz	x0, LBB0_12
; %bb.17:
	ldr	w2, [x26]
	mov	x0, x20
	mov	x1, x21
	bl	_rvu_read64
	asr	w8, w0, #28
	and	w2, w8, #0xfff
	ubfx	w8, w25, #8, #4
	mov	w9, #1
	lsl	w3, w9, w8
	ldr	w0, [x20]
	mov	x1, x22
	bl	_qmem_alloc
	cbnz	w0, LBB0_12
; %bb.18:
	mov	x0, x23
	bl	_NPA_AF_LFX_AURAS_CFG
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_rvu_read64
	mov	x25, x0
	mov	w0, #34
	bl	_BIT_ULL
	neg	w8, w0
	and	w25, w25, w8
	ldr	w24, [x24]
	mov	w0, #34
	bl	_BIT_ULL
	orr	w8, w0, w25
	orr	w24, w8, w24, lsl #16
	mov	x0, x23
	bl	_NPA_AF_LFX_AURAS_CFG
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	mov	x3, x24
	bl	_rvu_write64
	mov	x0, x23
	bl	_NPA_AF_LFX_LOC_AURAS_BASE
	mov	x2, x0
	ldr	x8, [x22, #8]
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_rvu_write64
	mov	x0, x23
	bl	_NPA_AF_LFX_QINTS_CFG
	mov	x24, x0
	mov	w0, #36
	bl	_BIT_ULL
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x24
	bl	_rvu_write64
	mov	x0, x23
	bl	_NPA_AF_LFX_QINTS_BASE
	mov	x2, x0
	ldr	x8, [x22]
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_rvu_write64
	mov	w22, #0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_NPA_AURA_SZ_MAX,4,2            ; @NPA_AURA_SZ_MAX
	.comm	_NPA_AURA_SZ_0,4,2              ; @NPA_AURA_SZ_0
	.comm	_NPA_AF_ERR_PARAM,4,2           ; @NPA_AF_ERR_PARAM
	.comm	_BLKTYPE_NPA,4,2                ; @BLKTYPE_NPA
	.comm	_NPA_AF_ERR_AF_LF_INVALID,4,2   ; @NPA_AF_ERR_AF_LF_INVALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reset NPALF%d\n"

	.comm	_NPA_AF_ERR_LF_RESET,4,2        ; @NPA_AF_ERR_LF_RESET
	.comm	_NPA_AF_CONST1,4,2              ; @NPA_AF_CONST1
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_NPA_AF_CONST,4,2               ; @NPA_AF_CONST
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
