	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nic_update_hw_frs
_nic_update_hw_frs:                     ## @nic_update_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_NIC_HW_MAX_FRS@GOTPCREL(%rip), %rax
	movl	$1, %r15d
	cmpl	%esi, (%rax)
	jl	LBB0_4
## %bb.1:
	movl	%esi, %r12d
	movq	_NIC_HW_MIN_FRS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jg	LBB0_4
## %bb.2:
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movslq	%edx, %r14
	movl	(%rax,%r14,4), %edi
	callq	_NIC_GET_BGX_FROM_VF_LMAC_MAP
	movl	%eax, %r15d
	movq	8(%r13), %rax
	movl	(%rax,%r14,4), %edi
	callq	_NIC_GET_LMAC_FROM_VF_LMAC_MAP
	movq	_MAX_LMAC_PER_BGX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	imull	%r15d, %ebx
	addl	%eax, %ebx
	movq	_VLAN_ETH_HLEN@GOTPCREL(%rip), %rax
	movq	_ETH_FCS_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	(%rax), %ecx
	leal	(%r12,%rcx), %r14d
	addl	$4, %r14d
	movl	4(%r13), %edi
	movl	%r15d, %esi
	callq	_bgx_get_lmac_count
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_NIC_PF_LMAC_0_7_CREDIT@GOTPCREL(%rip), %rax
	shll	$3, %ebx
	movslq	%ebx, %r12
	movl	%r14d, %ebx
	movq	(%rax), %rsi
	movq	%rax, %r14
	addq	%r12, %rsi
	movq	%r13, %rdi
	callq	_nic_reg_read
	movl	%eax, %ecx
	andl	$4095, %ecx                     ## imm = 0xFFF
	xorl	%r15d, %r15d
	movl	$49152, %eax                    ## imm = 0xC000
	xorl	%edx, %edx
	idivl	-44(%rbp)                       ## 4-byte Folded Reload
                                        ## kill: def $eax killed $eax def $rax
	subl	%ebx, %eax
	leal	15(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	andl	$-16, %edx
	shll	$8, %edx
	orl	%ecx, %edx
	movq	(%r14), %rsi
	addq	%r12, %rsi
	movq	%r13, %rdi
	callq	_nic_reg_write
	movl	(%r13), %edi
	callq	_pass1_silicon
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	_NIC_PF_LMAC_0_7_CFG2@GOTPCREL(%rip), %rax
	addq	(%rax), %r12
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_nic_reg_write
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NIC_HW_MAX_FRS,4,2             ## @NIC_HW_MAX_FRS
	.comm	_NIC_HW_MIN_FRS,4,2             ## @NIC_HW_MIN_FRS
	.comm	_MAX_LMAC_PER_BGX,4,2           ## @MAX_LMAC_PER_BGX
	.comm	_VLAN_ETH_HLEN,8,3              ## @VLAN_ETH_HLEN
	.comm	_ETH_FCS_LEN,8,3                ## @ETH_FCS_LEN
	.comm	_NIC_PF_LMAC_0_7_CREDIT,8,3     ## @NIC_PF_LMAC_0_7_CREDIT
	.comm	_NIC_PF_LMAC_0_7_CFG2,8,3       ## @NIC_PF_LMAC_0_7_CFG2
	.no_dead_strip	_nic_update_hw_frs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nic_update_hw_frs
_nic_update_hw_frs:                     ; @nic_update_hw_frs
	.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
                                        ; kill: def $w2 killed $w2 def $x2
Lloh0:
	adrp	x8, _NIC_HW_MAX_FRS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NIC_HW_MAX_FRS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _NIC_HW_MIN_FRS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NIC_HW_MIN_FRS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w1
	ccmp	w9, w1, #0, ge
	b.le	LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_5
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	sbfiz	x22, x2, #2, #32
	ldr	w0, [x8, x22]
	bl	_NIC_GET_BGX_FROM_VF_LMAC_MAP
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x22]
	bl	_NIC_GET_LMAC_FROM_VF_LMAC_MAP
Lloh6:
	adrp	x8, _MAX_LMAC_PER_BGX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_LMAC_PER_BGX@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	madd	w22, w8, w21, w0
Lloh9:
	adrp	x8, _VLAN_ETH_HLEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VLAN_ETH_HLEN@GOTPAGEOFF]
Lloh11:
	adrp	x9, _ETH_FCS_LEN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ETH_FCS_LEN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	ldr	w9, [x9]
	add	w8, w9, w8
	add	w8, w20, w8
	add	w20, w8, #4
	ldr	w0, [x19, #4]
	mov	x1, x21
	bl	_bgx_get_lmac_count
	mov	x21, x0
Lloh15:
	adrp	x23, _NIC_PF_LMAC_0_7_CREDIT@GOTPAGE
Lloh16:
	ldr	x23, [x23, _NIC_PF_LMAC_0_7_CREDIT@GOTPAGEOFF]
	ldr	x8, [x23]
	lsl	w9, w22, #3
	sxtw	x22, w9
	add	x1, x8, x22
	mov	x0, x19
	bl	_nic_reg_read
	mov	x2, x0
	mov	w8, #49152
	sdiv	w8, w8, w21
	sub	w8, w8, w20
	add	w9, w8, #15
	cmp	w8, #0
	csel	w8, w9, w8, lt
	lsr	w8, w8, #4
	bfi	w2, w8, #12, #20
	ldr	x8, [x23]
	add	x1, x8, x22
	mov	x0, x19
	bl	_nic_reg_write
	ldr	w0, [x19]
	bl	_pass1_silicon
	cbnz	w0, LBB0_4
; %bb.3:
Lloh17:
	adrp	x8, _NIC_PF_LMAC_0_7_CFG2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NIC_PF_LMAC_0_7_CFG2@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	add	x1, x8, x22
	mov	x0, x19
	mov	x2, x20
	bl	_nic_reg_write
LBB0_4:
	mov	w0, #0
LBB0_5:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_NIC_HW_MAX_FRS,4,2             ; @NIC_HW_MAX_FRS
	.comm	_NIC_HW_MIN_FRS,4,2             ; @NIC_HW_MIN_FRS
	.comm	_MAX_LMAC_PER_BGX,4,2           ; @MAX_LMAC_PER_BGX
	.comm	_VLAN_ETH_HLEN,8,3              ; @VLAN_ETH_HLEN
	.comm	_ETH_FCS_LEN,8,3                ; @ETH_FCS_LEN
	.comm	_NIC_PF_LMAC_0_7_CREDIT,8,3     ; @NIC_PF_LMAC_0_7_CREDIT
	.comm	_NIC_PF_LMAC_0_7_CFG2,8,3       ; @NIC_PF_LMAC_0_7_CFG2
	.no_dead_strip	_nic_update_hw_frs
.subsections_via_symbols
