	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_cleanup                   ## -- Begin function nand_cleanup
	.p2align	4, 0x90
_nand_cleanup:                          ## @nand_cleanup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	_NAND_ECC_SOFT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	16(%rbx), %rax
	movq	_NAND_ECC_BCH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	40(%rbx), %rdi
	callq	_nand_bch_free
LBB0_3:
	movq	56(%rbx), %rdi
	callq	_kfree
	movq	48(%rbx), %rdi
	callq	_kfree
	movq	32(%rbx), %rdi
	callq	_kfree
	movq	24(%rbx), %rdi
	callq	_kfree
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:
	movq	_NAND_BBT_DYNAMICSTRUCT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_6
## %bb.5:
	callq	_kfree
LBB0_6:
	movq	%rbx, %rdi
	callq	_nand_manufacturer_cleanup
	movq	%rbx, %rdi
	callq	_nand_detach
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_nand_scan_ident_cleanup        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ECC_SOFT,8,3              ## @NAND_ECC_SOFT
	.comm	_NAND_ECC_BCH,8,3               ## @NAND_ECC_BCH
	.comm	_NAND_BBT_DYNAMICSTRUCT,4,2     ## @NAND_BBT_DYNAMICSTRUCT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nand_cleanup                   ; -- Begin function nand_cleanup
	.p2align	2
_nand_cleanup:                          ; @nand_cleanup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _NAND_ECC_SOFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_ECC_SOFT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x19, #16]
Lloh3:
	adrp	x9, _NAND_ECC_BCH@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NAND_ECC_BCH@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	x0, [x19, #40]
	bl	_nand_bch_free
LBB0_3:
	ldr	x0, [x19, #56]
	bl	_kfree
	ldr	x0, [x19, #48]
	bl	_kfree
	ldr	x0, [x19, #32]
	bl	_kfree
	ldr	x0, [x19, #24]
	bl	_kfree
	ldr	x0, [x19]
	cbz	x0, LBB0_6
; %bb.4:
	ldr	w8, [x0]
Lloh6:
	adrp	x9, _NAND_BBT_DYNAMICSTRUCT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NAND_BBT_DYNAMICSTRUCT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	bl	_kfree
LBB0_6:
	mov	x0, x19
	bl	_nand_manufacturer_cleanup
	mov	x0, x19
	bl	_nand_detach
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_nand_scan_ident_cleanup
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_SOFT,8,3              ; @NAND_ECC_SOFT
	.comm	_NAND_ECC_BCH,8,3               ; @NAND_ECC_BCH
	.comm	_NAND_BBT_DYNAMICSTRUCT,4,2     ; @NAND_BBT_DYNAMICSTRUCT
.subsections_via_symbols
