	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nic_set_lmac_vf_mapping
_nic_set_lmac_vf_mapping:               ## @nic_set_lmac_vf_mapping
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	24(%rdi), %edi
	callq	_bgx_get_map
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	$0, (%r12)
	movq	32(%r12), %rax
	cmpl	$0, (%rax)
	jle	LBB0_14
## %bb.1:
	xorl	%ebx, %ebx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%r13d
	addl	$8, %ebx
	cmpl	(%rax), %r13d
	jge	LBB0_14
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##     Child Loop BB0_9 Depth 2
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	btl	%r13d, %ecx
	jae	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	24(%r12), %edi
	movl	%r13d, %esi
	callq	_bgx_get_lmac_count
	movl	%eax, %esi
	testl	%eax, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %r15d
	movq	%r12, %r13
	movslq	-44(%rbp), %r14                 ## 4-byte Folded Reload
	shlq	$2, %r14
	movl	%esi, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_NIC_SET_VF_LMAC_MAP
	movq	16(%r13), %rcx
	addq	%r14, %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	cmpl	%ebx, %r12d
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%ebx, -44(%rbp)                 ## 4-byte Folded Spill
	movq	%r13, %r12
	movl	%r15d, %r13d
	movl	-52(%rbp), %esi                 ## 4-byte Reload
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movslq	%esi, %r14
	addq	(%r12), %r14
	movq	%r14, (%r12)
	movl	$49152, %eax                    ## imm = 0xC000
	xorl	%edx, %edx
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	movq	_NIC_HW_MAX_FRS@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	leal	15(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	testl	%esi, %esi
	jle	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	andl	$-16, %ebx
	shll	$8, %ebx
	orl	$2046, %ebx                     ## imm = 0x7FE
	movq	_MAX_LMAC_PER_BGX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	movl	%r14d, %eax
	imull	%r13d, %eax
	movq	%r12, %r15
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movq	%rcx, %r13
	movslq	%eax, %r12
	imull	-64(%rbp), %r14d                ## 4-byte Folded Reload
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%r14d, %r14
	movq	_NIC_PF_LMAC_0_7_CREDIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r14, %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_nic_reg_write
	incq	%r12
	movl	(%r13), %eax
	imull	-48(%rbp), %eax                 ## 4-byte Folded Reload
	addl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	cltq
	addl	$8, %r14d
	cmpq	%rax, %r12
	jl	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %r14
	movq	%r15, %r12
	movl	-48(%rbp), %r13d                ## 4-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%r12), %edi
	callq	_pci_sriov_get_totalvfs
	cmpq	%rax, %r14
	jge	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	32(%r12), %rax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_15:
	movl	8(%r12), %edi
	callq	_pci_sriov_get_totalvfs
	movq	%rax, (%r12)
LBB0_14:
	addq	$24, %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	_MAX_LMAC_PER_BGX,4,2           ## @MAX_LMAC_PER_BGX
	.comm	_NIC_PF_LMAC_0_7_CREDIT,8,3     ## @NIC_PF_LMAC_0_7_CREDIT
	.no_dead_strip	_nic_set_lmac_vf_mapping
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nic_set_lmac_vf_mapping
_nic_set_lmac_vf_mapping:               ; @nic_set_lmac_vf_mapping
	.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	x19, x0
	ldr	w0, [x0, #24]
	bl	_bgx_get_map
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	str	xzr, [x19]
	ldr	x8, [x19, #32]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_15
; %bb.1:
	mov	w24, #0
	mov	w25, #0
	mov	w21, #0
Lloh0:
	adrp	x28, _MAX_LMAC_PER_BGX@GOTPAGE
Lloh1:
	ldr	x28, [x28, _MAX_LMAC_PER_BGX@GOTPAGEOFF]
Lloh2:
	adrp	x26, _NIC_PF_LMAC_0_7_CREDIT@GOTPAGE
Lloh3:
	ldr	x26, [x26, _NIC_PF_LMAC_0_7_CREDIT@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w21, w21, #1
	ldr	w9, [x8]
	add	w24, w24, #8
	cmp	w21, w9
	b.ge	LBB0_15
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	lsr	w9, w9, w21
	tbz	w9, #0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #24]
	mov	x1, x21
	bl	_bgx_get_lmac_count
	mov	x22, x0
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, #0
	sbfiz	x27, x25, #2, #32
	mov	w20, w22
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x21
	mov	x1, x23
	bl	_NIC_SET_VF_LMAC_MAP
	ldr	x8, [x19, #16]
	add	x8, x8, x27
	str	w0, [x8, x23, lsl #2]
	add	x23, x23, #1
	cmp	w20, w23
	b.ne	LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w25, w25, w23
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19]
	add	x20, x8, w22, sxtw
	str	x20, [x19]
	mov	w8, #49152
	sdiv	w8, w8, w22
Lloh4:
	adrp	x9, _NIC_HW_MAX_FRS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _NIC_HW_MAX_FRS@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	sub	w8, w8, w9
	add	w9, w8, #15
	cmp	w8, #0
	csel	w8, w9, w8, lt
	cmp	w22, #1
	b.lt	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	lsr	w8, w8, #4
	mov	w23, #2046
	bfi	w23, w8, #12, #20
	ldr	w8, [x28]
	mul	w9, w8, w21
	sxtw	x27, w9
	mul	w20, w8, w24
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x26]
	add	x1, x8, w20, sxtw
	mov	x0, x19
	mov	x2, x23
	bl	_nic_reg_write
	add	x27, x27, #1
	ldr	w8, [x28]
	madd	w8, w8, w21, w22
	add	w20, w20, #8
	cmp	x27, w8, sxtw
	b.lt	LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x20, [x19]
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #8]
	bl	_pci_sriov_get_totalvfs
	cmp	x20, x0
	b.ge	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #32]
	b	LBB0_2
LBB0_14:
	ldr	w0, [x19, #8]
	bl	_pci_sriov_get_totalvfs
	str	x0, [x19]
LBB0_15:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_NIC_HW_MAX_FRS,4,2             ; @NIC_HW_MAX_FRS
	.comm	_MAX_LMAC_PER_BGX,4,2           ; @MAX_LMAC_PER_BGX
	.comm	_NIC_PF_LMAC_0_7_CREDIT,8,3     ; @NIC_PF_LMAC_0_7_CREDIT
	.no_dead_strip	_nic_set_lmac_vf_mapping
.subsections_via_symbols
