	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function savage_bci_event_wait
_savage_bci_event_wait:                 ## @savage_bci_event_wait
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	(%rdi), %rbx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	xorl	%eax, %eax
	callq	_UPDATE_EVENT_COUNTER
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movzwl	4(%rax), %eax
	jmp	LBB0_3
LBB0_2:
	movq	_SAVAGE_STATUS_WORD1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SAVAGE_READ
LBB0_3:
	movzwl	%ax, %eax
	movl	8(%rbx), %edx
	cmpl	%eax, 12(%rbx)
	sbbl	$0, %edx
	movl	(%r14), %ecx
	movl	%ecx, %esi
	sarl	$16, %esi
	cmpl	%edx, %esi
	jb	LBB0_6
## %bb.4:
	movzwl	%cx, %esi
	jne	LBB0_7
## %bb.5:
	cmpl	%eax, %esi
	ja	LBB0_7
LBB0_6:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	16(%rbx), %rax
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_SAVAGE_STATUS_WORD1,4,2        ## @SAVAGE_STATUS_WORD1
	.no_dead_strip	_savage_bci_event_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function savage_bci_event_wait
_savage_bci_event_wait:                 ; @savage_bci_event_wait
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	bl	_UPDATE_EVENT_COUNTER
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
	ldrh	w0, [x8, #4]
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _SAVAGE_STATUS_WORD1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SAVAGE_STATUS_WORD1@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_SAVAGE_READ
LBB0_3:
	and	w8, w0, #0xffff
	ldp	w10, w9, [x19, #8]
	cmp	w8, w9
	cset	w11, hi
	ldr	w9, [x20]
	asr	w12, w9, #16
	sub	w10, w10, w11
	cmp	w12, w10
	b.lo	LBB0_6
; %bb.4:
	and	w1, w9, #0xffff
	ccmp	w1, w8, #2, eq
	b.ls	LBB0_6
; %bb.5:
	ldr	x2, [x19, #16]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	br	x2
LBB0_6:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_SAVAGE_STATUS_WORD1,4,2        ; @SAVAGE_STATUS_WORD1
	.no_dead_strip	_savage_bci_event_wait
.subsections_via_symbols
