	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_nandc_block_markbad
_qcom_nandc_block_markbad:              ## @qcom_nandc_block_markbad
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %r14
	callq	_to_qcom_nand_host
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_get_qcom_nand_controller
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_clear_read_regs
	movq	%rbx, %rdi
	callq	_clear_bam_transaction
	movl	4(%rbx), %edi
	movl	(%r12), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_memset
	movb	(%r14), %cl
	sarl	%cl, %r13d
	andl	4(%r14), %r13d
	movl	$0, 4(%r12)
	movl	8(%r14), %esi
	decl	%esi
	imull	(%r12), %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_set_address
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_update_rw_regs
	movq	%rbx, %rdi
	callq	_config_nand_page_write
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_write_data_dma
	movq	%rbx, %rdi
	callq	_config_nand_cw_write
	movq	%rbx, %rdi
	callq	_submit_descs
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_free_descs
	testl	%r12d, %r12d
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, %rdi
	addq	$8, %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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failure to update BBM\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_qcom_nandc_block_markbad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcom_nandc_block_markbad
_qcom_nandc_block_markbad:              ; @qcom_nandc_block_markbad
	.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	x21, x1
	mov	x19, x0
	bl	_to_qcom_nand_host
	mov	x22, x0
	mov	x0, x19
	bl	_get_qcom_nand_controller
	mov	x20, x0
	bl	_clear_read_regs
	mov	x0, x20
	bl	_clear_bam_transaction
	ldr	w0, [x20, #4]
	ldr	w2, [x22]
	mov	w1, #0
	bl	_memset
	ldp	w8, w9, [x19]
	asr	w8, w21, w8
	and	w2, w8, w9
	str	wzr, [x22, #4]
	ldr	w8, [x22]
	ldr	w9, [x19, #8]
	sub	w9, w9, #1
	mul	w1, w9, w8
	mov	x0, x22
	bl	_set_address
	mov	x0, x22
	mov	w1, #1
	mov	w2, #0
	bl	_update_rw_regs
	mov	x0, x20
	bl	_config_nand_page_write
Lloh0:
	adrp	x8, _FLASH_BUF_ACC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FLASH_BUF_ACC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x20, #4]
	ldr	w3, [x22]
	mov	x0, x20
	mov	w4, #0
	bl	_write_data_dma
	mov	x0, x20
	bl	_config_nand_cw_write
	mov	x0, x20
	bl	_submit_descs
	mov	x21, x0
	mov	x0, x20
	bl	_free_descs
	cbz	w21, LBB0_2
; %bb.1:
	ldr	w0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	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
LBB0_2:
	mov	x0, x19
	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
	b	_nand_prog_page_end_op
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.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 update BBM\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_qcom_nandc_block_markbad
.subsections_via_symbols
