	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_midi_event_encode_byte     ## -- Begin function snd_midi_event_encode_byte
	.p2align	4, 0x90
_snd_midi_event_encode_byte:            ## @snd_midi_event_encode_byte
	.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	%rdx, %r15
	movl	%esi, %r13d
	movzbl	%r13b, %r14d
	movq	_MIDI_CMD_COMMON_CLOCK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jge	LBB0_6
## %bb.1:
	movq	%rdi, %r12
	leaq	36(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	testb	$-128, %r13b
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_7
LBB0_2:
	movq	8(%r12), %rax
	movq	24(%r12), %rcx
	testq	%rcx, %rcx
	jle	LBB0_11
## %bb.3:
	movslq	16(%r12), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 16(%r12)
	movl	%r14d, (%rax,%rdx,4)
	movl	(%r12), %r13d
	movq	_ST_SYSEX@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r13d
	je	LBB0_18
## %bb.4:
	decq	%rcx
	jmp	LBB0_5
LBB0_6:
	movq	_status_event@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ST_SPECIAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%r14d, %ecx
	addl	$-240, %ecx
	movslq	%ecx, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rax, (%r15)
	movq	_SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	24(%r15), %ecx
	movq	_SNDRV_SEQ_EVENT_LENGTH_FIXED@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, 24(%r15)
	movq	_SNDRV_SEQ_EVENT_NONE@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	setne	%bl
	jmp	LBB0_26
LBB0_7:
	movq	_MIDI_CMD_COMMON_SYSEX_END@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_9
## %bb.8:
	movl	(%r12), %eax
	movq	_ST_SYSEX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_2
LBB0_9:
	movq	8(%r12), %rax
	movl	%r14d, (%rax)
	movl	%r13d, %ecx
	notl	%ecx
	testb	$-16, %cl
	jne	LBB0_16
## %bb.10:
	andl	$15, %r13d
	movq	_ST_SPECIAL@GOTPCREL(%rip), %rcx
	addl	(%rcx), %r13d
	jmp	LBB0_17
LBB0_11:
	movl	%r14d, 4(%rax)
	movq	_status_event@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	(%r12), %r13
	leaq	(,%r13,2), %rdx
	addq	%r13, %rdx
	movq	8(%rcx,%rdx,8), %rcx
	decq	%rcx
	movq	%rcx, 24(%r12)
	movl	$2, 16(%r12)
	testq	%rcx, %rcx
	jne	LBB0_18
LBB0_12:
	movq	_status_event@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r13d, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	(%rax,%rcx,8), %rdx
	movq	%rdx, (%r15)
	movq	_SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	24(%r15), %edx
	movq	_SNDRV_SEQ_EVENT_LENGTH_FIXED@GOTPCREL(%rip), %rsi
	orl	(%rsi), %edx
	movl	%edx, 24(%r15)
	movq	16(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	*%rax
	movl	(%r12), %r13d
LBB0_14:
	movq	_ST_SPECIAL@GOTPCREL(%rip), %rax
	movl	$1, %ebx
	cmpl	(%rax), %r13d
	jl	LBB0_25
## %bb.15:
	movq	_ST_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	jmp	LBB0_25
LBB0_16:
	shrl	$4, %r13d
	andl	$7, %r13d
LBB0_17:
	movl	%r13d, (%r12)
	movl	$1, 16(%r12)
	movq	_status_event@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%r13d, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movq	8(%rcx,%rdx,8), %rcx
LBB0_5:
	movq	%rcx, 24(%r12)
	testq	%rcx, %rcx
	je	LBB0_12
LBB0_18:
	movq	_ST_SYSEX@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %r13d
	jne	LBB0_25
## %bb.19:
	movq	_MIDI_CMD_COMMON_SYSEX_END@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	16(%r12), %edx
	cmpl	%ecx, %r14d
	je	LBB0_21
## %bb.20:
	cmpl	32(%r12), %edx
	jl	LBB0_25
LBB0_21:
	movq	_SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	notl	%esi
	andl	24(%r15), %esi
	movq	_SNDRV_SEQ_EVENT_LENGTH_VARIABLE@GOTPCREL(%rip), %rdi
	orl	(%rdi), %esi
	movl	%esi, 24(%r15)
	movq	_SNDRV_SEQ_EVENT_SYSEX@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movq	%rsi, (%r15)
	movl	%edx, 8(%r15)
	movq	%rax, 16(%r15)
	cmpl	%ecx, %r14d
	jne	LBB0_23
## %bb.22:
	movq	%r12, %rdi
	callq	_reset_encode
	jmp	LBB0_24
LBB0_23:
	movl	$0, 16(%r12)
LBB0_24:
	movl	$1, %ebx
LBB0_25:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
LBB0_26:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIDI_CMD_COMMON_CLOCK,4,2      ## @MIDI_CMD_COMMON_CLOCK
	.comm	_status_event,8,3               ## @status_event
	.comm	_ST_SPECIAL,4,2                 ## @ST_SPECIAL
	.comm	_SNDRV_SEQ_EVENT_LENGTH_MASK,4,2 ## @SNDRV_SEQ_EVENT_LENGTH_MASK
	.comm	_SNDRV_SEQ_EVENT_LENGTH_FIXED,4,2 ## @SNDRV_SEQ_EVENT_LENGTH_FIXED
	.comm	_SNDRV_SEQ_EVENT_NONE,8,3       ## @SNDRV_SEQ_EVENT_NONE
	.comm	_MIDI_CMD_COMMON_SYSEX_END,4,2  ## @MIDI_CMD_COMMON_SYSEX_END
	.comm	_ST_SYSEX,4,2                   ## @ST_SYSEX
	.comm	_ST_INVALID,4,2                 ## @ST_INVALID
	.comm	_SNDRV_SEQ_EVENT_LENGTH_VARIABLE,4,2 ## @SNDRV_SEQ_EVENT_LENGTH_VARIABLE
	.comm	_SNDRV_SEQ_EVENT_SYSEX,8,3      ## @SNDRV_SEQ_EVENT_SYSEX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_midi_event_encode_byte     ; -- Begin function snd_midi_event_encode_byte
	.p2align	2
_snd_midi_event_encode_byte:            ; @snd_midi_event_encode_byte
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	and	w23, w1, #0xff
Lloh0:
	adrp	x8, _MIDI_CMD_COMMON_CLOCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIDI_CMD_COMMON_CLOCK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ge	LBB0_5
; %bb.1:
	mov	x22, x1
	mov	x20, x0
	add	x19, x0, #36
	mov	x0, x19
	bl	_spin_lock_irqsave
	tbnz	w22, #7, LBB0_6
LBB0_2:
	ldr	x9, [x20, #24]
	ldr	x8, [x20, #8]
	subs	x10, x9, #1
	b.lt	LBB0_10
; %bb.3:
	ldrsw	x9, [x20, #16]
	add	w11, w9, #1
	str	w11, [x20, #16]
	str	w23, [x8, x9, lsl #2]
	ldr	w9, [x20]
Lloh3:
	adrp	x11, _ST_SYSEX@GOTPAGE
Lloh4:
	ldr	x11, [x11, _ST_SYSEX@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	cmp	w9, w11
	b.eq	LBB0_17
; %bb.4:
	str	x10, [x20, #24]
	cbnz	x10, LBB0_17
	b	LBB0_11
LBB0_5:
Lloh6:
	adrp	x8, _status_event@GOTPAGE
Lloh7:
	ldr	x8, [x8, _status_event@GOTPAGEOFF]
Lloh8:
	adrp	x9, _ST_SPECIAL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ST_SPECIAL@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	ldr	w9, [x9]
	add	w9, w23, w9
	sub	w9, w9, #240
	mov	w10, #24
	smull	x9, w9, w10
	ldr	x8, [x8, x9]
	str	x8, [x21]
Lloh12:
	adrp	x9, _SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	ldr	w10, [x21, #24]
	bic	w9, w10, w9
Lloh15:
	adrp	x10, _SNDRV_SEQ_EVENT_LENGTH_FIXED@GOTPAGE
Lloh16:
	ldr	x10, [x10, _SNDRV_SEQ_EVENT_LENGTH_FIXED@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	orr	w9, w10, w9
	str	w9, [x21, #24]
Lloh18:
	adrp	x9, _SNDRV_SEQ_EVENT_NONE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SNDRV_SEQ_EVENT_NONE@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w20, ne
	b	LBB0_26
LBB0_6:
Lloh21:
	adrp	x8, _MIDI_CMD_COMMON_SYSEX_END@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MIDI_CMD_COMMON_SYSEX_END@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ne	LBB0_8
; %bb.7:
	ldr	w8, [x20]
Lloh24:
	adrp	x9, _ST_SYSEX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ST_SYSEX@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_2
LBB0_8:
	ldr	x8, [x20, #8]
	str	w23, [x8]
	mvn	w9, w22
	tst	w9, #0xf0
	b.ne	LBB0_15
; %bb.9:
	and	w9, w22, #0xf
Lloh27:
	adrp	x10, _ST_SPECIAL@GOTPAGE
Lloh28:
	ldr	x10, [x10, _ST_SPECIAL@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	add	w9, w10, w9
	b	LBB0_16
LBB0_10:
	str	w23, [x8, #4]
Lloh30:
	adrp	x9, _status_event@GOTPAGE
Lloh31:
	ldr	x9, [x9, _status_event@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x9]
	ldrsw	x9, [x20]
	mov	w11, #24
	madd	x10, x9, x11, x10
	ldr	x10, [x10, #8]
	sub	x10, x10, #1
	str	x10, [x20, #24]
	mov	w11, #2
	str	w11, [x20, #16]
	cbnz	x10, LBB0_17
LBB0_11:
Lloh33:
	adrp	x8, _status_event@GOTPAGE
Lloh34:
	ldr	x8, [x8, _status_event@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
	mov	w10, #24
	smaddl	x8, w9, w10, x8
	ldr	x10, [x8]
	str	x10, [x21]
Lloh36:
	adrp	x10, _SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPAGE
Lloh37:
	ldr	x10, [x10, _SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
	ldr	w11, [x21, #24]
	bic	w10, w11, w10
Lloh39:
	adrp	x11, _SNDRV_SEQ_EVENT_LENGTH_FIXED@GOTPAGE
Lloh40:
	ldr	x11, [x11, _SNDRV_SEQ_EVENT_LENGTH_FIXED@GOTPAGEOFF]
Lloh41:
	ldr	w11, [x11]
	orr	w10, w11, w10
	str	w10, [x21, #24]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_13
; %bb.12:
	mov	x0, x20
	mov	x1, x21
	blr	x8
	ldr	w9, [x20]
LBB0_13:
Lloh42:
	adrp	x8, _ST_SPECIAL@GOTPAGE
Lloh43:
	ldr	x8, [x8, _ST_SPECIAL@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	cmp	w9, w8
	b.lt	LBB0_24
; %bb.14:
Lloh45:
	adrp	x8, _ST_INVALID@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ST_INVALID@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_24
LBB0_15:
	ubfx	w9, w22, #4, #3
LBB0_16:
	str	w9, [x20]
	mov	w10, #1
Lloh48:
	adrp	x11, _status_event@GOTPAGE
Lloh49:
	ldr	x11, [x11, _status_event@GOTPAGEOFF]
	str	w10, [x20, #16]
Lloh50:
	ldr	x10, [x11]
	mov	w11, #24
	smaddl	x10, w9, w11, x10
	ldr	x10, [x10, #8]
	str	x10, [x20, #24]
	cbz	x10, LBB0_11
LBB0_17:
Lloh51:
	adrp	x10, _ST_SYSEX@GOTPAGE
Lloh52:
	ldr	x10, [x10, _ST_SYSEX@GOTPAGEOFF]
Lloh53:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_20
; %bb.18:
Lloh54:
	adrp	x9, _MIDI_CMD_COMMON_SYSEX_END@GOTPAGE
Lloh55:
	ldr	x9, [x9, _MIDI_CMD_COMMON_SYSEX_END@GOTPAGEOFF]
Lloh56:
	ldr	w9, [x9]
	ldr	w10, [x20, #16]
	cmp	w23, w9
	b.eq	LBB0_21
; %bb.19:
	ldr	w11, [x20, #32]
	cmp	w10, w11
	b.ge	LBB0_21
LBB0_20:
	mov	w20, #0
	b	LBB0_25
LBB0_21:
Lloh57:
	adrp	x11, _SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPAGE
Lloh58:
	ldr	x11, [x11, _SNDRV_SEQ_EVENT_LENGTH_MASK@GOTPAGEOFF]
Lloh59:
	ldr	w11, [x11]
	ldr	w12, [x21, #24]
	bic	w11, w12, w11
Lloh60:
	adrp	x12, _SNDRV_SEQ_EVENT_LENGTH_VARIABLE@GOTPAGE
Lloh61:
	ldr	x12, [x12, _SNDRV_SEQ_EVENT_LENGTH_VARIABLE@GOTPAGEOFF]
Lloh62:
	ldr	w12, [x12]
	orr	w11, w12, w11
Lloh63:
	adrp	x12, _SNDRV_SEQ_EVENT_SYSEX@GOTPAGE
Lloh64:
	ldr	x12, [x12, _SNDRV_SEQ_EVENT_SYSEX@GOTPAGEOFF]
	str	w11, [x21, #24]
Lloh65:
	ldr	x11, [x12]
	str	x11, [x21]
	str	w10, [x21, #8]
	str	x8, [x21, #16]
	cmp	w23, w9
	b.ne	LBB0_23
; %bb.22:
	mov	x0, x20
	bl	_reset_encode
	b	LBB0_24
LBB0_23:
	str	wzr, [x20, #16]
LBB0_24:
	mov	w20, #1
LBB0_25:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_26:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.cfi_endproc
                                        ; -- End function
	.comm	_MIDI_CMD_COMMON_CLOCK,4,2      ; @MIDI_CMD_COMMON_CLOCK
	.comm	_status_event,8,3               ; @status_event
	.comm	_ST_SPECIAL,4,2                 ; @ST_SPECIAL
	.comm	_SNDRV_SEQ_EVENT_LENGTH_MASK,4,2 ; @SNDRV_SEQ_EVENT_LENGTH_MASK
	.comm	_SNDRV_SEQ_EVENT_LENGTH_FIXED,4,2 ; @SNDRV_SEQ_EVENT_LENGTH_FIXED
	.comm	_SNDRV_SEQ_EVENT_NONE,8,3       ; @SNDRV_SEQ_EVENT_NONE
	.comm	_MIDI_CMD_COMMON_SYSEX_END,4,2  ; @MIDI_CMD_COMMON_SYSEX_END
	.comm	_ST_SYSEX,4,2                   ; @ST_SYSEX
	.comm	_ST_INVALID,4,2                 ; @ST_INVALID
	.comm	_SNDRV_SEQ_EVENT_LENGTH_VARIABLE,4,2 ; @SNDRV_SEQ_EVENT_LENGTH_VARIABLE
	.comm	_SNDRV_SEQ_EVENT_SYSEX,8,3      ; @SNDRV_SEQ_EVENT_SYSEX
.subsections_via_symbols
