	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtd_check_oob_ops
_mtd_check_oob_ops:                     ## @mtd_check_oob_ops
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	cmpl	$0, 28(%rdx)
	je	LBB0_1
## %bb.2:
	cmpl	$0, 24(%rbx)
	je	LBB0_3
LBB0_4:
	testq	%r12, %r12
	jns	LBB0_5
	jmp	LBB0_9
LBB0_1:
	movq	$0, (%rbx)
	cmpl	$0, 24(%rbx)
	jne	LBB0_4
LBB0_3:
	movq	$0, 8(%rbx)
	testq	%r12, %r12
	js	LBB0_9
LBB0_5:
	movq	(%rbx), %rax
	addq	%r12, %rax
	cmpq	(%r15), %rax
	jg	LBB0_9
## %bb.6:
	xorl	%r14d, %r14d
	cmpq	$0, 8(%rbx)
	je	LBB0_10
## %bb.7:
	movq	16(%rbx), %r13
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mtd_oobavail
	cmpq	%rax, %r13
	jae	LBB0_9
## %bb.8:
	movq	(%r15), %rdi
	movq	%r15, %rsi
	callq	_mtd_div_by_ws
	movq	%rax, %r13
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_mtd_div_by_ws
	subq	%rax, %r13
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mtd_oobavail
	imulq	%r13, %rax
	subq	16(%rbx), %rax
	cmpq	%rax, 8(%rbx)
	jbe	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mtd_check_oob_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtd_check_oob_ops
_mtd_check_oob_ops:                     ; @mtd_check_oob_ops
	.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	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w8, [x2, #28]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_4
LBB0_2:
	tbz	x21, #63, LBB0_5
	b	LBB0_9
LBB0_3:
	str	xzr, [x19]
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_2
LBB0_4:
	str	xzr, [x19, #8]
	tbnz	x21, #63, LBB0_9
LBB0_5:
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x8, x8, x21
	cmp	x8, x9
	b.gt	LBB0_9
; %bb.6:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.7:
	ldr	x22, [x19, #16]
	mov	x0, x20
	mov	x1, x19
	bl	_mtd_oobavail
	cmp	x22, x0
	b.hs	LBB0_9
; %bb.8:
	ldr	x0, [x20]
	mov	x1, x20
	bl	_mtd_div_by_ws
	mov	x22, x0
	mov	x0, x21
	mov	x1, x20
	bl	_mtd_div_by_ws
	sub	x21, x22, x0
	mov	x0, x20
	mov	x1, x19
	bl	_mtd_oobavail
	ldp	x9, x8, [x19, #8]
	neg	x8, x8
	madd	x8, x21, x0, x8
	cmp	x9, x8
	b.ls	LBB0_11
LBB0_9:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
LBB0_11:
	mov	w0, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mtd_check_oob_ops
.subsections_via_symbols
