	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgx_set_lmac_config
_bgx_set_lmac_config:                   ## @bgx_set_lmac_config
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r15
	leaq	(%rsi,%rsi,2), %r12
	leaq	(%r15,%r12,8), %r14
	cmpl	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	cmpq	$0, (%rbx)
	je	LBB0_5
LBB0_2:
	movq	_BGX_CMRX_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_bgx_reg_read
	shrl	$8, %eax
	andl	$7, %eax
	movl	%eax, (%r14)
	cmpq	$0, (%rbx)
	je	LBB0_4
## %bb.3:
	movq	_BGX_MODE_RGMII@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_4:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_lmac_set_training
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lmac_set_lane2sds              ## TAILCALL
LBB0_5:
	movq	_BGX_CMRX_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_bgx_reg_read
	movzbl	%al, %ecx
	shrl	$8, %eax
	andl	$7, %eax
	movl	%ecx, %edx
	xorl	$228, %edx
	orl	%eax, %edx
	jne	LBB0_7
## %bb.6:
	movq	_BGX_MODE_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	movl	%eax, (%r14)
	movq	%rcx, 8(%r15,%r12,8)
	movl	16(%r15,%r12,8), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lmac_set_training              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BGX_CMRX_CFG,4,2               ## @BGX_CMRX_CFG
	.comm	_BGX_MODE_RGMII,4,2             ## @BGX_MODE_RGMII
	.comm	_BGX_MODE_INVALID,4,2           ## @BGX_MODE_INVALID
	.no_dead_strip	_bgx_set_lmac_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgx_set_lmac_config
_bgx_set_lmac_config:                   ; @bgx_set_lmac_config
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x22, [x0, #16]
	mov	w8, #24
	madd	x20, x1, x8, x22
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x8, [x19]
	cbz	x8, LBB0_5
LBB0_2:
Lloh0:
	adrp	x8, _BGX_CMRX_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BGX_CMRX_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_bgx_reg_read
	ubfx	w8, w0, #8, #3
	str	w8, [x20]
	ldr	x8, [x19]
	cbz	x8, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _BGX_MODE_RGMII@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BGX_MODE_RGMII@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_lmac_set_training
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_lmac_set_lane2sds
LBB0_5:
	mov	x21, x1
Lloh6:
	adrp	x8, _BGX_CMRX_CFG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BGX_CMRX_CFG@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_bgx_reg_read
	ubfx	w8, w0, #8, #3
	and	w9, w0, #0xff
	cmp	w9, #228
	ccmp	w8, #0, #0, eq
Lloh9:
	adrp	x10, _BGX_MODE_INVALID@GOTPAGE
Lloh10:
	ldr	x10, [x10, _BGX_MODE_INVALID@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	csel	w8, w10, w8, eq
	str	w8, [x20]
	mov	w8, #24
	madd	x8, x21, x8, x22
	str	x9, [x8, #8]
	ldr	w2, [x8, #16]
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_lmac_set_training
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BGX_CMRX_CFG,4,2               ; @BGX_CMRX_CFG
	.comm	_BGX_MODE_RGMII,4,2             ; @BGX_MODE_RGMII
	.comm	_BGX_MODE_INVALID,4,2           ; @BGX_MODE_INVALID
	.no_dead_strip	_bgx_set_lmac_config
.subsections_via_symbols
