	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DSOUND_WaveQueue
_DSOUND_WaveQueue:                      ## @DSOUND_WaveQueue
	.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, %r15d
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movq	8(%r14), %rcx
	movq	16(%r14), %rsi
	movq	(%r14), %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rsi
	movq	%rdx, %rbx
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
	movl	%edx, %ebx
LBB0_3:
	movq	24(%r14), %rdx
	imulq	%rbx, %rdx
	movq	32(%r14), %r8
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.10:
	movq	32(%r14), %rax
	movq	%rax, %r12
	jmp	LBB0_11
LBB0_4:
	movq	24(%r14), %rcx
	movq	40(%r14), %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r12
	jmp	LBB0_7
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r12d
LBB0_7:
	xorl	%eax, %eax
	cmpq	16(%r14), %r12
	sete	%al
	subq	%rax, %r12
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_TRACE
	cmpq	%rbx, %r12
	jae	LBB0_9
## %bb.8:
	addq	16(%r14), %r12
LBB0_9:
	subq	%rbx, %r12
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movq	32(%r14), %rax
LBB0_11:
	movq	8(%r14), %rcx
	movq	%rax, %r15
	subq	%rcx, %r15
	addq	%r12, %rcx
	cmpq	%rax, %rcx
	cmovbeq	%r12, %r15
	leaq	L_.str.4(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	addq	%r15, 8(%r14)
	leaq	48(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_LeaveCriticalSection
	testq	%r15, %r15
	je	LBB0_17
## %bb.12:
	leaq	L_.str.5(%rip), %r13
	xorl	%r12d, %r12d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %rbx
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r12
	cmpq	%r15, %r12
	jae	LBB0_17
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movl	64(%r14), %edi
	leaq	(,%rbx,4), %rsi
	addq	56(%r14), %rsi
	movl	$4, %edx
	callq	_waveOutWrite
	incq	%rbx
	movq	16(%r14), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %ebx
	jmp	LBB0_16
LBB0_17:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_EnterCriticalSection
	movq	8(%r14), %rsi
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_TRACE                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p)\n"

L_.str.1:                               ## @.str.1
	.asciz	"wave_fragpos = %i, wave_writepos = %i, pwqueue = %i, prebuf = %i\n"

L_.str.2:                               ## @.str.2
	.asciz	"wave_fragpos = %d, mixpos_frags = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"wanted prebuf_frags = %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"prebuf_frags = %i\n"

L_.str.5:                               ## @.str.5
	.asciz	"queueing wave buffer %i\n"

L_.str.6:                               ## @.str.6
	.asciz	"queue now = %i\n"

	.no_dead_strip	_DSOUND_WaveQueue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DSOUND_WaveQueue
_DSOUND_WaveQueue:                      ; @DSOUND_WaveQueue
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	mov	x19, x0
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldp	x8, x9, [x19]
	add	x8, x9, x8
	ldp	x10, x11, [x19, #16]
	udiv	x12, x8, x10
	msub	x22, x12, x10, x8
	mul	x8, x11, x22
	ldr	x10, [x19, #32]
	stp	x9, x10, [sp, #16]
	stp	x22, x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	cbz	w20, LBB0_2
; %bb.1:
	ldr	x8, [x19, #32]
	mov	x20, x8
	b	LBB0_5
LBB0_2:
	ldr	x8, [x19, #40]
	ldp	x10, x9, [x19, #16]
	udiv	x8, x8, x9
	cmp	x8, x10
	cset	w9, eq
	sub	x20, x8, x9
	stp	x22, x20, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	cmp	x20, x22
	b.hs	LBB0_4
; %bb.3:
	ldr	x8, [x19, #16]
	add	x20, x8, x20
LBB0_4:
	sub	x20, x20, x22
	str	x20, [sp]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
	ldr	x8, [x19, #32]
LBB0_5:
	ldr	x9, [x19, #8]
	sub	x10, x8, x9
	add	x9, x9, x20
	cmp	x9, x8
	csel	x23, x10, x20, hi
	str	x23, [sp]
Lloh8:
	adrp	x0, l_.str.4@PAGE
Lloh9:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_TRACE
	ldr	x8, [x19, #8]
	add	x8, x8, x23
	str	x8, [x19, #8]
	add	x20, x19, #48
	mov	x0, x20
	bl	_LeaveCriticalSection
	cbz	x23, LBB0_8
; %bb.6:
	mov	x24, #0
Lloh10:
	adrp	x21, l_.str.5@PAGE
Lloh11:
	add	x21, x21, l_.str.5@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	str	x22, [sp]
	mov	x0, x21
	bl	_TRACE
	ldr	w0, [x19, #64]
	ldr	x8, [x19, #56]
	add	x1, x8, x22, lsl #2
	mov	w2, #4
	bl	_waveOutWrite
	add	x8, x22, #1
	ldr	x9, [x19, #16]
	udiv	x10, x8, x9
	msub	x22, x10, x9, x8
	add	x24, x24, #1
	cmp	x24, x23
	b.lo	LBB0_7
LBB0_8:
	mov	x0, x20
	bl	_EnterCriticalSection
	ldr	x8, [x19, #8]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.6@PAGE
Lloh13:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_TRACE
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p)\n"

l_.str.1:                               ; @.str.1
	.asciz	"wave_fragpos = %i, wave_writepos = %i, pwqueue = %i, prebuf = %i\n"

l_.str.2:                               ; @.str.2
	.asciz	"wave_fragpos = %d, mixpos_frags = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"wanted prebuf_frags = %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"prebuf_frags = %i\n"

l_.str.5:                               ; @.str.5
	.asciz	"queueing wave buffer %i\n"

l_.str.6:                               ; @.str.6
	.asciz	"queue now = %i\n"

	.no_dead_strip	_DSOUND_WaveQueue
.subsections_via_symbols
