	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function EventsQueue_GetEvent
_EventsQueue_GetEvent:                  ## @EventsQueue_GetEvent
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	movl	%edx, %esi
	callq	_WaitForSingleObject
	movq	_WAIT_OBJECT_0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	leaq	20(%rbx), %r14
	movq	%r14, %rdi
	callq	_EnterCriticalSection
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_4
## %bb.3:
	movq	_FALSE@GOTPCREL(%rip), %r15
	jmp	LBB0_9
LBB0_1:
	movq	_FALSE@GOTPCREL(%rip), %r15
	jmp	LBB0_10
LBB0_4:
	movq	32(%rbx), %rdx
	movl	(%rdx,%rax,4), %edx
	movl	%edx, (%r15)
	incq	%rax
	movslq	16(%rbx), %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_7
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_7:
	movq	%rdx, (%rbx)
	movq	_TRUE@GOTPCREL(%rip), %r15
	cmpq	%rcx, %rdx
	jne	LBB0_9
## %bb.8:
	movl	24(%rbx), %edi
	callq	_ResetEvent
LBB0_9:
	movq	%r14, %rdi
	callq	_LeaveCriticalSection
LBB0_10:
	movl	(%r15), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WAIT_OBJECT_0,8,3              ## @WAIT_OBJECT_0
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_EventsQueue_GetEvent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function EventsQueue_GetEvent
_EventsQueue_GetEvent:                  ; @EventsQueue_GetEvent
	.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, x1
	mov	x20, x0
	ldr	w0, [x0, #24]
	mov	x1, x2
	bl	_WaitForSingleObject
Lloh0:
	adrp	x8, _WAIT_OBJECT_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WAIT_OBJECT_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.1:
	add	x19, x20, #20
	mov	x0, x19
	bl	_EnterCriticalSection
	ldp	x9, x8, [x20]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.2:
Lloh3:
	adrp	x20, _FALSE@GOTPAGE
Lloh4:
	ldr	x20, [x20, _FALSE@GOTPAGEOFF]
	b	LBB0_7
LBB0_3:
Lloh5:
	adrp	x20, _FALSE@GOTPAGE
Lloh6:
	ldr	x20, [x20, _FALSE@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	ldr	x10, [x20, #32]
	ldr	w10, [x10, x9, lsl #2]
	str	w10, [x21]
	add	x9, x9, #1
	ldrsw	x10, [x20, #16]
	udiv	x11, x9, x10
	msub	x9, x11, x10, x9
	str	x9, [x20]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldr	w0, [x20, #24]
	bl	_ResetEvent
LBB0_6:
Lloh7:
	adrp	x20, _TRUE@GOTPAGE
Lloh8:
	ldr	x20, [x20, _TRUE@GOTPAGEOFF]
LBB0_7:
	mov	x0, x19
	bl	_LeaveCriticalSection
LBB0_8:
	ldr	w0, [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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_WAIT_OBJECT_0,8,3              ; @WAIT_OBJECT_0
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_EventsQueue_GetEvent
.subsections_via_symbols
