	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_RecalcFormat            ## -- Begin function DSOUND_RecalcFormat
	.p2align	4, 0x90
_DSOUND_RecalcFormat:                   ## @DSOUND_RecalcFormat
	.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	$24, %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	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %ecx
	movq	48(%rdi), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edx
	movl	4(%rax), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	movl	%ecx, %r15d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	cmpl	%edx, %ecx
	setne	%r14b
	movq	64(%rdi), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_TRACE
	movq	64(%rbx), %rdi
	movq	8(%rdi), %rax
	movq	_WAVE_FORMAT_IEEE_FLOAT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.1:
	movq	_WAVE_FORMAT_EXTENSIBLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movq	_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT@GOTPCREL(%rip), %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	je	LBB0_4
LBB0_3:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
LBB0_4:
	movb	%r14b, %r13b
	movslq	(%rbx), %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movq	48(%rbx), %rdx
	movq	64(%rbx), %rcx
	imull	(%rcx), %eax
	movl	%eax, 4(%rbx)
	movl	4(%rcx), %esi
	movq	8(%rdx), %rax
	cmpl	8(%rax), %esi
	jne	LBB0_5
## %bb.6:
	movl	%r15d, %r14d
	movl	%r15d, %edx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	xorl	%r15d, %edx
	movq	8(%rcx), %rcx
	orl	%r12d, %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rsi, %rdx
	jne	LBB0_8
## %bb.7:
	movq	_FALSE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
LBB0_8:
	cmpq	16(%rax), %rcx
	cmoveq	%rdx, %rsi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_9
LBB0_5:
	movl	%r15d, %r14d
	movl	-44(%rbp), %r15d                ## 4-byte Reload
LBB0_9:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	56(%rbx), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapFree
	movq	$0, 56(%rbx)
	movl	$0, 16(%rbx)
	movq	$0, 8(%rbx)
	movl	%r13d, 20(%rbx)
	movq	_convertbpp@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$4, %edx
	testl	%r12d, %r12d
	jne	LBB0_11
