	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7531_sw_init
_mt7531_sw_init:                        ## @mt7531_sw_init
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	4(%rdi), %eax
	incl	%eax
	movq	_MT753X_SMI_ADDR_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, (%rdi)
	movq	_mt753x_mii_read@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rdi)
	movq	_mt753x_mii_write@GOTPCREL(%rip), %rcx
	movq	%rcx, 24(%rdi)
	movq	_mt753x_mmd_read@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 36(%rdi)
	movq	_mt753x_mmd_write@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rdi)
	movq	_MT753X_NUM_PHYS@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	jle	LBB0_4
## %bb.1:
	movl	$1, %r12d
	movq	_MII_BMCR@GOTPCREL(%rip), %r13
	movq	_BMCR_ISOLATE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leal	-1(%r12), %ebx
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	*%rax
	orl	(%r15), %eax
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	callq	*24(%r14)
	movq	_MT753X_NUM_PHYS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jge	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rax
	incl	%r12d
	jmp	LBB0_2
LBB0_4:
	movl	$5, %edi
	callq	_PMCR
	movq	_FORCE_MODE_LNK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mt753x_reg_write
	movl	$6, %edi
	callq	_PMCR
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mt753x_reg_write
	movq	_SYS_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SW_SYS_RST@GOTPCREL(%rip), %rax
	movq	_SW_REG_RST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mt753x_reg_write
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movq	_SMT0_IOLB@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_mt753x_reg_read
	movl	(%rbx), %esi
	movq	_SMT_IOLB_5_SMI_MDC_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_mt753x_reg_write
	movq	%r14, %rdi
	callq	_mt7531_set_gpio_pinmux
	movq	_MTCC_LMT_S@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$15, %eax
	shll	%cl, %eax
	movq	_GMACCR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_MAX_RX_JUMBO_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$11, %edx
	shll	%cl, %edx
	orl	%eax, %edx
	movq	_RX_PKT_LEN_MAX_JUMBO@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mt753x_reg_write
	movq	%r14, %rdi
	callq	_mt7531_core_pll_setup
	leaq	20(%r14), %rdx
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_mt7531_mac_port_setup
	leaq	16(%r14), %rdx
	movq	%r14, %rdi
	movl	$6, %esi
	callq	_mt7531_mac_port_setup
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT753X_SMI_ADDR_MASK,4,2       ## @MT753X_SMI_ADDR_MASK
	.comm	_mt753x_mmd_read,4,2            ## @mt753x_mmd_read
	.comm	_mt753x_mmd_write,4,2           ## @mt753x_mmd_write
	.comm	_MT753X_NUM_PHYS,4,2            ## @MT753X_NUM_PHYS
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_ISOLATE,4,2               ## @BMCR_ISOLATE
	.comm	_FORCE_MODE_LNK,4,2             ## @FORCE_MODE_LNK
	.comm	_SYS_CTRL,4,2                   ## @SYS_CTRL
	.comm	_SW_SYS_RST,4,2                 ## @SW_SYS_RST
	.comm	_SW_REG_RST,4,2                 ## @SW_REG_RST
	.comm	_SMT0_IOLB,4,2                  ## @SMT0_IOLB
	.comm	_SMT_IOLB_5_SMI_MDC_EN,4,2      ## @SMT_IOLB_5_SMI_MDC_EN
	.comm	_GMACCR,4,2                     ## @GMACCR
	.comm	_MTCC_LMT_S,4,2                 ## @MTCC_LMT_S
	.comm	_MAX_RX_JUMBO_S,4,2             ## @MAX_RX_JUMBO_S
	.comm	_RX_PKT_LEN_MAX_JUMBO,4,2       ## @RX_PKT_LEN_MAX_JUMBO
	.no_dead_strip	_mt7531_sw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7531_sw_init
