	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PrimaryDirectSoundBuffer_GetPosition ## -- Begin function PrimaryDirectSoundBuffer_GetPosition
	.p2align	4, 0x90
_PrimaryDirectSoundBuffer_GetPosition:  ## @PrimaryDirectSoundBuffer_GetPosition
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	_CDirectSoundBuffer@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_lpVtbl@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_CONTAINING_RECORD
	cltq
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_1
## %bb.6:
	movq	_KSPROPERTY_AUDIO_POSITION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	_KSPROPSETID_Audio@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	_KSPROPERTY_TYPE_GET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	_IOCTL_KS_PROPERTY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	leaq	-48(%rbp), %r8
	movq	$0, (%rsp)
                                        ## kill: def $edx killed $edx killed $rdx
	movl	$12, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	$16, %r9d
	callq	_SyncOverlappedDeviceIoControl
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.8:
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.9:
	movq	-40(%rbp), %rax
	movq	%rax, (%rbx)
LBB0_10:
	movq	_DS_OK@GOTPCREL(%rip), %rax
	testq	%r14, %r14
	je	LBB0_12
## %bb.11:
	movq	-48(%rbp), %rcx
	movq	%rcx, (%r14)
	jmp	LBB0_12
LBB0_1:
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.2:
	movq	$0, (%rbx)
LBB0_3:
	testq	%r14, %r14
	je	LBB0_5
## %bb.4:
	movq	$0, (%r14)
LBB0_5:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DPRINT
	movq	_DS_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DPRINT
	movq	_DSERR_UNSUPPORTED@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CDirectSoundBuffer,4,2         ## @CDirectSoundBuffer
	.comm	_lpVtbl,4,2                     ## @lpVtbl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No Audio Pin\n"

	.comm	_DS_OK,4,2                      ## @DS_OK
	.comm	_KSPROPERTY_AUDIO_POSITION,4,2  ## @KSPROPERTY_AUDIO_POSITION
	.comm	_KSPROPSETID_Audio,4,2          ## @KSPROPSETID_Audio
	.comm	_KSPROPERTY_TYPE_GET,4,2        ## @KSPROPERTY_TYPE_GET
	.comm	_IOCTL_KS_PROPERTY,4,2          ## @IOCTL_KS_PROPERTY
	.comm	_ERROR_SUCCESS,8,3              ## @ERROR_SUCCESS
L_.str.1:                               ## @.str.1
	.asciz	"GetPosition failed with %x\n"

	.comm	_DSERR_UNSUPPORTED,4,2          ## @DSERR_UNSUPPORTED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PrimaryDirectSoundBuffer_GetPosition ; -- Begin function PrimaryDirectSoundBuffer_GetPosition
	.p2align	2
_PrimaryDirectSoundBuffer_GetPosition:  ; @PrimaryDirectSoundBuffer_GetPosition
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x2
	mov	x20, x1
Lloh0:
	adrp	x8, _CDirectSoundBuffer@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CDirectSoundBuffer@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _lpVtbl@GOTPAGE
Lloh4:
	ldr	x8, [x8, _lpVtbl@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_CONTAINING_RECORD
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	w0, [x8]
	cbz	w0, LBB0_6
; %bb.1:
Lloh6:
	adrp	x8, _KSPROPERTY_AUDIO_POSITION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KSPROPERTY_AUDIO_POSITION@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #24]
Lloh9:
	adrp	x8, _KSPROPSETID_Audio@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KSPROPSETID_Audio@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _KSPROPERTY_TYPE_GET@GOTPAGE
Lloh13:
	ldr	x9, [x9, _KSPROPERTY_TYPE_GET@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #16]
Lloh15:
	adrp	x8, _IOCTL_KS_PROPERTY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IOCTL_KS_PROPERTY@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x2, sp, #16
	add	x4, sp, #32
	mov	w3, #12
	mov	w5, #16
	mov	x6, #0
	bl	_SyncOverlappedDeviceIoControl
Lloh18:
	adrp	x8, _ERROR_SUCCESS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERROR_SUCCESS@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.2:
	cbz	x20, LBB0_4
; %bb.3:
	ldr	x8, [sp, #40]
	str	x8, [x20]
LBB0_4:
	cbz	x19, LBB0_11
; %bb.5:
	ldr	x8, [sp, #32]
	str	x8, [x19]
	b	LBB0_11
LBB0_6:
	cbz	x20, LBB0_8
; %bb.7:
	str	xzr, [x20]
LBB0_8:
	cbz	x19, LBB0_10
; %bb.9:
	str	xzr, [x19]
LBB0_10:
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINT
LBB0_11:
Lloh23:
	adrp	x8, _DS_OK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DS_OK@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
	str	x0, [sp]
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPRINT
Lloh27:
	adrp	x8, _DSERR_UNSUPPORTED@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DSERR_UNSUPPORTED@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_CDirectSoundBuffer,4,2         ; @CDirectSoundBuffer
	.comm	_lpVtbl,4,2                     ; @lpVtbl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No Audio Pin\n"

	.comm	_DS_OK,4,2                      ; @DS_OK
	.comm	_KSPROPERTY_AUDIO_POSITION,4,2  ; @KSPROPERTY_AUDIO_POSITION
	.comm	_KSPROPSETID_Audio,4,2          ; @KSPROPSETID_Audio
	.comm	_KSPROPERTY_TYPE_GET,4,2        ; @KSPROPERTY_TYPE_GET
	.comm	_IOCTL_KS_PROPERTY,4,2          ; @IOCTL_KS_PROPERTY
	.comm	_ERROR_SUCCESS,8,3              ; @ERROR_SUCCESS
l_.str.1:                               ; @.str.1
	.asciz	"GetPosition failed with %x\n"

	.comm	_DSERR_UNSUPPORTED,4,2          ; @DSERR_UNSUPPORTED
.subsections_via_symbols
