	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DSOUND_MixToPrimary
_DSOUND_MixToPrimary:                   ## @DSOUND_MixToPrimary
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rax, (%r8)
	leaq	L_.str(%rip), %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_TRACE
	cmpq	$0, (%rbx)
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %r15
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%r13)
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_DSOUND_CheckEvent
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	callq	_RtlReleaseResource
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	cmpq	(%rbx), %r14
	jae	LBB0_17
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movq	(%rax,%r14,8), %r13
	movq	(%r13), %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	cmpq	$0, 24(%r13)
	je	LBB0_16
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, (%r13)
	je	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 20(%r13)
	jne	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movq	%r13, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_TRACE
	leaq	16(%r13), %r12
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_RtlAcquireResourceShared
	movq	(%r13), %rax
	movq	_STATE_STOPPED@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_STATE_STOPPING@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rcx, %rax
	je	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_STATE_STARTING@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rcx, %rax
	jne	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 8(%r13)
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rcx, %rax
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_STATE_PLAYING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r13)
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_DSOUND_MixOne
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, %rax
	movq	%rdx, %rcx
	cmovbq	%rax, %rcx
	testq	%rax, %rax
	cmoveq	%rdx, %rcx
	testq	%rdx, %rdx
	cmoveq	%rax, %rcx
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rdx)
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_15
LBB0_1:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TRUE,8,3                       ## @TRUE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d,%d,%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"MixToPrimary for %p, state=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Checking %p, mixlen=%d\n"

	.comm	_STATE_STOPPING,8,3             ## @STATE_STOPPING
	.comm	_STATE_STOPPED,8,3              ## @STATE_STOPPED
	.comm	_STATE_STARTING,8,3             ## @STATE_STARTING
	.comm	_STATE_PLAYING,8,3              ## @STATE_PLAYING
	.comm	_FALSE,8,3                      ## @FALSE
L_.str.3:                               ## @.str.3
	.asciz	"Mixed at least %d from all buffers\n"

	.no_dead_strip	_DSOUND_MixToPrimary
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DSOUND_MixToPrimary
_DSOUND_MixToPrimary:                   ; @DSOUND_MixToPrimary
	.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	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
Lloh0:
	adrp	x8, _TRUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x4]
	stp	x2, x3, [sp, #8]
	str	x1, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x8, [x23]
	cbz	x8, LBB0_16
; %bb.1:
	mov	x26, #0
	mov	x24, #0
Lloh5:
	adrp	x25, l_.str.1@PAGE
Lloh6:
	add	x25, x25, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	x9, [x28]
	mov	x0, x28
	mov	w1, #0
	mov	w2, #0
	bl	_DSOUND_CheckEvent
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x27
	bl	_RtlReleaseResource
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x26, x26, #1
	ldr	x8, [x23]
	cmp	x26, x8
	b.hs	LBB0_17
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	ldr	x28, [x8, x26, lsl #3]
	ldr	x8, [x28]
	stp	x28, x8, [sp]
	mov	x0, x25
	bl	_TRACE
	ldr	x8, [x28, #24]
	cbz	x8, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x28]
	cbz	x8, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x28, #20]
	cbnz	w8, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	stp	x28, x21, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	add	x27, x28, #16
Lloh9:
	adrp	x8, _TRUE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh11:
	ldr	x1, [x8]
	mov	x0, x27
	bl	_RtlAcquireResourceShared
	ldr	x8, [x28]
Lloh12:
	adrp	x9, _STATE_STOPPING@GOTPAGE
Lloh13:
	ldr	x9, [x9, _STATE_STOPPING@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x9]
Lloh15:
	adrp	x9, _STATE_STOPPED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _STATE_STOPPED@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x10
	b.eq	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh18:
	adrp	x9, _STATE_STARTING@GOTPAGE
Lloh19:
	ldr	x9, [x9, _STATE_STARTING@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cbnz	x20, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	cmp	x8, x9
	b.ne	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	str	x22, [x28, #8]
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh21:
	adrp	x8, _STATE_PLAYING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _STATE_PLAYING@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	str	x8, [x28]
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x28
	mov	x1, x22
	mov	x2, x21
	bl	_DSOUND_MixOne
	cmp	x0, x24
	csel	x8, x0, x24, lo
	cmp	x0, #0
	csel	x8, x24, x8, eq
	cmp	x24, #0
	csel	x24, x0, x8, eq
Lloh24:
	adrp	x8, _FALSE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_3
LBB0_16:
	mov	x24, #0
LBB0_17:
	str	x24, [sp]
Lloh27:
	adrp	x0, l_.str.3@PAGE
Lloh28:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
	mov	x0, x24
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_TRUE,8,3                       ; @TRUE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d,%d,%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"MixToPrimary for %p, state=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Checking %p, mixlen=%d\n"

	.comm	_STATE_STOPPING,8,3             ; @STATE_STOPPING
	.comm	_STATE_STOPPED,8,3              ; @STATE_STOPPED
	.comm	_STATE_STARTING,8,3             ; @STATE_STARTING
	.comm	_STATE_PLAYING,8,3              ; @STATE_PLAYING
	.comm	_FALSE,8,3                      ; @FALSE
l_.str.3:                               ; @.str.3
	.asciz	"Mixed at least %d from all buffers\n"

	.no_dead_strip	_DSOUND_MixToPrimary
.subsections_via_symbols
