	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7531_set_port_rgmii
_mt7531_set_port_rgmii:                 ## @mt7531_set_port_rgmii
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	cmpl	$5, %esi
	jne	LBB0_1
## %bb.2:
	movq	_CLKGEN_CTRL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_mt753x_reg_read
	movq	_GP_CLK_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GP_MODE_M@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	_GP_MODE_RGMII@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_GP_MODE_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%edx, %eax
	movq	_TXCLK_NO_REVERSE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_RXCLK_NO_DELAY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_CLK_SKEW_IN_M@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_CLK_SKEW_IN_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_CLK_SKEW_IN_NO_CHANGE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	shll	%cl, %esi
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %esi
	movq	_CLK_SKEW_OUT_M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_CLK_SKEW_OUT_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_CLK_SKEW_OUT_NO_CHANGE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	shll	%cl, %edx
	notl	%eax
	andl	%esi, %eax
	orl	%eax, %edx
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_mt753x_reg_write
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movl	%esi, %edx
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RGMII mode is not available for port %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CLKGEN_CTRL,4,2                ## @CLKGEN_CTRL
	.comm	_GP_CLK_EN,4,2                  ## @GP_CLK_EN
	.comm	_GP_MODE_M,4,2                  ## @GP_MODE_M
	.comm	_GP_MODE_RGMII,4,2              ## @GP_MODE_RGMII
	.comm	_GP_MODE_S,4,2                  ## @GP_MODE_S
	.comm	_TXCLK_NO_REVERSE,4,2           ## @TXCLK_NO_REVERSE
	.comm	_RXCLK_NO_DELAY,4,2             ## @RXCLK_NO_DELAY
	.comm	_CLK_SKEW_IN_M,4,2              ## @CLK_SKEW_IN_M
	.comm	_CLK_SKEW_IN_NO_CHANGE,4,2      ## @CLK_SKEW_IN_NO_CHANGE
	.comm	_CLK_SKEW_IN_S,4,2              ## @CLK_SKEW_IN_S
	.comm	_CLK_SKEW_OUT_M,4,2             ## @CLK_SKEW_OUT_M
	.comm	_CLK_SKEW_OUT_NO_CHANGE,4,2     ## @CLK_SKEW_OUT_NO_CHANGE
	.comm	_CLK_SKEW_OUT_S,4,2             ## @CLK_SKEW_OUT_S
	.no_dead_strip	_mt7531_set_port_rgmii
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7531_set_port_rgmii
_mt7531_set_port_rgmii:                 ; @mt7531_set_port_rgmii
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	cmp	w1, #5
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x20, _CLKGEN_CTRL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CLKGEN_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mt753x_reg_read
Lloh2:
	adrp	x8, _GP_CLK_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GP_CLK_EN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh5:
	adrp	x9, _GP_MODE_M@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GP_MODE_M@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh8:
	adrp	x9, _GP_MODE_RGMII@GOTPAGE
Lloh9:
	ldr	x9, [x9, _GP_MODE_RGMII@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _GP_MODE_S@GOTPAGE
Lloh12:
	ldr	x10, [x10, _GP_MODE_S@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _TXCLK_NO_REVERSE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _TXCLK_NO_REVERSE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh17:
	adrp	x9, _RXCLK_NO_DELAY@GOTPAGE
Lloh18:
	ldr	x9, [x9, _RXCLK_NO_DELAY@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	adrp	x10, _CLK_SKEW_IN_M@GOTPAGE
Lloh21:
	ldr	x10, [x10, _CLK_SKEW_IN_M@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh22:
	ldr	w9, [x10]
	bic	w8, w8, w9
Lloh23:
	adrp	x9, _CLK_SKEW_IN_NO_CHANGE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _CLK_SKEW_IN_NO_CHANGE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
Lloh26:
	adrp	x10, _CLK_SKEW_IN_S@GOTPAGE
Lloh27:
	ldr	x10, [x10, _CLK_SKEW_IN_S@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	lsl	w9, w9, w10
Lloh29:
	adrp	x10, _CLK_SKEW_OUT_M@GOTPAGE
Lloh30:
	ldr	x10, [x10, _CLK_SKEW_OUT_M@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh31:
	ldr	w9, [x10]
	bic	w8, w8, w9
Lloh32:
	adrp	x9, _CLK_SKEW_OUT_NO_CHANGE@GOTPAGE
Lloh33:
	ldr	x9, [x9, _CLK_SKEW_OUT_NO_CHANGE@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
Lloh35:
	adrp	x10, _CLK_SKEW_OUT_S@GOTPAGE
Lloh36:
	ldr	x10, [x10, _CLK_SKEW_OUT_S@GOTPAGEOFF]
Lloh37:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w2, w9, w8
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mt753x_reg_write
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	mov	x2, x1
	ldr	w0, [x19]
Lloh38:
	adrp	x1, l_.str@PAGE
Lloh39:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
Lloh40:
	adrp	x8, _EINVAL@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RGMII mode is not available for port %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CLKGEN_CTRL,4,2                ; @CLKGEN_CTRL
	.comm	_GP_CLK_EN,4,2                  ; @GP_CLK_EN
	.comm	_GP_MODE_M,4,2                  ; @GP_MODE_M
	.comm	_GP_MODE_RGMII,4,2              ; @GP_MODE_RGMII
	.comm	_GP_MODE_S,4,2                  ; @GP_MODE_S
	.comm	_TXCLK_NO_REVERSE,4,2           ; @TXCLK_NO_REVERSE
	.comm	_RXCLK_NO_DELAY,4,2             ; @RXCLK_NO_DELAY
	.comm	_CLK_SKEW_IN_M,4,2              ; @CLK_SKEW_IN_M
	.comm	_CLK_SKEW_IN_NO_CHANGE,4,2      ; @CLK_SKEW_IN_NO_CHANGE
	.comm	_CLK_SKEW_IN_S,4,2              ; @CLK_SKEW_IN_S
	.comm	_CLK_SKEW_OUT_M,4,2             ; @CLK_SKEW_OUT_M
	.comm	_CLK_SKEW_OUT_NO_CHANGE,4,2     ; @CLK_SKEW_OUT_NO_CHANGE
	.comm	_CLK_SKEW_OUT_S,4,2             ; @CLK_SKEW_OUT_S
	.no_dead_strip	_mt7531_set_port_rgmii
.subsections_via_symbols
