	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdswap_read_markers
_mtdswap_read_markers:                  ## @mtdswap_read_markers
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_mtdswap_eb_offset
	movl	%eax, %r15d
	movq	(%rbx), %rdi
	callq	_mtd_can_have_bb
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	(%rbx), %rdi
	movl	%r15d, %esi
	callq	_mtd_block_isbad
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_MTDSWAP_SCANNED_BAD@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_3:
	movq	(%rbx), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	movl	%eax, -64(%rbp)
	movq	8(%rbx), %rax
	movq	%rax, -40(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -56(%rbp)
	movq	_MTD_OPS_AUTO_OOB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_mtdswap_read_oob
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%r15d, %edi
	callq	_mtd_is_bitflip
	testq	%rax, %rax
	je	LBB0_13
LBB0_5:
	movq	(%rbx), %rax
	movq	8(%rbx), %rbx
	movslq	(%rax), %r12
	movl	(%rbx), %edi
	callq	_le16_to_cpu
	movq	_MTDSWAP_MAGIC_CLEAN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.6:
	movl	4(%rbx), %edi
	callq	_le32_to_cpu
	movl	%eax, 4(%r14)
	movl	%r15d, %edi
	callq	_mtd_is_bitflip
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_MTDSWAP_SCANNED_BITFLIP@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_10:
	movq	_EBLOCK_NOMAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
LBB0_11:
	movq	_MTDSWAP_SCANNED_DIRTY@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r12,%rbx), %edi
	callq	_le16_to_cpu
	movq	_MTDSWAP_MAGIC_DIRTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.9:
	movq	_MTDSWAP_SCANNED_CLEAN@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_MTDSWAP_SCANNED_BAD,4,2        ## @MTDSWAP_SCANNED_BAD
	.comm	_MTD_OPS_AUTO_OOB,4,2           ## @MTD_OPS_AUTO_OOB
	.comm	_MTDSWAP_MAGIC_CLEAN,8,3        ## @MTDSWAP_MAGIC_CLEAN
	.comm	_MTDSWAP_SCANNED_BITFLIP,4,2    ## @MTDSWAP_SCANNED_BITFLIP
	.comm	_MTDSWAP_MAGIC_DIRTY,8,3        ## @MTDSWAP_MAGIC_DIRTY
	.comm	_MTDSWAP_SCANNED_DIRTY,4,2      ## @MTDSWAP_SCANNED_DIRTY
	.comm	_MTDSWAP_SCANNED_CLEAN,4,2      ## @MTDSWAP_SCANNED_CLEAN
	.comm	_EBLOCK_NOMAGIC,4,2             ## @EBLOCK_NOMAGIC
	.no_dead_strip	_mtdswap_read_markers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdswap_read_markers
_mtdswap_read_markers:                  ; @mtdswap_read_markers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x20, x0
	bl	_mtdswap_eb_offset
	mov	x21, x0
	ldr	x0, [x20]
	bl	_mtd_can_have_bb
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x0, [x20]
	mov	x1, x21
	bl	_mtd_block_isbad
	cbz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _MTDSWAP_SCANNED_BAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTDSWAP_SCANNED_BAD@GOTPAGEOFF]
	b	LBB0_10
LBB0_3:
	ldp	x8, x9, [x20]
	ldr	w8, [x8]
	lsl	w8, w8, #1
	stp	xzr, x9, [sp, #16]
	str	xzr, [sp, #8]
Lloh2:
	adrp	x9, _MTD_OPS_AUTO_OOB@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MTD_OPS_AUTO_OOB@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	stp	w8, w9, [sp]
	mov	x2, sp
	mov	x0, x20
	mov	x1, x21
	bl	_mtdswap_read_oob
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_mtd_is_bitflip
	cbz	x0, LBB0_11
LBB0_5:
	ldp	x8, x22, [x20]
	ldrsw	x20, [x8]
	ldr	w0, [x22]
	bl	_le16_to_cpu
Lloh5:
	adrp	x8, _MTDSWAP_MAGIC_CLEAN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MTDSWAP_MAGIC_CLEAN@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.6:
	ldr	w0, [x22, #4]
	bl	_le32_to_cpu
	str	w0, [x19, #4]
	mov	x0, x21
	bl	_mtd_is_bitflip
	cbz	x0, LBB0_9
; %bb.7:
Lloh8:
	adrp	x8, _MTDSWAP_SCANNED_BITFLIP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MTDSWAP_SCANNED_BITFLIP@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh10:
	adrp	x8, _EBLOCK_NOMAGIC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBLOCK_NOMAGIC@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh13:
	adrp	x8, _MTDSWAP_SCANNED_DIRTY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MTDSWAP_SCANNED_DIRTY@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
	ldr	w0, [x20, x22]
	bl	_le16_to_cpu
Lloh15:
	adrp	x8, _MTDSWAP_MAGIC_DIRTY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MTDSWAP_MAGIC_DIRTY@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
Lloh18:
	adrp	x9, _MTDSWAP_SCANNED_CLEAN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MTDSWAP_SCANNED_CLEAN@GOTPAGEOFF]
Lloh20:
	adrp	x10, _MTDSWAP_SCANNED_DIRTY@GOTPAGE
Lloh21:
	ldr	x10, [x10, _MTDSWAP_SCANNED_DIRTY@GOTPAGEOFF]
	cmp	x0, x8
	csel	x8, x10, x9, eq
LBB0_10:
	ldr	w21, [x8]
LBB0_11:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MTDSWAP_SCANNED_BAD,4,2        ; @MTDSWAP_SCANNED_BAD
	.comm	_MTD_OPS_AUTO_OOB,4,2           ; @MTD_OPS_AUTO_OOB
	.comm	_MTDSWAP_MAGIC_CLEAN,8,3        ; @MTDSWAP_MAGIC_CLEAN
	.comm	_MTDSWAP_SCANNED_BITFLIP,4,2    ; @MTDSWAP_SCANNED_BITFLIP
	.comm	_MTDSWAP_MAGIC_DIRTY,8,3        ; @MTDSWAP_MAGIC_DIRTY
	.comm	_MTDSWAP_SCANNED_DIRTY,4,2      ; @MTDSWAP_SCANNED_DIRTY
	.comm	_MTDSWAP_SCANNED_CLEAN,4,2      ; @MTDSWAP_SCANNED_CLEAN
	.comm	_EBLOCK_NOMAGIC,4,2             ; @EBLOCK_NOMAGIC
	.no_dead_strip	_mtdswap_read_markers
.subsections_via_symbols
