	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DSoundRender_GetWritePos
_DSoundRender_GetWritePos:              ## @DSoundRender_GetWritePos
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r14
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	40(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	leaq	-88(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	callq	_DSoundRender_UpdatePositions
	movq	(%r13), %r15
	movq	32(%r13), %rdi
	leaq	48(%r13), %rax
	cmpq	%rax, %rdi
	je	LBB0_1
## %bb.2:
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.4:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leaq	-64(%rbp), %rsi
	callq	_IReferenceClock_GetTime
	movl	-64(%rbp), %ebx
	subl	24(%r13), %ebx
	movl	$500000, %eax                   ## imm = 0x7A120
	jmp	LBB0_5
LBB0_1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	8(%r13), %r14d
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_time_from_pos
	movl	%eax, %ebx
	addl	%r14d, %ebx
	subl	24(%r13), %ebx
	movl	$250000, %eax                   ## imm = 0x3D090
LBB0_5:
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	movl	%ebx, -64(%rbp)
	movq	-88(%rbp), %rdx
	xorl	%r12d, %r12d
	cmpq	-72(%rbp), %rdx
	cmovnel	%eax, %r12d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	testl	%r14d, %r14d
	js	LBB0_23
## %bb.6:
	movq	%rdx, %rsi
	subq	%r15, %rsi
	jge	LBB0_8
## %bb.7:
	subq	%r15, %rdx
	addq	16(%r13), %rdx
	movq	%rdx, %rsi
LBB0_8:
	movq	%r13, %rdi
	callq	_time_from_pos
	addl	%ebx, %eax
                                        ## kill: def $r14d killed $r14d def $r14
	subl	%eax, %r14d
	movl	%r12d, %eax
	negl	%eax
	cmpl	%eax, %r14d
	jl	LBB0_11
## %bb.9:
	cmpl	%r12d, %r14d
	jg	LBB0_11
## %bb.10:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	-88(%rbp), %rdx
LBB0_23:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_24:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_25
LBB0_11:
	testl	%r14d, %r14d
	js	LBB0_12
## %bb.19:
	movl	%r14d, %esi
	movl	$3518437209, %eax               ## imm = 0xD1B71759
	imulq	%rax, %rsi
	shrq	$45, %rsi
	movl	%r12d, %edx
	imulq	%rax, %rdx
	shrq	$45, %rdx
	leaq	L_.str.4(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_WARN
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_pos_from_time
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_WARN
	movq	_DSoundRenderer_Max_Fill@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jge	LBB0_32
## %bb.20:
	addq	-72(%rbp), %rbx
	movq	16(%r13), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_21
## %bb.22:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_23
LBB0_3:
	movq	-88(%rbp), %rdx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
LBB0_25:
	movq	%rdx, (%rbx)
	subq	%rdx, %r15
	jg	LBB0_29
## %bb.26:
	movq	16(%r13), %rax
	jne	LBB0_28
## %bb.27:
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	subq	(%rcx), %rax
	movq	%rax, %r15
	jmp	LBB0_29
LBB0_28:
	addq	%rax, %r15
LBB0_29:
	movq	%r15, (%r14)
	movq	16(%r13), %rsi
	subq	%r15, %rsi
	movq	%r13, %rdi
	callq	_time_from_pos
	movq	_DSoundRenderer_Max_Fill@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	jge	LBB0_31
## %bb.30:
	movq	_S_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_33
LBB0_31:
	movq	16(%r13), %rsi
	subq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_time_from_pos
	cltq
	imulq	$1759218605, %rax, %rsi         ## imm = 0x68DB8BAD
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$44, %rsi
	addl	%eax, %esi
	movslq	(%rbx), %rax
	imulq	$1759218605, %rax, %rdx         ## imm = 0x68DB8BAD
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$44, %rdx
	addl	%eax, %edx
	leaq	L_.str.5(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_TRACE
LBB0_32:
	movq	_S_FALSE@GOTPCREL(%rip), %rax
LBB0_33:
	movl	(%rax), %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	negl	%r14d
	movl	$3518437209, %eax               ## imm = 0xD1B71759
	imulq	%rax, %r14
	shrq	$45, %r14
	negl	%r14d
	movslq	%r14d, %rsi
	movl	%r12d, %edx
	imulq	%rax, %rdx
	shrq	$45, %rdx
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_WARN
	movq	-72(%rbp), %rax
	movq	%rax, %rsi
	movl	-64(%rbp), %ebx
	subq	%r15, %rsi
	jge	LBB0_14
## %bb.13:
	subq	%r15, %rax
	addq	16(%r13), %rax
	movq	%rax, %rsi
LBB0_14:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_time_from_pos
	addl	%ebx, %eax
	subl	-60(%rbp), %eax                 ## 4-byte Folded Reload
	js	LBB0_16
## %bb.15:
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_pos_from_time
	movq	%rax, %rbx
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_WARN
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	movq	-72(%rbp), %rdx
	jmp	LBB0_24
LBB0_16:
	negl	%eax
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_pos_from_time
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_WARN
	addq	-72(%rbp), %rbx
	movq	16(%r13), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_17
## %bb.18:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_24
LBB0_21:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	jmp	LBB0_23
LBB0_17:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Continuing from old position\n"

L_.str.1:                               ## @.str.1
	.asciz	"Delta too big %i/%i, overwriting old data or even skipping\n"

L_.str.2:                               ## @.str.2
	.asciz	"Skipping %u bytes\n"

L_.str.3:                               ## @.str.3
	.asciz	"Advancing %u bytes\n"

L_.str.4:                               ## @.str.4
	.asciz	"Delta too big %i/%i, too far ahead\n"

	.comm	_DSoundRenderer_Max_Fill,4,2    ## @DSoundRenderer_Max_Fill
	.comm	_S_FALSE,4,2                    ## @S_FALSE
L_.str.5:                               ## @.str.5
	.asciz	"Blocked: too full %i / %i\n"

	.comm	_S_OK,4,2                       ## @S_OK
	.no_dead_strip	_DSoundRender_GetWritePos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DSoundRender_GetWritePos
_DSoundRender_GetWritePos:              ; @DSoundRender_GetWritePos
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x23, x4
	mov	x20, x3
	mov	x24, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #40]
	ldr	x27, [x8]
	add	x1, sp, #40
	add	x2, sp, #32
	bl	_DSoundRender_UpdatePositions
	ldr	x22, [x19]
	ldr	x0, [x19, #32]
	add	x8, x19, #48
Lloh0:
	adrp	x26, _DSoundRenderer_Max_Fill@GOTPAGE
Lloh1:
	ldr	x26, [x26, _DSoundRenderer_Max_Fill@GOTPAGEOFF]
	cmp	x0, x8
	b.eq	LBB0_3
; %bb.1:
	cbz	x0, LBB0_11
; %bb.2:
	add	x1, sp, #28
	bl	_IReferenceClock_GetTime
	ldr	w8, [x19, #24]
	ldr	w9, [sp, #28]
	sub	w25, w9, w8
	mov	w9, #41248
	movk	w9, #7, lsl #16
	b	LBB0_4
LBB0_3:
	ldr	w25, [x19, #8]
	mov	x0, x19
	mov	x1, x22
	bl	_time_from_pos
	ldr	w8, [x19, #24]
	add	w9, w0, w25
	sub	w25, w9, w8
	mov	w9, #53392
	movk	w9, #3, lsl #16
LBB0_4:
	str	w25, [sp, #28]
	ldp	x10, x8, [sp, #32]
	cmp	x8, x10
	csel	w28, wzr, w9, eq
	str	xzr, [x23]
	tbnz	w24, #31, LBB0_18
; %bb.5:
	subs	x1, x8, x22
	b.ge	LBB0_7
; %bb.6:
	ldr	x8, [x19, #16]
	add	x1, x1, x8
LBB0_7:
	mov	x0, x19
	bl	_time_from_pos
	add	w8, w0, w25
	sub	w25, w24, w8
	neg	w8, w28
	cmp	w25, w8
	ccmp	w25, w28, #0, ge
	b.le	LBB0_10
; %bb.8:
	tbnz	w25, #31, LBB0_12
; %bb.9:
	mov	w8, #5977
	movk	w8, #53687, lsl #16
	umull	x9, w25, w8
	lsr	x1, x9, #45
	umull	x8, w28, w8
	lsr	x8, x8, #45
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.4@PAGE
Lloh3:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_WARN
	mov	x0, x19
	mov	x1, x25
	bl	_pos_from_time
	mov	x23, x0
Lloh4:
	adrp	x0, l_.str.3@PAGE
Lloh5:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	bl	_WARN
	ldr	w8, [x26]
	cmp	w25, w8
	b.lt	LBB0_17
	b	LBB0_25
LBB0_10:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x8, [sp, #40]
	b	LBB0_18
LBB0_11:
	ldr	x8, [sp, #40]
	str	xzr, [x23]
	b	LBB0_18
LBB0_12:
	neg	w8, w25
	mov	w9, #5977
	movk	w9, #53687, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #45
	neg	w8, w8
	sxtw	x1, w8
	umull	x8, w28, w9
	lsr	x8, x8, #45
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_WARN
	ldr	x8, [sp, #32]
	ldr	w25, [sp, #28]
	subs	x1, x8, x22
	b.ge	LBB0_14
; %bb.13:
	ldr	x8, [x19, #16]
	add	x1, x1, x8
LBB0_14:
	mov	x0, x19
	bl	_time_from_pos
	add	w8, w0, w25
	subs	w1, w8, w24
	b.mi	LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_pos_from_time
	mov	x24, x0
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x24
	bl	_WARN
	str	x24, [x23]
	ldr	x8, [sp, #32]
	b	LBB0_18
LBB0_16:
	neg	w1, w1
	mov	x0, x19
	bl	_pos_from_time
	mov	x23, x0
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	bl	_WARN
LBB0_17:
	ldr	x8, [sp, #32]
	add	x8, x8, x23
	ldr	x9, [x19, #16]
	sdiv	x10, x8, x9
	msub	x8, x10, x9, x8
LBB0_18:
	str	x8, [x21]
	subs	x8, x22, x8
	b.gt	LBB0_22
; %bb.19:
	ldr	x9, [x19, #16]
	b.ne	LBB0_21
; %bb.20:
	ldr	x8, [x27]
	sub	x8, x9, x8
	b	LBB0_22
LBB0_21:
	add	x8, x8, x9
LBB0_22:
	str	x8, [x20]
	ldr	x9, [x19, #16]
	sub	x1, x9, x8
	mov	x0, x19
	bl	_time_from_pos
	ldr	w8, [x26]
	cmp	w0, w8
	b.ge	LBB0_24
; %bb.23:
Lloh14:
	adrp	x8, _S_OK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
	b	LBB0_26
LBB0_24:
	ldr	x8, [x19, #16]
	ldr	x9, [x20]
	sub	x1, x8, x9
	mov	x0, x19
	bl	_time_from_pos
	mov	w8, #35757
	movk	w8, #26843, lsl #16
	smull	x9, w0, w8
	lsr	x10, x9, #63
	asr	x9, x9, #44
	add	w9, w9, w10
	ldrsw	x10, [x26]
	mul	x8, x10, x8
	lsr	x10, x8, #63
	asr	x8, x8, #44
	add	w8, w8, w10
	stp	x9, x8, [sp]
Lloh16:
	adrp	x0, l_.str.5@PAGE
Lloh17:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_TRACE
LBB0_25:
Lloh18:
	adrp	x8, _S_FALSE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _S_FALSE@GOTPAGEOFF]
LBB0_26:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Continuing from old position\n"

l_.str.1:                               ; @.str.1
	.asciz	"Delta too big %i/%i, overwriting old data or even skipping\n"

l_.str.2:                               ; @.str.2
	.asciz	"Skipping %u bytes\n"

l_.str.3:                               ; @.str.3
	.asciz	"Advancing %u bytes\n"

l_.str.4:                               ; @.str.4
	.asciz	"Delta too big %i/%i, too far ahead\n"

	.comm	_DSoundRenderer_Max_Fill,4,2    ; @DSoundRenderer_Max_Fill
	.comm	_S_FALSE,4,2                    ; @S_FALSE
l_.str.5:                               ; @.str.5
	.asciz	"Blocked: too full %i / %i\n"

	.comm	_S_OK,4,2                       ; @S_OK
	.no_dead_strip	_DSoundRender_GetWritePos
.subsections_via_symbols
