	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl3_oss_create_port
_snd_opl3_oss_create_port:              ## @snd_opl3_oss_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	(%rdi), %eax
	movq	_OPL3_HW_OPL3@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_1
## %bb.2:
	movq	_MAX_OPL2_VOICES@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_MAX_OPL3_VOICES@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r15d
	movl	%r15d, %edi
	callq	_snd_midi_channel_alloc_set
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, 8(%rax)
	leaq	-104(%rbp), %r12
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	_snd_opl3_oss_event_input@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	movq	_snd_opl3_oss_free_port@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movq	%rbx, -104(%rbp)
	movq	_OPL3_HW_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	(%rbx), %edx
	sarl	$8, %edx
	leaq	L_.str(%rip), %rsi
	leaq	-80(%rbp), %r13
	movq	%r13, %rdi
	callq	_sprintf
	movl	16(%rbx), %edi
	movq	8(%rbx), %rax
	movl	%edi, 4(%rax)
	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_CAP_WRITE@GOTPCREL(%rip), %rax
	movq	_SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	(%rax), %edx
	movq	_SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	%r13, (%rsp)
	movq	%r12, %rsi
	movl	%r15d, %r8d
	movl	%r15d, %r9d
	callq	_snd_seq_event_port_attach
	movq	8(%rbx), %rdi
	movl	%eax, (%rdi)
	testl	%eax, %eax
	jns	LBB0_7
## %bb.6:
	movl	%eax, %r15d
	callq	_snd_midi_channel_free_set
	movl	%r15d, %r14d
	jmp	LBB0_7
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	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_oss_event_input,4,2   ## @snd_opl3_oss_event_input
	.comm	_snd_opl3_oss_free_port,4,2     ## @snd_opl3_oss_free_port
	.comm	_OPL3_HW_MASK,4,2               ## @OPL3_HW_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OPL%i OSS Port"

	.comm	_SNDRV_SEQ_PORT_CAP_WRITE,4,2   ## @SNDRV_SEQ_PORT_CAP_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_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_oss_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_oss_create_port
_snd_opl3_oss_create_port:              ; @snd_opl3_oss_create_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	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, #-24]
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _OPL3_HW_OPL3@GOTPAGE
Lloh4:
	ldr	x9, [x9, _OPL3_HW_OPL3@GOTPAGEOFF]
Lloh5:
	adrp	x10, _MAX_OPL2_VOICES@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MAX_OPL2_VOICES@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x11, _MAX_OPL3_VOICES@GOTPAGE
Lloh9:
	ldr	x11, [x11, _MAX_OPL3_VOICES@GOTPAGEOFF]
	cmp	w8, w9
	csel	x8, x10, x11, lt
	ldr	w20, [x8]
	mov	x0, x20
	bl	_snd_midi_channel_alloc_set
	str	x0, [x19, #8]
	cbz	x0, LBB0_3
; %bb.1:
	str	x19, [x0, #8]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh10:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [sp, #16]
Lloh13:
	adrp	x8, _snd_opl3_oss_event_input@GOTPAGE
Lloh14:
	ldr	x8, [x8, _snd_opl3_oss_event_input@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _snd_opl3_oss_free_port@GOTPAGE
Lloh17:
	ldr	x9, [x9, _snd_opl3_oss_free_port@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #8]
	str	x19, [sp]
	ldr	w8, [x19]
Lloh19:
	adrp	x9, _OPL3_HW_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _OPL3_HW_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	and	w8, w9, w8
	asr	w2, w8, #8
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #24
	bl	_sprintf
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	str	w0, [x8, #4]
Lloh24:
	adrp	x8, _SNDRV_SEQ_PORT_CAP_WRITE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SNDRV_SEQ_PORT_CAP_WRITE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
Lloh27:
	adrp	x8, _SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_MIDI_GM@GOTPAGE
Lloh31:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_MIDI_GM@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh33:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPAGE
Lloh34:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh36:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPAGE
Lloh37:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w3, w8, w9
	mov	x1, sp
	add	x6, sp, #24
	mov	x4, x20
	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:
Lloh39:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldur	x8, [x29, #-24]
Lloh42:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh43:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.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_oss_event_input,4,2   ; @snd_opl3_oss_event_input
	.comm	_snd_opl3_oss_free_port,4,2     ; @snd_opl3_oss_free_port
	.comm	_OPL3_HW_MASK,4,2               ; @OPL3_HW_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OPL%i OSS Port"

	.comm	_SNDRV_SEQ_PORT_CAP_WRITE,4,2   ; @SNDRV_SEQ_PORT_CAP_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_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_oss_create_port
.subsections_via_symbols
