	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_msndmidi_input_read        ## -- Begin function snd_msndmidi_input_read
	.p2align	4, 0x90
_snd_msndmidi_input_read:               ## @snd_msndmidi_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	_MIDQ_DATA_BUFF@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %r13
	addq	8(%rax), %r13
	callq	_spin_lock_irqsave
	movq	8(%r12), %rax
	movq	_JQS_wTail@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	addl	(%rax), %edi
	callq	_readw
	movl	%eax, %r14d
	movq	8(%r12), %rax
	movq	_JQS_wHead@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	addl	(%rax), %edi
	callq	_readw
	cmpl	%eax, %r14d
	jne	LBB0_1
LBB0_5:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	20(%r12), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rax
	movl	(%r15), %edi
	addl	(%rax), %edi
	callq	_readw
	movl	%eax, %ebx
	movq	8(%r12), %rax
	movq	_JQS_wSize@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	addl	(%rax), %edi
	callq	_readw
	leal	1(%rbx), %edi
	cmpl	%eax, %ebx
	movl	$0, %eax
	cmovgel	%eax, %edi
	movq	8(%r12), %rax
	movl	(%r15), %esi
	addl	(%rax), %esi
	callq	_writew
	movq	8(%r12), %rax
	movq	_JQS_wTail@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	addl	(%rax), %edi
	callq	_readw
	movl	%eax, %ebx
	movq	8(%r12), %rax
	movl	(%r15), %edi
	addl	(%rax), %edi
	callq	_readw
	cmpl	%eax, %ebx
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%r15), %edi
	addl	(%rax), %edi
	callq	_readw
                                        ## kill: def $eax killed $eax def $rax
	leal	(%r13,%rax,2), %edi
	callq	_readw
	movl	%eax, -44(%rbp)
	movq	_MSNDMIDI_MODE_BIT_INPUT_TRIGGER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%r12), %edi
	leaq	-44(%rbp), %rsi
	movl	$1, %edx
	callq	_snd_rawmidi_receive
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_MIDQ_DATA_BUFF,4,2             ## @MIDQ_DATA_BUFF
	.comm	_JQS_wTail,4,2                  ## @JQS_wTail
	.comm	_JQS_wHead,4,2                  ## @JQS_wHead
	.comm	_MSNDMIDI_MODE_BIT_INPUT_TRIGGER,4,2 ## @MSNDMIDI_MODE_BIT_INPUT_TRIGGER
	.comm	_JQS_wSize,4,2                  ## @JQS_wSize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_msndmidi_input_read        ; -- Begin function snd_msndmidi_input_read
	.p2align	2
_snd_msndmidi_input_read:               ; @snd_msndmidi_input_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8, #8]
Lloh0:
	adrp	x8, _MIDQ_DATA_BUFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIDQ_DATA_BUFF@GOTPAGEOFF]
Lloh2:
	ldrsw	x24, [x8]
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh3:
	adrp	x22, _JQS_wTail@GOTPAGE
Lloh4:
	ldr	x22, [x22, _JQS_wTail@GOTPAGEOFF]
	ldr	w9, [x22]
	add	w0, w9, w8
	bl	_readw
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh5:
	adrp	x23, _JQS_wHead@GOTPAGE
Lloh6:
	ldr	x23, [x23, _JQS_wHead@GOTPAGEOFF]
	ldr	w9, [x23]
	add	w0, w9, w8
	bl	_readw
	cmp	w20, w0
	b.ne	LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_2:
	add	x24, x21, x24
	add	x20, x19, #20
Lloh7:
	adrp	x25, _MSNDMIDI_MODE_BIT_INPUT_TRIGGER@GOTPAGE
Lloh8:
	ldr	x25, [x25, _MSNDMIDI_MODE_BIT_INPUT_TRIGGER@GOTPAGEOFF]
Lloh9:
	adrp	x26, _JQS_wSize@GOTPAGE
Lloh10:
	ldr	x26, [x26, _JQS_wSize@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x23]
	add	w0, w9, w8
	bl	_readw
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x26]
	add	w0, w9, w8
	bl	_readw
	cmp	w21, w0
	csinc	w0, wzr, w21, ge
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x23]
	add	w1, w9, w8
	bl	_writew
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x22]
	add	w0, w9, w8
	bl	_readw
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x23]
	add	w0, w9, w8
	bl	_readw
	cmp	w21, w0
	b.eq	LBB0_1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x23]
	add	w0, w9, w8
	bl	_readw
	add	w0, w24, w0, lsl #1
	bl	_readw
	str	w0, [sp, #12]
	ldr	w0, [x25]
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #16]
	add	x1, sp, #12
	mov	w2, #1
	bl	_snd_rawmidi_receive
	b	LBB0_3
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MIDQ_DATA_BUFF,4,2             ; @MIDQ_DATA_BUFF
	.comm	_JQS_wTail,4,2                  ; @JQS_wTail
	.comm	_JQS_wHead,4,2                  ; @JQS_wHead
	.comm	_MSNDMIDI_MODE_BIT_INPUT_TRIGGER,4,2 ; @MSNDMIDI_MODE_BIT_INPUT_TRIGGER
	.comm	_JQS_wSize,4,2                  ; @JQS_wSize
.subsections_via_symbols
