	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl3_synth_create_port
_snd_opl3_synth_create_port:            ## @snd_opl3_synth_create_port
	.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	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	(%rdi), %r14d
	movq	_OPL3_HW_OPL3@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_MAX_OPL2_VOICES@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_MAX_OPL3_VOICES@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	$16, %edi
	callq	_snd_midi_channel_alloc_set
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpl	%ebx, %r14d
	cmovll	%r13d, %r15d
	movq	%r12, 8(%rax)
	leaq	-112(%rbp), %rbx
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	_snd_opl3_synth_use@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	movq	_snd_opl3_synth_unuse@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movq	_snd_opl3_synth_event_input@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -100(%rbp)
	movq	_snd_opl3_synth_free_port@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	movq	%r12, -112(%rbp)
	movq	_OPL3_HW_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	(%r12), %edx
	sarl	$8, %edx
	leaq	L_.str(%rip), %rsi
	leaq	-80(%rbp), %r13
	movq	%r13, %rdi
	callq	_sprintf
	movl	16(%r12), %edi
	movq	8(%r12), %rax
	movl	%edi, 4(%rax)
	movq	_SNDRV_SEQ_PORT_CAP_WRITE@GOTPCREL(%rip), %rax
	movq	_SNDRV_SEQ_PORT_CAP_SUBS_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPCREL(%rip), %rax
	movq	_SNDRV_SEQ_PORT_TYPE_MIDI_GM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	%r13, (%rsp)
	movq	%rbx, %rsi
	movl	$16, %r8d
	movl	%r15d, %r9d
	callq	_snd_seq_event_port_attach
	movq	8(%r12), %rdi
	movl	%eax, (%rdi)
	testl	%eax, %eax
	jns	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	callq	_snd_midi_channel_free_set
	movl	%ebx, %r14d
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	movl	%r14d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_OPL3_HW_OPL3,4,2               ## @OPL3_HW_OPL3
	.comm	_MAX_OPL2_VOICES,4,2            ## @MAX_OPL2_VOICES
	.comm	_MAX_OPL3_VOICES,4,2            ## @MAX_OPL3_VOICES
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_snd_opl3_synth_use,4,2         ## @snd_opl3_synth_use
	.comm	_snd_opl3_synth_unuse,4,2       ## @snd_opl3_synth_unuse
	.comm	_snd_opl3_synth_event_input,4,2 ## @snd_opl3_synth_event_input
	.comm	_snd_opl3_synth_free_port,4,2   ## @snd_opl3_synth_free_port
	.comm	_OPL3_HW_MASK,4,2               ## @OPL3_HW_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OPL%i FM Port"

	.comm	_SNDRV_SEQ_PORT_CAP_WRITE,4,2   ## @SNDRV_SEQ_PORT_CAP_WRITE
	.comm	_SNDRV_SEQ_PORT_CAP_SUBS_WRITE,4,2 ## @SNDRV_SEQ_PORT_CAP_SUBS_WRITE
	.comm	_SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC,4,2 ## @SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC
	.comm	_SNDRV_SEQ_PORT_TYPE_MIDI_GM,4,2 ## @SNDRV_SEQ_PORT_TYPE_MIDI_GM
	.comm	_SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE,4,2 ## @SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE
	.comm	_SNDRV_SEQ_PORT_TYPE_HARDWARE,4,2 ## @SNDRV_SEQ_PORT_TYPE_HARDWARE
	.comm	_SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,4,2 ## @SNDRV_SEQ_PORT_TYPE_SYNTHESIZER
	.no_dead_strip	_snd_opl3_synth_create_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_opl3_synth_create_port
_snd_opl3_synth_create_port:            ; @snd_opl3_synth_create_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	w20, [x0]
Lloh3:
	adrp	x8, _OPL3_HW_OPL3@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OPL3_HW_OPL3@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
Lloh6:
	adrp	x8, _MAX_OPL2_VOICES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_OPL2_VOICES@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
Lloh9:
	adrp	x8, _MAX_OPL3_VOICES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX_OPL3_VOICES@GOTPAGEOFF]
