	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alsa_midi_get_avail_ports
_alsa_midi_get_avail_ports:             ## @alsa_midi_get_avail_ports
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	leaq	-56(%rbp), %rdi
	callq	_snd_seq_client_info_alloca
	leaq	-40(%rbp), %rdi
	callq	_snd_seq_port_info_alloca
	movq	_SND_SEQ_OPEN_DUPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SND_SEQ_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdi
	callq	_snd_seq_open
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-56(%rbp), %rdi
	movl	$-1, %esi
	callq	_snd_seq_client_info_set_client
	movq	-48(%rbp), %rdi
	movq	-56(%rbp), %rsi
	callq	_snd_seq_query_next_client
	testq	%rax, %rax
	je	LBB0_3
LBB0_11:
	movq	-48(%rbp), %rdi
	callq	_snd_seq_close
	movl	$1, %ebx
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_12
LBB0_3:
	movq	_SND_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPCREL(%rip), %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rdi
	movq	-56(%rbp), %rsi
	callq	_snd_seq_query_next_client
	testq	%rax, %rax
	jne	LBB0_11
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	-56(%rbp), %rdi
	callq	_snd_seq_client_info_get_client
	movq	-40(%rbp), %rdi
	movl	%eax, %esi
	callq	_snd_seq_port_info_set_client
	movq	-40(%rbp), %rdi
	movl	$-1, %esi
	callq	_snd_seq_port_info_set_port
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rdi
	movq	-40(%rbp), %rsi
	callq	_snd_seq_query_next_port
	testq	%rax, %rax
	jne	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-40(%rbp), %rdi
	callq	_snd_seq_port_info_get_capability
	movl	%eax, %ebx
	movq	-40(%rbp), %rdi
	callq	_snd_seq_port_info_get_type
	testl	%eax, (%r12)
	je	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	andl	%r15d, %ebx
	cmpl	%r15d, %ebx
	jne	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-40(%rbp), %rdi
	callq	_snd_seq_port_info_get_name
	movq	%r14, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_string_list_append
	testl	%eax, %eax
	jne	LBB0_4
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_RARCH_ERR
	movq	-48(%rbp), %rdi
	callq	_snd_seq_close
LBB0_12:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"default"

	.comm	_SND_SEQ_OPEN_DUPLEX,4,2        ## @SND_SEQ_OPEN_DUPLEX
	.comm	_SND_SEQ_NONBLOCK,4,2           ## @SND_SEQ_NONBLOCK
L_.str.1:                               ## @.str.1
	.asciz	"[MIDI]: snd_seq_open failed with error %d.\n"

	.comm	_SND_SEQ_PORT_TYPE_MIDI_GENERIC,4,2 ## @SND_SEQ_PORT_TYPE_MIDI_GENERIC
L_.str.2:                               ## @.str.2
	.asciz	"[MIDI]: string_list_append failed.\n"

	.no_dead_strip	_alsa_midi_get_avail_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alsa_midi_get_avail_ports
_alsa_midi_get_avail_ports:             ; @alsa_midi_get_avail_ports
	.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
	mov	x19, x1
	mov	x20, x0
	add	x0, sp, #16
	bl	_snd_seq_client_info_alloca
	add	x0, sp, #8
	bl	_snd_seq_port_info_alloca
Lloh0:
	adrp	x8, _SND_SEQ_OPEN_DUPLEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SND_SEQ_OPEN_DUPLEX@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _SND_SEQ_NONBLOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SND_SEQ_NONBLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #24
	bl	_snd_seq_open
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	x0, [sp, #16]
	mov	w1, #-1
	bl	_snd_seq_client_info_set_client
	ldp	x1, x0, [sp, #16]
	bl	_snd_seq_query_next_client
	cbz	x0, LBB0_4
LBB0_2:
	ldr	x0, [sp, #24]
	bl	_snd_seq_close
	mov	w0, #1
	b	LBB0_12
LBB0_3:
	str	x0, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_11
LBB0_4:
Lloh10:
	adrp	x22, _SND_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGE
Lloh11:
	ldr	x22, [x22, _SND_SEQ_PORT_TYPE_MIDI_GENERIC@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldp	x1, x0, [sp, #16]
	bl	_snd_seq_query_next_client
	cbnz	x0, LBB0_2
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	x0, [sp, #16]
	bl	_snd_seq_client_info_get_client
	mov	x1, x0
	ldr	x0, [sp, #8]
	bl	_snd_seq_port_info_set_client
	ldr	x0, [sp, #8]
	mov	w1, #-1
	bl	_snd_seq_port_info_set_port
LBB0_7:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [sp, #24]
	ldr	x1, [sp, #8]
	bl	_snd_seq_query_next_port
	cbnz	x0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x0, [sp, #8]
	bl	_snd_seq_port_info_get_capability
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_snd_seq_port_info_get_type
	ldr	w8, [x22]
	and	w8, w8, w0
	and	w9, w21, w19
	cmp	w8, #0
	ccmp	w9, w19, #0, ne
	b.ne	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x0, [sp, #8]
	bl	_snd_seq_port_info_get_name
	mov	x1, x0
	mov	x0, x20
	mov	x2, #0
	bl	_string_list_append
	cbnz	w0, LBB0_7
; %bb.10:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_RARCH_ERR
	ldr	x0, [sp, #24]
	bl	_snd_seq_close
LBB0_11:
	mov	w0, #0
LBB0_12:
	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
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"default"

	.comm	_SND_SEQ_OPEN_DUPLEX,4,2        ; @SND_SEQ_OPEN_DUPLEX
	.comm	_SND_SEQ_NONBLOCK,4,2           ; @SND_SEQ_NONBLOCK
l_.str.1:                               ; @.str.1
	.asciz	"[MIDI]: snd_seq_open failed with error %d.\n"

	.comm	_SND_SEQ_PORT_TYPE_MIDI_GENERIC,4,2 ; @SND_SEQ_PORT_TYPE_MIDI_GENERIC
l_.str.2:                               ; @.str.2
	.asciz	"[MIDI]: string_list_append failed.\n"

	.no_dead_strip	_alsa_midi_get_avail_ports
.subsections_via_symbols
