	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl4_seq_new_device
_snd_opl4_seq_new_device:               ## @snd_opl4_seq_new_device
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_SNDRV_SEQ_DEVICE_ARGPTR
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_1
## %bb.3:
	movq	%r15, %rdi
	callq	_snd_yrw801_detect
	testq	%rax, %rax
	js	LBB0_4
## %bb.5:
	movl	$16, %edi
	callq	_snd_midi_channel_alloc_set
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%r15, 8(%rax)
	movl	16(%r15), %esi
	movl	20(%r15), %edi
	leaq	L_.str(%rip), %rdx
	callq	_snd_seq_create_kernel_client
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movl	%r14d, (%r15)
	movq	8(%r15), %rax
	movl	%r14d, (%rax)
	leaq	-64(%rbp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_snd_opl4_seq_use@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	_snd_opl4_seq_unuse@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_snd_opl4_seq_event_input@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SNDRV_SEQ_PORT_CAP_WRITE@GOTPCREL(%rip), %rcx
	movq	_SNDRV_SEQ_PORT_CAP_SUBS_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%eax, -52(%rbp)
	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	_snd_opl4_seq_free_port@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	%r15, -64(%rbp)
	movq	_SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%rsp)
	movl	%r14d, %edi
	movq	%r12, %rsi
	movl	$16, %r8d
	movl	$24, %r9d
	callq	_snd_seq_event_port_attach
	movq	8(%r15), %rdi
	movl	%eax, 4(%rdi)
	testl	%eax, %eax
	jns	LBB0_11
## %bb.10:
	movl	%eax, %r12d
	callq	_snd_midi_channel_free_set
	movl	%r14d, %edi
	callq	_snd_seq_delete_kernel_client
	movl	$-1, (%r15)
	movl	%r12d, %ebx
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	8(%r15), %rdi
	callq	_snd_midi_channel_free_set
	movl	%r14d, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OPL4 Wavetable"

	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_snd_opl4_seq_use,4,2           ## @snd_opl4_seq_use
	.comm	_snd_opl4_seq_unuse,4,2         ## @snd_opl4_seq_unuse
	.comm	_snd_opl4_seq_event_input,4,2   ## @snd_opl4_seq_event_input
	.comm	_snd_opl4_seq_free_port,4,2     ## @snd_opl4_seq_free_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_HARDWARE,4,2 ## @SNDRV_SEQ_PORT_TYPE_HARDWARE
	.comm	_SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,4,2 ## @SNDRV_SEQ_PORT_TYPE_SYNTHESIZER
L_.str.1:                               ## @.str.1
	.asciz	"OPL4 Wavetable Port"

	.no_dead_strip	_snd_opl4_seq_new_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_opl4_seq_new_device
_snd_opl4_seq_new_device:               ; @snd_opl4_seq_new_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	bl	_SNDRV_SEQ_DEVICE_ARGPTR
	ldr	x19, [x0]
	cbz	x19, LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_snd_yrw801_detect
	tbnz	x0, #63, LBB0_7
; %bb.2:
	mov	w0, #16
	bl	_snd_midi_channel_alloc_set
	str	x0, [x19, #8]
	cbz	x0, LBB0_8
; %bb.3:
	str	x19, [x0, #8]
	ldp	w1, w0, [x19, #16]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	bl	_snd_seq_create_kernel_client
	mov	x20, x0
	tbnz	w0, #31, LBB0_11
; %bb.4:
	str	w20, [x19]
	ldr	x8, [x19, #8]
	str	w20, [x8]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh2:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [sp, #24]
Lloh5:
	adrp	x8, _snd_opl4_seq_use@GOTPAGE
Lloh6:
	ldr	x8, [x8, _snd_opl4_seq_use@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _snd_opl4_seq_unuse@GOTPAGE
Lloh9:
	ldr	x9, [x9, _snd_opl4_seq_unuse@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _snd_opl4_seq_event_input@GOTPAGE
Lloh12:
	ldr	x10, [x10, _snd_opl4_seq_event_input@GOTPAGEOFF]
	stp	w9, w8, [sp, #16]
Lloh13:
	ldr	w8, [x10]
Lloh14:
	adrp	x9, _snd_opl4_seq_free_port@GOTPAGE
Lloh15:
	ldr	x9, [x9, _snd_opl4_seq_free_port@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #8]
Lloh17:
	adrp	x8, _SNDRV_SEQ_PORT_CAP_WRITE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SNDRV_SEQ_PORT_CAP_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _SNDRV_SEQ_PORT_CAP_SUBS_WRITE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_CAP_SUBS_WRITE@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh23:
	adrp	x8, _SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGEOFF]
Lloh25:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_MIDI_GM@GOTPAGE
Lloh26:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_MIDI_GM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh29:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_HARDWARE@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh32:
	adrp	x9, _SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPAGE
Lloh33:
	ldr	x9, [x9, _SNDRV_SEQ_PORT_TYPE_SYNTHESIZER@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w3, w8, w9
	str	x19, [sp]
Lloh35:
	adrp	x6, l_.str.1@PAGE
Lloh36:
	add	x6, x6, l_.str.1@PAGEOFF
	mov	x1, sp
	mov	x0, x20
	mov	w4, #16
	mov	w5, #24
	bl	_snd_seq_event_port_attach
	mov	x21, x0
	mov	w0, #0
	ldr	x8, [x19, #8]
	str	w21, [x8, #4]
	tbz	w21, #31, LBB0_10
; %bb.5:
	mov	x0, x8
	bl	_snd_midi_channel_free_set
	mov	x0, x20
	bl	_snd_seq_delete_kernel_client
	mov	w8, #-1
	str	w8, [x19]
	mov	x0, x21
	b	LBB0_10
LBB0_6:
Lloh37:
	adrp	x8, _EINVAL@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh39:
	adrp	x8, _ENODEV@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh41:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	ldr	x0, [x19, #8]
	bl	_snd_midi_channel_free_set
	mov	x0, x20
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OPL4 Wavetable"

	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_snd_opl4_seq_use,4,2           ; @snd_opl4_seq_use
	.comm	_snd_opl4_seq_unuse,4,2         ; @snd_opl4_seq_unuse
	.comm	_snd_opl4_seq_event_input,4,2   ; @snd_opl4_seq_event_input
	.comm	_snd_opl4_seq_free_port,4,2     ; @snd_opl4_seq_free_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_HARDWARE,4,2 ; @SNDRV_SEQ_PORT_TYPE_HARDWARE
	.comm	_SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,4,2 ; @SNDRV_SEQ_PORT_TYPE_SYNTHESIZER
l_.str.1:                               ; @.str.1
	.asciz	"OPL4 Wavetable Port"

	.no_dead_strip	_snd_opl4_seq_new_device
.subsections_via_symbols
