	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function copy_last_cw
_copy_last_cw:                          ## @copy_last_cw
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %rbx
	addq	$16, %rdi
	callq	_get_qcom_nand_controller
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_clear_read_regs
	xorl	%eax, %eax
	cmpq	$0, 8(%rbx)
	sete	%al
	movl	(%rbx,%rax,4), %r15d
	movl	4(%r14), %edi
	movl	$255, %esi
	movl	%r15d, %edx
	callq	_memset
	movl	16(%rbx), %esi
	decl	%esi
	imull	4(%rbx), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_set_address
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_update_rw_regs
	movq	8(%rbx), %rsi
	movq	%r14, %rdi
	callq	_config_nand_single_cw_page_read
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r14), %edx
	movq	%r14, %rdi
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	callq	_read_data_dma
	movq	%r14, %rdi
	callq	_submit_descs
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_2:
	movq	%r14, %rdi
	callq	_free_descs
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FLASH_BUF_ACC,4,2              ## @FLASH_BUF_ACC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to copy last codeword\n"

	.no_dead_strip	_copy_last_cw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function copy_last_cw
_copy_last_cw:                          ; @copy_last_cw
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x21, x0
	add	x0, x0, #16
	bl	_get_qcom_nand_controller
	mov	x19, x0
	bl	_clear_read_regs
	ldr	x8, [x21, #8]
	cmp	x8, #0
	cset	w8, eq
	ldr	w22, [x21, w8, uxtw #2]
	ldr	w0, [x19, #4]
	mov	w1, #255
	mov	x2, x22
	bl	_memset
	ldr	w8, [x21, #4]
	ldr	w9, [x21, #16]
	sub	w9, w9, #1
	mul	w1, w9, w8
	mov	x0, x21
	mov	x2, x20
	bl	_set_address
	mov	x0, x21
	mov	w1, #1
	mov	w2, #1
	bl	_update_rw_regs
	ldr	x1, [x21, #8]
	mov	x0, x19
	bl	_config_nand_single_cw_page_read
Lloh0:
	adrp	x8, _FLASH_BUF_ACC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FLASH_BUF_ACC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	mov	x0, x19
	mov	x3, x22
	mov	w4, #0
	bl	_read_data_dma
	mov	x0, x19
	bl	_submit_descs
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	mov	x0, x19
	bl	_free_descs
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.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	"failed to copy last codeword\n"

	.no_dead_strip	_copy_last_cw
.subsections_via_symbols