## %bb.10:
	movq	64(%rbx), %rcx
	movl	4(%rcx), %ecx
	leal	7(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$3, %edx
	decl	%edx
	movslq	%edx, %rdx
LBB0_11:
	movq	48(%rbx), %rcx
	movq	8(%rcx), %rsi
	movl	8(%rsi), %esi
	leal	7(%rsi), %edi
	testl	%esi, %esi
	cmovnsl	%esi, %edi
	movq	(%rax,%rdx,8), %rax
	sarl	$3, %edi
	movslq	%edi, %rdx
	movq	-8(%rax,%rdx,8), %rax
	movq	%rax, 72(%rbx)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_24
## %bb.12:
	cmpl	%r15d, %r14d
	je	LBB0_14
## %bb.13:
	movq	%rbx, %rdi
	callq	_DSOUND_RecalcFreqAcc
	movl	24(%rbx), %eax
	movq	48(%rbx), %rcx
	jmp	LBB0_15
LBB0_24:
	movl	28(%rbx), %eax
	movl	%eax, 24(%rbx)
	movl	%eax, 8(%rbx)
	jmp	LBB0_25
LBB0_14:
	movl	28(%rbx), %eax
	cltd
	idivl	-60(%rbp)                       ## 4-byte Folded Reload
	imull	-64(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, 24(%rbx)
LBB0_15:
	movl	%eax, 8(%rbx)
	movq	_ds_snd_shadow_maxsize@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	(%rcx), %eax
	jle	LBB0_19
## %bb.16:
	testl	%edx, %edx
	js	LBB0_18
## %bb.17:
	shll	$20, %edx
	cmpl	%edx, %eax
	jl	LBB0_20
LBB0_18:
	movq	56(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_23
LBB0_22:
	movl	24(%rbx), %esi
	movq	48(%rbx), %rax
	movq	8(%rax), %rax
	xorl	%edx, %edx
	cmpl	$8, 8(%rax)
	sete	%dl
	shll	$7, %edx
	callq	_FillMemory
	jmp	LBB0_25
LBB0_19:
	testl	%edx, %edx
	js	LBB0_18
LBB0_20:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	8(%rbx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, %rdi
	movq	%rax, 56(%rbx)
	testq	%rdi, %rdi
	jne	LBB0_22
LBB0_23:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%rbx)
LBB0_25:
	movl	32(%rbx), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_DSOUND_secpos_to_bufpos
	movl	%eax, 36(%rbx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_FALSE,8,3                      ## @FALSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p)\n"

	.comm	_WAVE_FORMAT_IEEE_FLOAT,8,3     ## @WAVE_FORMAT_IEEE_FLOAT
	.comm	_WAVE_FORMAT_EXTENSIBLE,8,3     ## @WAVE_FORMAT_EXTENSIBLE
	.comm	_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT,4,2 ## @KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
	.comm	_convertbpp,8,3                 ## @convertbpp
	.comm	_ds_snd_shadow_maxsize,4,2      ## @ds_snd_shadow_maxsize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_RecalcFormat            ; -- Begin function DSOUND_RecalcFormat
	.p2align	2
_DSOUND_RecalcFormat:                   ; @DSOUND_RecalcFormat
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
Lloh0:
	adrp	x20, _TRUE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _TRUE@GOTPAGEOFF]
	ldr	x23, [x20]
	ldr	w21, [x0]
	ldr	x8, [x0, #48]
	ldr	x8, [x8, #8]
	ldp	w24, w22, [x8]
	cmp	w21, w24
	cset	w28, ne
	ldr	x8, [x0, #64]
	ldr	w25, [x8]
Lloh2:
	adrp	x26, _FALSE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _FALSE@GOTPAGEOFF]
	ldr	x27, [x26]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_TRACE
	ldr	x0, [x19, #64]
	ldr	x8, [x0, #8]
Lloh6:
	adrp	x9, _WAVE_FORMAT_IEEE_FLOAT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WAVE_FORMAT_IEEE_FLOAT@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.1:
Lloh9:
	adrp	x9, _WAVE_FORMAT_EXTENSIBLE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WAVE_FORMAT_EXTENSIBLE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
Lloh12:
	adrp	x1, _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT@GOTPAGE
Lloh13:
	ldr	x1, [x1, _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT@GOTPAGEOFF]
	bl	_IsEqualGUID
	cbz	x0, LBB0_4
LBB0_3:
	ldr	x27, [x20]
LBB0_4:
	ldrsw	x8, [x19]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w9, w8, w9
	ldr	x8, [x19, #64]
	ldp	w10, w11, [x8]
	mul	w9, w10, w9
	str	w9, [x19, #4]
	ldr	x9, [x19, #48]
	ldr	x9, [x9, #8]
	ldr	w10, [x9, #8]
	cmp	w11, w10
	b.ne	LBB0_6
; %bb.5:
	cmp	w27, #0
	ccmp	w21, w24, #0, eq
	ldr	x8, [x8, #8]
	ldr	x9, [x9, #16]
	ccmp	x8, x9, #0, eq
	ldr	x8, [x26]
	csel	x23, x23, x8, ne
LBB0_6:
	bl	_GetProcessHeap
	ldr	x2, [x19, #56]
	mov	w1, #0
	bl	_HeapFree
	str	xzr, [x19, #56]
	str	xzr, [x19, #8]
	stp	wzr, w28, [x19, #16]
Lloh14:
	adrp	x8, _convertbpp@GOTPAGE
Lloh15:
	ldr	x8, [x8, _convertbpp@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cbz	w27, LBB0_8
; %bb.7:
	mov	w9, #4
	b	LBB0_9
LBB0_8:
	ldr	x9, [x19, #64]
	ldr	w9, [x9, #4]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	sub	w9, w9, #1
	sxtw	x9, w9
LBB0_9:
	ldr	x9, [x8, x9, lsl #3]
	ldr	x8, [x19, #48]
	ldr	x10, [x8, #8]
	ldr	w10, [x10, #8]
	add	w11, w10, #7
	cmp	w10, #0
	csel	w10, w11, w10, lt
	asr	w10, w10, #3
	sub	w10, w10, #1
	ldr	x9, [x9, w10, sxtw #3]
	str	x9, [x19, #72]
	ldr	x9, [x26]
	str	x9, [x19, #40]
	cbz	w23, LBB0_12
; %bb.10:
	cmp	w21, w24
	b.eq	LBB0_13
; %bb.11:
	mov	x0, x19
	bl	_DSOUND_RecalcFreqAcc
	ldr	w9, [x19, #24]
	ldr	x8, [x19, #48]
	b	LBB0_14
LBB0_12:
	ldr	w8, [x19, #28]
	str	w8, [x19, #24]
	str	w8, [x19, #8]
	b	LBB0_22
LBB0_13:
	ldr	w9, [x19, #28]
	sdiv	w9, w9, w25
	mul	w9, w9, w22
	str	w9, [x19, #24]
LBB0_14:
	str	w9, [x19, #8]
	ldr	w10, [x8]
Lloh17:
	adrp	x8, _ds_snd_shadow_maxsize@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ds_snd_shadow_maxsize@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w9, w10
	b.le	LBB0_19
; %bb.15:
	tbnz	w8, #31, LBB0_17
; %bb.16:
	lsl	w8, w8, #20
	cmp	w9, w8
	b.lt	LBB0_20
LBB0_17:
	ldr	x0, [x19, #56]
	cbz	x0, LBB0_21
LBB0_18:
	ldr	w1, [x19, #24]
	ldr	x8, [x19, #48]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #8]
	cmp	w8, #8
	cset	w8, eq
	lsl	w2, w8, #7
	bl	_FillMemory
	b	LBB0_22
LBB0_19:
	tbnz	w8, #31, LBB0_17
LBB0_20:
	bl	_GetProcessHeap
	ldr	w2, [x19, #8]
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x19, #56]
	cbnz	x0, LBB0_18
LBB0_21:
	ldr	x8, [x20]
	str	x8, [x19, #40]
LBB0_22:
	ldr	w1, [x19, #32]
	mov	x0, x19
	mov	w2, #0
	mov	x3, #0
	bl	_DSOUND_secpos_to_bufpos
	str	w0, [x19, #36]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_FALSE,8,3                      ; @FALSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p)\n"

	.comm	_WAVE_FORMAT_IEEE_FLOAT,8,3     ; @WAVE_FORMAT_IEEE_FLOAT
	.comm	_WAVE_FORMAT_EXTENSIBLE,8,3     ; @WAVE_FORMAT_EXTENSIBLE
	.comm	_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT,4,2 ; @KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
	.comm	_convertbpp,8,3                 ; @convertbpp
	.comm	_ds_snd_shadow_maxsize,4,2      ; @ds_snd_shadow_maxsize
.subsections_via_symbols
