	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_wavefront_midi_output_write
_snd_wavefront_midi_output_write:       ## @snd_wavefront_midi_output_write
	.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, %rbx
	movq	(%rdi), %rax
	movq	40(%rdi), %rcx
	cmpq	$0, (%rcx,%rax,8)
	je	LBB0_1
## %bb.2:
	leaq	24(%rbx), %r14
	movl	$256, %r12d                     ## imm = 0x100
	movq	_MPU401_MODE_OUTPUT@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %esi
	movq	%rbx, %rdi
	callq	_write_data
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	leal	-1(%r12), %r15d
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	cmpl	$1, %r12d
	movl	%r15d, %r12d
	jbe	LBB0_14
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	$30000, %r15d                   ## imm = 0x7530
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_output_ready
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	leal	-1(%r15), %eax
	cmpl	$1, %r15d
	movl	%eax, %r15d
	ja	LBB0_4
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movl	(%r13), %edx
	testl	%edx, (%rcx,%rax,4)
	je	LBB0_19
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_output_ready
	testq	%rax, %rax
	je	LBB0_44
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rax
	movq	40(%rbx), %rcx
	movq	(%rcx,%rax,8), %rdi
	leaq	-41(%rbp), %rsi
	movl	$1, %edx
	callq	_snd_rawmidi_transmit
	cmpl	$1, %eax
	jne	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 32(%rbx)
	movb	-41(%rbp), %al
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_WF_INTERNAL_SWITCH@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_WF_EXTERNAL_SWITCH@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	jne	LBB0_12
	jmp	LBB0_13
LBB0_1:
	movl	$256, %r12d                     ## imm = 0x100
	jmp	LBB0_20
LBB0_14:
	xorl	%r12d, %r12d
	jmp	LBB0_20
LBB0_15:
	movq	16(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	leaq	-1(%rax), %rcx
	movq	%rcx, 16(%rbx)
	cmpq	$1, %rax
	jg	LBB0_18
## %bb.17:
	leaq	28(%rbx), %rdi
	callq	_del_timer
LBB0_18:
	movq	_MPU401_MODE_OUTPUT_TRIGGER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	andl	%eax, (%rdx,%rcx,4)
LBB0_19:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_20:
	xorl	%eax, %eax
	cmpq	$0, (%rbx)
	movq	40(%rbx), %rcx
	sete	%al
	cmpq	$0, (%rcx,%rax,8)
	je	LBB0_45
## %bb.21:
	testl	%r12d, %r12d
	jle	LBB0_45
## %bb.22:
	leaq	24(%rbx), %r14
	movl	$1, %r13d
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_23 Depth=1
	movzbl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_write_data
	movq	%r13, (%rbx)
LBB0_39:                                ##   in Loop: Header=BB0_23 Depth=1
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	$0, %r13d
	testl	%r12d, %r12d
	jle	LBB0_45
LBB0_23:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_24 Depth 2
	movl	$30000, %r15d                   ## imm = 0x7530
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_23 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_output_ready
	testq	%rax, %rax
	jne	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=2
	leal	-1(%r15), %eax
	cmpl	$1, %r15d
	movl	%eax, %r15d
	ja	LBB0_24
LBB0_26:                                ##   in Loop: Header=BB0_23 Depth=1
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	cmpl	$0, 32(%rbx)
	movl	$0, %eax
	cmoveq	%rax, %r13
	xorq	(%rbx), %r13
	movq	8(%rbx), %rax
	movq	_MPU401_MODE_OUTPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax,%r13,4)
	je	LBB0_44
## %bb.27:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	40(%rbx), %rax
	movq	(%rax,%r13,8), %rdi
	callq	_snd_rawmidi_transmit_empty
	testq	%rax, %rax
	jne	LBB0_40
## %bb.28:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	%rbx, %rdi
	callq	_output_ready
	testq	%rax, %rax
	je	LBB0_44
## %bb.29:                              ##   in Loop: Header=BB0_23 Depth=1
	cmpq	(%rbx), %r13
	jne	LBB0_30
## %bb.33:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	40(%rbx), %rax
	movq	(%rax,%r13,8), %rdi
	leaq	-41(%rbp), %rsi
	movl	$1, %edx
	callq	_snd_rawmidi_transmit
	cmpl	$1, %eax
	jne	LBB0_40
