	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7621_gmac0_rgmii_adjust
_mt7621_gmac0_rgmii_adjust:             ## @mt7621_gmac0_rgmii_adjust
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	(%rdi), %edi
	movq	_ETHSYS_SYSCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_regmap_read
	movq	_PHY_INTERFACE_MODE_TRGMII@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rbx, %rax
	jne	LBB0_3
## %bb.1:
	movq	_SYSCFG_DRAM_TYPE_DDR2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, -28(%rbp)
	je	LBB0_3
## %bb.2:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_3:
	xorl	%r14d, %r14d
	movl	$0, %ecx
	cmpq	%rbx, %rax
	jne	LBB0_5
## %bb.4:
	movq	_ETHSYS_TRGMII_MT7621_DDR_PLL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_5:
	movl	%ecx, -28(%rbp)
	movl	(%r15), %edi
	movq	_ETHSYS_CLKCFG0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ETHSYS_TRGMII_MT7621_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_update_bits
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETHSYS_SYSCFG,4,2              ## @ETHSYS_SYSCFG
	.comm	_PHY_INTERFACE_MODE_TRGMII,8,3  ## @PHY_INTERFACE_MODE_TRGMII
	.comm	_SYSCFG_DRAM_TYPE_DDR2,4,2      ## @SYSCFG_DRAM_TYPE_DDR2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TRGMII mode with DDR2 memory is not supported!\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_ETHSYS_TRGMII_MT7621_DDR_PLL,4,2 ## @ETHSYS_TRGMII_MT7621_DDR_PLL
	.comm	_ETHSYS_CLKCFG0,4,2             ## @ETHSYS_CLKCFG0
	.comm	_ETHSYS_TRGMII_MT7621_MASK,4,2  ## @ETHSYS_TRGMII_MT7621_MASK
	.no_dead_strip	_mt7621_gmac0_rgmii_adjust
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7621_gmac0_rgmii_adjust
_mt7621_gmac0_rgmii_adjust:             ; @mt7621_gmac0_rgmii_adjust
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _ETHSYS_SYSCFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETHSYS_SYSCFG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
Lloh3:
	adrp	x8, _PHY_INTERFACE_MODE_TRGMII@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PHY_INTERFACE_MODE_TRGMII@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ne	LBB0_3
; %bb.1:
	ldr	w9, [sp, #12]
Lloh6:
	adrp	x10, _SYSCFG_DRAM_TYPE_DDR2@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SYSCFG_DRAM_TYPE_DDR2@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_3
; %bb.2:
	ldr	w0, [x19, #4]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh11:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
Lloh14:
	adrp	x9, _ETHSYS_TRGMII_MT7621_DDR_PLL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ETHSYS_TRGMII_MT7621_DDR_PLL@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	x8, x20
	csel	w3, w9, wzr, eq
	str	w3, [sp, #12]
	ldr	w0, [x19]
Lloh17:
	adrp	x8, _ETHSYS_CLKCFG0@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ETHSYS_CLKCFG0@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _ETHSYS_TRGMII_MT7621_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETHSYS_TRGMII_MT7621_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	bl	_regmap_update_bits
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ETHSYS_SYSCFG,4,2              ; @ETHSYS_SYSCFG
	.comm	_PHY_INTERFACE_MODE_TRGMII,8,3  ; @PHY_INTERFACE_MODE_TRGMII
	.comm	_SYSCFG_DRAM_TYPE_DDR2,4,2      ; @SYSCFG_DRAM_TYPE_DDR2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TRGMII mode with DDR2 memory is not supported!\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_ETHSYS_TRGMII_MT7621_DDR_PLL,4,2 ; @ETHSYS_TRGMII_MT7621_DDR_PLL
	.comm	_ETHSYS_CLKCFG0,4,2             ; @ETHSYS_CLKCFG0
	.comm	_ETHSYS_TRGMII_MT7621_MASK,4,2  ; @ETHSYS_TRGMII_MT7621_MASK
	.no_dead_strip	_mt7621_gmac0_rgmii_adjust
.subsections_via_symbols
