	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_MixToTemporary          ## -- Begin function DSOUND_MixToTemporary
	.p2align	4, 0x90
_DSOUND_MixToTemporary:                 ## @DSOUND_MixToTemporary
	.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	%rcx, %r12
	cmpq	$0, 48(%rdi)
	setne	%al
	testq	%rcx, %rcx
	setne	%cl
	cmpb	%al, %cl
	je	LBB0_24
## %bb.1:
	movq	%rdi, %r13
	cmpq	%r12, (%rdi)
	jne	LBB0_24
## %bb.2:
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	32(%r13), %rax
	movq	56(%r13), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movq	8(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leal	(%r14,%rbx), %r15d
	xorl	%edi, %edi
	cmpl	8(%r13), %r15d
	setle	%dil
	callq	_assert
	testq	%r12, %r12
	je	LBB0_5
## %bb.3:
	cmpl	8(%r13), %r15d
	jge	LBB0_5
## %bb.4:
	movq	56(%r13), %rax
	addl	(%rax), %r14d
LBB0_5:
	movq	%r13, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_DSOUND_secpos_to_bufpos
	movl	%eax, %r15d
	movq	16(%r13), %rax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movslq	%ebx, %rbx
	shlq	$2, %rbx
	addq	(%rax), %rbx
	testq	%r12, %r12
	je	LBB0_6
## %bb.7:
	movq	32(%r13), %rcx
	movq	16(%rcx), %rax
	cmpl	%r15d, (%rcx)
	jge	LBB0_8
## %bb.11:
	movl	%r15d, (%rcx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	32(%r13), %rcx
	movq	16(%rcx), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	%r15d, %ecx
	callq	_HeapReAlloc
	jmp	LBB0_13
LBB0_6:
	movq	48(%r13), %rax
	jmp	LBB0_14
LBB0_8:
	testq	%rax, %rax
	jne	LBB0_14
## %bb.9:
	movl	%r15d, (%rcx)
LBB0_10:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_HeapAlloc
LBB0_13:
	movq	32(%r13), %rcx
	movq	%rax, 16(%rcx)
LBB0_14:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_TRACE
	movl	%r14d, %eax
	cltd
	movl	-68(%rbp), %r15d                ## 4-byte Reload
	idivl	%r15d
	movl	%eax, %r14d
	movl	40(%r13), %edx
	movq	32(%r13), %rax
	movq	8(%rax), %rax
	movl	4(%rax), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_19
## %bb.15:
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	movl	%edx, %ecx
	xorl	%eax, %eax
	callq	_TRACE
	testq	%r12, %r12
	je	LBB0_17
## %bb.16:
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_19:
	leaq	L_.str.2(%rip), %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movl	24(%r13), %edx
	leaq	-48(%rbp), %rcx
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_DSOUND_secpos_to_bufpos
	movl	%eax, %r8d
	movl	-48(%rbp), %eax
	movq	_DSOUND_FREQSHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %esi
	sarl	%cl, %esi
	testl	%esi, %esi
	je	LBB0_23
## %bb.20:
	subl	%esi, %r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jle	LBB0_24
## %bb.21:
	movl	%esi, %edx
	imull	%r15d, %edx
	addl	%edi, %edx
	cmpl	8(%r13), %edx
	jge	LBB0_24
## %bb.22:
	movq	16(%r13), %rdi
	movslq	%edx, %rbx
	shlq	$2, %rbx
	addq	(%rdi), %rbx
	movl	$-1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	notl	%edx
	andl	%edx, %eax
	movl	%eax, -48(%rbp)
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	callq	_TRACE
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	movl	-48(%rbp), %eax
LBB0_23:
	xorl	%ecx, %ecx
	testq	%r12, %r12
	movslq	%r8d, %rdx
	cmoveq	%rdx, %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rcx,4), %rdx
	movl	12(%r13), %r10d
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r14d, %r9d
	pushq	%r10
	pushq	%rax
	callq	_cp_fields
	addq	$16, %rsp
LBB0_24:
	addq	$40, %rsp
LBB0_25:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%r15d
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	imull	%r8d, %eax
	cltq
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rax,4), %rdx
LBB0_18:
	movq	_DSOUND_FREQSHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %ecx
	movl	%r14d, %r9d
	pushq	%rax
	pushq	$0
	callq	_cp_fields
	addq	$56, %rsp
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p, %p)\n"

L_.str.1:                               ## @.str.1
	.asciz	"(%p) Same sample rate %d = primary %d\n"

	.comm	_DSOUND_FREQSHIFT,4,2           ## @DSOUND_FREQSHIFT
L_.str.2:                               ## @.str.2
	.asciz	"(%p) Adjusting frequency: %d -> %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Overshot: %d, freqAcc: %04x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_MixToTemporary          ; -- Begin function DSOUND_MixToTemporary
	.p2align	2
