	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_unload_uart401                 ## -- Begin function unload_uart401
	.p2align	4, 0x90
_unload_uart401:                        ## @unload_uart401
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movslq	16(%rax), %rax
	cmpq	$-1, %rax
	je	LBB0_6
## %bb.1:
	movq	_midi_devs@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movq	(%rcx,%rax,8), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	24(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.3:
	movq	%rdi, %r14
	movq	%rbx, %rdi
	callq	_reset_uart401
	movl	8(%r14), %edi
	movl	$4, %esi
	callq	_release_region
	cmpl	$0, 20(%rbx)
	jne	LBB0_5
## %bb.4:
	movl	16(%rbx), %edi
	movq	%rbx, %rsi
	callq	_free_irq
LBB0_5:
	movq	(%r15), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	8(%rax), %rdi
	callq	_kfree
	movq	(%r15), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_kfree
	movq	(%r14), %rax
	movslq	16(%rax), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sound_unload_mididev           ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_midi_devs,8,3                  ## @midi_devs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_unload_uart401                 ; -- Begin function unload_uart401
	.p2align	2
_unload_uart401:                        ; @unload_uart401
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
	ldrsw	x8, [x8, #16]
	cmn	w8, #1
	b.eq	LBB0_6
; %bb.1:
Lloh0:
	adrp	x21, _midi_devs@GOTPAGE
Lloh1:
	ldr	x21, [x21, _midi_devs@GOTPAGEOFF]
	ldr	x9, [x21]
	ldr	x8, [x9, x8, lsl #3]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	x20, [x8, #24]
	cbz	x20, LBB0_6
; %bb.3:
	mov	x19, x0
	mov	x0, x20
	bl	_reset_uart401
	ldr	w0, [x19, #8]
	mov	w1, #4
	bl	_release_region
	ldr	w8, [x20, #20]
	cbnz	w8, LBB0_5
; %bb.4:
	ldr	w0, [x20, #16]
	mov	x1, x20
	bl	_free_irq
LBB0_5:
	ldr	x8, [x21]
	ldr	x9, [x20]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x0, [x8, #8]
	bl	_kfree
	ldr	x8, [x21]
	ldr	x9, [x20]
	ldr	x0, [x8, x9, lsl #3]
	bl	_kfree
	mov	x0, x20
	bl	_kfree
	ldr	x8, [x19]
	ldrsw	x0, [x8, #16]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_sound_unload_mididev
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_midi_devs,8,3                  ; @midi_devs
.subsections_via_symbols
