	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw686x_irq
_tw686x_irq:                            ## @tw686x_irq
	.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	%rsi, %r13
	movq	_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_reg_read
	movl	%eax, %r15d
	movq	_VIDEO_FIFO_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_reg_read
	movl	%eax, %r14d
	testl	%r15d, %r15d
	jne	LBB0_3
## %bb.1:
	movl	%r14d, %edi
	callq	_TW686X_FIFO_ERROR
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movq	_INT_STATUS_DMA_TOUT@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_5
## %bb.4:
	movq	8(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movl	$-1, -44(%rbp)
	jmp	LBB0_10
LBB0_5:
	leaq	4(%r13), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_DMA_CHANNEL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_reg_read
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r14d, %eax
	notl	%eax
	movl	%r14d, %ecx
	shrl	$24, %ecx
	movl	%r14d, %ebx
	shrl	$16, %ebx
	orl	%ecx, %ebx
	andl	%eax, %ebx
	orl	%r15d, %ebx
	andl	%r12d, %ebx
	movl	$0, -44(%rbp)
	movq	_PB_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_reg_read
	andl	%r15d, %r12d
	andl	$255, %ebx
	je	LBB0_7
## %bb.6:
	leaq	-44(%rbp), %r8
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %ebx
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_tw686x_video_irq
	movl	%ebx, %eax
LBB0_7:
	cmpl	$256, %r12d                     ## imm = 0x100
	jb	LBB0_9
## %bb.8:
	sarl	$8, %r12d
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_tw686x_audio_irq
LBB0_9:
	cmpl	$0, -44(%rbp)
	je	LBB0_11
LBB0_10:
	leaq	4(%r13), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movl	-44(%rbp), %esi
	movq	%r13, %rdi
	callq	_tw686x_reset_channels
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$100, %edi
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_mod_timer
LBB0_11:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_IRQ_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_STATUS,4,2                 ## @INT_STATUS
	.comm	_VIDEO_FIFO_STATUS,4,2          ## @VIDEO_FIFO_STATUS
	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.comm	_INT_STATUS_DMA_TOUT,4,2        ## @INT_STATUS_DMA_TOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA timeout. Resetting DMA for all channels\n"

	.comm	_DMA_CHANNEL_ENABLE,4,2         ## @DMA_CHANNEL_ENABLE
	.comm	_PB_STATUS,4,2                  ## @PB_STATUS
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_tw686x_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw686x_irq
_tw686x_irq:                            ; @tw686x_irq
	.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	x19, x1
Lloh0:
	adrp	x8, _INT_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_reg_read
	mov	x21, x0
Lloh3:
	adrp	x8, _VIDEO_FIFO_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDEO_FIFO_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_reg_read
	mov	x20, x0
	cbnz	w21, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_TW686X_FIFO_ERROR
	cbz	w0, LBB0_12
LBB0_2:
Lloh6:
	adrp	x8, _INT_STATUS_DMA_TOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INT_STATUS_DMA_TOUT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_4
; %bb.3:
	ldr	x0, [x19, #8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	mov	w8, #-1
	str	w8, [sp, #12]
	b	LBB0_9
LBB0_4:
	add	x22, x19, #4
	mov	x0, x22
	bl	_spin_lock_irqsave
Lloh11:
	adrp	x8, _DMA_CHANNEL_ENABLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DMA_CHANNEL_ENABLE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_reg_read
	mov	x23, x0
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	lsr	w8, w20, #24
	orr	w8, w8, w20, lsr #16
	bic	w8, w8, w20
	orr	w8, w8, w21
	and	w24, w23, w8
	str	wzr, [sp, #12]
Lloh14:
	adrp	x8, _PB_STATUS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PB_STATUS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_reg_read
	mov	x22, x0
	and	w21, w23, w21
	ands	w1, w24, #0xff
	b.eq	LBB0_6
; %bb.5:
	add	x4, sp, #12
	mov	x0, x19
	mov	x2, x22
	mov	x3, x20
	bl	_tw686x_video_irq
LBB0_6:
	cmp	w21, #256
	b.lo	LBB0_8
; %bb.7:
	asr	w1, w21, #8
	mov	x0, x19
	mov	x2, x22
	bl	_tw686x_audio_irq
LBB0_8:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_10
LBB0_9:
	add	x20, x19, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_tw686x_reset_channels
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh17:
	adrp	x8, _jiffies@GOTPAGE
Lloh18:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh19:
	ldr	x20, [x8]
	mov	w0, #100
	bl	_msecs_to_jiffies
	add	x1, x0, x20
	mov	x0, x19
	bl	_mod_timer
LBB0_10:
Lloh20:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	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
	ret
LBB0_12:
Lloh22:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_STATUS,4,2                 ; @INT_STATUS
	.comm	_VIDEO_FIFO_STATUS,4,2          ; @VIDEO_FIFO_STATUS
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.comm	_INT_STATUS_DMA_TOUT,4,2        ; @INT_STATUS_DMA_TOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA timeout. Resetting DMA for all channels\n"

	.comm	_DMA_CHANNEL_ENABLE,4,2         ; @DMA_CHANNEL_ENABLE
	.comm	_PB_STATUS,4,2                  ; @PB_STATUS
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_tw686x_irq
.subsections_via_symbols