_DSOUND_MixToTemporary:                 ; @DSOUND_MixToTemporary
	.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
	ldr	x8, [x0, #48]
	cmp	x8, #0
	cset	w8, ne
	cmp	x3, #0
	cset	w9, ne
	cmp	w9, w8
	b.eq	LBB0_20
; %bb.1:
	mov	x20, x3
	mov	x19, x0
	ldr	x8, [x0]
	cmp	x8, x3
	b.ne	LBB0_20
; %bb.2:
	mov	x25, x2
	mov	x23, x1
	ldr	x8, [x19, #56]
	ldr	w21, [x8]
	ldr	x8, [x19, #32]
	ldr	x8, [x8, #8]
	ldr	w22, [x8]
	ldr	w8, [x19, #8]
	add	w24, w2, w1
	cmp	w24, w8
	cset	w0, le
	bl	_assert
	cbz	x20, LBB0_8
; %bb.3:
	ldr	w8, [x19, #8]
	cmp	w24, w8
	b.ge	LBB0_5
; %bb.4:
	ldr	x8, [x19, #56]
	ldr	w8, [x8]
	add	w25, w8, w25
LBB0_5:
	mov	x0, x19
	mov	x1, x25
	mov	w2, #0
	mov	x3, #0
	bl	_DSOUND_secpos_to_bufpos
	mov	x27, x0
	mov	x28, x19
	ldr	x8, [x28, #16]!
	ldr	x8, [x8]
	add	x24, x8, w23, sxtw #2
	ldr	x8, [x28, #16]
	ldr	w9, [x8]
	ldr	x26, [x8, #16]
	cmp	w9, w0
	b.ge	LBB0_9
; %bb.6:
	str	w27, [x8]
	cbz	x26, LBB0_11
; %bb.7:
	bl	_GetProcessHeap
	ldr	x8, [x19, #32]
	ldr	x2, [x8, #16]
	mov	w1, #0
	mov	x3, x27
	bl	_HeapReAlloc
	b	LBB0_12
LBB0_8:
	mov	x0, x19
	mov	x1, x25
	mov	w2, #0
	mov	x3, #0
	bl	_DSOUND_secpos_to_bufpos
	mov	x28, x19
	ldr	x8, [x28, #16]!
	ldr	x8, [x8]
	add	x24, x8, w23, sxtw #2
	ldr	x26, [x28, #32]
	b	LBB0_13
LBB0_9:
	cbnz	x26, LBB0_13
; %bb.10:
	str	w27, [x8]
LBB0_11:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x27
	bl	_HeapAlloc
LBB0_12:
	mov	x26, x0
	ldr	x8, [x19, #32]
	str	x0, [x8, #16]
LBB0_13:
	stp	x19, x24, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	sdiv	w25, w25, w21
	ldr	w8, [x19, #40]
	ldr	x9, [x19, #32]
	ldr	x9, [x9, #8]
	ldr	w9, [x9, #4]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.14:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	stp	x8, x8, [sp, #8]
	str	x19, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	sdiv	w8, w23, w21
	mul	w8, w8, w22
	add	x8, x26, w8, sxtw #2
Lloh4:
	adrp	x9, _DSOUND_FREQSHIFT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _DSOUND_FREQSHIFT@GOTPAGEOFF]
	cmp	x20, #0
	csel	x2, x26, x8, ne
Lloh6:
	ldr	w8, [x9]
	mov	w9, #1
	lsl	w7, w9, w8
	mov	x0, x19
	mov	x1, x24
	mov	x3, x21
	mov	x4, x22
	mov	x5, x25
	mov	w6, #0
	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
	b	_cp_fields
LBB0_15:
	stp	x8, x9, [sp, #8]
	str	x19, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	ldr	w2, [x19, #24]
	add	x3, sp, #28
	mov	x0, x19
	mov	x1, x23
	bl	_DSOUND_secpos_to_bufpos
	mov	x27, x0
	ldr	w6, [sp, #28]
Lloh9:
	adrp	x8, _DSOUND_FREQSHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DSOUND_FREQSHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x8]
	asr	w8, w6, w9
	cbz	w8, LBB0_19
; %bb.16:
	subs	w25, w25, w8
	b.le	LBB0_20
; %bb.17:
	madd	w10, w8, w21, w23
	ldr	w11, [x19, #8]
	cmp	w10, w11
	b.ge	LBB0_20
; %bb.18:
	ldr	x11, [x28]
	ldr	x11, [x11]
	add	x24, x11, w10, sxtw #2
	mov	w10, #-1
	lsl	w9, w10, w9
	bic	w9, w6, w9
	str	w9, [sp, #28]
	stp	x8, x9, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
	ldr	w6, [sp, #28]
LBB0_19:
	sxtw	x8, w27
	cmp	x20, #0
	csel	x8, xzr, x8, ne
	add	x2, x26, x8, lsl #2
	ldr	w7, [x19, #12]
	mov	x0, x19
	mov	x1, x24
	mov	x3, x21
	mov	x4, x22
	mov	x5, x25
	bl	_cp_fields
LBB0_20:
	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 AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p, %p)\n"

l_.str.1:                               ; @.str.1
	.asciz	"(%p) Same sample rate %d = primary %d\n"

	.comm	_DSOUND_FREQSHIFT,4,2           ; @DSOUND_FREQSHIFT
l_.str.2:                               ; @.str.2
	.asciz	"(%p) Adjusting frequency: %d -> %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Overshot: %d, freqAcc: %04x\n"

.subsections_via_symbols
