	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_CheckEvent              ## -- Begin function DSOUND_CheckEvent
	.p2align	4, 0x90
_DSOUND_CheckEvent:                     ## @DSOUND_CheckEvent
	.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
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_TRACE
	cmpl	$0, (%rbx)
	je	LBB0_13
## %bb.1:
	movl	4(%rbx), %edx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_TRACE
	cmpl	$0, (%rbx)
	jle	LBB0_13
## %bb.2:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, -48(%rbp)                 ## 4-byte Folded Spill
	movl	$8, %r12d
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r15,%r12), %rsi
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_TRACE
	movq	(%r15,%r12), %rdi
	callq	_SetEvent
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movslq	(%rbx), %rax
	addq	$16, %r12
	cmpq	%rax, %r13
	jge	LBB0_13
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %r15
	movl	-8(%r15,%r12), %r14d
	movq	(%r15,%r12), %rcx
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_TRACE
	movq	_DSBPN_OFFSETSTOP@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rbx), %rax
	movq	_STATE_STOPPED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r15,%r12), %rdi
	callq	_SetEvent
	movq	(%r15,%r12), %rsi
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_TRACE
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%rbx), %ecx
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	%ecx, %eax
	jge	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	-44(%rbp), %r14d                ## 4-byte Folded Reload
	jl	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	jl	LBB0_11
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	cltd
	idivl	%ecx
	cmpl	-44(%rbp), %r14d                ## 4-byte Folded Reload
	jge	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%edx, %r14d
	jge	LBB0_12
	jmp	LBB0_11
LBB0_13:
	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	"(%p,%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"(%p) buflen = %d, playpos = %d, len = %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"checking %d, position %d, event = %p\n"

	.comm	_DSBPN_OFFSETSTOP,4,2           ## @DSBPN_OFFSETSTOP
	.comm	_STATE_STOPPED,8,3              ## @STATE_STOPPED
L_.str.3:                               ## @.str.3
	.asciz	"signalled event %p (%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_CheckEvent              ; -- Begin function DSOUND_CheckEvent
	.p2align	2
_DSOUND_CheckEvent:                     ; @DSOUND_CheckEvent
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	x8, x2
	stp	x0, x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	w8, [x20]
	cbz	w8, LBB0_11
; %bb.1:
	ldr	w8, [x20, #4]
	stp	x19, x21, [sp, #16]
	stp	x20, x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.2:
	mov	x23, #0
	mov	x24, #0
	add	w25, w21, w19
Lloh4:
	adrp	x21, l_.str.2@PAGE
Lloh5:
	add	x21, x21, l_.str.2@PAGEOFF
Lloh6:
	adrp	x26, _DSBPN_OFFSETSTOP@GOTPAGE
Lloh7:
	ldr	x26, [x26, _DSBPN_OFFSETSTOP@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str.3@PAGE
Lloh9:
	add	x22, x22, l_.str.3@PAGEOFF
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x28, #8]
	stp	x8, x24, [sp]
	mov	x0, x22
	bl	_TRACE
	ldr	x0, [x28, #8]
	bl	_SetEvent
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x20]
	add	x23, x23, #16
	cmp	x24, x8
	b.ge	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	add	x28, x8, x23
	ldr	w27, [x28]
	ldr	x8, [x28, #8]
	stp	x27, x8, [sp, #8]
	str	x24, [sp]
	mov	x0, x21
	bl	_TRACE
	ldr	w8, [x26]
	cmp	w27, w8
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #8]
Lloh10:
	adrp	x9, _STATE_STOPPED@GOTPAGE
Lloh11:
	ldr	x9, [x9, _STATE_STOPPED@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x28, #8]
	bl	_SetEvent
	ldr	x8, [x28, #8]
	stp	x8, x24, [sp]
	mov	x0, x22
	bl	_TRACE
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #4]
	cmp	w25, w8
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w27, w19
	ccmp	w27, w25, #0, ge
	b.lt	LBB0_3
	b	LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	sdiv	w9, w25, w8
	msub	w8, w9, w8, w25
	cmp	w27, w19
	ccmp	w27, w8, #8, lt
	b.lt	LBB0_3
	b	LBB0_4
LBB0_11:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p,%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"(%p) buflen = %d, playpos = %d, len = %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"checking %d, position %d, event = %p\n"

	.comm	_DSBPN_OFFSETSTOP,4,2           ; @DSBPN_OFFSETSTOP
	.comm	_STATE_STOPPED,8,3              ; @STATE_STOPPED
l_.str.3:                               ; @.str.3
	.asciz	"signalled event %p (%d)\n"

.subsections_via_symbols
