	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SexyALI_DSound_RawCanWrite     ## -- Begin function SexyALI_DSound_RawCanWrite
	.p2align	4, 0x90
_SexyALI_DSound_RawCanWrite:            ## @SexyALI_DSound_RawCanWrite
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	(%rdi), %rbx
	movl	$0, -12(%rbp)
	movq	%rbx, %rdi
	callq	_CheckStatus
	movl	$0, -16(%rbp)
	movl	12(%rbx), %edi
	leaq	-12(%rbp), %rsi
	leaq	-16(%rbp), %rdx
	callq	_IDirectSoundBuffer_GetCurrentPosition
	movl	(%rbx), %r8d
	movl	4(%rbx), %edi
	movl	-12(%rbp), %eax
	addl	%r8d, %eax
	cltd
	idivl	%edi
	movl	8(%rbx), %r9d
	movl	%r9d, %ecx
	subl	%edx, %ecx
	movl	%edi, %esi
	shrl	$31, %esi
	addl	%edi, %esi
	sarl	%esi
	xorl	%eax, %eax
	cmpl	%esi, %ecx
	movl	%edi, %ecx
	cmovll	%eax, %ecx
	addl	%edx, %ecx
	movl	%ecx, %edx
	subl	%r9d, %edx
	jle	LBB0_3
## %bb.1:
	movl	%edx, %eax
	cmpl	%r8d, %edx
	jle	LBB0_3
## %bb.2:
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%edx, 8(%rbx)
	subl	%edx, %ecx
	movl	%ecx, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_SexyALI_DSound_RawCanWrite     ; -- Begin function SexyALI_DSound_RawCanWrite
	.p2align	2
_SexyALI_DSound_RawCanWrite:            ; @SexyALI_DSound_RawCanWrite
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x19, [x0]
	str	wzr, [sp, #8]
	mov	x0, x19
	bl	_CheckStatus
	str	wzr, [sp, #12]
	ldr	w0, [x19, #12]
	add	x1, sp, #8
	add	x2, sp, #12
	bl	_IDirectSoundBuffer_GetCurrentPosition
	mov	w0, #0
	ldr	w10, [sp, #8]
	ldp	w9, w8, [x19]
	add	w10, w9, w10
	sdiv	w11, w10, w8
	msub	w10, w11, w8, w10
	ldr	w11, [x19, #8]
	sub	w12, w11, w10
	cmp	w8, #0
	cinc	w13, w8, lt
	cmp	w12, w13, asr #1
	csel	w12, wzr, w8, lt
	add	w10, w10, w12
	subs	w11, w10, w11
	b.le	LBB0_3
; %bb.1:
	mov	x0, x11
	cmp	w11, w9
	b.le	LBB0_3
; %bb.2:
	sdiv	w9, w10, w8
	mul	w0, w9, w8
	sub	w8, w10, w0
	str	w8, [x19, #8]
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
	.comm	_DS_OK,8,3                      ; @DS_OK
.subsections_via_symbols
