	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uinput_destroy_device
_uinput_destroy_device:                 ## @uinput_destroy_device
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rbx
	movl	(%rdi), %eax
	movq	_UIST_NEW_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rdi)
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.1:
	movq	%rdi, %r15
	movq	(%rbx), %r12
	movq	8(%rbx), %r14
	movq	_UIST_CREATED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_uinput_flush_requests
	movq	%rbx, %rdi
	callq	_input_unregister_device
	jmp	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	callq	_input_free_device
LBB0_4:
	movq	%r12, %rdi
	callq	_kfree
	movq	%r14, %rdi
	callq	_kfree
	movq	$0, 8(%r15)
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UIST_NEW_DEVICE,4,2            ## @UIST_NEW_DEVICE
	.comm	_UIST_CREATED,4,2               ## @UIST_CREATED
	.no_dead_strip	_uinput_destroy_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uinput_destroy_device
_uinput_destroy_device:                 ; @uinput_destroy_device
	.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
	ldr	x21, [x0, #8]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _UIST_NEW_DEVICE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UIST_NEW_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	str	w9, [x0]
	cbz	x21, LBB0_5
; %bb.1:
	mov	x19, x0
	ldp	x22, x20, [x21]
Lloh3:
	adrp	x9, _UIST_CREATED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _UIST_CREATED@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_uinput_flush_requests
	mov	x0, x21
	bl	_input_unregister_device
	b	LBB0_4
LBB0_3:
	mov	x0, x21
	bl	_input_free_device
LBB0_4:
	mov	x0, x22
	bl	_kfree
	mov	x0, x20
	bl	_kfree
	str	xzr, [x19, #8]
LBB0_5:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_UIST_NEW_DEVICE,4,2            ; @UIST_NEW_DEVICE
	.comm	_UIST_CREATED,4,2               ; @UIST_CREATED
	.no_dead_strip	_uinput_destroy_device
.subsections_via_symbols
