	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgx_init_hw
_bgx_init_hw:                           ## @bgx_init_hw
	.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	%rdi, %r14
	movq	_BGX_CMR_GLOBAL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CMR_GLOBAL_CFG_FCS_STRIP@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%esi, %esi
	callq	_bgx_reg_modify
	movq	_BGX_CMR_BIST_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_bgx_reg_read
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	24(%r14), %rdi
	movl	16(%r14), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_2:
	movl	(%r14), %ecx
	testl	%ecx, %ecx
	jle	LBB0_5
## %bb.3:
	movq	8(%r14), %rax
	xorl	%ebx, %ebx
	movq	_BGX_CMRX_CFG@GOTPCREL(%rip), %r12
	movq	_lmac_count@GOTPCREL(%rip), %r13
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdx
	movl	(%rax,%rbx), %ecx
	shll	$8, %ecx
	orl	4(%rax,%rbx), %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_bgx_reg_write
	movl	(%r13), %ecx
	movq	8(%r14), %rax
	movl	%ecx, 8(%rax,%rbx)
	incl	(%r13)
	incq	%r15
	movslq	(%r14), %rcx
	addq	$12, %rbx
	cmpq	%rcx, %r15
	jl	LBB0_4
LBB0_5:
	movq	_BGX_CMR_TX_LMACS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_bgx_reg_write
	movq	_BGX_CMR_RX_LMACS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	(%r14), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_bgx_reg_write
	cmpl	$0, (%r14)
	jle	LBB0_8
## %bb.6:
	xorl	%ebx, %ebx
	movq	_BGX_CMR_CHAN_MSK_AND@GOTPCREL(%rip), %r15
	movq	_MAX_BGX_CHANS_PER_LMAC@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edx
	movq	(%r12), %rcx
	movq	$-1, %rax
	shlq	%cl, %rax
	notq	%rax
	imull	%ebx, %ecx
                                        ## kill: def $cl killed $cl killed $rcx
	shlq	%cl, %rax
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%rax, %rcx
	callq	_bgx_reg_modify
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_7
LBB0_8:
	movq	_RX_DMAC_COUNT@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_11
## %bb.9:
	xorl	%r13d, %r13d
	movq	_BGX_CMR_RX_DMACX_CAM@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdx
	addq	%r13, %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_bgx_reg_write
	incq	%rbx
	movslq	(%r15), %rax
	addq	$8, %r13
	cmpq	%rax, %rbx
	jl	LBB0_10
LBB0_11:
	movq	_RX_TRAFFIC_STEER_RULE_COUNT@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_14
## %bb.12:
	xorl	%r13d, %r13d
	movq	_BGX_CMR_RX_STEERING@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdx
	addq	%r13, %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_bgx_reg_write
	incq	%rbx
	movslq	(%r15), %rax
	addq	$8, %r13
	cmpq	%rax, %rbx
	jl	LBB0_13
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGX_CMR_GLOBAL_CFG,4,2         ## @BGX_CMR_GLOBAL_CFG
	.comm	_CMR_GLOBAL_CFG_FCS_STRIP,8,3   ## @CMR_GLOBAL_CFG_FCS_STRIP
	.comm	_BGX_CMR_BIST_STATUS,4,2        ## @BGX_CMR_BIST_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BGX%d BIST failed\n"

	.comm	_BGX_CMRX_CFG,8,3               ## @BGX_CMRX_CFG
	.comm	_lmac_count,4,2                 ## @lmac_count
	.comm	_BGX_CMR_TX_LMACS,8,3           ## @BGX_CMR_TX_LMACS
	.comm	_BGX_CMR_RX_LMACS,8,3           ## @BGX_CMR_RX_LMACS
	.comm	_BGX_CMR_CHAN_MSK_AND,4,2       ## @BGX_CMR_CHAN_MSK_AND
	.comm	_MAX_BGX_CHANS_PER_LMAC,8,3     ## @MAX_BGX_CHANS_PER_LMAC
	.comm	_RX_DMAC_COUNT,4,2              ## @RX_DMAC_COUNT
	.comm	_BGX_CMR_RX_DMACX_CAM,8,3       ## @BGX_CMR_RX_DMACX_CAM
	.comm	_RX_TRAFFIC_STEER_RULE_COUNT,4,2 ## @RX_TRAFFIC_STEER_RULE_COUNT
	.comm	_BGX_CMR_RX_STEERING,8,3        ## @BGX_CMR_RX_STEERING
	.no_dead_strip	_bgx_init_hw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgx_init_hw
_bgx_init_hw:                           ; @bgx_init_hw
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _BGX_CMR_GLOBAL_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BGX_CMR_GLOBAL_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _CMR_GLOBAL_CFG_FCS_STRIP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMR_GLOBAL_CFG_FCS_STRIP@GOTPAGEOFF]
Lloh5:
	ldr	x3, [x8]
	mov	w1, #0
	bl	_bgx_reg_modify
