	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_gsw_init                   ## -- Begin function mtk_gsw_init
	.p2align	4, 0x90
_mtk_gsw_init:                          ## @mtk_gsw_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_of_find_device_by_node
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	_mediatek_gsw_match@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_of_device_is_compatible
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_platform_get_drvdata
	movq	%rax, %r14
	movq	8(%r15), %rax
	movq	%r14, (%rax)
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_mt7620_mdio_mode
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mt7620_hw_init
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.7:
	movq	_gsw_interrupt_mt7620@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	movq	%r15, %r8
	callq	_request_irq
	movq	_PORT_IRQ_ST_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	movq	_GSW_REG_IMR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mtk_switch_w32
	jmp	LBB0_8
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_mediatek_gsw_match,8,3         ## @mediatek_gsw_match
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_gsw_interrupt_mt7620,4,2       ## @gsw_interrupt_mt7620
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gsw"

	.comm	_PORT_IRQ_ST_CHG,4,2            ## @PORT_IRQ_ST_CHG
	.comm	_GSW_REG_IMR,4,2                ## @GSW_REG_IMR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_gsw_init                   ; -- Begin function mtk_gsw_init
	.p2align	2
_mtk_gsw_init:                          ; @mtk_gsw_init
	.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	x19, x0
	ldr	x21, [x0, #16]
	mov	x0, x21
	bl	_of_find_device_by_node
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _mediatek_gsw_match@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mediatek_gsw_match@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_of_device_is_compatible
	cbz	w0, LBB0_5
; %bb.2:
	mov	x0, x20
	bl	_platform_get_drvdata
	mov	x20, x0
	ldp	x9, x8, [x19]
	str	x0, [x8]
	ldr	w0, [x9]
	bl	_mt7620_mdio_mode
	mov	x1, x0
	mov	x0, x20
	bl	_mt7620_hw_init
	ldr	x0, [x20]
	cbz	x0, LBB0_7
; %bb.3:
Lloh3:
	adrp	x8, _gsw_interrupt_mt7620@GOTPAGE
Lloh4:
	ldr	x8, [x8, _gsw_interrupt_mt7620@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	w2, #0
	mov	x4, x19
	bl	_request_irq
Lloh8:
	adrp	x8, _PORT_IRQ_ST_CHG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PORT_IRQ_ST_CHG@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mvn	w1, w8
Lloh11:
	adrp	x8, _GSW_REG_IMR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GSW_REG_IMR@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mtk_switch_w32
	mov	w0, #0
	b	LBB0_7
LBB0_4:
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_mediatek_gsw_match,8,3         ; @mediatek_gsw_match
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_gsw_interrupt_mt7620,4,2       ; @gsw_interrupt_mt7620
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gsw"

	.comm	_PORT_IRQ_ST_CHG,4,2            ; @PORT_IRQ_ST_CHG
	.comm	_GSW_REG_IMR,4,2                ; @GSW_REG_IMR
.subsections_via_symbols
