	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PrimaryDirectSoundBuffer_Write ## -- Begin function PrimaryDirectSoundBuffer_Write
	.p2align	4, 0x90
_PrimaryDirectSoundBuffer_Write:        ## @PrimaryDirectSoundBuffer_Write
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r14d
	movq	_CDirectSoundBuffer@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_lpVtbl@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_CONTAINING_RECORD
	movslq	%eax, %r12
	leaq	-128(%rbp), %rdi
	movl	$40, %esi
	callq	_ZeroMemory
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	movl	%edx, %esi
	xorl	%ecx, %ecx
	callq	_CreateEvent
	movl	%eax, -96(%rbp)
	movl	(%r12), %edi
	callq	_ASSERT
	leaq	-88(%rbp), %r13
	movq	%r13, %rdi
	movl	$40, %esi
	callq	_ZeroMemory
	movq	%rbx, -64(%rbp)
	movq	%rbx, -72(%rbp)
	movl	%r14d, -76(%rbp)
	movabsq	$4294967336, %rax               ## imm = 0x100000028
	movq	%rax, -88(%rbp)
	movl	$1, -80(%rbp)
	movl	(%r12), %edi
	movq	_IOCTL_KS_WRITE_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r13, %r8
	movl	$40, %r9d
	leaq	-128(%rbp), %rbx
	pushq	%rbx
	pushq	%rax
	callq	_DeviceIoControl
	addq	$16, %rsp
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	-48(%rbp), %r15
LBB0_2:
	movq	%r15, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CDirectSoundBuffer,4,2         ## @CDirectSoundBuffer
	.comm	_lpVtbl,4,2                     ## @lpVtbl
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_IOCTL_KS_WRITE_STREAM,4,2      ## @IOCTL_KS_WRITE_STREAM
	.comm	_ERROR_SUCCESS,8,3              ## @ERROR_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function PrimaryDirectSoundBuffer_Write
lCPI0_0:
	.long	40                              ; 0x28
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_PrimaryDirectSoundBuffer_Write
	.p2align	2
_PrimaryDirectSoundBuffer_Write:        ; @PrimaryDirectSoundBuffer_Write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	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	x21, w0
	add	x0, sp, #8
	mov	w1, #40
	bl	_ZeroMemory
Lloh6:
	adrp	x8, _FALSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, #0
	mov	x2, x1
	mov	x3, #0
	bl	_CreateEvent
	str	w0, [sp, #40]
	ldr	w0, [x21]
	bl	_ASSERT
	add	x0, sp, #56
	mov	w1, #40
	bl	_ZeroMemory
	stp	x19, x19, [sp, #72]
Lloh9:
	adrp	x8, lCPI0_0@PAGE
Lloh10:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #56]
	mov	w8, #1
	stp	w8, w20, [sp, #64]
	ldr	w0, [x21]
Lloh11:
	adrp	x8, _IOCTL_KS_WRITE_STREAM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IOCTL_KS_WRITE_STREAM@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x4, sp, #56
	add	x6, sp, #48
	add	x7, sp, #8
	mov	x2, #0
	mov	w3, #0
	mov	w5, #40
	bl	_DeviceIoControl
Lloh14:
	adrp	x8, _ERROR_SUCCESS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERROR_SUCCESS@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	x9, [sp, #48]
	cmp	x0, x8
	csel	x0, x9, xzr, eq
	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
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdr	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CDirectSoundBuffer,4,2         ; @CDirectSoundBuffer
	.comm	_lpVtbl,4,2                     ; @lpVtbl
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_IOCTL_KS_WRITE_STREAM,4,2      ; @IOCTL_KS_WRITE_STREAM
	.comm	_ERROR_SUCCESS,8,3              ; @ERROR_SUCCESS
.subsections_via_symbols
