	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pad
_pad:                                   ## @pad
	.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	%edi, %ebx
	movq	_ofs@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movq	_erasesize@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%edx, %edx
	jne	LBB0_2
## %bb.1:
	cmpl	%esi, %ecx
	jl	LBB0_13
LBB0_2:
	cmpl	%esi, %ecx
	jge	LBB0_4
## %bb.3:
	movslq	%ecx, %rdi
	movq	_buf@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	$255, %esi
	movl	%eax, %edx
	callq	_memset
	movl	(%r15), %ecx
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	addl	%ebx, %ecx
	subl	%edx, %ecx
	movq	_erasesize@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_4:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%edx, (%r15)
	testl	%edx, %edx
	jne	LBB0_13
## %bb.5:
	movq	_outfd@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_mtdofs@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	callq	_mtd_block_is_bad
	movq	(%rbx), %rdx
	testq	%rax, %rax
	je	LBB0_12
## %bb.6:
	movq	_mtdsize@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rdx
	jge	LBB0_12
## %bb.7:
	movq	_quiet@GOTPCREL(%rip), %r15
	movq	_SEEK_CUR@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r15)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	movq	(%rbx), %rdx
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	_erasesize@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	addq	%rsi, %rdx
	movq	%rdx, (%rbx)
	movl	(%r12), %edi
	movl	(%r14), %edx
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_lseek
	movl	(%r12), %edi
	movq	(%rbx), %rsi
	callq	_mtd_block_is_bad
	movq	(%rbx), %rdx
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpq	(%r13), %rdx
	jl	LBB0_8
LBB0_12:
	movl	(%r12), %edi
	movq	%rdx, %rsi
	callq	_mtd_erase_block
	movl	(%r12), %edi
	movq	_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_erasesize@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	callq	_write
	movslq	(%r14), %rax
	addq	%rax, (%rbx)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ofs,4,2                        ## @ofs
	.comm	_erasesize,4,2                  ## @erasesize
	.comm	_buf,8,3                        ## @buf
	.comm	_outfd,4,2                      ## @outfd
	.comm	_mtdofs,8,3                     ## @mtdofs
	.comm	_mtdsize,8,3                    ## @mtdsize
	.comm	_quiet,4,2                      ## @quiet
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\nSkipping bad block at 0x%08x   "

	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.no_dead_strip	_pad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pad
_pad:                                   ; @pad
	.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
Lloh0:
	adrp	x21, _ofs@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ofs@GOTPAGEOFF]
	ldr	w8, [x21]
	sdiv	w9, w8, w0
	msub	w10, w9, w0, w8
Lloh2:
	adrp	x20, _erasesize@GOTPAGE
Lloh3:
	ldr	x20, [x20, _erasesize@GOTPAGEOFF]
	ldr	w9, [x20]
	cmp	w10, #0
	ccmp	w8, w9, #0, eq
	b.lt	LBB0_11
; %bb.1:
	cmp	w8, w9
	b.ge	LBB0_3
; %bb.2:
	mov	x19, x0
	sxtw	x8, w8
Lloh4:
	adrp	x9, _buf@GOTPAGE
Lloh5:
	ldr	x9, [x9, _buf@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x0, x9, x8
	sub	w2, w19, w10
	mov	w1, #255
	bl	_memset
	ldr	w8, [x21]
	sdiv	w9, w8, w19
	neg	w10, w8
	madd	w9, w9, w19, w10
	add	w8, w8, w19
	add	w8, w8, w9
	ldr	w9, [x20]
LBB0_3:
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	str	w8, [x21]
	cbnz	w8, LBB0_11
; %bb.4:
Lloh7:
	adrp	x22, _outfd@GOTPAGE
Lloh8:
	ldr	x22, [x22, _outfd@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh9:
	adrp	x21, _mtdofs@GOTPAGE
Lloh10:
	ldr	x21, [x21, _mtdofs@GOTPAGEOFF]
	ldr	x1, [x21]
	bl	_mtd_block_is_bad
	ldr	x2, [x21]
	cbz	x0, LBB0_10
; %bb.5:
Lloh11:
	adrp	x23, _mtdsize@GOTPAGE
Lloh12:
	ldr	x23, [x23, _mtdsize@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x2, x8
	b.ge	LBB0_10
; %bb.6:
Lloh13:
	adrp	x24, _quiet@GOTPAGE
Lloh14:
	ldr	x24, [x24, _quiet@GOTPAGEOFF]
Lloh15:
	adrp	x25, _stderr@GOTPAGE
Lloh16:
	ldr	x25, [x25, _stderr@GOTPAGEOFF]
Lloh17:
	adrp	x19, l_.str@PAGE
Lloh18:
	add	x19, x19, l_.str@PAGEOFF
Lloh19:
	adrp	x26, _SEEK_CUR@GOTPAGE
Lloh20:
	ldr	x26, [x26, _SEEK_CUR@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldrsw	x1, [x20]
	add	x8, x2, x1
	str	x8, [x21]
	ldr	w0, [x22]
	ldr	w2, [x26]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_lseek
	ldr	w0, [x22]
	ldr	x1, [x21]
	bl	_mtd_block_is_bad
	ldr	x2, [x21]
	ldr	x8, [x23]
	cmp	x0, #0
	ccmp	x2, x8, #0, ne
	b.ge	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cbnz	w8, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x25]
	mov	x1, x19
	bl	_fprintf
	ldr	x2, [x21]
	b	LBB0_7
LBB0_10:
	ldr	w0, [x22]
	mov	x1, x2
	bl	_mtd_erase_block
	ldr	w0, [x22]
Lloh21:
	adrp	x8, _buf@GOTPAGE
Lloh22:
	ldr	x8, [x8, _buf@GOTPAGEOFF]
Lloh23:
	ldr	x1, [x8]
	ldr	w2, [x20]
	bl	_write
	ldrsw	x8, [x20]
	ldr	x9, [x21]
	add	x8, x9, x8
	str	x8, [x21]
LBB0_11:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ofs,4,2                        ; @ofs
	.comm	_erasesize,4,2                  ; @erasesize
	.comm	_buf,8,3                        ; @buf
	.comm	_outfd,4,2                      ; @outfd
	.comm	_mtdofs,8,3                     ; @mtdofs
	.comm	_mtdsize,8,3                    ; @mtdsize
	.comm	_quiet,4,2                      ; @quiet
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\nSkipping bad block at 0x%08x   "

	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.no_dead_strip	_pad
.subsections_via_symbols
