	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtd_dump
_mtd_dump:                              ## @mtd_dump
	.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	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_quiet@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jg	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_2:
	movq	%rbx, %rdi
	callq	_mtd_check_open
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	js	LBB0_19
## %bb.3:
	testl	%r13d, %r13d
	jne	LBB0_5
## %bb.4:
	movq	_mtdsize@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_5:
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r15d, %esi
	callq	_lseek
LBB0_7:
	movq	_erasesize@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_20
## %bb.8:
	movq	%rax, %rbx
	xorl	%r14d, %r14d
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_11 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINTR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.10:                              ##   in Loop: Header=BB0_11 Depth=1
	testl	%r13d, %r13d
	jle	LBB0_18
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_erasesize@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	%r12d, %r13d
	cmovll	%r13d, %r12d
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%r15d, %r15d
	testl	%eax, %eax
	je	LBB0_22
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpl	%r12d, %eax
	jne	LBB0_22
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	movl	%r14d, %esi
	callq	_mtd_block_is_bad
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	subl	%r12d, %r13d
	movl	$1, %edi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_write
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	addl	%r12d, %r14d
	testl	%r13d, %r13d
	jg	LBB0_11
LBB0_18:
	xorl	%r15d, %r15d
	jmp	LBB0_22
LBB0_19:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_20:
	movl	$-1, %r15d
	jmp	LBB0_23
LBB0_21:
	movl	$-1, %r15d
LBB0_22:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_close
LBB0_23:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_quiet,4,2                      ## @quiet
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Dumping %s ...\n"

L_.str.1:                               ## @.str.1
	.asciz	"Could not open mtd device: %s\n"

	.comm	_mtdsize,4,2                    ## @mtdsize
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_erasesize,4,2                  ## @erasesize
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.2:                               ## @.str.2
	.asciz	"skipping bad block at 0x%08x\n"

	.no_dead_strip	_mtd_dump
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtd_dump
_mtd_dump:                              ; @mtd_dump
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _quiet@GOTPAGE
Lloh1:
	ldr	x8, [x8, _quiet@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.gt	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _stderr@GOTPAGE
Lloh4:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	str	x22, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
LBB0_2:
	mov	x0, x22
	bl	_mtd_check_open
	tbnz	w0, #31, LBB0_17
; %bb.3:
	mov	x19, x0
Lloh8:
	adrp	x8, _mtdsize@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mtdsize@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w21, #0
	csel	w24, w8, w21, eq
	cbz	w20, LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_lseek
LBB0_5:
Lloh14:
	adrp	x25, _erasesize@GOTPAGE
Lloh15:
	ldr	x25, [x25, _erasesize@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_malloc
	cbz	x0, LBB0_18
; %bb.6:
	mov	x20, x0
	mov	w21, #0
Lloh16:
	adrp	x26, _errno@GOTPAGE
Lloh17:
	ldr	x26, [x26, _errno@GOTPAGEOFF]
Lloh18:
	adrp	x27, _EINTR@GOTPAGE
Lloh19:
	ldr	x27, [x27, _EINTR@GOTPAGEOFF]
Lloh20:
	adrp	x28, _stderr@GOTPAGE
Lloh21:
	ldr	x28, [x28, _stderr@GOTPAGEOFF]
Lloh22:
	adrp	x22, l_.str.2@PAGE
Lloh23:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x26]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.8:                                ;   in Loop: Header=BB0_9 Depth=1
	cmp	w24, #0
	b.le	LBB0_15
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	cmp	w24, w8
	csel	w23, w24, w8, lt
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	_read
	tbnz	w0, #31, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w0, #0
	ccmp	w0, w23, #0, ne
	b.ne	LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_mtd_block_is_bad
	cbz	x0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x28]
	str	x21, [sp]
	mov	x1, x22
	bl	_fprintf
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	sub	w24, w24, w23
	mov	w0, #1
	mov	x1, x20
	mov	x2, x23
	bl	_write
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	add	w21, w23, w21
	cmp	w24, #0
	b.gt	LBB0_9
LBB0_15:
	mov	w20, #0
LBB0_16:
	mov	x0, x19
	bl	_close
	b	LBB0_19
LBB0_17:
Lloh24:
	adrp	x8, _stderr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	str	x22, [sp]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
LBB0_18:
	mov	w20, #-1
LBB0_19:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	mov	w20, #-1
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_quiet,4,2                      ; @quiet
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Dumping %s ...\n"

l_.str.1:                               ; @.str.1
	.asciz	"Could not open mtd device: %s\n"

	.comm	_mtdsize,4,2                    ; @mtdsize
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_erasesize,4,2                  ; @erasesize
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.2:                               ; @.str.2
	.asciz	"skipping bad block at 0x%08x\n"

	.no_dead_strip	_mtd_dump
.subsections_via_symbols
