	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_nandc_write_oob
_qcom_nandc_write_oob:                  ## @qcom_nandc_write_oob
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	callq	_nand_to_mtd
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_qcom_nand_host
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_get_qcom_nand_controller
	movq	%rax, %rbx
	movq	(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$1, (%r13)
	movq	%rbx, %rdi
	callq	_clear_bam_transaction
	movl	8(%r14), %eax
	movl	12(%r14), %ecx
	shll	$2, %ecx
	negl	%ecx
	leal	(%rax,%rcx), %r12d
	addl	$4, %r12d
	movq	8(%rbx), %rdi
	movl	8(%r13), %edx
	movl	(%r15), %eax
	addl	%r12d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$255, %esi
	callq	_memset
	movslq	%r12d, %rsi
	addq	8(%rbx), %rsi
	movl	(%r15), %r8d
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	callq	_mtd_ooblayout_get_databytes
	movl	12(%r14), %esi
	decl	%esi
	imull	4(%r13), %esi
	movq	%r13, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_set_address
	movq	%r13, %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
	movq	8(%rbx), %rdx
	movq	%rbx, %rdi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_write_data_dma
	movq	%rbx, %rdi
	callq	_config_nand_cw_write
	movq	%rbx, %rdi
	callq	_submit_descs
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_free_descs
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, %rdi
	addq	$24, %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 write oob\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_qcom_nandc_write_oob
.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_oob
_qcom_nandc_write_oob:                  ; @qcom_nandc_write_oob
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_nand_to_mtd
	mov	x22, x0
	mov	x0, x19
	bl	_to_qcom_nand_host
	mov	x23, x0
	mov	x0, x19
	bl	_get_qcom_nand_controller
	mov	x20, x0
	ldr	x24, [x19]
	mov	w8, #1
	str	w8, [x23]
	bl	_clear_bam_transaction
	ldp	w8, w9, [x19, #8]
	sub	w8, w8, w9, lsl #2
	add	w25, w8, #4
	ldr	w26, [x22]
	ldr	x0, [x20, #8]
	ldr	w2, [x23, #8]
	mov	w1, #255
	bl	_memset
	ldr	x8, [x20, #8]
	add	x1, x8, w25, sxtw
	ldr	w4, [x22]
	mov	x0, x22
	mov	x2, x24
	mov	w3, #0
	bl	_mtd_ooblayout_get_databytes
	ldr	w8, [x23, #4]
	ldr	w9, [x19, #12]
	sub	w9, w9, #1
	mul	w1, w9, w8
	mov	x0, x23
	mov	x2, x21
	bl	_set_address
	mov	x0, x23
	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	x2, [x20, #8]
	add	w3, w25, w26
	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, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 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 write oob\n"

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