	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function event_device_add
_event_device_add:                      ## @event_device_add
	.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	%rdi, %r15
	movq	_EVENT_MAX_DEV@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	decq	%rsi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	_event_ida@GOTPCREL(%rip), %rdi
	callq	_ida_alloc_max
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%rbx), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movq	%rax, (%r15)
	movq	_queue_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_event_queue_new
	movl	%eax, 48(%rbx)
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	leaq	44(%rbx), %rdi
	callq	_spin_lock_init
	leaq	40(%rbx), %rdi
	callq	_init_waitqueue_head
	movl	$1, (%rbx)
	leaq	36(%rbx), %rdi
	movl	$1, %esi
	callq	_atomic_set
	movq	_event_major@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_MKDEV
	leaq	8(%rbx), %r15
	movl	%eax, 24(%rbx)
	movq	_event_class@GOTPCREL(%rip), %rax
	movq	%rax, 16(%rbx)
	movq	_free_device_data@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_EVENT_DEV_NAME_FMT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_dev_set_name
	movq	%r15, %rdi
	callq	_device_initialize
	movq	%rbx, %r12
	addq	$32, %r12
	movq	_event_fops@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_cdev_init
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_cdev_device_add
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_hangup_device
	jmp	LBB0_9
LBB0_1:
	addq	$8, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_dev_err
	jmp	LBB0_10
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_9:
	movq	_event_ida@GOTPCREL(%rip), %rdi
	movl	%r14d, %esi
	callq	_ida_simple_remove
	movl	%r15d, %r14d
LBB0_10:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%r14d, %r14d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_event_ida,4,2                  ## @event_ida
	.comm	_EVENT_MAX_DEV,8,3              ## @EVENT_MAX_DEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to find minor number: %d\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_queue_size,4,2                 ## @queue_size
	.comm	_event_major,4,2                ## @event_major
	.comm	_event_class,4,2                ## @event_class
	.comm	_free_device_data,4,2           ## @free_device_data
	.comm	_EVENT_DEV_NAME_FMT,4,2         ## @EVENT_DEV_NAME_FMT
	.comm	_event_fops,4,2                 ## @event_fops
	.no_dead_strip	_event_device_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function event_device_add
_event_device_add:                      ; @event_device_add
	.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	x21, x0
Lloh0:
	adrp	x8, _EVENT_MAX_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EVENT_MAX_DEV@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sub	x1, x8, #1
Lloh3:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x20]
Lloh5:
	adrp	x0, _event_ida@GOTPAGE
Lloh6:
	ldr	x0, [x0, _event_ida@GOTPAGEOFF]
	bl	_ida_alloc_max
	mov	x19, x0
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	w1, [x20]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x20, x0
	str	x0, [x21]
Lloh7:
	adrp	x8, _queue_size@GOTPAGE
Lloh8:
	ldr	x8, [x8, _queue_size@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_event_queue_new
	str	w0, [x20, #48]
	cbz	w0, LBB0_6
; %bb.3:
	add	x0, x20, #44
	bl	_spin_lock_init
	add	x0, x20, #40
	bl	_init_waitqueue_head
	mov	w8, #1
	mov	x0, x20
	str	w8, [x0], #36
	mov	w1, #1
	bl	_atomic_set
Lloh10:
	adrp	x8, _event_major@GOTPAGE
Lloh11:
	ldr	x8, [x8, _event_major@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_MKDEV
Lloh13:
	adrp	x8, _free_device_data@GOTPAGE
Lloh14:
	ldr	x8, [x8, _free_device_data@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	mov	x21, x20
	str	w8, [x21, #8]!
	str	w0, [x21, #16]
Lloh16:
	adrp	x8, _event_class@GOTPAGE
Lloh17:
	ldr	x8, [x8, _event_class@GOTPAGEOFF]
	str	x8, [x21, #8]
Lloh18:
	adrp	x8, _EVENT_DEV_NAME_FMT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EVENT_DEV_NAME_FMT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x19
	bl	_dev_set_name
	mov	x0, x21
	bl	_device_initialize
	add	x22, x21, #24
Lloh21:
	adrp	x1, _event_fops@GOTPAGE
Lloh22:
	ldr	x1, [x1, _event_fops@GOTPAGEOFF]
	mov	x0, x22
	bl	_cdev_init
	mov	x0, x22
	mov	x1, x21
	bl	_cdev_device_add
	cbz	w0, LBB0_10
; %bb.4:
	mov	x21, x0
	mov	x0, x20
	bl	_hangup_device
	b	LBB0_8
LBB0_5:
	add	x0, x21, #8
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
	b	LBB0_9
LBB0_6:
	mov	x0, x20
	bl	_kfree
LBB0_7:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
Lloh28:
	adrp	x0, _event_ida@GOTPAGE
Lloh29:
	ldr	x0, [x0, _event_ida@GOTPAGEOFF]
	mov	x1, x19
	bl	_ida_simple_remove
	mov	x19, x21
LBB0_9:
	mov	x0, x19
	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_10:
	mov	w19, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_event_ida,4,2                  ; @event_ida
	.comm	_EVENT_MAX_DEV,8,3              ; @EVENT_MAX_DEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to find minor number: %d\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_queue_size,4,2                 ; @queue_size
	.comm	_event_major,4,2                ; @event_major
	.comm	_event_class,4,2                ; @event_class
	.comm	_free_device_data,4,2           ; @free_device_data
	.comm	_EVENT_DEV_NAME_FMT,4,2         ; @EVENT_DEV_NAME_FMT
	.comm	_event_fops,4,2                 ; @event_fops
	.no_dead_strip	_event_device_add
.subsections_via_symbols
