	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_bad_peb_limit
_get_bad_peb_limit:                     ## @get_bad_peb_limit
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testl	%esi, %esi
	je	LBB0_1
## %bb.3:
	movl	%esi, %r14d
	callq	_mtd_get_device_size
	movq	(%rbx), %rsi
	movl	%eax, %edi
	callq	_mtd_div_by_eb
	movl	%eax, %r15d
	movl	%eax, %edi
	movl	%r14d, %esi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_mult_frac
	movl	%eax, %ebx
	movl	%eax, %edi
	movl	$1024, %esi                     ## imm = 0x400
	movl	%r14d, %edx
	callq	_mult_frac
	xorl	%ecx, %ecx
	cmpl	%r15d, %eax
	setl	%cl
	addl	%ebx, %ecx
	movl	%ecx, %eax
	jmp	LBB0_2
LBB0_1:
	movl	(%rdi), %edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_mtd_max_bad_blocks
	testl	%eax, %eax
	cmovlel	%ebx, %eax
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_get_bad_peb_limit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_bad_peb_limit
_get_bad_peb_limit:                     ; @get_bad_peb_limit
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
	ldr	x0, [x0]
	cbz	w1, LBB0_2
; %bb.1:
	mov	x19, x1
	bl	_mtd_get_device_size
	ldr	x1, [x20]
	bl	_mtd_div_by_eb
	mov	x20, x0
	mov	x1, x19
	mov	w2, #1024
	bl	_mult_frac
	mov	x21, x0
	mov	w1, #1024
	mov	x2, x19
	bl	_mult_frac
	cmp	w0, w20
	cinc	w0, w21, lt
	b	LBB0_3
LBB0_2:
	ldr	w2, [x0]
	bl	_mtd_max_bad_blocks
	cmp	w0, #0
	csel	w0, w0, wzr, gt
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_get_bad_peb_limit
.subsections_via_symbols
