	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DSOUND_MixOne
_DSOUND_MixOne:                         ## @DSOUND_MixOne
	.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	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_TRACE
	movl	(%r12), %edx
	movl	4(%r12), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_TRACE
	movq	40(%r12), %rdx
	movl	8(%r12), %esi
	movl	12(%r12), %ecx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	cmpq	$0, 40(%r12)
	je	LBB0_4
## %bb.1:
	movq	16(%r12), %rax
	movq	_STATE_STARTING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movq	24(%r12), %rcx
	movl	(%rcx), %edx
	addl	%edx, %edx
	cmpl	%r15d, %edx
	jge	LBB0_4
## %bb.3:
	movl	%r15d, %eax
	subl	%edx, %eax
	addl	4(%r12), %eax
	cltd
	idivl	4(%rcx)
	movl	%edx, 4(%r12)
LBB0_4:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%r12)
	movq	24(%r12), %rax
	movl	4(%rax), %edi
	movl	4(%r12), %esi
	movl	%r14d, %edx
	callq	_DSOUND_BufPtrDiff
	movl	%eax, %r13d
	cmpl	%r15d, %eax
	jle	LBB0_6
## %bb.5:
	movl	12(%r12), %ecx
	movl	36(%r12), %r8d
	movl	32(%r12), %r9d
	movl	(%r12), %edx
	movl	4(%r12), %eax
	subq	$8, %rsp
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %esi
	pushq	%r15
	pushq	%r14
	pushq	%rax
	callq	_ERR
	addq	$32, %rsp
	addl	%r15d, %r14d
	movq	24(%r12), %rcx
	movl	%r14d, %eax
	cltd
	idivl	4(%rcx)
	movl	%edx, 4(%r12)
	jmp	LBB0_14
LBB0_6:
	leaq	L_.str.4(%rip), %rdi
	movl	%r15d, %edx
	subl	%r13d, %edx
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_TRACE
	movl	%r15d, %ebx
	subl	%r13d, %ebx
	je	LBB0_14
## %bb.7:
	movl	(%r12), %eax
	movl	12(%r12), %edx
	leal	(%rax,%rbx), %ecx
	cmpl	%edx, %ecx
	jge	LBB0_8
## %bb.12:
	movl	4(%r12), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_DSOUND_MixInBuffer
	jmp	LBB0_13
LBB0_8:
	subl	%eax, %edx
	movl	4(%r12), %esi
	movq	%r12, %rdi
	callq	_DSOUND_MixInBuffer
	movq	_DSBPLAY_LOOPING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 8(%r12)
	je	LBB0_13
	.p2align	4, 0x90
## %bb.9:
	testl	%eax, %eax
	je	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	subl	%eax, %ebx
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	4(%r12), %esi
	movl	12(%r12), %edx
	cmpl	%ebx, %edx
	cmovgel	%ebx, %edx
	movq	%r12, %rdi
	callq	_DSOUND_MixInBuffer
	testl	%eax, %eax
	jne	LBB0_10
LBB0_13:
	movq	24(%r12), %rax
	movl	4(%rax), %edi
	movl	4(%r12), %esi
	movl	%r14d, %edx
	callq	_DSOUND_BufPtrDiff
	movl	%eax, %r15d
	movl	4(%r12), %esi
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_TRACE
LBB0_14:
	movl	%r15d, %eax
	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,%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"writepos=%d, buf_mixpos=%d, primary_mixpos=%d, mixlen=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"looping=%d, leadin=%d, buflen=%d\n"

	.comm	_STATE_STARTING,8,3             ## @STATE_STARTING
	.comm	_FALSE,8,3                      ## @FALSE
L_.str.3:                               ## @.str.3
	.asciz	"Fatal error. Under/Overflow? primary_done=%d, mixpos=%d/%d (%d/%d), primary_mixpos=%d, writepos=%d, mixlen=%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"primary_done=%d, mixlen (primary) = %i\n"

	.comm	_DSBPLAY_LOOPING,4,2            ## @DSBPLAY_LOOPING
