	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mvpp2_port_loopback_set
_mvpp2_port_loopback_set:               ## @mvpp2_port_loopback_set
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	_MVPP2_GMAC_CTRL_1_REG@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	movq	_MVPP2_GMAC_GMII_LB_EN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%ebx, %ecx
	orl	%eax, %ecx
	notl	%ebx
	andl	%eax, %ebx
	cmpl	$1000, (%r15)                   ## imm = 0x3E8
	cmovel	%ecx, %ebx
	movq	(%r14), %rdi
	callq	_phy_interface_mode_is_8023z
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movq	_PHY_INTERFACE_MODE_SGMII@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_2:
	movq	_MVPP2_GMAC_PCS_LB_EN_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_4
LBB0_3:
	movq	_MVPP2_GMAC_PCS_LB_EN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %ebx
LBB0_4:
	movq	(%r12), %rsi
	addq	8(%r14), %rsi
	movl	%ebx, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MVPP2_GMAC_CTRL_1_REG,8,3      ## @MVPP2_GMAC_CTRL_1_REG
	.comm	_MVPP2_GMAC_GMII_LB_EN_MASK,4,2 ## @MVPP2_GMAC_GMII_LB_EN_MASK
	.comm	_PHY_INTERFACE_MODE_SGMII,8,3   ## @PHY_INTERFACE_MODE_SGMII
	.comm	_MVPP2_GMAC_PCS_LB_EN_MASK,4,2  ## @MVPP2_GMAC_PCS_LB_EN_MASK
	.no_dead_strip	_mvpp2_port_loopback_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mvpp2_port_loopback_set
_mvpp2_port_loopback_set:               ; @mvpp2_port_loopback_set
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x21, _MVPP2_GMAC_CTRL_1_REG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MVPP2_GMAC_CTRL_1_REG@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _MVPP2_GMAC_GMII_LB_EN_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MVPP2_GMAC_GMII_LB_EN_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	orr	w10, w9, w0
	bic	w9, w0, w9
	cmp	w8, #1000
	csel	w20, w10, w9, eq
	ldr	x0, [x19]
	bl	_phy_interface_mode_is_8023z
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _PHY_INTERFACE_MODE_SGMII@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PHY_INTERFACE_MODE_SGMII@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
LBB0_2:
Lloh8:
	adrp	x8, _MVPP2_GMAC_PCS_LB_EN_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MVPP2_GMAC_PCS_LB_EN_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w0, w8, w20
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x8, _MVPP2_GMAC_PCS_LB_EN_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MVPP2_GMAC_PCS_LB_EN_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	bic	w0, w20, w8
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	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	_writel
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MVPP2_GMAC_CTRL_1_REG,8,3      ; @MVPP2_GMAC_CTRL_1_REG
	.comm	_MVPP2_GMAC_GMII_LB_EN_MASK,4,2 ; @MVPP2_GMAC_GMII_LB_EN_MASK
	.comm	_PHY_INTERFACE_MODE_SGMII,8,3   ; @PHY_INTERFACE_MODE_SGMII
	.comm	_MVPP2_GMAC_PCS_LB_EN_MASK,4,2  ; @MVPP2_GMAC_PCS_LB_EN_MASK
	.no_dead_strip	_mvpp2_port_loopback_set
.subsections_via_symbols
