	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scsp_midi_in_read              ## -- Begin function scsp_midi_in_read
	.p2align	4, 0x90
_scsp_midi_in_read:                     ## @scsp_midi_in_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_SCSP_MIDI_IN_OVF@GOTPCREL(%rip), %rcx
	movq	_SCSP_MIDI_IN_FUL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	notl	%eax
	movq	_scsp@GOTPCREL(%rip), %rbx
	andl	(%rbx), %eax
	movl	%eax, (%rbx)
	movl	4(%rbx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	cmpl	$1, %ecx
	jne	LBB0_4
## %bb.3:
	movq	_SCSP_MIDI_IN_EMP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	8(%rbx), %rax
	movl	(%rax), %eax
	movl	$0, 4(%rbx)
	jmp	LBB0_10
LBB0_1:
	movl	$255, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_4:
	movl	$8, %edi
	callq	_scsp_sound_interrupt
	movl	$8, %edi
	callq	_scsp_main_interrupt
	movl	4(%rbx), %edx
	decl	%edx
	movq	8(%rbx), %rcx
	movl	(%rcx), %eax
	movl	%edx, 4(%rbx)
	andl	$3, %edx
	cmpl	$3, %edx
	je	LBB0_9
## %bb.5:
	cmpl	$2, %edx
	je	LBB0_8
## %bb.6:
	cmpl	$1, %edx
	jne	LBB0_10
## %bb.7:
	movl	4(%rcx), %edx
	movl	%edx, (%rcx)
	jmp	LBB0_10
LBB0_9:
	movq	4(%rcx), %rdx
	movq	%rdx, (%rcx)
	movl	12(%rcx), %edx
	movl	%edx, 8(%rcx)
	jmp	LBB0_10
LBB0_8:
	movq	4(%rcx), %rdx
	movq	%rdx, (%rcx)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SCSP_MIDI_IN_OVF,4,2           ## @SCSP_MIDI_IN_OVF
	.comm	_SCSP_MIDI_IN_FUL,4,2           ## @SCSP_MIDI_IN_FUL
	.comm	_scsp,16,3                      ## @scsp
	.comm	_SCSP_MIDI_IN_EMP,4,2           ## @SCSP_MIDI_IN_EMP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scsp_midi_in_read              ; -- Begin function scsp_midi_in_read
	.p2align	2
_scsp_midi_in_read:                     ; @scsp_midi_in_read
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _SCSP_MIDI_IN_OVF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCSP_MIDI_IN_OVF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SCSP_MIDI_IN_FUL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SCSP_MIDI_IN_FUL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x19, _scsp@GOTPAGE
Lloh7:
	ldr	x19, [x19, _scsp@GOTPAGEOFF]
	orr	w8, w9, w8
	ldp	w9, w10, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	cmp	w10, #1
	b.lt	LBB0_3
; %bb.1:
	b.ne	LBB0_5
; %bb.2:
Lloh8:
	adrp	x9, _SCSP_MIDI_IN_EMP@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SCSP_MIDI_IN_EMP@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19]
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	str	wzr, [x19, #4]
	b	LBB0_4
LBB0_3:
	mov	w0, #255
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	mov	w0, #8
	bl	_scsp_sound_interrupt
	mov	w0, #8
	bl	_scsp_main_interrupt
	ldr	w8, [x19, #4]
	sub	w9, w8, #1
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	str	w9, [x19, #4]
	and	w9, w9, #0x3
	cmp	w9, #3
	b.eq	LBB0_9
; %bb.6:
	cmp	w9, #2
	b.eq	LBB0_10
; %bb.7:
	cmp	w9, #1
	b.ne	LBB0_4
; %bb.8:
	ldr	w9, [x8, #4]
	str	w9, [x8]
	b	LBB0_4
LBB0_9:
	ldur	d0, [x8, #4]
	str	d0, [x8]
	ldr	w9, [x8, #12]
	str	w9, [x8, #8]
	b	LBB0_4
LBB0_10:
	ldur	d0, [x8, #4]
	str	d0, [x8]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SCSP_MIDI_IN_OVF,4,2           ; @SCSP_MIDI_IN_OVF
	.comm	_SCSP_MIDI_IN_FUL,4,2           ; @SCSP_MIDI_IN_FUL
	.comm	_scsp,16,3                      ; @scsp
	.comm	_SCSP_MIDI_IN_EMP,4,2           ; @SCSP_MIDI_IN_EMP
.subsections_via_symbols
