	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mg_remove
_mg_remove:                             ## @mg_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %r14
	movq	16(%r14), %rbx
	leaq	48(%rbx), %rdi
	callq	_del_timer_sync
	movq	40(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_del_gendisk
	movq	40(%rbx), %rdi
	callq	_put_disk
LBB0_2:
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_blk_cleanup_queue
LBB0_4:
	movl	28(%rbx), %edi
	movq	_MG_DISK_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_unregister_blkdev
	cmpl	$0, 8(%r14)
	jne	LBB0_6
## %bb.5:
	movl	24(%rbx), %edi
	movq	%rbx, %rsi
	callq	_free_irq
LBB0_6:
	movq	(%r14), %rax
	movq	_MG_BOOT_DEV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.7:
	movq	16(%rbx), %rdi
	callq	_gpio_free
LBB0_8:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_gpio_free
LBB0_10:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	callq	_iounmap
LBB0_12:
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MG_DISK_NAME,4,2               ## @MG_DISK_NAME
	.comm	_MG_BOOT_DEV,8,3                ## @MG_BOOT_DEV
	.no_dead_strip	_mg_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mg_remove
_mg_remove:                             ; @mg_remove
	.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
	ldr	x20, [x0]
	ldr	x19, [x20, #16]
	add	x0, x19, #48
	bl	_del_timer_sync
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_del_gendisk
	ldr	x0, [x19, #40]
	bl	_put_disk
LBB0_2:
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_blk_cleanup_queue
LBB0_4:
	ldr	w0, [x19, #28]
Lloh0:
	adrp	x8, _MG_DISK_NAME@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MG_DISK_NAME@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_unregister_blkdev
	ldr	w8, [x20, #8]
	cbnz	w8, LBB0_6
; %bb.5:
	ldr	w0, [x19, #24]
	mov	x1, x19
	bl	_free_irq
LBB0_6:
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _MG_BOOT_DEV@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MG_BOOT_DEV@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.7:
	ldr	x0, [x19, #16]
	bl	_gpio_free
LBB0_8:
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_gpio_free
LBB0_10:
	ldr	x0, [x19]
	cbz	x0, LBB0_12
; %bb.11:
	bl	_iounmap
LBB0_12:
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MG_DISK_NAME,4,2               ; @MG_DISK_NAME
	.comm	_MG_BOOT_DEV,8,3                ; @MG_BOOT_DEV
	.no_dead_strip	_mg_remove
.subsections_via_symbols