_mt7531_sw_init:                        ; @mt7531_sw_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	w8, [x0, #4]
	add	w8, w8, #1
Lloh0:
	adrp	x9, _MT753X_SMI_ADDR_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MT753X_SMI_ADDR_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w8, w9
	str	w8, [x0]
Lloh3:
	adrp	x8, _mt753x_mii_read@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mt753x_mii_read@GOTPAGEOFF]
	str	x8, [x0, #8]
Lloh5:
	adrp	x8, _mt753x_mii_write@GOTPAGE
Lloh6:
	ldr	x8, [x8, _mt753x_mii_write@GOTPAGEOFF]
	str	x8, [x0, #24]
Lloh7:
	adrp	x8, _mt753x_mmd_read@GOTPAGE
Lloh8:
	ldr	x8, [x8, _mt753x_mmd_read@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _mt753x_mmd_write@GOTPAGE
Lloh11:
	ldr	x9, [x9, _mt753x_mmd_write@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #32]
Lloh13:
	adrp	x21, _MT753X_NUM_PHYS@GOTPAGE
Lloh14:
	ldr	x21, [x21, _MT753X_NUM_PHYS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
Lloh15:
	adrp	x8, _mt753x_mii_read@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mt753x_mii_read@GOTPAGEOFF]
	mov	w22, #1
Lloh17:
	adrp	x23, _MII_BMCR@GOTPAGE
Lloh18:
	ldr	x23, [x23, _MII_BMCR@GOTPAGEOFF]
Lloh19:
	adrp	x24, _BMCR_ISOLATE@GOTPAGE
Lloh20:
	ldr	x24, [x24, _BMCR_ISOLATE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	w20, w22, #1
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	ldr	w8, [x24]
	orr	w3, w8, w0
	ldr	x8, [x19, #24]
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	ldr	w8, [x21]
	cmp	w22, w8
	b.ge	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #8]
	add	w22, w22, #1
	b	LBB0_2
LBB0_4:
	mov	w0, #5
	bl	_PMCR
	mov	x1, x0
Lloh21:
	adrp	x20, _FORCE_MODE_LNK@GOTPAGE
Lloh22:
	ldr	x20, [x20, _FORCE_MODE_LNK@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_mt753x_reg_write
	mov	w0, #6
	bl	_PMCR
	mov	x1, x0
	ldr	w2, [x20]
	mov	x0, x19
	bl	_mt753x_reg_write
Lloh23:
	adrp	x8, _SYS_CTRL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SYS_CTRL@GOTPAGEOFF]
Lloh25:
	adrp	x9, _SW_SYS_RST@GOTPAGE
Lloh26:
	ldr	x9, [x9, _SW_SYS_RST@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	ldr	w8, [x9]
Lloh29:
	adrp	x9, _SW_REG_RST@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SW_REG_RST@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_mt753x_reg_write
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
Lloh32:
	adrp	x20, _SMT0_IOLB@GOTPAGE
Lloh33:
	ldr	x20, [x20, _SMT0_IOLB@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mt753x_reg_read
	ldr	w1, [x20]
Lloh34:
	adrp	x8, _SMT_IOLB_5_SMI_MDC_EN@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SMT_IOLB_5_SMI_MDC_EN@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	bl	_mt753x_reg_write
	mov	x0, x19
	bl	_mt7531_set_gpio_pinmux
Lloh37:
	adrp	x8, _GMACCR@GOTPAGE
Lloh38:
	ldr	x8, [x8, _GMACCR@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x8, _MTCC_LMT_S@GOTPAGE
Lloh41:
	ldr	x8, [x8, _MTCC_LMT_S@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	mov	w9, #15
	lsl	w8, w9, w8
Lloh43:
	adrp	x9, _MAX_RX_JUMBO_S@GOTPAGE
Lloh44:
	ldr	x9, [x9, _MAX_RX_JUMBO_S@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	mov	w10, #11
	lsl	w9, w10, w9
	orr	w8, w9, w8
Lloh46:
	adrp	x9, _RX_PKT_LEN_MAX_JUMBO@GOTPAGE
Lloh47:
	ldr	x9, [x9, _RX_PKT_LEN_MAX_JUMBO@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_mt753x_reg_write
	mov	x0, x19
	bl	_mt7531_core_pll_setup
	add	x2, x19, #20
	mov	x0, x19
	mov	w1, #5
	bl	_mt7531_mac_port_setup
	add	x2, x19, #16
	mov	x0, x19
	mov	w1, #6
	bl	_mt7531_mac_port_setup
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MT753X_SMI_ADDR_MASK,4,2       ; @MT753X_SMI_ADDR_MASK
	.comm	_mt753x_mmd_read,4,2            ; @mt753x_mmd_read
	.comm	_mt753x_mmd_write,4,2           ; @mt753x_mmd_write
	.comm	_MT753X_NUM_PHYS,4,2            ; @MT753X_NUM_PHYS
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_ISOLATE,4,2               ; @BMCR_ISOLATE
	.comm	_FORCE_MODE_LNK,4,2             ; @FORCE_MODE_LNK
	.comm	_SYS_CTRL,4,2                   ; @SYS_CTRL
	.comm	_SW_SYS_RST,4,2                 ; @SW_SYS_RST
	.comm	_SW_REG_RST,4,2                 ; @SW_REG_RST
	.comm	_SMT0_IOLB,4,2                  ; @SMT0_IOLB
	.comm	_SMT_IOLB_5_SMI_MDC_EN,4,2      ; @SMT_IOLB_5_SMI_MDC_EN
	.comm	_GMACCR,4,2                     ; @GMACCR
	.comm	_MTCC_LMT_S,4,2                 ; @MTCC_LMT_S
	.comm	_MAX_RX_JUMBO_S,4,2             ; @MAX_RX_JUMBO_S
	.comm	_RX_PKT_LEN_MAX_JUMBO,4,2       ; @RX_PKT_LEN_MAX_JUMBO
	.no_dead_strip	_mt7531_sw_init
.subsections_via_symbols
