	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_hdsp_midi_input_read
_snd_hdsp_midi_input_read:              ## @snd_hdsp_midi_input_read
	.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
	subq	$136, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	callq	_spin_lock_irqsave
	movq	8(%r14), %rdi
	movq	16(%r14), %rsi
	callq	_snd_hdsp_midi_input_available
	testl	%eax, %eax
	jle	LBB0_7
## %bb.1:
	movl	%eax, %ebx
	cmpq	$0, 32(%r14)
	je	LBB0_2
## %bb.4:
	cmpl	$128, %ebx
	movl	$128, %r15d
	cmovll	%ebx, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	movq	16(%r14), %rsi
	callq	_snd_hdsp_midi_read_byte
	movb	%al, -160(%rbp,%rbx)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_5
## %bb.6:
	movq	32(%r14), %rdi
	leaq	-160(%rbp), %rsi
	movl	%r15d, %edx
	callq	_snd_rawmidi_receive
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
	movq	16(%r14), %rsi
	callq	_snd_hdsp_midi_read_byte
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	decl	%ebx
	jne	LBB0_3
LBB0_7:
	movq	$0, 24(%r14)
	cmpq	$0, 16(%r14)
	je	LBB0_9
## %bb.8:
	movq	_HDSP_Midi1InterruptEnable@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_HDSP_Midi0InterruptEnable@GOTPCREL(%rip), %rax
LBB0_10:
	movq	8(%r14), %rdi
	movl	(%rdi), %edx
	orl	(%rax), %edx
	movl	%edx, (%rdi)
	movq	_HDSP_controlRegister@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hdsp_write
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r14, %rdi
	callq	_snd_hdsp_midi_output_write
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	addq	$136, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HDSP_Midi1InterruptEnable,4,2  ## @HDSP_Midi1InterruptEnable
	.comm	_HDSP_Midi0InterruptEnable,4,2  ## @HDSP_Midi0InterruptEnable
	.comm	_HDSP_controlRegister,4,2       ## @HDSP_controlRegister
	.no_dead_strip	_snd_hdsp_midi_input_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_hdsp_midi_input_read
_snd_hdsp_midi_input_read:              ; @snd_hdsp_midi_input_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_spin_lock_irqsave
	ldp	x0, x1, [x19, #8]
	bl	_snd_hdsp_midi_input_available
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.1:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_5
; %bb.2:
	mov	w8, #128
	cmp	w0, #128
	csel	w20, w0, w8, lt
	add	x21, sp, #8
	mov	x22, x20
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x0, x1, [x19, #8]
	bl	_snd_hdsp_midi_read_byte
	strb	w0, [x21], #1
	subs	x22, x22, #1
	b.ne	LBB0_3
; %bb.4:
	ldr	x0, [x19, #32]
	add	x1, sp, #8
	mov	x2, x20
	bl	_snd_rawmidi_receive
	b	LBB0_7
LBB0_5:
	subs	w20, w0, #1
	b.eq	LBB0_7
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x0, x1, [x19, #8]
	bl	_snd_hdsp_midi_read_byte
	subs	w20, w20, #1
	b.ne	LBB0_6
LBB0_7:
	str	xzr, [x19, #24]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_9
; %bb.8:
Lloh3:
	adrp	x8, _HDSP_Midi1InterruptEnable@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDSP_Midi1InterruptEnable@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh5:
	adrp	x8, _HDSP_Midi0InterruptEnable@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HDSP_Midi0InterruptEnable@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	ldr	x0, [x19, #8]
	ldr	w9, [x0]
	orr	w2, w9, w8
	str	w2, [x0]
Lloh7:
	adrp	x8, _HDSP_controlRegister@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HDSP_controlRegister@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_hdsp_write
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_snd_hdsp_midi_output_write
	ldur	x8, [x29, #-40]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_HDSP_Midi1InterruptEnable,4,2  ; @HDSP_Midi1InterruptEnable
	.comm	_HDSP_Midi0InterruptEnable,4,2  ; @HDSP_Midi0InterruptEnable
	.comm	_HDSP_controlRegister,4,2       ; @HDSP_controlRegister
	.no_dead_strip	_snd_hdsp_midi_input_read
.subsections_via_symbols
