	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_nfc_nand_chip_init
_meson_nfc_nand_chip_init:              ## @meson_nfc_nand_chip_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rsi
	movq	%rdx, %rdi
	movl	$4, %edx
	callq	_of_property_count_elems_of_size
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movq	_MAX_CE_NUM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_2
## %bb.4:
	movq	_sels@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_struct_size
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%ebx, (%rax)
	testl	%ebx, %ebx
	jle	LBB0_13
## %bb.7:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	16(%rax), %r15
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	leaq	-44(%rbp), %rcx
	callq	_of_property_read_u32_index
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-44(%rbp), %edi
	movq	%r15, %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_9 Depth=1
	incl	%r12d
	cmpl	%r12d, %ebx
	jne	LBB0_9
LBB0_13:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	leaq	8(%r15), %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	leaq	8(%r14), %rax
	movq	%rax, 16(%r15)
	movq	_meson_nand_controller_ops@GOTPCREL(%rip), %rax
	movq	%rax, 8(%r14)
	movq	%r13, %rsi
	movq	%rdi, %r13
	callq	_nand_set_flash_node
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_nand_set_controller_data
	movq	_NAND_USE_BOUNCE_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r15)
	movq	%r13, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r15
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, (%r15)
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_nand_scan
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.14:
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r13, %rdi
	callq	_nand_cleanup
	movl	%ebx, %r14d
	jmp	LBB0_17
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_17
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_17
LBB0_10:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_17
LBB0_12:
	movl	-44(%rbp), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%r14d, %r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_3
LBB0_16:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	addq	$4, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_list_add_tail
LBB0_17:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

	.comm	_MAX_CE_NUM,4,2                 ## @MAX_CE_NUM
L_.str.1:                               ## @.str.1
	.asciz	"invalid register property size\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_sels,4,2                       ## @sels
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"could not retrieve register property: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"CS %d already assigned\n"

	.comm	_meson_nand_controller_ops,4,2  ## @meson_nand_controller_ops
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ## @NAND_USE_BOUNCE_BUFFER
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
L_.str.4:                               ## @.str.4
	.asciz	"failed to register MTD device: %d\n"

	.no_dead_strip	_meson_nfc_nand_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_nfc_nand_chip_init
_meson_nfc_nand_chip_init:              ; @meson_nfc_nand_chip_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x2
	mov	w2, #4
	bl	_of_property_count_elems_of_size
Lloh2:
	adrp	x8, _MAX_CE_NUM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_CE_NUM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, #0
	ccmp	w0, w8, #0, ne
	b.le	LBB0_3
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_2:
	mov	x0, x19
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_3:
	mov	x21, x0
Lloh9:
	adrp	x8, _sels@GOTPAGE
Lloh10:
	ldr	x8, [x8, _sels@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x2, x0
	bl	_struct_size
	mov	x1, x0
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_devm_kzalloc
	cbz	x0, LBB0_12
; %bb.4:
	mov	x22, x0
	str	w21, [x0]
	cmp	w21, #1
	b.lt	LBB0_9
; %bb.5:
	mov	w24, #0
	add	x26, x20, #16
Lloh15:
	adrp	x27, l_.str@PAGE
Lloh16:
	add	x27, x27, l_.str@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #12
	mov	x0, x23
	mov	x1, x27
	mov	x2, x24
	bl	_of_property_read_u32_index
	cbnz	w0, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [sp, #12]
	mov	x1, x26
	bl	_test_and_set_bit
	cbnz	x0, LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w24, w24, #1
	cmp	w21, w24
	b.ne	LBB0_6
LBB0_9:
	add	x24, x22, #8
Lloh17:
	adrp	x8, _meson_nand_controller_ops@GOTPAGE
Lloh18:
	ldr	x8, [x8, _meson_nand_controller_ops@GOTPAGEOFF]
	mov	x9, x20
	str	x8, [x9, #8]!
	str	x9, [x22, #16]
	mov	x0, x24
	mov	x1, x23
	bl	_nand_set_flash_node
	mov	x0, x24
	mov	x1, x20
	bl	_nand_set_controller_data
Lloh19:
	adrp	x8, _NAND_USE_BOUNCE_BUFFER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NAND_USE_BOUNCE_BUFFER@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x22, #8]
	orr	w8, w9, w8
	str	w8, [x22, #8]
	mov	x0, x24
	bl	_nand_to_mtd
	mov	x23, x0
Lloh22:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	str	x19, [x0]
	mov	x0, x24
	mov	x1, x21
	bl	_nand_scan
	mov	x25, x0
	cbnz	w0, LBB0_14
; %bb.10:
	mov	x0, x23
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
	mov	x25, x0
	cbz	w0, LBB0_17
; %bb.11:
	str	x25, [sp]
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x24
	bl	_nand_cleanup
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	b	LBB0_14
LBB0_12:
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_14:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
	mov	x25, x0
	str	x25, [sp]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_14
LBB0_16:
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_17:
	add	x0, x22, #4
	mov	x1, x20
	bl	_list_add_tail
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

	.comm	_MAX_CE_NUM,4,2                 ; @MAX_CE_NUM
l_.str.1:                               ; @.str.1
	.asciz	"invalid register property size\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_sels,4,2                       ; @sels
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"could not retrieve register property: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"CS %d already assigned\n"

	.comm	_meson_nand_controller_ops,4,2  ; @meson_nand_controller_ops
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ; @NAND_USE_BOUNCE_BUFFER
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
l_.str.4:                               ; @.str.4
	.asciz	"failed to register MTD device: %d\n"

	.no_dead_strip	_meson_nfc_nand_chip_init
.subsections_via_symbols
