	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function midi_port_create
_midi_port_create:                      ## @midi_port_create
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	$32, %edi
	callq	_heap_alloc_zero
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_midi_port_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	_midi_thru_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rbx)
	movl	$1, (%rbx)
	leaq	16(%rbx), %rsi
	movq	_IID_IReferenceClock@GOTPCREL(%rip), %rdi
	xorl	%edx, %edx
	callq	_DMUSIC_CreateReferenceClockImpl
	movq	%rax, %r15
	movq	_S_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_3
## %bb.4:
	addq	$8, %rbx
	movq	%rbx, (%r14)
	jmp	LBB0_5
LBB0_1:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
LBB0_5:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_E_OUTOFMEMORY,8,3              ## @E_OUTOFMEMORY
	.comm	_midi_port_vtbl,4,2             ## @midi_port_vtbl
	.comm	_midi_thru_vtbl,4,2             ## @midi_thru_vtbl
	.comm	_IID_IReferenceClock,4,2        ## @IID_IReferenceClock
	.comm	_S_OK,8,3                       ## @S_OK
	.no_dead_strip	_midi_port_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function midi_port_create
_midi_port_create:                      ; @midi_port_create
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x3
	mov	w0, #32
	bl	_heap_alloc_zero
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _midi_port_vtbl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _midi_port_vtbl@GOTPAGEOFF]
	mov	x22, x0
	str	x8, [x22, #8]!
Lloh2:
	adrp	x8, _midi_thru_vtbl@GOTPAGE
Lloh3:
	ldr	x8, [x8, _midi_thru_vtbl@GOTPAGEOFF]
	str	x8, [x0, #24]
	mov	w8, #1
	str	w8, [x0]
	add	x1, x0, #16
Lloh4:
	adrp	x0, _IID_IReferenceClock@GOTPAGE
Lloh5:
	ldr	x0, [x0, _IID_IReferenceClock@GOTPAGEOFF]
	mov	x2, #0
	bl	_DMUSIC_CreateReferenceClockImpl
	mov	x21, x0
Lloh6:
	adrp	x8, _S_OK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	str	x22, [x20]
	b	LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
Lloh11:
	ldr	x21, [x8]
	b	LBB0_5
LBB0_4:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x19
	bl	_HeapFree
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_E_OUTOFMEMORY,8,3              ; @E_OUTOFMEMORY
	.comm	_midi_port_vtbl,4,2             ; @midi_port_vtbl
	.comm	_midi_thru_vtbl,4,2             ; @midi_thru_vtbl
	.comm	_IID_IReferenceClock,4,2        ; @IID_IReferenceClock
	.comm	_S_OK,8,3                       ; @S_OK
	.no_dead_strip	_midi_port_create
.subsections_via_symbols
