	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function evdev_connect
_evdev_connect:                         ## @evdev_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_EVDEV_MINOR_BASE@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_EVDEV_MINORS@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$1, %edx
	callq	_input_get_new_minor
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$88, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	leaq	80(%rax), %rdi
	callq	_INIT_LIST_HEAD
	leaq	76(%rbx), %rdi
	callq	_spin_lock_init
	leaq	72(%rbx), %rdi
	callq	_mutex_init
	leaq	68(%rbx), %rdi
	callq	_init_waitqueue_head
	movl	$1, (%rbx)
	movl	(%r14), %eax
	movl	(%r12), %ecx
	addl	%eax, %ecx
	xorl	%r14d, %r14d
	cmpl	%ecx, %r13d
	cmovgel	%r14d, %eax
	movl	%r13d, %edx
	subl	%eax, %edx
	leaq	8(%rbx), %r12
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_set_name
	movq	%r15, %rdi
	callq	_input_get_device
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	leaq	40(%rbx), %r15
	movl	%eax, 60(%rbx)
	movq	%r12, %rdi
	callq	_dev_name
	movl	%eax, 56(%rbx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 48(%rbx)
	movq	%rbx, 40(%rbx)
	movq	_INPUT_MAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_MKDEV
	movl	%eax, 32(%rbx)
	movq	_input_class@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%rbx)
	movq	_evdev_free@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%r12, %rdi
	callq	_device_initialize
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_input_register_handle
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	%rbx, %r15
	addq	$64, %r15
	movq	_evdev_fops@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_cdev_init
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_cdev_device_add
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_evdev_cleanup
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_input_unregister_handle
LBB0_7:
	movq	%r12, %rdi
	callq	_put_device
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_pr_err
	movl	%r13d, %r14d
	jmp	LBB0_9
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movl	%r13d, %edi
	callq	_input_free_minor
	movl	%r15d, %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVDEV_MINOR_BASE,4,2           ## @EVDEV_MINOR_BASE
	.comm	_EVDEV_MINORS,4,2               ## @EVDEV_MINORS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to reserve new minor: %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"event%d"

	.comm	_INPUT_MAJOR,4,2                ## @INPUT_MAJOR
	.comm	_input_class,4,2                ## @input_class
	.comm	_evdev_free,4,2                 ## @evdev_free
	.comm	_evdev_fops,4,2                 ## @evdev_fops
	.no_dead_strip	_evdev_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function evdev_connect
_evdev_connect:                         ; @evdev_connect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x23, x0
Lloh0:
	adrp	x22, _EVDEV_MINOR_BASE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _EVDEV_MINOR_BASE@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x24, _EVDEV_MINORS@GOTPAGE
Lloh3:
	ldr	x24, [x24, _EVDEV_MINORS@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	w2, #1
	bl	_input_get_new_minor
	mov	x19, x0
	tbnz	w0, #31, LBB0_6
; %bb.1:
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #88
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x20, x0
	add	x0, x0, #80
	bl	_INIT_LIST_HEAD
	add	x0, x20, #76
	bl	_spin_lock_init
	add	x0, x20, #72
	bl	_mutex_init
	add	x0, x20, #68
	bl	_init_waitqueue_head
	mov	w8, #1
	str	w8, [x20]
	ldr	w8, [x22]
	ldr	w9, [x24]
	add	w9, w9, w8
	cmp	w19, w9
	csel	w8, w8, wzr, lt
	sub	w2, w19, w8
	add	x22, x20, #8
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_set_name
	mov	x0, x21
	bl	_input_get_device
	add	x24, x20, #40
	str	w0, [x20, #60]
	mov	x0, x22
	bl	_dev_name
	str	w0, [x20, #56]
	stp	x20, x23, [x20, #40]
Lloh9:
	adrp	x8, _INPUT_MAJOR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _INPUT_MAJOR@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_MKDEV
	str	w0, [x20, #32]
Lloh12:
	adrp	x8, _input_class@GOTPAGE
Lloh13:
	ldr	x8, [x8, _input_class@GOTPAGEOFF]
	stp	x21, x8, [x20, #16]
Lloh14:
	adrp	x8, _evdev_free@GOTPAGE
Lloh15:
	ldr	x8, [x8, _evdev_free@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	mov	x0, x22
	bl	_device_initialize
	mov	x0, x24
	bl	_input_register_handle
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.3:
	add	x21, x20, #64
Lloh17:
	adrp	x1, _evdev_fops@GOTPAGE
Lloh18:
	ldr	x1, [x1, _evdev_fops@GOTPAGEOFF]
	mov	x0, x21
	bl	_cdev_init
	mov	x0, x21
	mov	x1, x22
	bl	_cdev_device_add
	cbz	w0, LBB0_10
; %bb.4:
	mov	x21, x0
	mov	x0, x20
	bl	_evdev_cleanup
	mov	x0, x24
	bl	_input_unregister_handle
LBB0_5:
	mov	x0, x22
	bl	_put_device
	b	LBB0_8
LBB0_6:
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_pr_err
	b	LBB0_9
LBB0_7:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x19
	bl	_input_free_minor
	mov	x19, x21
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	w19, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EVDEV_MINOR_BASE,4,2           ; @EVDEV_MINOR_BASE
	.comm	_EVDEV_MINORS,4,2               ; @EVDEV_MINORS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to reserve new minor: %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"event%d"

	.comm	_INPUT_MAJOR,4,2                ; @INPUT_MAJOR
	.comm	_input_class,4,2                ; @input_class
	.comm	_evdev_free,4,2                 ; @evdev_free
	.comm	_evdev_fops,4,2                 ; @evdev_fops
	.no_dead_strip	_evdev_connect
.subsections_via_symbols
