	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SNDDXGetAudioSpace             ## -- Begin function SNDDXGetAudioSpace
	.p2align	4, 0x90
_SNDDXGetAudioSpace:                    ## @SNDDXGetAudioSpace
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	movq	_lpDSB2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-8(%rbp), %rsi
	leaq	-16(%rbp), %rdx
	callq	_IDirectSoundBuffer8_GetCurrentPosition
	movq	%rax, %rcx
	movq	_DS_OK@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.1:
	movq	_soundoffset@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rsi
	movl	%esi, %eax
	subl	%edx, %eax
	xorl	%ecx, %ecx
	cmpq	%rdx, %rsi
	jge	LBB0_3
## %bb.2:
	movq	_soundbufsize@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_3:
	movl	%eax, %edx
	addl	%ecx, %edx
	leal	3(%rax,%rcx), %eax
	cmovnsl	%edx, %eax
	sarl	$2, %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_lpDSB2,4,2                     ## @lpDSB2
	.comm	_DS_OK,8,3                      ## @DS_OK
	.comm	_soundoffset,8,3                ## @soundoffset
	.comm	_soundbufsize,8,3               ## @soundbufsize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SNDDXGetAudioSpace             ; -- Begin function SNDDXGetAudioSpace
	.p2align	2
_SNDDXGetAudioSpace:                    ; @SNDDXGetAudioSpace
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _lpDSB2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _lpDSB2@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, sp, #8
	mov	x2, sp
	bl	_IDirectSoundBuffer8_GetCurrentPosition
Lloh3:
	adrp	x8, _DS_OK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DS_OK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _soundoffset@GOTPAGE
Lloh7:
	ldr	x8, [x8, _soundoffset@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
Lloh9:
	adrp	x10, _soundbufsize@GOTPAGE
Lloh10:
	ldr	x10, [x10, _soundbufsize@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	x9, x8
	csel	w10, w10, wzr, lt
	sub	w8, w9, w8
	add	w8, w8, w10
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #2
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_lpDSB2,4,2                     ; @lpDSB2
	.comm	_DS_OK,8,3                      ; @DS_OK
	.comm	_soundoffset,8,3                ; @soundoffset
	.comm	_soundbufsize,8,3               ; @soundbufsize
.subsections_via_symbols
