	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rvu_mbox_handler_nix_set_hw_frs ## -- Begin function rvu_mbox_handler_nix_set_hw_frs
	.p2align	4, 0x90
_rvu_mbox_handler_nix_set_hw_frs:       ## @rvu_mbox_handler_nix_set_hw_frs
	.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
	movq	%rdi, %r13
	movq	16(%rdi), %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	32(%rsi), %rbx
	movq	%rbx, %rdi
	callq	_rvu_get_pf
	movl	%eax, %r14d
	movl	$0, -48(%rbp)
	movl	$0, -64(%rbp)
	movq	_BLKTYPE_NIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdx
	callq	_rvu_get_blkaddr
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movl	%eax, %r15d
	movq	16(%r13), %rdi
	movl	%eax, %esi
	callq	_get_nix_hw
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	8(%rdi), %rcx
	testq	%rcx, %rcx
	jne	LBB0_4
## %bb.3:
	movl	(%rdi), %edx
	movq	_NIC_HW_MAX_FRS@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jg	LBB0_6
LBB0_4:
	cmpq	$0, 16(%rdi)
	je	LBB0_9
## %bb.5:
	movl	4(%rdi), %edx
	movq	_NIC_HW_MIN_FRS@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jge	LBB0_9
LBB0_6:
	movq	_NIX_AF_ERR_FRS_INVALID@GOTPCREL(%rip), %rax
	jmp	LBB0_33
LBB0_7:
	movq	_NIX_AF_ERR_AF_LF_INVALID@GOTPCREL(%rip), %rax
LBB0_33:
	movl	(%rax), %ebx
	jmp	LBB0_34
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_34
LBB0_9:
	cmpl	$0, 24(%rdi)
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_18
## %bb.10:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r15
	movq	_NIX_TXSCH_LVL_SMQ@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	%r13, %rbx
	leaq	8(%r13), %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	shlq	$4, %r14
	cmpl	$0, 8(%r15,%r14)
	jle	LBB0_17
## %bb.11:
	leaq	(%r15,%r14), %r13
	addq	$8, %r13
	addq	%r14, %r15
	xorl	%r12d, %r12d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	%r12d, %edi
	callq	_NIX_AF_SMQX_CFG
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_rvu_write64
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r12
	movslq	(%r13), %rax
	cmpq	%rax, %r12
	jge	LBB0_17
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movl	(%rax,%r12,4), %edi
	callq	_TXSCH_MAP_FUNC
	cmpq	-72(%rbp), %rax                 ## 8-byte Folded Reload
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%r12d, %edi
	callq	_NIX_AF_SMQX_CFG
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_rvu_read64
	andl	$-16776961, %eax                ## imm = 0xFF0000FF
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %r14d
	shll	$8, %r14d
	orl	%eax, %r14d
	cmpq	$0, 16(%rcx)
	je	LBB0_12
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	andl	$-128, %r14d
	movl	4(%rcx), %eax
	andl	$127, %eax
	orl	%eax, %r14d
	jmp	LBB0_12
LBB0_17:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rcx
	movq	%rbx, %r13
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	movq	-88(%rbp), %r12                 ## 8-byte Reload
LBB0_18:
	testq	%rcx, %rcx
	je	LBB0_21
## %bb.19:
	cmpl	$0, 12(%r12)
	je	LBB0_32
## %bb.20:
	movq	%r12, %rax
	movl	4(%r12), %r12d
	addl	(%rax), %r12d
	jmp	LBB0_24
LBB0_21:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_is_pf_cgxmapped
	testq	%rax, %rax
	je	LBB0_30
