	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_nandc_write_page
_qcom_nandc_write_page:                 ## @qcom_nandc_write_page
	.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
	movl	%ecx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r14
	callq	_to_qcom_nand_host
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_get_qcom_nand_controller
	movq	%rax, %r15
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_prog_page_begin_op
	movq	%r15, %rdi
	callq	_clear_read_regs
	movq	%r15, %rdi
	callq	_clear_bam_transaction
	movq	(%r14), %rbx
	movl	$1, (%r13)
	movl	8(%r14), %esi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_update_rw_regs
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_config_nand_page_write
	xorl	%esi, %esi
	movq	%r12, %rdx
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %r12d
	testl	%r12d, %r12d
	jle	LBB0_11
## %bb.1:
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rdi
	xorl	%r15d, %r15d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	16(%rax), %rax
	leaq	(%rbx,%rax,4), %rbx
	movslq	%r14d, %r14
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r14, %rsi
	movq	%r13, %rdi
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	callq	_write_data_dma
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	callq	_config_nand_cw_write
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%r14,4), %rdx
	movslq	%r12d, %rax
	leaq	(%rbx,%rax,4), %rbx
	incl	%r15d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %r12d
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	addl	$-4, %esi
	cmpl	%r12d, %r15d
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rdi
	jge	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leal	-1(%r12), %eax
	cmpl	%eax, %r15d
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	12(%rcx), %r14d
	addl	%esi, %r14d
	shll	$2, %r12d
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	addl	4(%rcx), %r12d
	addl	8(%rcx), %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	12(%rcx), %r14d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	16(%rcx), %r12d
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	xorl	%r8d, %r8d
	cmpl	%eax, %r15d
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_NAND_BAM_NO_EOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rdi), %rsi
	movq	%r13, %rdi
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%r14d, %ecx
	callq	_write_data_dma
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	decl	%eax
	cmpl	%eax, %r15d
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r14d, %r14
	jmp	LBB0_10
LBB0_11:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_submit_descs
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r14d
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_free_descs
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%rbx, %rdi
	callq	_free_descs
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nand_prog_page_end_op          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FLASH_BUF_ACC,8,3              ## @FLASH_BUF_ACC
	.comm	_NAND_BAM_NO_EOT,4,2            ## @NAND_BAM_NO_EOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failure to write page\n"

	.no_dead_strip	_qcom_nandc_write_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcom_nandc_write_page
_qcom_nandc_write_page:                 ; @qcom_nandc_write_page
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x3
	mov	x21, x1
	mov	x19, x0
	bl	_to_qcom_nand_host
	mov	x22, x0
	mov	x0, x19
	bl	_get_qcom_nand_controller
	mov	x20, x0
	mov	x0, x19
	mov	x1, x23
	mov	w2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_nand_prog_page_begin_op
	mov	x0, x20
	bl	_clear_read_regs
	mov	x0, x20
	bl	_clear_bam_transaction
	ldr	x23, [x19]
	mov	w8, #1
	str	w8, [x22]
	ldr	w1, [x19, #8]
	mov	x0, x22
	mov	w2, #0
	bl	_update_rw_regs
	mov	x0, x20
	bl	_config_nand_page_write
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	w26, #0
	mov	w27, #0
Lloh0:
	adrp	x28, _FLASH_BUF_ACC@GOTPAGE
Lloh1:
	ldr	x28, [x28, _FLASH_BUF_ACC@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldrsw	x8, [x22, #16]
	add	x23, x23, x8, lsl #2
	ldr	x8, [x28]
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	sxtw	x25, w25
	add	x1, x8, x25
	mov	x0, x20
	mov	x2, x23
	mov	x3, x24
	mov	w4, #0
	bl	_write_data_dma
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_config_nand_cw_write
	add	x21, x21, x25, lsl #2
	add	x23, x23, w24, sxtw #2
	add	w27, w27, #1
	ldr	w8, [x19, #8]
	sub	w26, w26, #4
	cmp	w27, w8
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w9, w8, #1
	cmp	w27, w9
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w10, [x19, #12]
	add	w25, w26, w10
	ldp	w10, w11, [x22, #4]
	add	w8, w10, w8, lsl #2
	add	w24, w8, w11
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w25, [x22, #12]
	ldr	w24, [x19, #16]
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [x28]
Lloh2:
	adrp	x8, _NAND_BAM_NO_EOT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NAND_BAM_NO_EOT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w27, w9
	csel	w4, w8, wzr, eq
	mov	x0, x20
	mov	x2, x21
	mov	x3, x25
	bl	_write_data_dma
	ldr	w8, [x19, #8]
	sub	w8, w8, #1
	cmp	w27, w8
	b.eq	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x25, w25
	b	LBB0_3
LBB0_9:
	mov	x0, x20
	bl	_submit_descs
	cbz	w0, LBB0_11
; %bb.10:
	mov	x21, x0
	ldr	w0, [x20]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x20
	bl	_free_descs
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x0, x20
	bl	_free_descs
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_nand_prog_page_end_op
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_BUF_ACC,8,3              ; @FLASH_BUF_ACC
	.comm	_NAND_BAM_NO_EOT,4,2            ; @NAND_BAM_NO_EOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failure to write page\n"

	.no_dead_strip	_qcom_nandc_write_page
.subsections_via_symbols