Lloh6:
	adrp	x8, _BGX_CMR_BIST_STATUS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BGX_CMR_BIST_STATUS@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_bgx_reg_read
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x19, #24]
	ldr	w2, [x19, #16]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	ldr	w3, [x19]
	cmp	w3, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x21, #0
	mov	x20, #0
	ldr	x8, [x19, #8]
Lloh11:
	adrp	x22, _BGX_CMRX_CFG@GOTPAGE
Lloh12:
	ldr	x22, [x22, _BGX_CMRX_CFG@GOTPAGEOFF]
Lloh13:
	adrp	x23, _lmac_count@GOTPAGE
Lloh14:
	ldr	x23, [x23, _lmac_count@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x22]
	add	x8, x8, x21
	ldp	w9, w8, [x8]
	orr	w3, w8, w9, lsl #8
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_write
	ldr	w9, [x23]
	ldr	x8, [x19, #8]
	add	x10, x8, x21
	str	w9, [x10, #8]
	ldr	w9, [x23]
	add	w9, w9, #1
	str	w9, [x23]
	add	x20, x20, #1
	ldrsw	x3, [x19]
	add	x21, x21, #12
	cmp	x20, x3
	b.lt	LBB0_4
LBB0_5:
Lloh15:
	adrp	x8, _BGX_CMR_TX_LMACS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BGX_CMR_TX_LMACS@GOTPAGEOFF]
Lloh17:
	ldr	x2, [x8]
	mov	x0, x19
	mov	w1, #0
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_bgx_reg_write
Lloh18:
	adrp	x8, _BGX_CMR_RX_LMACS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BGX_CMR_RX_LMACS@GOTPAGEOFF]
Lloh20:
	ldr	x2, [x8]
	ldr	w3, [x19]
	mov	x0, x19
	mov	w1, #0
	bl	_bgx_reg_write
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x20, #0
Lloh21:
	adrp	x21, _BGX_CMR_CHAN_MSK_AND@GOTPAGE
Lloh22:
	ldr	x21, [x21, _BGX_CMR_CHAN_MSK_AND@GOTPAGEOFF]
Lloh23:
	adrp	x22, _MAX_BGX_CHANS_PER_LMAC@GOTPAGE
Lloh24:
	ldr	x22, [x22, _MAX_BGX_CHANS_PER_LMAC@GOTPAGEOFF]
	mov	x23, #-1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21]
	ldr	x8, [x22]
	lsl	x9, x23, x8
	mvn	x9, x9
	mul	x8, x8, x20
	lsl	x3, x9, x8
	mov	x0, x19
	mov	w1, #0
	bl	_bgx_reg_modify
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.lt	LBB0_7
LBB0_8:
Lloh25:
	adrp	x20, _RX_DMAC_COUNT@GOTPAGE
Lloh26:
	ldr	x20, [x20, _RX_DMAC_COUNT@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.9:
	mov	x21, #0
	mov	x22, #0
Lloh27:
	adrp	x23, _BGX_CMR_RX_DMACX_CAM@GOTPAGE
Lloh28:
	ldr	x23, [x23, _BGX_CMR_RX_DMACX_CAM@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	add	x2, x21, x8
	mov	x0, x19
	mov	w1, #0
	mov	w3, #0
	bl	_bgx_reg_write
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x21, x21, #8
	cmp	x22, x8
	b.lt	LBB0_10
LBB0_11:
Lloh29:
	adrp	x20, _RX_TRAFFIC_STEER_RULE_COUNT@GOTPAGE
Lloh30:
	ldr	x20, [x20, _RX_TRAFFIC_STEER_RULE_COUNT@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.12:
	mov	x21, #0
	mov	x22, #0
Lloh31:
	adrp	x23, _BGX_CMR_RX_STEERING@GOTPAGE
Lloh32:
	ldr	x23, [x23, _BGX_CMR_RX_STEERING@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	add	x2, x21, x8
	mov	x0, x19
	mov	w1, #0
	mov	w3, #0
	bl	_bgx_reg_write
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x21, x21, #8
	cmp	x22, x8
	b.lt	LBB0_13
LBB0_14:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_BGX_CMR_GLOBAL_CFG,4,2         ; @BGX_CMR_GLOBAL_CFG
	.comm	_CMR_GLOBAL_CFG_FCS_STRIP,8,3   ; @CMR_GLOBAL_CFG_FCS_STRIP
	.comm	_BGX_CMR_BIST_STATUS,4,2        ; @BGX_CMR_BIST_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BGX%d BIST failed\n"

	.comm	_BGX_CMRX_CFG,8,3               ; @BGX_CMRX_CFG
	.comm	_lmac_count,4,2                 ; @lmac_count
	.comm	_BGX_CMR_TX_LMACS,8,3           ; @BGX_CMR_TX_LMACS
	.comm	_BGX_CMR_RX_LMACS,8,3           ; @BGX_CMR_RX_LMACS
	.comm	_BGX_CMR_CHAN_MSK_AND,4,2       ; @BGX_CMR_CHAN_MSK_AND
	.comm	_MAX_BGX_CHANS_PER_LMAC,8,3     ; @MAX_BGX_CHANS_PER_LMAC
	.comm	_RX_DMAC_COUNT,4,2              ; @RX_DMAC_COUNT
	.comm	_BGX_CMR_RX_DMACX_CAM,8,3       ; @BGX_CMR_RX_DMACX_CAM
	.comm	_RX_TRAFFIC_STEER_RULE_COUNT,4,2 ; @RX_TRAFFIC_STEER_RULE_COUNT
	.comm	_BGX_CMR_RX_STEERING,8,3        ; @BGX_CMR_RX_STEERING
	.no_dead_strip	_bgx_init_hw
.subsections_via_symbols