## %bb.34:                              ##   in Loop: Header=BB0_23 Depth=1
	cmpl	$0, 32(%rbx)
	movb	-41(%rbp), %al
	je	LBB0_37
## %bb.35:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	_WF_INTERNAL_SWITCH@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	je	LBB0_38
## %bb.36:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	_WF_EXTERNAL_SWITCH@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	je	LBB0_38
LBB0_37:                                ##   in Loop: Header=BB0_23 Depth=1
	movzbl	%al, %esi
	movq	%rbx, %rdi
	callq	_write_data
LBB0_38:                                ##   in Loop: Header=BB0_23 Depth=1
	decl	%r12d
	jmp	LBB0_39
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_23 Depth=1
	movq	_WF_EXTERNAL_SWITCH@GOTPCREL(%rip), %rax
	movq	_internal_mpu@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r13
	jne	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	_WF_INTERNAL_SWITCH@GOTPCREL(%rip), %rax
	jmp	LBB0_32
LBB0_40:
	movq	16(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_43
## %bb.41:
	leaq	-1(%rax), %rcx
	movq	%rcx, 16(%rbx)
	cmpq	$1, %rax
	jg	LBB0_43
## %bb.42:
	leaq	28(%rbx), %rdi
	callq	_del_timer
LBB0_43:
	movq	_MPU401_MODE_OUTPUT_TRIGGER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	8(%rbx), %rcx
	andl	%eax, (%rcx,%r13,4)
LBB0_44:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_45:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MPU401_MODE_OUTPUT,4,2         ## @MPU401_MODE_OUTPUT
	.comm	_WF_INTERNAL_SWITCH,1,0         ## @WF_INTERNAL_SWITCH
	.comm	_WF_EXTERNAL_SWITCH,1,0         ## @WF_EXTERNAL_SWITCH
	.comm	_MPU401_MODE_OUTPUT_TRIGGER,4,2 ## @MPU401_MODE_OUTPUT_TRIGGER
	.comm	_internal_mpu,8,3               ## @internal_mpu
	.no_dead_strip	_snd_wavefront_midi_output_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_wavefront_midi_output_write
_snd_wavefront_midi_output_write:       ; @snd_wavefront_midi_output_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x8, [x0, #40]
	ldr	x9, [x0]
	ldr	x8, [x8, x9, lsl #3]
Lloh0:
	adrp	x21, _MPU401_MODE_OUTPUT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MPU401_MODE_OUTPUT@GOTPAGEOFF]
Lloh2:
	adrp	x22, _WF_INTERNAL_SWITCH@GOTPAGE
Lloh3:
	ldr	x22, [x22, _WF_INTERNAL_SWITCH@GOTPAGEOFF]
Lloh4:
	adrp	x23, _WF_EXTERNAL_SWITCH@GOTPAGE
Lloh5:
	ldr	x23, [x23, _WF_EXTERNAL_SWITCH@GOTPAGEOFF]
	cbz	x8, LBB0_12
; %bb.1:
	add	x20, x19, #24
	mov	w24, #256
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_write_data
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	subs	w24, w24, #1
	b.ls	LBB0_13
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	w25, #30000
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	bl	_output_ready
	subs	w25, w25, #1
	cbnz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	b.hi	LBB0_5
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldp	x9, x8, [x19]
	ldr	w8, [x8, x9, lsl #2]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_output_ready
	cbz	x0, LBB0_40
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #40]
	ldr	x9, [x19]
	ldr	x0, [x8, x9, lsl #3]
	add	x1, sp, #15
	mov	w2, #1
	bl	_snd_rawmidi_transmit
	cmp	w0, #1
	b.ne	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19, #32]
	ldrb	w1, [sp, #15]
	cbz	w8, LBB0_2
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w8, [x22]
	ldrb	w9, [x23]
	cmp	w1, w8
	ccmp	w1, w9, #4, ne
	b.ne	LBB0_2
	b	LBB0_3
LBB0_12:
	mov	w24, #256
	b	LBB0_19
LBB0_13:
	mov	w24, #0
	b	LBB0_19
LBB0_14:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_17
; %bb.15:
	subs	x8, x8, #1
	str	x8, [x19, #16]
	b.gt	LBB0_17
; %bb.16:
	add	x0, x19, #28
	bl	_del_timer
LBB0_17:
Lloh6:
	adrp	x8, _MPU401_MODE_OUTPUT_TRIGGER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MPU401_MODE_OUTPUT_TRIGGER@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldp	x10, x9, [x19]
	lsl	x10, x10, #2
	ldr	w11, [x9, x10]
	bic	w8, w11, w8
	str	w8, [x9, x10]
LBB0_18:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
LBB0_19:
	ldr	x8, [x19, #40]
	ldr	x9, [x19]
	cmp	x9, #0
	cset	w9, eq
	ldr	x8, [x8, w9, uxtw #3]
	cmp	x8, #0
	ccmp	w24, #1, #8, ne
	b.lt	LBB0_41
; %bb.20:
	add	x20, x19, #24
	mov	w26, #1
Lloh9:
	adrp	x25, _internal_mpu@GOTPAGE
Lloh10:
	ldr	x25, [x25, _internal_mpu@GOTPAGEOFF]
	b	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x25]
	cmp	x26, x8
	csel	x8, x22, x23, eq
	ldrb	w1, [x8]
	mov	x0, x19
	bl	_write_data
	str	x26, [x19]
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x26, #0
	cmp	w24, #0
	b.le	LBB0_41
LBB0_23:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_24 Depth 2
	mov	w27, #30000
LBB0_24:                                ;   Parent Loop BB0_23 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	bl	_output_ready
	subs	w27, w27, #1
	cbnz	x0, LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=2
	b.hi	LBB0_24
LBB0_26:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x19, #32]
	cmp	w8, #0
	csel	x8, xzr, x26, eq
	ldp	x9, x10, [x19]
	eor	x26, x8, x9
	ldr	w8, [x10, x26, lsl #2]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_40
; %bb.27:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x19, #40]
	ldr	x0, [x8, x26, lsl #3]
	bl	_snd_rawmidi_transmit_empty
	cbnz	x0, LBB0_36
; %bb.28:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x19
	bl	_output_ready
	cbz	x0, LBB0_40
; %bb.29:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x19]
	cmp	x26, x8
	b.ne	LBB0_21
; %bb.30:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x19, #40]
	ldr	x0, [x8, x26, lsl #3]
	add	x1, sp, #15
	mov	w2, #1
	bl	_snd_rawmidi_transmit
	cmp	w0, #1
	b.ne	LBB0_36
; %bb.31:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w8, [x19, #32]
	ldrb	w1, [sp, #15]
	cbz	w8, LBB0_34
; %bb.32:                               ;   in Loop: Header=BB0_23 Depth=1
	ldrb	w8, [x22]
	cmp	w1, w8
	b.eq	LBB0_35
; %bb.33:                               ;   in Loop: Header=BB0_23 Depth=1
	ldrb	w8, [x23]
	cmp	w1, w8
	b.eq	LBB0_35
LBB0_34:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x19
	bl	_write_data
LBB0_35:                                ;   in Loop: Header=BB0_23 Depth=1
	sub	w24, w24, #1
	b	LBB0_22
LBB0_36:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_39
; %bb.37:
	subs	x8, x8, #1
	str	x8, [x19, #16]
	b.gt	LBB0_39
; %bb.38:
	add	x0, x19, #28
	bl	_del_timer
LBB0_39:
Lloh11:
	adrp	x8, _MPU401_MODE_OUTPUT_TRIGGER@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MPU401_MODE_OUTPUT_TRIGGER@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
	lsl	x10, x26, #2
	ldr	w11, [x9, x10]
	bic	w8, w11, w8
	str	w8, [x9, x10]
LBB0_40:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
LBB0_41:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MPU401_MODE_OUTPUT,4,2         ; @MPU401_MODE_OUTPUT
	.comm	_WF_INTERNAL_SWITCH,1,0         ; @WF_INTERNAL_SWITCH
	.comm	_WF_EXTERNAL_SWITCH,1,0         ; @WF_EXTERNAL_SWITCH
	.comm	_MPU401_MODE_OUTPUT_TRIGGER,4,2 ; @MPU401_MODE_OUTPUT_TRIGGER
	.comm	_internal_mpu,8,3               ; @internal_mpu
	.no_dead_strip	_snd_wavefront_midi_output_write
.subsections_via_symbols