## %bb.22:
	movq	(%r13), %rax
	movslq	%r14d, %rcx
	movl	(%rax,%rcx,4), %edi
	leaq	-48(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	_rvu_get_cgx_lmac_id
	movl	8(%r12), %r12d
	imull	-48(%rbp), %r12d
	addl	-64(%rbp), %r12d
	testl	%r12d, %r12d
	js	LBB0_32
LBB0_23:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_nix_find_link_frs
LBB0_24:
	movl	%r12d, %edi
	callq	_NIX_AF_RX_LINKX_CFG
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_rvu_read64
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %ebx
	shll	$16, %ebx
	cmpq	$0, 16(%r14)
	je	LBB0_26
## %bb.25:
	orl	4(%r14), %ebx
	jmp	LBB0_27
LBB0_26:
	movzwl	%ax, %eax
	orl	%eax, %ebx
LBB0_27:
	movl	%r12d, %edi
	callq	_NIX_AF_RX_LINKX_CFG
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_rvu_write64
	xorl	%ebx, %ebx
	cmpq	$0, 8(%r14)
	jne	LBB0_34
## %bb.28:
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_34
## %bb.29:
	movq	_CGX_FIFO_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	-48(%rbp), %edi
	movq	%r13, %rsi
	callq	_rvu_cgx_pdata
	movl	%eax, %edi
	callq	_cgx_get_lmac_cnt
	movl	%eax, %ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	movl	%r12d, %edi
	callq	_NIX_AF_TX_LINKX_NORM_CREDIT
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_rvu_read64
	andl	$4095, %eax                     ## imm = 0xFFF
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	subl	(%rcx), %r14d
	movq	%r13, %r15
	leal	15(%r14), %r13d
	testl	%r14d, %r14d
	cmovnsl	%r14d, %r13d
	andl	$-16, %r13d
	shll	$8, %r13d
	orl	%eax, %r13d
	movl	%r12d, %edi
	callq	_NIX_AF_TX_LINKX_NORM_CREDIT
	movq	%r15, %rdi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	movl	%eax, %edx
	movl	%r13d, %ecx
	callq	_rvu_write64
	movl	%r12d, %edi
	callq	_NIX_AF_TX_LINKX_EXPR_CREDIT
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	movl	%r13d, %ecx
	callq	_rvu_write64
LBB0_34:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	testl	%r14d, %r14d
	jne	LBB0_32
## %bb.31:
	movl	(%r12), %r12d
	testl	%r12d, %r12d
	jns	LBB0_23
LBB0_32:
	movq	_NIX_AF_ERR_RX_LINK_INVALID@GOTPCREL(%rip), %rax
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.comm	_BLKTYPE_NIX,4,2                ## @BLKTYPE_NIX
	.comm	_NIX_AF_ERR_AF_LF_INVALID,4,2   ## @NIX_AF_ERR_AF_LF_INVALID
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NIC_HW_MAX_FRS,4,2             ## @NIC_HW_MAX_FRS
	.comm	_NIX_AF_ERR_FRS_INVALID,4,2     ## @NIX_AF_ERR_FRS_INVALID
	.comm	_NIC_HW_MIN_FRS,4,2             ## @NIC_HW_MIN_FRS
	.comm	_NIX_TXSCH_LVL_SMQ,8,3          ## @NIX_TXSCH_LVL_SMQ
	.comm	_NIX_AF_ERR_RX_LINK_INVALID,4,2 ## @NIX_AF_ERR_RX_LINK_INVALID
	.comm	_CGX_FIFO_LEN,4,2               ## @CGX_FIFO_LEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rvu_mbox_handler_nix_set_hw_frs ; -- Begin function rvu_mbox_handler_nix_set_hw_frs
	.p2align	2
_rvu_mbox_handler_nix_set_hw_frs:       ; @rvu_mbox_handler_nix_set_hw_frs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x27, [x0, #16]
	ldr	x23, [x1, #32]
	mov	x0, x23
	bl	_rvu_get_pf
	mov	x22, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _BLKTYPE_NIX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BLKTYPE_NIX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_rvu_get_blkaddr
	tbnz	w0, #31, LBB0_7
; %bb.1:
	mov	x20, x0
	ldr	x0, [x19, #16]
	mov	x1, x20
	bl	_get_nix_hw
	cbz	x0, LBB0_9
; %bb.2:
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	w9, [x21]
Lloh3:
	adrp	x10, _NIC_HW_MAX_FRS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NIC_HW_MAX_FRS@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, w10
	b.gt	LBB0_6
LBB0_4:
	ldr	x9, [x21, #16]
	cbz	x9, LBB0_10
; %bb.5:
	ldr	w9, [x21, #4]
Lloh6:
	adrp	x10, _NIC_HW_MIN_FRS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _NIC_HW_MIN_FRS@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ge	LBB0_10
LBB0_6:
Lloh9:
	adrp	x8, _NIX_AF_ERR_FRS_INVALID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NIX_AF_ERR_FRS_INVALID@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _NIX_AF_ERR_AF_LF_INVALID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NIX_AF_ERR_AF_LF_INVALID@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	b	LBB0_31
LBB0_9:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_31
LBB0_10:
	ldr	w9, [x21, #24]
	cbz	w9, LBB0_19
; %bb.11:
	ldr	x24, [x0]
Lloh16:
	adrp	x8, _NIX_TXSCH_LVL_SMQ@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NIX_TXSCH_LVL_SMQ@GOTPAGEOFF]
Lloh18:
	ldr	x25, [x8]
	add	x0, x19, #8
	str	x0, [sp]                        ; 8-byte Folded Spill
	bl	_mutex_lock
	add	x24, x24, x25, lsl #4
	mov	x28, x24
	ldr	w8, [x28, #8]!
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.12:
	mov	x25, #0
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x25
	bl	_NIX_AF_SMQX_CFG
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	mov	x3, x26
	bl	_rvu_write64
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x28]
	cmp	x25, x8
	b.ge	LBB0_18
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	ldr	w0, [x8, x25, lsl #2]
	bl	_TXSCH_MAP_FUNC
	cmp	x0, x23
	b.ne	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x25
	bl	_NIX_AF_SMQX_CFG
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_rvu_read64
	and	w8, w0, #0xff0000ff
	ldr	w9, [x21]
	orr	w26, w8, w9, lsl #8
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x21, #4]
	bfxil	w26, w8, #0, #7
	b	LBB0_13
LBB0_18:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_mutex_unlock
	ldr	x8, [x21, #8]
LBB0_19:
	cbz	x8, LBB0_22
; %bb.20:
	ldr	w8, [x27, #12]
	cbz	w8, LBB0_34
; %bb.21:
	ldp	w8, w9, [x27]
	add	w24, w9, w8
	b	LBB0_25
LBB0_22:
	mov	x0, x19
	mov	x1, x22
	bl	_is_pf_cgxmapped
	cbz	x0, LBB0_32
; %bb.23:
	ldr	x8, [x19]
	ldr	w0, [x8, w22, sxtw #2]
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_rvu_get_cgx_lmac_id
	ldp	w10, w8, [sp, #8]
	ldr	w9, [x27, #8]
	madd	w24, w9, w8, w10
	tbnz	w24, #31, LBB0_34
LBB0_24:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	bl	_nix_find_link_frs
LBB0_25:
	mov	x0, x24
	bl	_NIX_AF_RX_LINKX_CFG
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_rvu_read64
	ldr	w8, [x21]
	ldr	x9, [x21, #16]
	cbz	x9, LBB0_27
; %bb.26:
	lsl	w8, w8, #16
	ldr	w9, [x21, #4]
	orr	w23, w9, w8
	b	LBB0_28
LBB0_27:
	mov	x23, x0
	bfi	w23, w8, #16, #16
LBB0_28:
	mov	x0, x24
	bl	_NIX_AF_RX_LINKX_CFG
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	mov	x3, x23
	bl	_rvu_write64
	mov	w0, #0
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_31
; %bb.29:
	cbz	w22, LBB0_31
; %bb.30:
Lloh19:
	adrp	x8, _CGX_FIFO_LEN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CGX_FIFO_LEN@GOTPAGEOFF]
Lloh21:
	ldr	w22, [x8]
	ldr	w0, [sp, #12]
	mov	x1, x19
	bl	_rvu_cgx_pdata
	bl	_cgx_get_lmac_cnt
	sdiv	w23, w22, w0
	mov	x0, x24
	bl	_NIX_AF_TX_LINKX_NORM_CREDIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_rvu_read64
	mov	x22, x0
	ldr	w8, [x21]
	sub	w8, w23, w8
	add	w9, w8, #15
	cmp	w8, #0
	csel	w8, w9, w8, lt
	lsr	w8, w8, #4
	bfi	w22, w8, #12, #20
	mov	x0, x24
	bl	_NIX_AF_TX_LINKX_NORM_CREDIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	bl	_rvu_write64
	mov	x0, x24
	bl	_NIX_AF_TX_LINKX_EXPR_CREDIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	bl	_rvu_write64
	mov	w0, #0
LBB0_31:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_32:
	cbnz	w22, LBB0_34
; %bb.33:
	ldr	w24, [x27]
	tbz	w24, #31, LBB0_24
LBB0_34:
Lloh22:
	adrp	x8, _NIX_AF_ERR_RX_LINK_INVALID@GOTPAGE
Lloh23:
	ldr	x8, [x8, _NIX_AF_ERR_RX_LINK_INVALID@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_BLKTYPE_NIX,4,2                ; @BLKTYPE_NIX
	.comm	_NIX_AF_ERR_AF_LF_INVALID,4,2   ; @NIX_AF_ERR_AF_LF_INVALID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NIC_HW_MAX_FRS,4,2             ; @NIC_HW_MAX_FRS
	.comm	_NIX_AF_ERR_FRS_INVALID,4,2     ; @NIX_AF_ERR_FRS_INVALID
	.comm	_NIC_HW_MIN_FRS,4,2             ; @NIC_HW_MIN_FRS
	.comm	_NIX_TXSCH_LVL_SMQ,8,3          ; @NIX_TXSCH_LVL_SMQ
	.comm	_NIX_AF_ERR_RX_LINK_INVALID,4,2 ; @NIX_AF_ERR_RX_LINK_INVALID
	.comm	_CGX_FIFO_LEN,4,2               ; @CGX_FIFO_LEN
.subsections_via_symbols
