	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function EventsQueue_PutEvent
_EventsQueue_PutEvent:                  ## @EventsQueue_PutEvent
	.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, %r15
	movq	%rdi, %rbx
	leaq	12(%rdi), %r14
	movq	%r14, %rdi
	callq	_EnterCriticalSection
	movl	(%rbx), %esi
	movl	4(%rbx), %ecx
	leal	1(%rcx), %eax
	movl	8(%rbx), %r12d
	cltd
	idivl	%r12d
	cmpl	%edx, %esi
	jne	LBB0_3
## %bb.1:
	movq	_EVENTS_RING_BUFFER_INCREMENT@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	addl	%r12d, %eax
	movl	%eax, 8(%rbx)
	movslq	%eax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	movq	24(%rbx), %rdi
	movl	8(%rbx), %esi
	shll	$2, %esi
	callq	_CoTaskMemRealloc
	movq	%rax, 24(%rbx)
	movl	4(%rbx), %ecx
	movslq	(%rbx), %rdx
	cmpl	%edx, %ecx
	jge	LBB0_3
## %bb.2:
	movq	(%r13), %rcx
	addq	%rdx, %rcx
	leaq	(%rax,%rcx,4), %rdi
	leaq	(%rax,%rdx,4), %rsi
	subl	%edx, %r12d
	shll	$2, %r12d
	movl	%r12d, %edx
	callq	_memmove
	movl	(%r13), %eax
	addl	%eax, (%rbx)
	movl	4(%rbx), %ecx
LBB0_3:
	movl	(%r15), %eax
	movq	24(%rbx), %rdx
	movslq	%ecx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	movl	16(%rbx), %edi
	callq	_SetEvent
	movl	4(%rbx), %eax
	incl	%eax
	cltd
	idivl	8(%rbx)
	movl	%edx, 4(%rbx)
	movq	%r14, %rdi
	callq	_LeaveCriticalSection
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVENTS_RING_BUFFER_INCREMENT,8,3 ## @EVENTS_RING_BUFFER_INCREMENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"omr->ring_buffer_size=%d\n"

	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_EventsQueue_PutEvent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function EventsQueue_PutEvent
_EventsQueue_PutEvent:                  ; @EventsQueue_PutEvent
	.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	x20, x0
	add	x19, x0, #12
	mov	x0, x19
	bl	_EnterCriticalSection
	ldp	w9, w8, [x20]
	add	w10, w8, #1
	ldr	w22, [x20, #8]
	sdiv	w11, w10, w22
	msub	w10, w11, w22, w10
	cmp	w9, w10
	b.ne	LBB0_3
; %bb.1:
Lloh0:
	adrp	x23, _EVENTS_RING_BUFFER_INCREMENT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _EVENTS_RING_BUFFER_INCREMENT@GOTPAGEOFF]
	ldr	w8, [x23]
	add	w8, w22, w8
	str	w8, [x20, #8]
	sxtw	x1, w8
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x0, [x20, #24]
	ldr	w8, [x20, #8]
	lsl	w1, w8, #2
	bl	_CoTaskMemRealloc
	str	x0, [x20, #24]
	ldp	w9, w8, [x20]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	cmp	w8, w9
	b.ge	LBB0_3
; %bb.2:
	ldr	x8, [x23]
	add	x8, x8, x9
	add	x8, x0, x8, lsl #2
	add	x1, x0, x9, lsl #2
	sub	w9, w22, w9
	lsl	w2, w9, #2
	mov	x0, x8
	bl	_memmove
	ldr	w9, [x23]
	ldp	w10, w8, [x20]
	add	w9, w10, w9
	str	w9, [x20]
LBB0_3:
	ldr	w9, [x21]
	ldr	x10, [x20, #24]
	str	w9, [x10, w8, sxtw #2]
	ldr	w0, [x20, #16]
	bl	_SetEvent
	ldp	w8, w9, [x20, #4]
	add	w8, w8, #1
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	str	w8, [x20, #4]
	mov	x0, x19
	bl	_LeaveCriticalSection
Lloh4:
	adrp	x8, _TRUE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EVENTS_RING_BUFFER_INCREMENT,8,3 ; @EVENTS_RING_BUFFER_INCREMENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"omr->ring_buffer_size=%d\n"

	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_EventsQueue_PutEvent
.subsections_via_symbols
