	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtd_close
_mtd_close:                             ## @mtd_close
	.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	%rsi, %rbx
	movq	8(%rsi), %r14
	movq	(%r14), %r15
	movq	_MTD_DEBUG_LEVEL0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DEBUG
	movq	_FMODE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.1:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	*%rax
LBB0_3:
	movq	%r15, %rdi
	callq	_put_mtd_device
	movq	$0, 8(%rbx)
	movq	%r14, %rdi
	callq	_kfree
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTD_DEBUG_LEVEL0,4,2           ## @MTD_DEBUG_LEVEL0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MTD_close\n"

	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
	.no_dead_strip	_mtd_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtd_close
_mtd_close:                             ; @mtd_close
	.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, x1
	ldr	x19, [x1, #8]
	ldr	x21, [x19]
Lloh0:
	adrp	x8, _MTD_DEBUG_LEVEL0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTD_DEBUG_LEVEL0@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DEBUG
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _FMODE_WRITE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FMODE_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	x8, [x21]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x21
	blr	x8
LBB0_3:
	mov	x0, x21
	bl	_put_mtd_device
	str	xzr, [x20, #8]
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MTD_DEBUG_LEVEL0,4,2           ; @MTD_DEBUG_LEVEL0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MTD_close\n"

	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
	.no_dead_strip	_mtd_close
.subsections_via_symbols
