	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_PrimaryGetPosition      ## -- Begin function DSOUND_PrimaryGetPosition
	.p2align	4, 0x90
_DSOUND_PrimaryGetPosition:             ## @DSOUND_PrimaryGetPosition
	.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
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_TRACE
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_IDsDriverBuffer_GetPosition
	movq	%rax, %rbx
	movq	_S_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_7
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_WARN
	jmp	LBB0_12
LBB0_3:
	movl	(%r12), %esi
	movl	4(%r12), %edx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	testq	%r15, %r15
	je	LBB0_5
## %bb.4:
	movl	8(%r12), %eax
	imull	(%r12), %eax
	movl	%eax, (%r15)
LBB0_5:
	testq	%r14, %r14
	je	LBB0_7
## %bb.6:
	movl	4(%r12), %eax
	addl	(%r12), %eax
	cltd
	idivl	12(%r12)
	imull	8(%r12), %edx
	movl	%edx, (%r14)
LBB0_7:
	movl	$-1, %ebx
	movl	$-1, %r13d
	testq	%r15, %r15
	je	LBB0_9
## %bb.8:
	movl	(%r15), %r13d
LBB0_9:
	testq	%r14, %r14
	je	LBB0_11
## %bb.10:
	movl	(%r14), %ebx
LBB0_11:
	xorl	%eax, %eax
	callq	_GetTickCount
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movq	%r12, %rcx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_TRACE
	movq	_DS_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_12:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p,%p,%p)\n"

	.comm	_S_OK,8,3                       ## @S_OK
L_.str.1:                               ## @.str.1
	.asciz	"IDsDriverBuffer_GetPosition failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"pwplay=%i, pwqueue=%i\n"

L_.str.3:                               ## @.str.3
	.asciz	"playpos = %d, writepos = %d (%p, time=%d)\n"

	.comm	_DS_OK,8,3                      ## @DS_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_PrimaryGetPosition      ; -- Begin function DSOUND_PrimaryGetPosition
	.p2align	2
_DSOUND_PrimaryGetPosition:             ; @DSOUND_PrimaryGetPosition
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	stp	x1, x2, [sp, #8]
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x1, x21
	mov	x2, x20
	bl	_IDsDriverBuffer_GetPosition
Lloh2:
	adrp	x8, _S_OK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.2:
	mov	x22, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_WARN
	b	LBB0_13
LBB0_3:
	ldp	w8, w9, [x19]
	stp	x8, x9, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	cbz	x21, LBB0_5
; %bb.4:
	ldr	w8, [x19]
	ldr	w9, [x19, #8]
	mul	w8, w9, w8
	str	w8, [x21]
LBB0_5:
	cbz	x20, LBB0_7
; %bb.6:
	ldp	w8, w9, [x19]
	add	w8, w9, w8
	ldp	w10, w9, [x19, #8]
	sdiv	w11, w8, w9
	msub	w8, w11, w9, w8
	mul	w8, w10, w8
	str	w8, [x20]
LBB0_7:
	cbz	x21, LBB0_10
; %bb.8:
	ldr	w21, [x21]
	cbz	x20, LBB0_11
LBB0_9:
	ldr	w20, [x20]
	b	LBB0_12
LBB0_10:
	mov	w21, #-1
	cbnz	x20, LBB0_9
LBB0_11:
	mov	w20, #-1
LBB0_12:
	bl	_GetTickCount
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp, #16]
	stp	x21, x20, [sp]
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
Lloh11:
	adrp	x8, _DS_OK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DS_OK@GOTPAGEOFF]
Lloh13:
	ldr	x22, [x8]
LBB0_13:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p,%p,%p)\n"

	.comm	_S_OK,8,3                       ; @S_OK
l_.str.1:                               ; @.str.1
	.asciz	"IDsDriverBuffer_GetPosition failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"pwplay=%i, pwqueue=%i\n"

l_.str.3:                               ; @.str.3
	.asciz	"playpos = %d, writepos = %d (%p, time=%d)\n"

	.comm	_DS_OK,8,3                      ; @DS_OK
.subsections_via_symbols
