	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_destroy
_wiimote_destroy:                       ## @wiimote_destroy
	.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, %rbx
	callq	_wiidebug_deinit
	leaq	20(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_WIIPROTO_FLAG_EXITING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	leaq	16(%rbx), %rdi
	callq	_cancel_work_sync
	leaq	12(%rbx), %rdi
	callq	_del_timer_sync
	movq	(%rbx), %rdi
	movq	_dev_attr_devtype@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
	movq	(%rbx), %rdi
	movq	_dev_attr_extension@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
	movq	%rbx, %rdi
	callq	_wiimote_mp_unload
	movq	%rbx, %rdi
	callq	_wiimote_ext_unload
	movq	%rbx, %rdi
	callq	_wiimote_modules_unload
	leaq	8(%rbx), %rdi
	callq	_cancel_work_sync
	movq	(%rbx), %rdi
	callq	_hid_hw_close
	movq	(%rbx), %rdi
	callq	_hid_hw_stop
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WIIPROTO_FLAG_EXITING,4,2      ## @WIIPROTO_FLAG_EXITING
	.comm	_dev_attr_devtype,4,2           ## @dev_attr_devtype
	.comm	_dev_attr_extension,4,2         ## @dev_attr_extension
	.no_dead_strip	_wiimote_destroy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_destroy
_wiimote_destroy:                       ; @wiimote_destroy
	.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
	bl	_wiidebug_deinit
	add	x20, x19, #20
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh0:
	adrp	x8, _WIIPROTO_FLAG_EXITING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WIIPROTO_FLAG_EXITING@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #24]
	orr	w8, w9, w8
	str	w8, [x19, #24]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	add	x0, x19, #16
	bl	_cancel_work_sync
	add	x0, x19, #12
	bl	_del_timer_sync
	ldr	x0, [x19]
Lloh3:
	adrp	x1, _dev_attr_devtype@GOTPAGE
Lloh4:
	ldr	x1, [x1, _dev_attr_devtype@GOTPAGEOFF]
	bl	_device_remove_file
	ldr	x0, [x19]
Lloh5:
	adrp	x1, _dev_attr_extension@GOTPAGE
Lloh6:
	ldr	x1, [x1, _dev_attr_extension@GOTPAGEOFF]
	bl	_device_remove_file
	mov	x0, x19
	bl	_wiimote_mp_unload
	mov	x0, x19
	bl	_wiimote_ext_unload
	mov	x0, x19
	bl	_wiimote_modules_unload
	add	x0, x19, #8
	bl	_cancel_work_sync
	ldr	x0, [x19]
	bl	_hid_hw_close
	ldr	x0, [x19]
	bl	_hid_hw_stop
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_WIIPROTO_FLAG_EXITING,4,2      ; @WIIPROTO_FLAG_EXITING
	.comm	_dev_attr_devtype,4,2           ; @dev_attr_devtype
	.comm	_dev_attr_extension,4,2         ; @dev_attr_extension
	.no_dead_strip	_wiimote_destroy
.subsections_via_symbols
