	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_nandc_write_page_raw
_qcom_nandc_write_page_raw:             ## @qcom_nandc_write_page_raw
	.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	$104, %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, %r15
	callq	_nand_to_mtd
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_to_qcom_nand_host
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_get_qcom_nand_controller
	movq	%rax, %r14
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_prog_page_begin_op
	movq	%r14, %rdi
	callq	_clear_read_regs
	movq	%r14, %rdi
	callq	_clear_bam_transaction
	movq	(%r15), %rbx
	movl	$0, (%r13)
	movl	8(%r15), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_update_rw_regs
	movq	%r14, %rdi
	callq	_config_nand_page_write
	xorl	%esi, %esi
	movl	8(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.1:
	leaq	12(%r13), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rcx
	addq	$16, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%r13), %eax
	movl	20(%r13), %r14d
	subl	%r12d, %r14d
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	movslq	8(%r13), %rdx
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	movslq	(%rcx), %rcx
	cltq
	addq	%rcx, %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	_NAND_BAM_NO_EOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r9, %r15
	movq	%r9, %rdx
	movl	%r12d, %ecx
	callq	_write_data_dma
	addl	%r12d, %ebx
	movslq	%r12d, %rax
	leaq	(%r15,%rax,4), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	_NAND_BAM_NO_EOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	-136(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %rdx
	movq	-112(%rbp), %r12                ## 8-byte Reload
	movl	%r12d, %ecx
	callq	_write_data_dma
	addl	%r12d, %ebx
	leaq	(%r15,%r12,4), %r15
	movq	_NAND_BAM_NO_EOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	-104(%rbp), %r12                ## 8-byte Reload
	movq	%r12, %rdx
	movl	%r14d, %ecx
	callq	_write_data_dma
	addl	%r14d, %ebx
	movslq	%r14d, %rax
	leaq	(%r12,%rax,4), %r12
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	callq	_write_data_dma
	leaq	(%r15,%rbx,4), %rbx
	movq	%r13, %r14
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_config_nand_cw_write
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	incl	%edi
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movl	8(%r15), %eax
	movq	-128(%rbp), %rsi                ## 8-byte Reload
	addl	$-4, %esi
	cmpl	%eax, %edi
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	movq	%r12, %r9
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	leal	-1(%rax), %edx
	movl	4(%r13), %r14d
	imull	%edx, %r14d
	movl	%ecx, %r12d
	subl	%r14d, %r12d
	cmpl	%edx, %edi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -128(%rbp)                ## 8-byte Spill
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	12(%r15), %r14d
	subl	%ecx, %r14d
	addl	%esi, %r14d
	shll	$2, %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	addl	(%rcx), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_5
LBB0_6:
	movq	%r14, %rdi
	callq	_submit_descs
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_free_descs
	movl	%ebx, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, %rdi
	callq	_free_descs
	movq	%r15, %rdi
	addq	$104, %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,4,2              ## @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 raw page\n"

	.no_dead_strip	_qcom_nandc_write_page_raw
.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_raw
_qcom_nandc_write_page_raw:             ; @qcom_nandc_write_page_raw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x24, x3
	mov	x23, x1
	mov	x25, x0
	bl	_nand_to_mtd
	str	x0, [sp, #40]                   ; 8-byte Folded Spill
	mov	x0, x25
	bl	_to_qcom_nand_host
	mov	x20, x0
	mov	x0, x25
	bl	_get_qcom_nand_controller
	mov	x19, x0
	mov	x0, x25
	mov	x1, x24
	mov	w2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_nand_prog_page_begin_op
	mov	x0, x19
	bl	_clear_read_regs
	mov	x0, x19
	bl	_clear_bam_transaction
	ldr	x21, [x25]
	str	wzr, [x20]
	ldr	w1, [x25, #8]
	mov	x0, x20
	mov	w2, #0
	bl	_update_rw_regs
	str	x19, [sp, #48]                  ; 8-byte Folded Spill
	mov	x0, x19
	bl	_config_nand_page_write
	ldr	w8, [x25, #8]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w19, #0
	mov	w22, #0
	add	x9, x20, #12
	stp	x9, x20, [sp, #24]              ; 16-byte Folded Spill
	add	x9, x20, #16
	stp	x9, x25, [sp, #8]               ; 16-byte Folded Spill
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldp	w8, w9, [x20, #16]
	sub	w25, w9, w26
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh0:
	adrp	x10, _FLASH_BUF_ACC@GOTPAGE
Lloh1:
	ldr	x10, [x10, _FLASH_BUF_ACC@GOTPAGEOFF]
Lloh2:
	ldr	w27, [x10]
	ldrsw	x28, [x20, #8]
	ldr	w9, [x9]
	add	w21, w8, w9
Lloh3:
	adrp	x24, _NAND_BAM_NO_EOT@GOTPAGE
Lloh4:
	ldr	x24, [x24, _NAND_BAM_NO_EOT@GOTPAGEOFF]
	ldr	w4, [x24]
	ldr	x20, [sp, #48]                  ; 8-byte Folded Reload
	mov	x0, x20
	mov	x1, x27
	mov	x2, x23
	mov	x3, x26
	bl	_write_data_dma
	add	w27, w26, w27
	add	x23, x23, w26, sxtw #2
	ldr	w4, [x24]
	mov	x0, x20
	mov	x1, x27
	ldr	x24, [sp, #56]                  ; 8-byte Folded Reload
	mov	x2, x24
	mov	x3, x28
	bl	_write_data_dma
	add	w26, w27, w28
	add	x24, x24, x28, lsl #2
Lloh5:
	adrp	x8, _NAND_BAM_NO_EOT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NAND_BAM_NO_EOT@GOTPAGEOFF]
Lloh7:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x1, x26
	mov	x2, x23
	mov	x3, x25
	bl	_write_data_dma
	add	w1, w25, w26
	add	x23, x23, w25, sxtw #2
	mov	x0, x20
	mov	x2, x24
	mov	x3, x21
	mov	w4, #0
	bl	_write_data_dma
	add	x21, x24, w21, sxtw #2
	mov	x0, x20
	ldr	x20, [sp, #32]                  ; 8-byte Folded Reload
	bl	_config_nand_cw_write
	add	w22, w22, #1
	ldr	x25, [sp, #16]                  ; 8-byte Folded Reload
	ldr	w8, [x25, #8]
	sub	w19, w19, #4
	cmp	w22, w8
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	w9, [x9]
	ldr	w10, [x20, #4]
	sub	w11, w8, #1
	mul	w10, w10, w11
	sub	w26, w9, w10
	cmp	w22, w11
	str	x21, [sp, #56]                  ; 8-byte Folded Spill
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w11, [x25, #12]
	add	w10, w11, w10
	sub	w9, w10, w9
	add	w25, w19, w9
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w9, [x9]
	add	w8, w9, w8, lsl #2
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	b	LBB0_3
LBB0_6:
	ldr	x19, [sp, #48]                  ; 8-byte Folded Reload
	mov	x0, x19
	bl	_submit_descs
	cbz	w0, LBB0_8
; %bb.7:
	mov	x21, x0
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_free_descs
	mov	x0, x21
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_8:
	mov	x0, x19
	bl	_free_descs
	mov	x0, x25
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_nand_prog_page_end_op
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_BUF_ACC,4,2              ; @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 raw page\n"

	.no_dead_strip	_qcom_nandc_write_page_raw
.subsections_via_symbols
