	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cgx_lmac_internal_loopback     ## -- Begin function cgx_lmac_internal_loopback
	.p2align	4, 0x90
_cgx_lmac_internal_loopback:            ## @cgx_lmac_internal_loopback
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	cmpl	%esi, (%rdi)
	jle	LBB0_2
## %bb.3:
	movl	%edx, %r15d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_cgx_get_lmac_type
	movq	_LMAC_MODE_SGMII@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movq	_LMAC_MODE_QSGMII@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.6:
	movq	_CGXX_SPUX_CONTROL1@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_cgx_read
	movq	_CGXX_SPUX_CONTROL1_LBK@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_5:
	movq	_CGXX_GMP_PCS_MRX_CTL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_cgx_read
	movq	_CGXX_GMP_PCS_MRX_CTL_LBK@GOTPCREL(%rip), %rcx
LBB0_7:
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	orl	%eax, %edx
	notl	%ecx
	andl	%eax, %ecx
	testl	%r15d, %r15d
	cmovnel	%edx, %ecx
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_cgx_write
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_LMAC_MODE_SGMII,8,3            ## @LMAC_MODE_SGMII
	.comm	_LMAC_MODE_QSGMII,8,3           ## @LMAC_MODE_QSGMII
	.comm	_CGXX_GMP_PCS_MRX_CTL,4,2       ## @CGXX_GMP_PCS_MRX_CTL
	.comm	_CGXX_GMP_PCS_MRX_CTL_LBK,4,2   ## @CGXX_GMP_PCS_MRX_CTL_LBK
	.comm	_CGXX_SPUX_CONTROL1,4,2         ## @CGXX_SPUX_CONTROL1
	.comm	_CGXX_SPUX_CONTROL1_LBK,4,2     ## @CGXX_SPUX_CONTROL1_LBK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cgx_lmac_internal_loopback     ; -- Begin function cgx_lmac_internal_loopback
	.p2align	2
_cgx_lmac_internal_loopback:            ; @cgx_lmac_internal_loopback
	.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
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
	cmp	w8, w1
	b.le	LBB0_4
; %bb.2:
	mov	x21, x2
	mov	x0, x20
	mov	x1, x19
	bl	_cgx_get_lmac_type
Lloh0:
	adrp	x8, _LMAC_MODE_SGMII@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LMAC_MODE_SGMII@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _LMAC_MODE_QSGMII@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LMAC_MODE_QSGMII@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x0, x8
	ccmp	x0, x9, #4, ne
	b.ne	LBB0_5
; %bb.3:
Lloh6:
	adrp	x22, _CGXX_GMP_PCS_MRX_CTL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _CGXX_GMP_PCS_MRX_CTL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_cgx_read
Lloh8:
	adrp	x8, _CGXX_GMP_PCS_MRX_CTL_LBK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CGXX_GMP_PCS_MRX_CTL_LBK@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_5:
Lloh13:
	adrp	x22, _CGXX_SPUX_CONTROL1@GOTPAGE
Lloh14:
	ldr	x22, [x22, _CGXX_SPUX_CONTROL1@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_cgx_read
Lloh15:
	adrp	x8, _CGXX_SPUX_CONTROL1_LBK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CGXX_SPUX_CONTROL1_LBK@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	orr	w9, w8, w0
	bic	w8, w0, w8
	cmp	w21, #0
	csel	w3, w8, w9, eq
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_cgx_write
	mov	w0, #0
LBB0_7:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_LMAC_MODE_SGMII,8,3            ; @LMAC_MODE_SGMII
	.comm	_LMAC_MODE_QSGMII,8,3           ; @LMAC_MODE_QSGMII
	.comm	_CGXX_GMP_PCS_MRX_CTL,4,2       ; @CGXX_GMP_PCS_MRX_CTL
	.comm	_CGXX_GMP_PCS_MRX_CTL_LBK,4,2   ; @CGXX_GMP_PCS_MRX_CTL_LBK
	.comm	_CGXX_SPUX_CONTROL1,4,2         ; @CGXX_SPUX_CONTROL1
	.comm	_CGXX_SPUX_CONTROL1_LBK,4,2     ; @CGXX_SPUX_CONTROL1_LBK
.subsections_via_symbols
