	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nanddev_mtd_max_bad_blocks     ## -- Begin function nanddev_mtd_max_bad_blocks
	.p2align	4, 0x90
_nanddev_mtd_max_bad_blocks:            ## @nanddev_mtd_max_bad_blocks
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r15
	callq	_mtd_to_nanddev
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	leaq	-56(%rbp), %r12
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_nanddev_offs_to_pos
	addq	%r15, %rbx
	leaq	-48(%rbp), %r13
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_nanddev_offs_to_pos
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_nanddev_offs_to_pos
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_nanddev_pos_cmp
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %r15
	leaq	-48(%rbp), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	addl	(%r14), %ebx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_nanddev_pos_next_lun
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_nanddev_pos_cmp
	testq	%rax, %rax
	js	LBB0_4
	jmp	LBB0_5
LBB0_1:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nanddev_mtd_max_bad_blocks     ; -- Begin function nanddev_mtd_max_bad_blocks
	.p2align	2
_nanddev_mtd_max_bad_blocks:            ; @nanddev_mtd_max_bad_blocks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x2
	mov	x20, x1
	bl	_mtd_to_nanddev
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x2, sp, #8
	mov	x1, x20
	bl	_nanddev_offs_to_pos
	add	x1, x21, x20
	mov	x2, sp
	mov	x0, x19
	bl	_nanddev_offs_to_pos
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x20
	bl	_nanddev_offs_to_pos
	add	x0, sp, #8
	mov	x1, sp
	bl	_nanddev_pos_cmp
	mov	w20, #0
	tbz	x0, #63, LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	add	w20, w20, w8
	add	x1, sp, #8
	mov	x0, x19
	bl	_nanddev_pos_next_lun
	add	x0, sp, #8
	mov	x1, sp
	bl	_nanddev_pos_cmp
	tbnz	x0, #63, LBB0_2
	b	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
.subsections_via_symbols
