	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nfc_probe
_mtk_nfc_probe:                         ## @mtk_nfc_probe
	.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
	movq	(%rdi), %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$64, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r13
	leaq	48(%rax), %rdi
	callq	_nand_controller_init
	leaq	56(%r13), %rdi
	callq	_INIT_LIST_HEAD
	movq	_mtk_nfc_controller_ops@GOTPCREL(%rip), %rax
	movq	%rax, 48(%r13)
	movq	%rbx, %rdi
	callq	_of_mtk_ecc_get
	movq	%rax, (%r13)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	(%r13), %rdi
	testq	%rax, %rax
	je	LBB0_4
## %bb.27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_26
LBB0_4:
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	callq	_of_device_get_match_data
	movl	%eax, 40(%r13)
	movq	%r14, 32(%r13)
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movq	%rax, 24(%r13)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	24(%r13), %rdi
	jmp	LBB0_8
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_clk_get
	movq	%rax, 16(%r13)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	16(%r13), %rdi
	jmp	LBB0_8
LBB0_11:
	movq	%r13, %r15
	addq	$8, %r15
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_clk_get
	movq	%rax, (%r15)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	(%r15), %rdi
LBB0_8:
	callq	_PTR_ERR
	movl	%eax, %r12d
LBB0_25:
	movq	(%r13), %rdi
	callq	_mtk_ecc_release
LBB0_26:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mtk_nfc_enable_clk
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_25
## %bb.14:
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
	testl	%eax, %eax
	js	LBB0_15
## %bb.16:
	movq	_mtk_nfc_irq@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	L_.str.5(%rip), %r8
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%ecx, %ecx
	movq	%r13, %r9
	callq	_devm_request_irq
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r12d
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_23
LBB0_15:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_24
LBB0_18:
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	movl	%eax, %r12d
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_23
LBB0_20:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_platform_set_drvdata
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_mtk_nfc_nand_chips_init
	testl	%eax, %eax
	je	LBB0_21
## %bb.22:
	movl	%eax, %r12d
	leaq	L_.str.8(%rip), %rsi
LBB0_23:
	movq	%r14, %rdi
	callq	_dev_err
LBB0_24:
	movq	%r15, %rdi
	callq	_mtk_nfc_disable_clk
	jmp	LBB0_25
LBB0_21:
	xorl	%r12d, %r12d
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_mtk_nfc_controller_ops,4,2     ## @mtk_nfc_controller_ops
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nfi_clk"

L_.str.1:                               ## @.str.1
	.asciz	"no clk\n"

L_.str.2:                               ## @.str.2
	.asciz	"pad_clk"

L_.str.3:                               ## @.str.3
	.asciz	"no pad clk\n"

L_.str.4:                               ## @.str.4
	.asciz	"no nfi irq resource\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mtk_nfc_irq,4,2                ## @mtk_nfc_irq
L_.str.5:                               ## @.str.5
	.asciz	"mtk-nand"

L_.str.6:                               ## @.str.6
	.asciz	"failed to request nfi irq\n"

L_.str.7:                               ## @.str.7
	.asciz	"failed to set dma mask\n"

L_.str.8:                               ## @.str.8
	.asciz	"failed to init nand chips\n"

	.no_dead_strip	_mtk_nfc_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nfc_probe
_mtk_nfc_probe:                         ; @mtk_nfc_probe
	.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	x21, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #64
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x0, x0, #48
	bl	_nand_controller_init
	add	x0, x19, #56
	bl	_INIT_LIST_HEAD
Lloh3:
	adrp	x8, _mtk_nfc_controller_ops@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mtk_nfc_controller_ops@GOTPAGEOFF]
	str	x8, [x19, #48]
	mov	x0, x21
	bl	_of_mtk_ecc_get
	str	x0, [x19]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x19]
	cbz	x8, LBB0_5
; %bb.2:
	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
	b	_PTR_ERR
LBB0_3:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_15
LBB0_5:
	cbz	x0, LBB0_8
; %bb.6:
	mov	x0, x20
	bl	_of_device_get_match_data
	str	w0, [x19, #40]
	str	x20, [x19, #32]
Lloh7:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_platform_get_resource
	mov	x1, x0
	mov	x0, x20
	bl	_devm_ioremap_resource
	str	x0, [x19, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_9
; %bb.7:
	ldr	x0, [x19, #24]
	b	LBB0_13
LBB0_8:
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
LBB0_9:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_devm_clk_get
	str	x0, [x19, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_11
; %bb.10:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	x0, [x19, #16]
	b	LBB0_13
LBB0_11:
	add	x21, x19, #8
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_devm_clk_get
	str	x0, [x21]
	bl	_IS_ERR
	cbz	x0, LBB0_16
; %bb.12:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	x0, [x21]
LBB0_13:
	bl	_PTR_ERR
	mov	x22, x0
LBB0_14:
	ldr	x0, [x19]
	bl	_mtk_ecc_release
LBB0_15:
	mov	x0, x22
	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
LBB0_16:
	mov	x0, x20
	mov	x1, x21
	bl	_mtk_nfc_enable_clk
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.17:
	mov	x0, x20
	mov	w1, #0
	bl	_platform_get_irq
	tbnz	w0, #31, LBB0_20
; %bb.18:
	mov	x1, x0
Lloh20:
	adrp	x8, _mtk_nfc_irq@GOTPAGE
Lloh21:
	ldr	x8, [x8, _mtk_nfc_irq@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x4, l_.str.5@PAGE
Lloh24:
	add	x4, x4, l_.str.5@PAGEOFF
	mov	x0, x20
	mov	w3, #0
	mov	x5, x19
	bl	_devm_request_irq
	cbz	w0, LBB0_21
; %bb.19:
	mov	x22, x0
Lloh25:
	adrp	x1, l_.str.6@PAGE
Lloh26:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_25
LBB0_20:
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_26
LBB0_21:
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x20
	bl	_dma_set_mask
	cbz	w0, LBB0_23
; %bb.22:
	mov	x22, x0
Lloh32:
	adrp	x1, l_.str.7@PAGE
Lloh33:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_25
LBB0_23:
	mov	x0, x20
	mov	x1, x19
	bl	_platform_set_drvdata
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_nfc_nand_chips_init
	mov	x22, x0
	cbz	w0, LBB0_15
; %bb.24:
Lloh34:
	adrp	x1, l_.str.8@PAGE
Lloh35:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_25:
	mov	x0, x20
	bl	_dev_err
LBB0_26:
	mov	x0, x21
	bl	_mtk_nfc_disable_clk
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_mtk_nfc_controller_ops,4,2     ; @mtk_nfc_controller_ops
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nfi_clk"

l_.str.1:                               ; @.str.1
	.asciz	"no clk\n"

l_.str.2:                               ; @.str.2
	.asciz	"pad_clk"

l_.str.3:                               ; @.str.3
	.asciz	"no pad clk\n"

l_.str.4:                               ; @.str.4
	.asciz	"no nfi irq resource\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mtk_nfc_irq,4,2                ; @mtk_nfc_irq
l_.str.5:                               ; @.str.5
	.asciz	"mtk-nand"

l_.str.6:                               ; @.str.6
	.asciz	"failed to request nfi irq\n"

l_.str.7:                               ; @.str.7
	.asciz	"failed to set dma mask\n"

l_.str.8:                               ; @.str.8
	.asciz	"failed to init nand chips\n"

	.no_dead_strip	_mtk_nfc_probe
.subsections_via_symbols
