	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function button_hotplug_connect
_button_hotplug_connect:                ## @button_hotplug_connect
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	_button_map@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_3
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	movl	4(%r13), %esi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	incq	%rbx
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_1
LBB0_3:
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jne	LBB0_6
## %bb.4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
                                        ## kill: def $eax killed $eax def $rax
	leal	40(,%rax,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r15
	addq	$40, %rax
	movq	%rax, (%r15)
	movq	%r15, %r12
	addq	$8, %r12
	movq	%r15, 32(%r15)
	movq	%r13, 24(%r15)
	movq	%r14, 16(%r15)
	movq	_DRV_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	%r12, %rdi
	callq	_input_register_handle
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	movq	%r12, %rdi
	callq	_input_open_device
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_input_unregister_handle
LBB0_12:
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_13
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r13), %esi
	leaq	L_.str(%rip), %rdi
	callq	_BH_DBG
	xorl	%r14d, %r14d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_button_map,8,3                 ## @button_map
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DRV_NAME,4,2                   ## @DRV_NAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"connected to %s\n"

	.no_dead_strip	_button_hotplug_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function button_hotplug_connect
_button_hotplug_connect:                ; @button_hotplug_connect
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _button_map@GOTPAGE
Lloh1:
	ldr	x21, [x21, _button_map@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	w0, [x8, x22, lsl #2]
	ldr	w1, [x19, #4]
	bl	_test_bit
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x22, #1
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	x22, w0, sxtw
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w22, #0
LBB0_5:
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w22, w0
	b.ne	LBB0_7
; %bb.6:
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	lsl	w8, w0, #3
	add	w0, w8, #40
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_12
; %bb.8:
	mov	x21, x0
	add	x8, x0, #40
	str	x8, [x0]
Lloh7:
	adrp	x8, _DRV_NAME@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DRV_NAME@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	mov	x22, x0
	str	w8, [x22, #8]!
	stp	x19, x0, [x0, #24]
	str	x20, [x0, #16]
	mov	x0, x22
	bl	_input_register_handle
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.9:
	mov	x0, x22
	bl	_input_open_device
	mov	x20, x0
	cbz	w0, LBB0_15
; %bb.10:
	mov	x0, x22
	bl	_input_unregister_handle
LBB0_11:
	mov	x0, x21
	bl	_kfree
	b	LBB0_14
LBB0_12:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_14:
	mov	x0, x20
	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
LBB0_15:
	ldr	w1, [x19]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BH_DBG
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_button_map,8,3                 ; @button_map
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DRV_NAME,4,2                   ; @DRV_NAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"connected to %s\n"

	.no_dead_strip	_button_hotplug_connect
.subsections_via_symbols
