	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function of_flash_remove
_of_flash_remove:                       ## @of_flash_remove
	.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, %r14
	callq	_dev_get_drvdata
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	%rax, %r15
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_dev_set_drvdata
	cmpq	$0, (%r15)
	je	LBB0_5
## %bb.2:
	movq	%r15, %rdi
	callq	_OF_FLASH_PARTS
	movq	(%r15), %rdi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	_del_mtd_partitions
	movq	%r15, %rdi
	callq	_OF_FLASH_PARTS
	movq	%rax, %rdi
	callq	_kfree
LBB0_5:
	cmpl	$0, 8(%r15)
	jle	LBB0_14
LBB0_6:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r14
	movslq	8(%r15), %rax
	addq	$24, %rbx
	cmpq	%rax, %r14
	jge	LBB0_14
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movq	(%rax,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	callq	_map_destroy
	movq	16(%r15), %rax
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%rax,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	callq	_iounmap
	movq	16(%r15), %rax
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%rax,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	callq	_release_resource
	movq	16(%r15), %rax
	movq	8(%rax,%rbx), %rdi
	callq	_kfree
	jmp	LBB0_13
LBB0_4:
	callq	_del_mtd_device
	cmpl	$0, 8(%r15)
	jg	LBB0_6
LBB0_14:
	movq	%r15, %rdi
	callq	_kfree
LBB0_15:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_of_flash_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function of_flash_remove
_of_flash_remove:                       ; @of_flash_remove
	.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
	bl	_dev_get_drvdata
	cbz	x0, LBB0_15
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	mov	x1, #0
	bl	_dev_set_drvdata
	ldr	x8, [x19]
	cbz	x8, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_OF_FLASH_PARTS
	mov	x8, x0
	ldr	x0, [x19]
	cbz	x8, LBB0_4
; %bb.3:
	bl	_del_mtd_partitions
	mov	x0, x19
	bl	_OF_FLASH_PARTS
	bl	_kfree
	b	LBB0_5
LBB0_4:
	bl	_del_mtd_device
LBB0_5:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.6:
	mov	x20, #0
	mov	x21, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19, #8]
	add	x20, x20, #24
	cmp	x21, x8
	b.ge	LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x0, [x8, x20]
	cbz	x0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_map_destroy
	ldr	x8, [x19, #16]
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x9, x8, x20
	ldr	x0, [x9, #16]
	cbz	x0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	bl	_iounmap
	ldr	x8, [x19, #16]
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x8, x8, x20
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_7
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	bl	_release_resource
	ldr	x8, [x19, #16]
	add	x8, x8, x20
	ldr	x0, [x8, #8]
	bl	_kfree
	b	LBB0_7
LBB0_14:
	mov	x0, x19
	bl	_kfree
LBB0_15:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_of_flash_remove
.subsections_via_symbols
