	.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, %r14
	movq	8(%rdi), %r15
	movq	%r15, %rdi
	callq	_of_find_device_by_node
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	_mediatek_gsw_match@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_of_device_is_compatible
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_platform_get_drvdata
	movq	%rax, %rbx
	movq	(%r14), %rax
	movq	%rbx, (%rax)
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	movq	_gsw_interrupt_mt7621@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	xorl	%edx, %edx
	movq	%r14, %r8
	callq	_request_irq
	movq	(%rbx), %rdi
	callq	_disable_irq
LBB0_7:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_mt7621_hw_init
	movq	(%rbx), %rdi
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	callq	_enable_irq
	jmp	LBB0_9
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
LBB0_9:
	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_mt7621,4,2       ## @gsw_interrupt_mt7621
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gsw"

.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	x20, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_of_find_device_by_node
	cbz	x0, LBB0_6
; %bb.1:
	mov	x21, 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, x19
	bl	_of_device_is_compatible
	cbz	w0, LBB0_7
; %bb.2:
	mov	x0, x21
	bl	_platform_get_drvdata
	mov	x21, x0
	ldr	x8, [x20]
	str	x0, [x8]
	ldr	x0, [x0]
	cbz	x0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _gsw_interrupt_mt7621@GOTPAGE
Lloh4:
	ldr	x8, [x8, _gsw_interrupt_mt7621@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	w2, #0
	mov	x4, x20
	bl	_request_irq
	ldr	x0, [x21]
	bl	_disable_irq
LBB0_4:
	mov	x0, x21
	mov	x1, x19
	bl	_mt7621_hw_init
	ldr	x0, [x21]
	cbz	x0, LBB0_9
; %bb.5:
	bl	_enable_irq
	mov	w0, #0
	b	LBB0_9
LBB0_6:
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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 AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.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_mt7621,4,2       ; @gsw_interrupt_mt7621
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gsw"

.subsections_via_symbols
