	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function doc_read_oob
_doc_read_oob:                          ## @doc_read_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	(%rdi), %r14
	movq	32(%rdx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdx), %rax
	movq	_MTD_OOB_PLACE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_BUG_ON
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	addq	24(%rbx), %r13
	leaq	24(%r14), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	40(%r14), %r12
	movb	(%r14), %cl
	movq	%r13, %rbx
	shrq	%cl, %rbx
	shlq	$4, %rbx
	leaq	(%r12,%rbx), %r15
	movq	(%r12,%rbx), %rsi
	cmpq	%rsi, 8(%r14)
	jne	LBB0_1
## %bb.2:
	movq	8(%r12,%rbx), %rsi
	cmpq	%rsi, 16(%r14)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_3
	jmp	LBB0_4
LBB0_1:
	movq	%r14, %rdi
	callq	_DoC_SelectFloor
	movq	8(%r12,%rbx), %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_3:
	movq	%r14, %rdi
	callq	_DoC_SelectChip
LBB0_4:
	movups	(%r15), %xmm0
	movups	%xmm0, 8(%r14)
	cmpq	$0, 32(%r14)
	je	LBB0_8
## %bb.5:
	testb	$8, %r13b
	jne	LBB0_7
## %bb.6:
	addq	$256, %r13                      ## imm = 0x100
	jmp	LBB0_8
LBB0_7:
	addq	$-8, %r13
LBB0_8:
	movq	_NAND_CMD_READOOB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CDSN_CTRL_WP@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_DoC_Command
	movq	_ADDR_COLUMN_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movq	%r13, %rdx
	xorl	%r8d, %r8d
	callq	_DoC_Address
	cmpq	$0, 32(%r14)
	je	LBB0_12
## %bb.9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r13), %rcx
	movq	%r13, %rax
	orq	$7, %rax
	incq	%rax
	cmpq	%rax, %rcx
	jbe	LBB0_10
## %bb.11:
	subl	%r13d, %eax
	movslq	%eax, %r12
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_DoC_ReadBuf
	movq	_NAND_CMD_READOOB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_DoC_Command
	movq	_ADDR_COLUMN_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andq	$-512, %r13                     ## imm = 0xFE00
	movl	(%r15), %ecx
	movq	%r14, %rdi
	movq	%r13, %rdx
	xorl	%r8d, %r8d
	callq	_DoC_Address
	jmp	LBB0_12
LBB0_10:
	xorl	%r12d, %r12d
LBB0_12:
	leaq	(%rbx,%r12,4), %rsi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	subq	%r12, %rdx
	movq	%r14, %rdi
	callq	_DoC_ReadBuf
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, 16(%rax)
	movq	%r14, %rdi
	callq	_DoC_WaitReady
	movl	%eax, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTD_OOB_PLACE,8,3              ## @MTD_OOB_PLACE
	.comm	_NAND_CMD_READOOB,4,2           ## @NAND_CMD_READOOB
	.comm	_CDSN_CTRL_WP,4,2               ## @CDSN_CTRL_WP
	.comm	_ADDR_COLUMN_PAGE,4,2           ## @ADDR_COLUMN_PAGE
	.no_dead_strip	_doc_read_oob
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doc_read_oob
_doc_read_oob:                          ; @doc_read_oob
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x21, x1
	ldr	x20, [x0]
	ldr	x22, [x2, #32]
	ldp	x25, x8, [x2]
Lloh0:
	adrp	x9, _MTD_OOB_PLACE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTD_OOB_PLACE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_BUG_ON
	ldr	x8, [x19, #24]
	add	x23, x8, x21
	add	x21, x20, #24
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x20, #40]
	ldp	x9, x10, [x20]
	lsr	x9, x23, x9
	add	x24, x8, x9, lsl #4
	ldr	x1, [x24]
	cmp	x10, x1
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x20, #16]
	ldr	x1, [x24, #8]
	cmp	x8, x1
	b.ne	LBB0_3
	b	LBB0_4
LBB0_2:
	mov	x0, x20
	bl	_DoC_SelectFloor
	ldr	x1, [x24, #8]
LBB0_3:
	mov	x0, x20
	bl	_DoC_SelectChip
LBB0_4:
	ldr	q0, [x24]
	stur	q0, [x20, #8]
	ldr	x8, [x20, #32]
	sub	x9, x23, #8
	add	x10, x23, #256
	tst	w23, #0x8
	csel	x9, x9, x10, ne
	cmp	x8, #0
	csel	x23, x23, x9, eq
Lloh3:
	adrp	x27, _NAND_CMD_READOOB@GOTPAGE
Lloh4:
	ldr	x27, [x27, _NAND_CMD_READOOB@GOTPAGEOFF]
	ldr	w1, [x27]
Lloh5:
	adrp	x26, _CDSN_CTRL_WP@GOTPAGE
Lloh6:
	ldr	x26, [x26, _CDSN_CTRL_WP@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_DoC_Command
Lloh7:
	adrp	x28, _ADDR_COLUMN_PAGE@GOTPAGE
Lloh8:
	ldr	x28, [x28, _ADDR_COLUMN_PAGE@GOTPAGEOFF]
	ldr	w1, [x28]
	ldr	w3, [x26]
	mov	x0, x20
	mov	x2, x23
	mov	w4, #0
	bl	_DoC_Address
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_7
; %bb.5:
	orr	x8, x23, #0x7
	add	x8, x8, #1
	add	x9, x23, x25
	cmp	x9, x8
	b.ls	LBB0_7
; %bb.6:
	sub	w8, w8, w23
	sxtw	x24, w8
	mov	x0, x20
	mov	x1, x22
	mov	x2, x24
	bl	_DoC_ReadBuf
	ldr	w1, [x27]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_DoC_Command
	ldr	w1, [x28]
	and	x2, x23, #0xfffffffffffffe00
	ldr	w3, [x26]
	mov	x0, x20
	mov	w4, #0
	bl	_DoC_Address
	b	LBB0_8
LBB0_7:
	mov	x24, #0
LBB0_8:
	add	x1, x22, x24, lsl #2
	sub	x2, x25, x24
	mov	x0, x20
	bl	_DoC_ReadBuf
	str	x25, [x19, #16]
	mov	x0, x20
	bl	_DoC_WaitReady
	mov	x19, x0
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MTD_OOB_PLACE,8,3              ; @MTD_OOB_PLACE
	.comm	_NAND_CMD_READOOB,4,2           ; @NAND_CMD_READOOB
	.comm	_CDSN_CTRL_WP,4,2               ; @CDSN_CTRL_WP
	.comm	_ADDR_COLUMN_PAGE,4,2           ; @ADDR_COLUMN_PAGE
	.no_dead_strip	_doc_read_oob
.subsections_via_symbols
