	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DSoundRender_SendSampleData
_DSoundRender_SendSampleData:           ## @DSoundRender_SendSampleData
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	testq	%r8, %r8
	je	LBB0_30
## %bb.1:
	movq	%r8, %r13
	movl	%esi, %r15d
	movq	%rdi, %r14
	leaq	48(%rdi), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	_S_OK@GOTPCREL(%rip), %rbx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %r15d
	movq	_S_OK@GOTPCREL(%rip), %rbx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	testq	%r13, %r13
	je	LBB0_30
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r14), %rax
	movq	_State_Stopped@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_30
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, -64(%rbp)
	movq	_State_Running@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	leaq	-112(%rbp), %rsi
	movl	%r15d, %edx
	leaq	-104(%rbp), %rcx
	leaq	-64(%rbp), %r8
	callq	_DSoundRender_GetWritePos
	cmpq	(%rbx), %rax
	je	LBB0_16
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rbx
	movl	%r15d, %r13d
	movl	$1, (%r14)
	movq	-120(%rbp), %r12                ## 8-byte Reload
	movq	%r12, %rdi
	callq	_LeaveCriticalSection
	movl	56(%r14), %edi
	movl	$10, %esi
	callq	_WaitForSingleObject
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_EnterCriticalSection
	movl	$0, (%r14)
	movq	32(%r14), %rax
	movq	40(%r14), %rcx
	cmpq	$0, (%rcx)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_State_Stopped@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_WAIT_TIMEOUT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	callq	_ERR
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_S_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_7
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rdx
	callq	_FIXME
	movq	-64(%rbp), %r12
	subq	%r12, %r13
	jg	LBB0_20
	jmp	LBB0_30
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r12d, %r12d
	subq	%r12, %r13
	jle	LBB0_30
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	24(%r14), %ebx
	movq	-112(%rbp), %r15
	movq	-104(%rbp), %rdi
	movq	%r13, %rsi
	callq	_min
	movl	%ebx, %edi
	movq	%r15, %rsi
	movl	%eax, %edx
	leaq	-96(%rbp), %rcx
	leaq	-48(%rbp), %r8
	leaq	-88(%rbp), %r9
	pushq	$0
	leaq	-56(%rbp), %rax
	pushq	%rax
	callq	_IDirectSoundBuffer_Lock
	addq	$16, %rsp
	movq	_DS_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12,4), %r12
	movq	-96(%rbp), %rdi
	movq	-48(%rbp), %rdx
	movq	%r12, %rsi
	callq	_memcpy
	movq	-56(%rbp), %rdx
	testq	%rdx, %rdx
	je	LBB0_23
## %bb.24:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-88(%rbp), %rdi
	movq	-48(%rbp), %rax
	leaq	(%r12,%rax,4), %rsi
	callq	_memcpy
	movq	-56(%rbp), %r8
	jmp	LBB0_25
LBB0_23:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r8d, %r8d
LBB0_25:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	24(%r14), %edi
	movq	-96(%rbp), %rsi
	movq	-48(%rbp), %rdx
	movq	-88(%rbp), %rcx
	callq	_IDirectSoundBuffer_Unlock
	movq	-112(%rbp), %rbx
	movq	-56(%rbp), %rsi
	addq	-48(%rbp), %rsi
	leaq	(%rsi,%rbx), %rax
	movq	8(%r14), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_26
## %bb.27:                              ##   in Loop: Header=BB0_2 Depth=1
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	jmp	LBB0_28
LBB0_26:                                ##   in Loop: Header=BB0_2 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %ecx
LBB0_28:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, 16(%r14)
	movq	-104(%rbp), %r8
	leaq	L_.str.3(%rip), %rdi
	movq	%rbx, %rdx
	movq	%r13, %r9
	callq	_TRACE
	movq	-56(%rbp), %rax
	addq	-48(%rbp), %rax
	leaq	(%r12,%rax,4), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	subq	%rax, %r13
	movl	$-1, %r15d
	movq	_S_OK@GOTPCREL(%rip), %rbx
	testq	%r13, %r13
	jne	LBB0_2
	jmp	LBB0_30
LBB0_9:
	movq	_State_Paused@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.11:
	movq	_S_OK@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	jmp	LBB0_31
LBB0_21:
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rsi
	callq	_ERR
LBB0_30:
	movq	_S_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_31:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_VFW_E_WRONG_STATE@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	jmp	LBB0_31
	.cfi_endproc
                                        ## -- End function
	.comm	_State_Stopped,8,3              ## @State_Stopped
	.comm	_State_Running,8,3              ## @State_Running
	.comm	_S_FALSE,8,3                    ## @S_FALSE
	.comm	_S_OK,8,3                       ## @S_OK
	.comm	_State_Paused,8,3               ## @State_Paused
	.comm	_VFW_E_WRONG_STATE,8,3          ## @VFW_E_WRONG_STATE
	.comm	_WAIT_TIMEOUT,8,3               ## @WAIT_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"Sample dropped %u of %u bytes\n"

	.comm	_DS_OK,8,3                      ## @DS_OK
