	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iohidmanager_hid_device_remove
_iohidmanager_hid_device_remove:        ## @iohidmanager_hid_device_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, %rbx
	xorl	%eax, %eax
	callq	_hid_driver_get_data
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.1:
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	(%rbx), %rdi
	movq	_MAX_USERS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jae	LBB0_4
## %bb.3:
	movl	40(%rbx), %esi
	callq	_input_autoconfigure_disconnect
	movq	16(%r14), %rax
	movq	(%rbx), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %edi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	(%rbx), %rsi
	leaq	(,%rsi,4), %rdi
	addq	(%r14), %rdi
	callq	_pad_connection_pad_deinit
LBB0_4:
	testq	%rbx, %rbx
	je	LBB0_11
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rdi), %rax
	movq	%rax, 32(%rbx)
	callq	_free
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%rdi), %rax
	movq	%rax, 24(%rbx)
	callq	_free
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	jne	LBB0_7
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%rdi), %rax
	movq	%rax, 16(%rbx)
	callq	_free
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	jne	LBB0_8
## %bb.10:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_free                           ## TAILCALL
LBB0_11:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_USERS,8,3                  ## @MAX_USERS
	.no_dead_strip	_iohidmanager_hid_device_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iohidmanager_hid_device_remove
_iohidmanager_hid_device_remove:        ; @iohidmanager_hid_device_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
	mov	x19, x0
	bl	_hid_driver_get_data
	cbz	x19, LBB0_4
; %bb.1:
	mov	x20, x0
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x0, [x19]
Lloh0:
	adrp	x8, _MAX_USERS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_USERS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.hs	LBB0_4
; %bb.3:
	ldr	w1, [x19, #40]
	bl	_input_autoconfigure_disconnect
	ldr	x8, [x19]
	ldp	x10, x9, [x20, #8]
	str	xzr, [x9, x8, lsl #3]
	ldr	x8, [x19]
	ldr	w0, [x10, x8, lsl #2]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [x20]
	ldr	x1, [x19]
	add	x0, x8, x1, lsl #2
	bl	_pad_connection_pad_deinit
LBB0_4:
	cbz	x19, LBB0_12
; %bb.5:
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x0, #8]
	str	x8, [x19, #32]
	bl	_free
	ldr	x0, [x19, #32]
	cbnz	x0, LBB0_6
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x0, #8]
	str	x8, [x19, #24]
	bl	_free
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #24]
	cbnz	x0, LBB0_7
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x0, #8]
	str	x8, [x19, #16]
	bl	_free
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #16]
	cbnz	x0, LBB0_9
; %bb.11:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_free
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_USERS,8,3                  ; @MAX_USERS
	.no_dead_strip	_iohidmanager_hid_device_remove
.subsections_via_symbols
