	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_nand_host_init_and_register
_qcom_nand_host_init_and_register:      ## @qcom_nand_host_init_and_register
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	leaq	8(%rsi), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_nand_to_mtd
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%r12), %r13
	leaq	4(%rbx), %r14
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_of_property_read_u32
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_nand_set_flash_node
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %ecx
	leaq	L_.str.2(%rip), %rdx
	movq	%r13, %rdi
	callq	_devm_kasprintf
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, 12(%r15)
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	%r13, (%r15)
	movq	_qcom_nandc_command@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
	movq	_qcom_nandc_select_chip@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%rbx)
	movq	_qcom_nandc_read_byte@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movq	_qcom_nandc_read_buf@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movq	_qcom_nandc_write_buf@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	_nand_get_set_features_notsupp@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
	movq	%rax, 32(%rbx)
	movq	_qcom_nandc_block_bad@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_qcom_nandc_block_markbad@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	%r12, %r14
	leaq	24(%r12), %rax
	movq	%rax, 16(%rbx)
	movq	_NAND_NO_SUBPAGE_WRITE@GOTPCREL(%rip), %rax
	movq	_NAND_USE_BOUNCE_BUFFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_NAND_SKIP_BBTSCAN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	%ecx, 8(%rbx)
	movq	_NAND_STATUS_READY@GOTPCREL(%rip), %rax
	movq	_NAND_STATUS_WP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_nand_scan
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	16(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_9
## %bb.7:
	movq	%r14, %rdi
	callq	_free_bam_transaction
	movq	%r14, %rdi
	callq	_alloc_bam_transaction
	movl	%eax, 8(%r14)
	testl	%eax, %eax
	je	LBB0_8
LBB0_9:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_nand_cleanup
	movl	%r14d, %ebx
	jmp	LBB0_11
LBB0_8:
	movq	(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %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"

L_.str.1:                               ## @.str.1
	.asciz	"can't get chip-select\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"qcom_nand.%d"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_qcom_nandc_command,4,2         ## @qcom_nandc_command
	.comm	_qcom_nandc_select_chip,4,2     ## @qcom_nandc_select_chip
	.comm	_qcom_nandc_read_byte,4,2       ## @qcom_nandc_read_byte
	.comm	_qcom_nandc_read_buf,4,2        ## @qcom_nandc_read_buf
	.comm	_qcom_nandc_write_buf,4,2       ## @qcom_nandc_write_buf
	.comm	_nand_get_set_features_notsupp,8,3 ## @nand_get_set_features_notsupp
	.comm	_qcom_nandc_block_bad,4,2       ## @qcom_nandc_block_bad
	.comm	_qcom_nandc_block_markbad,4,2   ## @qcom_nandc_block_markbad
	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ## @NAND_NO_SUBPAGE_WRITE
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ## @NAND_USE_BOUNCE_BUFFER
	.comm	_NAND_SKIP_BBTSCAN,4,2          ## @NAND_SKIP_BBTSCAN
	.comm	_NAND_STATUS_READY,4,2          ## @NAND_STATUS_READY
	.comm	_NAND_STATUS_WP,4,2             ## @NAND_STATUS_WP
L_.str.3:                               ## @.str.3
	.asciz	"failed to allocate bam transaction\n"

	.no_dead_strip	_qcom_nand_host_init_and_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcom_nand_host_init_and_register
_qcom_nand_host_init_and_register:      ; @qcom_nand_host_init_and_register
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x24, x2
	mov	x22, x1
	mov	x20, x0
	add	x19, x1, #8
	mov	x0, x19
	bl	_nand_to_mtd
	mov	x21, x0
	ldr	x23, [x20]
	add	x25, x22, #4
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x25
	bl	_of_property_read_u32
	cbz	w0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_dev_err
Lloh4:
	adrp	x8, _ENXIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
	mov	x0, x19
	mov	x1, x24
	bl	_nand_set_flash_node
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w3, [x25]
Lloh9:
	adrp	x2, l_.str.2@PAGE
Lloh10:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x23
	bl	_devm_kasprintf
	str	w0, [x21, #12]
	cbz	w0, LBB0_9
; %bb.3:
Lloh11:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x21, #8]
	str	x23, [x21]
Lloh14:
	adrp	x8, _qcom_nandc_command@GOTPAGE
Lloh15:
	ldr	x8, [x8, _qcom_nandc_command@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x22, #64]
Lloh17:
	adrp	x8, _qcom_nandc_select_chip@GOTPAGE
Lloh18:
	ldr	x8, [x8, _qcom_nandc_select_chip@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _qcom_nandc_read_byte@GOTPAGE
Lloh21:
	ldr	x9, [x9, _qcom_nandc_read_byte@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	stp	w9, w8, [x22, #56]
Lloh23:
	adrp	x8, _qcom_nandc_read_buf@GOTPAGE
Lloh24:
	ldr	x8, [x8, _qcom_nandc_read_buf@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _qcom_nandc_write_buf@GOTPAGE
Lloh27:
	ldr	x9, [x9, _qcom_nandc_write_buf@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
Lloh29:
	adrp	x10, _nand_get_set_features_notsupp@GOTPAGE
Lloh30:
	ldr	x10, [x10, _nand_get_set_features_notsupp@GOTPAGEOFF]
	stp	w9, w8, [x22, #48]
Lloh31:
	ldr	x8, [x10]
	stp	x8, x8, [x22, #32]
Lloh32:
	adrp	x8, _qcom_nandc_block_bad@GOTPAGE
Lloh33:
	ldr	x8, [x8, _qcom_nandc_block_bad@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
Lloh35:
	adrp	x9, _qcom_nandc_block_markbad@GOTPAGE
Lloh36:
	ldr	x9, [x9, _qcom_nandc_block_markbad@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	stp	w9, w8, [x22, #24]
	add	x8, x20, #24
	str	x8, [x22, #16]
Lloh38:
	adrp	x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGEOFF]
Lloh40:
	adrp	x9, _NAND_USE_BOUNCE_BUFFER@GOTPAGE
Lloh41:
	ldr	x9, [x9, _NAND_USE_BOUNCE_BUFFER@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh44:
	adrp	x9, _NAND_SKIP_BBTSCAN@GOTPAGE
Lloh45:
	ldr	x9, [x9, _NAND_SKIP_BBTSCAN@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x22, #8]
	orr	w8, w8, w9
	str	w8, [x22, #8]
Lloh47:
	adrp	x8, _NAND_STATUS_READY@GOTPAGE
Lloh48:
	ldr	x8, [x8, _NAND_STATUS_READY@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
Lloh50:
	adrp	x9, _NAND_STATUS_WP@GOTPAGE
Lloh51:
	ldr	x9, [x9, _NAND_STATUS_WP@GOTPAGEOFF]
Lloh52:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x22]
	mov	x0, x19
	mov	w1, #1
	bl	_nand_scan
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.4:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_free_bam_transaction
	mov	x0, x20
	bl	_alloc_bam_transaction
	str	w0, [x20, #8]
	cbz	w0, LBB0_8
LBB0_6:
	mov	x0, x21
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
	mov	x22, x0
	cbz	w0, LBB0_11
; %bb.7:
	mov	x0, x19
	bl	_nand_cleanup
	b	LBB0_11
LBB0_8:
	ldr	x0, [x20]
Lloh53:
	adrp	x1, l_.str.3@PAGE
Lloh54:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
LBB0_9:
Lloh55:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh56:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh42
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh55, Lloh56
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

l_.str.1:                               ; @.str.1
	.asciz	"can't get chip-select\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"qcom_nand.%d"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_qcom_nandc_command,4,2         ; @qcom_nandc_command
	.comm	_qcom_nandc_select_chip,4,2     ; @qcom_nandc_select_chip
	.comm	_qcom_nandc_read_byte,4,2       ; @qcom_nandc_read_byte
	.comm	_qcom_nandc_read_buf,4,2        ; @qcom_nandc_read_buf
	.comm	_qcom_nandc_write_buf,4,2       ; @qcom_nandc_write_buf
	.comm	_nand_get_set_features_notsupp,8,3 ; @nand_get_set_features_notsupp
	.comm	_qcom_nandc_block_bad,4,2       ; @qcom_nandc_block_bad
	.comm	_qcom_nandc_block_markbad,4,2   ; @qcom_nandc_block_markbad
	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ; @NAND_NO_SUBPAGE_WRITE
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ; @NAND_USE_BOUNCE_BUFFER
	.comm	_NAND_SKIP_BBTSCAN,4,2          ; @NAND_SKIP_BBTSCAN
	.comm	_NAND_STATUS_READY,4,2          ; @NAND_STATUS_READY
	.comm	_NAND_STATUS_WP,4,2             ; @NAND_STATUS_WP
l_.str.3:                               ; @.str.3
	.asciz	"failed to allocate bam transaction\n"

	.no_dead_strip	_qcom_nand_host_init_and_register
.subsections_via_symbols