L_.str.5:                               ## @.str.5
	.asciz	"new primary_mixpos=%d, total mixed data=%d\n"

	.no_dead_strip	_DSOUND_MixOne
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DSOUND_MixOne
_DSOUND_MixOne:                         ; @DSOUND_MixOne
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x20, x1
	mov	x19, x0
	mov	x22, x2
	stp	x20, x22, [sp, #8]
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldp	w8, w9, [x19]
	stp	x9, x22, [sp, #16]
	stp	x20, x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	x8, [x19, #40]
	ldp	w9, w10, [x19, #8]
	stp	x8, x10, [sp, #8]
	str	x9, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x19, #16]
Lloh6:
	adrp	x9, _STATE_STARTING@GOTPAGE
Lloh7:
	ldr	x9, [x9, _STATE_STARTING@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	x8, [x19, #24]
	ldr	w9, [x8]
	lsl	w9, w9, #1
	cmp	w9, w21
	b.ge	LBB0_4
; %bb.3:
	ldr	w10, [x19, #4]
	sub	w9, w21, w9
	add	w9, w10, w9
	ldr	w8, [x8, #4]
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
	str	w8, [x19, #4]
LBB0_4:
Lloh9:
	adrp	x8, _FALSE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [x19, #40]
	ldr	x8, [x19, #24]
	ldr	w0, [x8, #4]
	ldr	w1, [x19, #4]
	mov	x2, x20
	bl	_DSOUND_BufPtrDiff
	mov	x22, x0
	cmp	w0, w21
	b.le	LBB0_6
; %bb.5:
	ldr	w3, [x19, #12]
	ldp	w5, w4, [x19, #32]
	ldp	w2, w6, [x19]
	str	w21, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x22
	mov	x7, x20
	bl	_ERR
	add	w8, w21, w20
	ldr	x9, [x19, #24]
	ldr	w9, [x9, #4]
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_6:
	subs	w8, w21, w22
	stp	x22, x8, [sp]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_TRACE
	subs	w22, w21, w22
	b.eq	LBB0_14
; %bb.7:
	ldr	w8, [x19]
	ldr	w9, [x19, #12]
	add	w10, w8, w22
	cmp	w10, w9
	b.ge	LBB0_9
; %bb.8:
	ldr	w1, [x19, #4]
	mov	x0, x19
	mov	x2, x22
	bl	_DSOUND_MixInBuffer
	b	LBB0_13
LBB0_9:
	sub	w2, w9, w8
	ldr	w1, [x19, #4]
	mov	x0, x19
	bl	_DSOUND_MixInBuffer
	ldr	w8, [x19, #8]
Lloh16:
	adrp	x9, _DSBPLAY_LOOPING@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DSBPLAY_LOOPING@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.10:
	cbz	w0, LBB0_13
; %bb.11:
	sub	w21, w22, w0
	cbz	w21, LBB0_13
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19, #12]
	cmp	w8, w21
	csel	w2, w8, w21, lt
	ldr	w1, [x19, #4]
	mov	x0, x19
	bl	_DSOUND_MixInBuffer
	sub	w21, w21, w0
	cmp	w0, #0
	ccmp	w21, #0, #4, ne
	b.ne	LBB0_12
LBB0_13:
	ldr	x8, [x19, #24]
	ldr	w0, [x8, #4]
	ldr	w1, [x19, #4]
	mov	x2, x20
	bl	_DSOUND_BufPtrDiff
	mov	x21, x0
	ldr	w8, [x19, #4]
	stp	x8, x21, [sp]
Lloh19:
	adrp	x0, l_.str.5@PAGE
Lloh20:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_TRACE
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p,%d,%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"writepos=%d, buf_mixpos=%d, primary_mixpos=%d, mixlen=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"looping=%d, leadin=%d, buflen=%d\n"

	.comm	_STATE_STARTING,8,3             ; @STATE_STARTING
	.comm	_FALSE,8,3                      ; @FALSE
l_.str.3:                               ; @.str.3
	.asciz	"Fatal error. Under/Overflow? primary_done=%d, mixpos=%d/%d (%d/%d), primary_mixpos=%d, writepos=%d, mixlen=%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"primary_done=%d, mixlen (primary) = %i\n"

	.comm	_DSBPLAY_LOOPING,4,2            ; @DSBPLAY_LOOPING
l_.str.5:                               ; @.str.5
	.asciz	"new primary_mixpos=%d, total mixed data=%d\n"

	.no_dead_strip	_DSOUND_MixOne
.subsections_via_symbols