L_.str.2:                               ## @.str.2
	.asciz	"Unable to lock sound buffer! (%x)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Wrote %u bytes at %u, next at %u - (%u/%u)\n"

	.no_dead_strip	_DSoundRender_SendSampleData
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DSoundRender_SendSampleData
_DSoundRender_SendSampleData:           ; @DSoundRender_SendSampleData
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
Lloh0:
	adrp	x28, _S_OK@GOTPAGE
Lloh1:
	ldr	x28, [x28, _S_OK@GOTPAGEOFF]
	cbz	x4, LBB0_22
; %bb.1:
	mov	x25, x4
	mov	x24, x3
	mov	x26, x1
	mov	x19, x0
Lloh2:
	adrp	x23, _State_Stopped@GOTPAGE
Lloh3:
	ldr	x23, [x23, _State_Stopped@GOTPAGEOFF]
Lloh4:
	adrp	x22, _State_Running@GOTPAGE
Lloh5:
	ldr	x22, [x22, _State_Running@GOTPAGEOFF]
	add	x20, x0, #48
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #8]
	ldr	x8, [sp, #32]
	add	x1, x24, x8, lsl #2
	bl	_memcpy
	ldr	x4, [sp, #24]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #24]
	ldp	x3, x1, [sp, #8]
	ldr	x2, [sp, #32]
	bl	_IDirectSoundBuffer_Unlock
	ldr	x2, [sp, #56]
	ldp	x9, x8, [sp, #24]
	add	x1, x9, x8
	add	x8, x1, x2
	ldr	x9, [x19, #8]
	sdiv	x10, x8, x9
	msub	x3, x10, x9, x8
	str	x3, [x19, #16]
	ldr	x4, [sp, #40]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x5, x25
	bl	_TRACE
	ldp	x9, x8, [sp, #24]
	add	x8, x9, x8
	sub	x25, x25, x8
	add	x24, x24, x8, lsl #2
	mov	w26, #-1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	cbz	x25, LBB0_22
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_22
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [sp, #48]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x1, sp, #56
	add	x3, sp, #40
	add	x4, sp, #48
	mov	x0, x19
	mov	x2, x26
	bl	_DSoundRender_GetWritePos
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh8:
	adrp	x8, _S_FALSE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _S_FALSE@GOTPAGEOFF]
Lloh10:
	ldr	x0, [x8]
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [sp, #48]
	cbz	x1, LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x25
	bl	_FIXME
	ldr	x21, [sp, #48]
	subs	x25, x25, x21
	b.gt	LBB0_17
	b	LBB0_22
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x20
	bl	_LeaveCriticalSection
	ldr	w0, [x19, #56]
	mov	w1, #10
	bl	_WaitForSingleObject
	mov	x27, x0
	mov	x0, x20
	bl	_EnterCriticalSection
	str	wzr, [x19]
	ldp	x8, x9, [x19, #32]
	ldr	x9, [x9]
	cbnz	x9, LBB0_20
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_20
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh13:
	adrp	x8, _WAIT_TIMEOUT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WAIT_TIMEOUT@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x27, x8
	b.eq	LBB0_4
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x27
	bl	_ERR
	b	LBB0_4
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, #0
	subs	x25, x25, x21
	b.le	LBB0_22
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w26, [x19, #24]
	ldr	x27, [sp, #56]
	ldr	x0, [sp, #40]
	mov	x1, x25
	bl	_min
	mov	x2, x0
	add	x3, sp, #16
	add	x4, sp, #32
	add	x5, sp, #8
	add	x6, sp, #24
	mov	x0, x26
	mov	x1, x27
	mov	w7, #0
	bl	_IDirectSoundBuffer_Lock
Lloh18:
	adrp	x8, _DS_OK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DS_OK@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, x21, lsl #2
	ldr	x0, [sp, #16]
	ldr	x2, [sp, #32]
	mov	x1, x24
	bl	_memcpy
	ldr	x2, [sp, #24]
	cbnz	x2, LBB0_2
; %bb.19:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x4, #0
	b	LBB0_3
LBB0_20:
Lloh21:
	adrp	x9, _State_Paused@GOTPAGE
Lloh22:
	ldr	x9, [x9, _State_Paused@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
Lloh24:
	adrp	x10, _VFW_E_WRONG_STATE@GOTPAGE
Lloh25:
	ldr	x10, [x10, _VFW_E_WRONG_STATE@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x28, x10, eq
	ldr	x0, [x8]
	b	LBB0_23
LBB0_21:
	mov	x1, x0
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_ERR
LBB0_22:
	ldr	x0, [x28]
LBB0_23:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_State_Stopped,8,3              ; @State_Stopped
	.comm	_State_Running,8,3              ; @State_Running
	.comm	_S_FALSE,8,3                    ; @S_FALSE
	.comm	_S_OK,8,3                       ; @S_OK
	.comm	_State_Paused,8,3               ; @State_Paused
	.comm	_VFW_E_WRONG_STATE,8,3          ; @VFW_E_WRONG_STATE
	.comm	_WAIT_TIMEOUT,8,3               ; @WAIT_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"Sample dropped %u of %u bytes\n"

	.comm	_DS_OK,8,3                      ; @DS_OK
l_.str.2:                               ; @.str.2
	.asciz	"Unable to lock sound buffer! (%x)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Wrote %u bytes at %u, next at %u - (%u/%u)\n"

	.no_dead_strip	_DSoundRender_SendSampleData
.subsections_via_symbols
