	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rx_interrupt
_rx_interrupt:                          ## @rx_interrupt
	.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
	movl	%esi, %r13d
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_RXBIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	60(%rbx), %r12
	movq	%r12, %rsi
	callq	_set_bit
	movq	%rbx, %rdi
	callq	_is_8bit
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_IRQBIT@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	%r12, %rsi
	callq	_test_bit
	movl	(%r15), %edi
	movq	%r12, %rsi
	testl	%eax, %eax
	je	LBB0_13
## %bb.2:
	callq	_clear_bit
	movq	%rbx, %rdi
	callq	_cosa_getdata8
	movzbl	%al, %edx
	orl	(%rbx), %edx
	movl	%edx, (%rbx)
	jmp	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	callq	_cosa_getdata16
	movl	%eax, %edx
	movl	%eax, (%rbx)
LBB0_4:
	movl	%edx, %eax
	shrl	$13, %eax
	andl	$7, %eax
	cmpl	4(%rbx), %eax
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	jge	LBB0_5
## %bb.6:
	movl	%eax, %eax
	shlq	$4, %rax
	addq	48(%rbx), %rax
	movq	%rax, 32(%rbx)
	andl	$8191, %edx                     ## imm = 0x1FFF
	movl	%edx, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	$0, 24(%rbx)
	movq	32(%rbx), %rdi
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%rbx), %esi
	callq	*%rax
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_8
LBB0_5:
	movl	56(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_8:
	movl	40(%rbx), %esi
	movq	32(%rbx), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movq	16(%rbx), %rax
	movq	%rax, 24(%rbx)
LBB0_9:
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r12
	movl	12(%rbx), %edi
	callq	_disable_dma
	movl	12(%rbx), %edi
	callq	_clear_dma_ff
	movl	12(%rbx), %edi
	movq	_DMA_MODE_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_dma_mode
	movq	24(%rbx), %rsi
	movq	32(%rbx), %rdi
	movl	$8191, %r13d                    ## imm = 0x1FFF
	movl	(%rbx), %edx
	andl	%r13d, %edx
	callq	_cosa_dma_able
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	movl	12(%rbx), %r15d
	movq	16(%rbx,%rcx,8), %rdi
	callq	_virt_to_bus
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_set_dma_addr
	movl	12(%rbx), %edi
	andl	(%rbx), %r13d
	movl	%r13d, %esi
	callq	_set_dma_count
	movl	12(%rbx), %edi
	callq	_enable_dma
	movq	%r12, %rdi
	callq	_release_dma_lock
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_spin_lock_irqsave
	movq	_SR_RX_DMA_ENA@GOTPCREL(%rip), %rax
	movq	_SR_USR_INT_ENA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cosa_putstatus
	movq	%rbx, %rdi
	callq	_is_8bit
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:
	movq	_SR_TX_RDY@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, (%rax)
	je	LBB0_12
## %bb.11:
	movq	_DRIVER_RX_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cosa_putdata8
LBB0_12:
	movq	%r14, %rdi
	movq	%r12, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_13:
	callq	_set_bit
	movq	%rbx, %rdi
	callq	_put_driver_status_nolock
	movq	%rbx, %rdi
	callq	_cosa_getdata8
	ud2
	.cfi_endproc
                                        ## -- End function
	.comm	_RXBIT,4,2                      ## @RXBIT
	.comm	_IRQBIT,4,2                     ## @IRQBIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: rx for unknown channel (0x%04x)\n"

L_.str.1:                               ## @.str.1
	.asciz	"cosa%d: rejecting packet on channel %d\n"

	.comm	_DMA_MODE_READ,4,2              ## @DMA_MODE_READ
	.comm	_SR_RX_DMA_ENA,4,2              ## @SR_RX_DMA_ENA
	.comm	_SR_USR_INT_ENA,4,2             ## @SR_USR_INT_ENA
	.comm	_SR_TX_RDY,4,2                  ## @SR_TX_RDY
	.comm	_DRIVER_RX_READY,4,2            ## @DRIVER_RX_READY
	.no_dead_strip	_rx_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rx_interrupt
_rx_interrupt:                          ; @rx_interrupt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	mov	x19, x0
	add	x20, x0, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh0:
	adrp	x8, _RXBIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RXBIT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x22, x19, #60
	mov	x1, x22
	bl	_set_bit
	mov	x0, x19
	bl	_is_8bit
	cbz	x0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x23, _IRQBIT@GOTPAGE
Lloh4:
	ldr	x23, [x23, _IRQBIT@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	x1, x22
	bl	_test_bit
	mov	x8, x0
	ldr	w0, [x23]
	mov	x1, x22
	cbz	w8, LBB0_13
; %bb.2:
	bl	_clear_bit
	mov	x0, x19
	bl	_cosa_getdata8
	and	w8, w0, #0xff
	ldr	w9, [x19]
	orr	w2, w9, w8
	str	w2, [x19]
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_cosa_getdata16
	mov	x2, x0
	str	w0, [x19]
LBB0_4:
	ubfx	w8, w2, #13, #3
	ldr	w9, [x19, #4]
	cmp	w8, w9
	b.ge	LBB0_7
; %bb.5:
	ldr	x9, [x19, #48]
	add	x8, x9, w8, uxtw #4
	str	x8, [x19, #32]
	and	w8, w2, #0x1fff
	str	w8, [x19]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	str	xzr, [x19, #24]
	ldr	x0, [x19, #32]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	w1, [x19]
	blr	x8
	str	x0, [x19, #24]
	cbnz	x0, LBB0_9
	b	LBB0_8
LBB0_7:
	ldr	w1, [x19, #56]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
	mov	x0, x20
	bl	_spin_unlock_irqrestore
LBB0_8:
	ldr	w1, [x19, #40]
	ldr	x8, [x19, #32]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	ldr	x8, [x19, #16]
	str	x8, [x19, #24]
LBB0_9:
	bl	_claim_dma_lock
	mov	x22, x0
	ldr	w0, [x19, #12]
	bl	_disable_dma
	ldr	w0, [x19, #12]
	bl	_clear_dma_ff
	ldr	w0, [x19, #12]
Lloh9:
	adrp	x8, _DMA_MODE_READ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_MODE_READ@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_set_dma_mode
	ldp	x1, x0, [x19, #24]
	ldr	w8, [x19]
	and	w2, w8, #0x1fff
	bl	_cosa_dma_able
	ldr	w23, [x19, #12]
	mov	w8, #24
	mov	w9, #16
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	x0, [x19, x8]
	bl	_virt_to_bus
	mov	x1, x0
	mov	x0, x23
	bl	_set_dma_addr
	ldr	w0, [x19, #12]
	ldr	w8, [x19]
	and	w1, w8, #0x1fff
	bl	_set_dma_count
	ldr	w0, [x19, #12]
	bl	_enable_dma
	mov	x0, x22
	bl	_release_dma_lock
	mov	x0, x20
	mov	x1, x22
	bl	_spin_lock_irqsave
Lloh12:
	adrp	x8, _SR_RX_DMA_ENA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SR_RX_DMA_ENA@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _SR_USR_INT_ENA@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SR_USR_INT_ENA@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_cosa_putstatus
	mov	x0, x19
	bl	_is_8bit
	cbnz	x0, LBB0_12
; %bb.10:
Lloh18:
	adrp	x8, _SR_TX_RDY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SR_TX_RDY@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_12
; %bb.11:
Lloh21:
	adrp	x8, _DRIVER_RX_READY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DRIVER_RX_READY@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cosa_putdata8
LBB0_12:
	mov	x0, x20
	mov	x1, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_spin_unlock_irqrestore
LBB0_13:
	bl	_set_bit
	mov	x0, x19
	bl	_put_driver_status_nolock
	mov	x0, x19
	bl	_cosa_getdata8
	brk	#0x1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_RXBIT,4,2                      ; @RXBIT
	.comm	_IRQBIT,4,2                     ; @IRQBIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: rx for unknown channel (0x%04x)\n"

l_.str.1:                               ; @.str.1
	.asciz	"cosa%d: rejecting packet on channel %d\n"

	.comm	_DMA_MODE_READ,4,2              ; @DMA_MODE_READ
	.comm	_SR_RX_DMA_ENA,4,2              ; @SR_RX_DMA_ENA
	.comm	_SR_USR_INT_ENA,4,2             ; @SR_USR_INT_ENA
	.comm	_SR_TX_RDY,4,2                  ; @SR_TX_RDY
	.comm	_DRIVER_RX_READY,4,2            ; @DRIVER_RX_READY
	.no_dead_strip	_rx_interrupt
.subsections_via_symbols
