	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function event_alloc
_event_alloc:                           ## @event_alloc
	.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	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r13
	movl	$100000, %edi                   ## imm = 0x186A0
	callq	_msecs_to_jiffies
	testl	%r12d, %r12d
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	cmpl	%ebx, %r12d
	jne	LBB0_3
## %bb.8:
	leaq	4(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movl	%r12d, %r12d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r13), %edi
	movq	_ETNA_NR_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_find_first_zero_bit
	movl	%eax, (%r14,%r15,4)
	movslq	%eax, %rbx
	leaq	(,%rbx,4), %rdi
	addq	16(%r13), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	8(%r13), %esi
	movl	%ebx, %edi
	callq	_set_bit
	incq	%r15
	cmpq	%r15, %r12
	jne	LBB0_9
## %bb.10:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_1:
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_spin_lock
	movq	%r13, %rdi
LBB0_11:
	callq	_spin_unlock
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_4:
	movl	24(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	testl	%ebx, %ebx
	je	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_complete
	decl	%ebx
	jne	LBB0_5
LBB0_6:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait_for_completion_timeout failed"

	.comm	_ETNA_NR_EVENTS,4,2             ## @ETNA_NR_EVENTS
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_event_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function event_alloc
_event_alloc:                           ; @event_alloc
	.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	x20, x2
	mov	x22, x1
	mov	x19, x0
	mov	w0, #34464
	movk	w0, #1, lsl #16
	bl	_msecs_to_jiffies
	cbz	w22, LBB0_6
; %bb.1:
	mov	x1, x0
	mov	w21, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x1, x0
	add	w21, w21, #1
	cmp	w22, w21
	b.ne	LBB0_2
; %bb.4:
	add	x21, x19, #4
	mov	x0, x21
	bl	_spin_lock
	mov	w23, w22
Lloh0:
	adrp	x24, _ETNA_NR_EVENTS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ETNA_NR_EVENTS@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #8]
	ldr	w1, [x24]
	bl	_find_first_zero_bit
	mov	x22, x0
	str	w0, [x20], #4
	ldr	x8, [x19, #16]
	add	x0, x8, w0, sxtw #2
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w1, [x19, #8]
	mov	x0, x22
	bl	_set_bit
	subs	x23, x23, #1
	b.ne	LBB0_5
	b	LBB0_7
LBB0_6:
	add	x21, x19, #4
	mov	x0, x21
	bl	_spin_lock
LBB0_7:
	mov	x0, x21
	bl	_spin_unlock
	mov	w0, #0
	b	LBB0_11
LBB0_8:
	ldr	w0, [x19, #24]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	cbz	w21, LBB0_10
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_complete
	subs	w21, w21, #1
	b.ne	LBB0_9
LBB0_10:
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait_for_completion_timeout failed"

	.comm	_ETNA_NR_EVENTS,4,2             ; @ETNA_NR_EVENTS
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_event_alloc
.subsections_via_symbols
