	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_nandc_read_cw_raw
_qcom_nandc_read_cw_raw:                ## @qcom_nandc_read_cw_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movl	%r8d, %ebx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_to_qcom_nand_host
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_get_qcom_nand_controller
	movq	%rax, %r13
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_read_page_op
	movl	$0, (%r14)
	movq	%r13, %rdi
	callq	_clear_bam_transaction
	movl	4(%r14), %esi
	imull	%r12d, %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_set_address
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_update_rw_regs
	movq	%r13, %rdi
	callq	_config_nand_page_read
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rdi
	movslq	4(%r14), %rax
	movslq	(%r15), %rbx
	leaq	-1(%rbx), %rcx
	imulq	%rcx, %rax
	subq	%rax, %rdi
	cmpl	%r12d, %ecx
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	jne	LBB0_2
## %bb.1:
	movl	4(%r15), %esi
	movq	%r12, %rax
	movq	%rdi, %r12
	leal	(%rdi,%rax,4), %eax
	subl	%eax, %esi
	shll	$2, %ebx
	addl	12(%r14), %ebx
	leaq	16(%r14), %rax
	jmp	LBB0_3
LBB0_2:
	movl	16(%r14), %ebx
	movl	20(%r14), %esi
	movq	%rdi, %r12
	subl	%edi, %esi
	leaq	12(%r14), %rax
LBB0_3:
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movslq	8(%r14), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rcx
	addl	(%rax), %ebx
	cmpq	$0, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%r12, %r14
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	callq	_nandc_set_read_loc
	movq	%r13, %rdi
	movl	$1, %esi
	movl	%r14d, %edx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	callq	_nandc_set_read_loc
	addl	%r12d, %r15d
	movq	%r13, %rdi
	movl	$2, %esi
	movl	%r15d, %edx
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	callq	_nandc_set_read_loc
	addl	%r14d, %r15d
	movq	%r13, %rdi
	movl	$3, %esi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	movl	$1, %r8d
	callq	_nandc_set_read_loc
LBB0_5:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_config_nand_cw_read
	movq	%r13, %rdi
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	callq	_read_data_dma
	addl	%r12d, %r14d
	movq	%r13, %rdi
	movl	%r14d, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%r13, %r15
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	callq	_read_data_dma
	addl	%r13d, %r14d
	leaq	(%rbx,%r12,4), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	callq	_read_data_dma
	addl	%ebx, %r14d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r13,4), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%r8d, %r8d
	callq	_read_data_dma
	movq	%r15, %rdi
	callq	_submit_descs
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_free_descs
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.6:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_err
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %esi
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_check_flash_errors             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FLASH_BUF_ACC,4,2              ## @FLASH_BUF_ACC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failure to read raw cw %d\n"

	.no_dead_strip	_qcom_nandc_read_cw_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_read_cw_raw
_qcom_nandc_read_cw_raw:                ; @qcom_nandc_read_cw_raw
	.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	x19, x5
	mov	x25, x4
	mov	x22, x3
	mov	x23, x2
	mov	x27, x1
	mov	x26, x0
	mov	x0, x1
	bl	_to_qcom_nand_host
	mov	x20, x0
	mov	x0, x27
	bl	_get_qcom_nand_controller
	mov	x21, x0
Lloh0:
	adrp	x8, _FLASH_BUF_ACC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FLASH_BUF_ACC@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	mov	x0, x27
	mov	x1, x25
	mov	w2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_nand_read_page_op
	str	wzr, [x20]
	mov	x0, x21
	bl	_clear_bam_transaction
	ldr	w8, [x20, #4]
	mul	w1, w8, w19
	mov	x0, x20
	mov	x2, x25
	bl	_set_address
	mov	x0, x20
	mov	w1, #1
	mov	w2, #1
	bl	_update_rw_regs
	mov	x0, x21
	bl	_config_nand_page_read
	ldr	w9, [x26]
	ldr	w8, [x27]
	sub	w10, w8, #1
	ldp	w11, w25, [x20, #4]
                                        ; kill: def $w25 killed $w25 def $x25
	sxtw	x25, w25
	msub	w26, w10, w11, w9
	cmp	w10, w19
	str	x22, [sp, #8]                   ; 8-byte Folded Spill
	b.ne	LBB0_2
; %bb.1:
	ldr	w9, [x27, #4]
	add	w10, w26, w19, lsl #2
	sub	w27, w9, w10
	ldr	w9, [x20, #12]
	add	w8, w9, w8, lsl #2
	add	x9, x20, #16
	b	LBB0_3
LBB0_2:
	ldp	w8, w9, [x20, #16]
	sub	w27, w9, w26
	add	x9, x20, #12
LBB0_3:
	ldr	w9, [x9]
	add	w28, w8, w9
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	mov	x3, x26
	mov	w4, #0
	bl	_nandc_set_read_loc
	mov	x0, x21
	mov	w1, #1
	mov	x2, x26
	mov	x3, x25
	mov	w4, #0
	bl	_nandc_set_read_loc
	add	w22, w26, w25
	mov	x0, x21
	mov	w1, #2
	mov	x2, x22
	mov	x3, x27
	mov	w4, #0
	bl	_nandc_set_read_loc
	add	w2, w27, w22
	mov	x0, x21
	mov	w1, #3
	mov	x3, x28
	mov	w4, #1
	bl	_nandc_set_read_loc
LBB0_5:
	mov	x0, x21
	mov	w1, #0
	bl	_config_nand_cw_read
	mov	x0, x21
	mov	x1, x24
	mov	x2, x23
	mov	x3, x26
	mov	w4, #0
	bl	_read_data_dma
	add	w22, w26, w24
	mov	x0, x21
	mov	x1, x22
	ldr	x24, [sp, #8]                   ; 8-byte Folded Reload
	mov	x2, x24
	mov	x3, x25
	mov	w4, #0
	bl	_read_data_dma
	add	w22, w22, w25
	add	x2, x23, w26, sxtw #2
	mov	x0, x21
	mov	x1, x22
	mov	x3, x27
	mov	w4, #0
	bl	_read_data_dma
	add	w1, w27, w22
	add	x2, x24, x25, lsl #2
	mov	x0, x21
	mov	x3, x28
	mov	w4, #0
	bl	_read_data_dma
	mov	x0, x21
	bl	_submit_descs
	mov	x22, x0
	mov	x0, x21
	bl	_free_descs
	cbz	w22, LBB0_7
; %bb.6:
	ldr	w0, [x21]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
	mov	x0, x22
	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_7:
	mov	x0, x20
	mov	w1, #1
	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
	b	_check_flash_errors
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_BUF_ACC,4,2              ; @FLASH_BUF_ACC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failure to read raw cw %d\n"

	.no_dead_strip	_qcom_nandc_read_cw_raw
.subsections_via_symbols