Lloh11:
	ldr	w23, [x8]
	mov	w0, #16
	bl	_snd_midi_channel_alloc_set
	str	x0, [x19, #8]
	cbz	x0, LBB0_3
; %bb.1:
	cmp	w20, w21
	csel	w20, w22, w23, lt
	str	x19, [x0, #8]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh12:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [sp, #32]
Lloh15:
	adrp	x8, _snd_opl3_synth_use@GOTPAGE
Lloh16:
	ldr	x8, [x8, _snd_opl3_synth_use@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _snd_opl3_synth_unuse@GOTPAGE
Lloh19:
	ldr	x9, [x9, _snd_opl3_synth_unuse@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
Lloh21:
	adrp	x8, _snd_opl3_synth_event_input@GOTPAGE
Lloh22:
	ldr	x8, [x8, _snd_opl3_synth_event_input@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _snd_opl3_synth_free_port@GOTPAGE
Lloh25:
	ldr	x9, [x9, _snd_opl3_synth_free_port@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #16]
	str	x19, [sp, #8]
	ldr	w8, [x19]
Lloh27:
	adrp	x9, _OPL3_HW_MASK@GOTPAGE
Lloh28:
	ldr	x9, [x9, _OPL3_HW_MASK@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	and	w8, w9, w8
	asr	w2, w8, #8
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #40
	bl	_sprintf
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	str	w0, [x8, #4]
Lloh32:
	adrp	x8, _SNDRV_SEQ_PORT_CAP_WRITE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SNDRV_SEQ_PORT_CAP_WRITE@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
Lloh35:
	adrp	x9, _SNDRV_SEQ_PORT_CAP_SUBS_WRITE@GOTPAGE
Lloh36:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_CAP_SUBS_WRITE@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
Lloh38:
	adrp	x10, _SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGE
Lloh39:
	ldr	x10, [x10, _SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGEOFF]
	orr	w2, w9, w8
Lloh40:
	ldr	w8, [x10]
Lloh41:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_MIDI_GM@GOTPAGE
Lloh42:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_MIDI_GM@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh44:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE@GOTPAGE
Lloh45:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh47:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPAGE
Lloh48:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPAGEOFF]
Lloh49:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh50:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPAGE
Lloh51:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPAGEOFF]
Lloh52:
	ldr	w9, [x9]
	orr	w3, w8, w9
	add	x1, sp, #8
	add	x6, sp, #40
	mov	w4, #16
	mov	x5, x20
	bl	_snd_seq_event_port_attach
	mov	x20, x0
	mov	w0, #0
	ldr	x8, [x19, #8]
	str	w20, [x8]
	tbz	w20, #31, LBB0_4
; %bb.2:
	mov	x0, x8
	bl	_snd_midi_channel_free_set
	mov	x0, x20
	b	LBB0_4
LBB0_3:
Lloh53:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh54:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh55:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldur	x8, [x29, #-56]
Lloh56:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh57:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh58:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	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
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_OPL3_HW_OPL3,4,2               ; @OPL3_HW_OPL3
	.comm	_MAX_OPL2_VOICES,4,2            ; @MAX_OPL2_VOICES
	.comm	_MAX_OPL3_VOICES,4,2            ; @MAX_OPL3_VOICES
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_snd_opl3_synth_use,4,2         ; @snd_opl3_synth_use
	.comm	_snd_opl3_synth_unuse,4,2       ; @snd_opl3_synth_unuse
	.comm	_snd_opl3_synth_event_input,4,2 ; @snd_opl3_synth_event_input
	.comm	_snd_opl3_synth_free_port,4,2   ; @snd_opl3_synth_free_port
	.comm	_OPL3_HW_MASK,4,2               ; @OPL3_HW_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OPL%i FM Port"

	.comm	_SNDRV_SEQ_PORT_CAP_WRITE,4,2   ; @SNDRV_SEQ_PORT_CAP_WRITE
	.comm	_SNDRV_SEQ_PORT_CAP_SUBS_WRITE,4,2 ; @SNDRV_SEQ_PORT_CAP_SUBS_WRITE
	.comm	_SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC,4,2 ; @SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC
	.comm	_SNDRV_SEQ_PORT_TYPE_MIDI_GM,4,2 ; @SNDRV_SEQ_PORT_TYPE_MIDI_GM
	.comm	_SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE,4,2 ; @SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE
	.comm	_SNDRV_SEQ_PORT_TYPE_HARDWARE,4,2 ; @SNDRV_SEQ_PORT_TYPE_HARDWARE
	.comm	_SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,4,2 ; @SNDRV_SEQ_PORT_TYPE_SYNTHESIZER
	.no_dead_strip	_snd_opl3_synth_create_port
.subsections_via_symbols
