	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMUSIC_CreateDirectMusicBufferImpl ## -- Begin function DMUSIC_CreateDirectMusicBufferImpl
	.p2align	4, 0x90
_DMUSIC_CreateDirectMusicBufferImpl:    ## @DMUSIC_CreateDirectMusicBufferImpl
	.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	%rsi, %r14
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_TRACE
	movq	$0, (%r14)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	$32, %edx
	callq	_HeapAlloc
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %r13
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	movq	_DirectMusicBuffer_Vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movl	$1, (%rbx)
	leaq	4(%r15), %r12
	movq	_GUID_NULL@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_IsEqualGUID
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_KSDATAFORMAT_SUBTYPE_MIDI@GOTPCREL(%rip), %r12
LBB0_3:
	movl	(%r12), %eax
	movl	%eax, 24(%rbx)
	movl	(%r15), %eax
	addl	$3, %eax
	andl	$-4, %eax
	movl	%eax, 4(%rbx)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	4(%rbx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	addq	$8, %rbx
	xorl	%eax, %eax
	callq	_DMUSIC_LockModule
	movq	%rbx, (%r14)
	movq	_S_OK@GOTPCREL(%rip), %r13
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
LBB0_6:
	movl	(%r13), %eax
	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)\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_DirectMusicBuffer_Vtbl,4,2     ## @DirectMusicBuffer_Vtbl
	.comm	_GUID_NULL,4,2                  ## @GUID_NULL
	.comm	_KSDATAFORMAT_SUBTYPE_MIDI,4,2  ## @KSDATAFORMAT_SUBTYPE_MIDI
	.comm	_S_OK,4,2                       ## @S_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMUSIC_CreateDirectMusicBufferImpl ; -- Begin function DMUSIC_CreateDirectMusicBufferImpl
	.p2align	2
_DMUSIC_CreateDirectMusicBufferImpl:    ; @DMUSIC_CreateDirectMusicBufferImpl
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	bl	_TRACE
	str	xzr, [x19]
	bl	_GetProcessHeap
Lloh2:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #32
	bl	_HeapAlloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh5:
	adrp	x8, _DirectMusicBuffer_Vtbl@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DirectMusicBuffer_Vtbl@GOTPAGEOFF]
	mov	x23, x0
	str	x8, [x23, #8]!
	mov	w8, #1
	str	w8, [x0]
	add	x22, x21, #4
Lloh7:
	adrp	x1, _GUID_NULL@GOTPAGE
Lloh8:
	ldr	x1, [x1, _GUID_NULL@GOTPAGEOFF]
	mov	x0, x22
	bl	_IsEqualGUID
Lloh9:
	adrp	x8, _KSDATAFORMAT_SUBTYPE_MIDI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KSDATAFORMAT_SUBTYPE_MIDI@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x22, x8, eq
	ldr	w8, [x8]
	str	w8, [x20, #24]
	ldr	w8, [x21]
	add	w8, w8, #3
	and	w8, w8, #0xfffffffc
	str	w8, [x20, #4]
	bl	_GetProcessHeap
	ldr	w2, [x20, #4]
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x20, #16]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_DMUSIC_LockModule
	str	x23, [x19]
Lloh11:
	adrp	x8, _S_OK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x20
	bl	_HeapFree
LBB0_4:
Lloh13:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p, %p)\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_DirectMusicBuffer_Vtbl,4,2     ; @DirectMusicBuffer_Vtbl
	.comm	_GUID_NULL,4,2                  ; @GUID_NULL
	.comm	_KSDATAFORMAT_SUBTYPE_MIDI,4,2  ; @KSDATAFORMAT_SUBTYPE_MIDI
	.comm	_S_OK,4,2                       ; @S_OK
.subsections_via_symbols
