	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx8800_vid_irq
_cx8800_vid_irq:                        ## @cx8800_vid_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	%rdi, %r15
	movq	16(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_MO_VID_INTSTAT@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_cx_read
	movl	%eax, %r12d
	movq	_MO_VID_INTMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	movl	%eax, %ebx
	andl	%r12d, %ebx
	je	LBB0_9
## %bb.1:
	movl	%eax, %r14d
	movl	(%r13), %edi
	movl	%r12d, %esi
	callq	_cx_write
	movq	_irq_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_3
## %bb.2:
	cmpl	$256, %ebx                      ## imm = 0x100
	jae	LBB0_3
## %bb.4:
	testl	$65536, %r12d                   ## imm = 0x10000
	jne	LBB0_5
LBB0_6:
	testb	$1, %r12b
	jne	LBB0_7
LBB0_8:
	testb	$8, %r12b
	jne	LBB0_10
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_cx88_vid_irqs@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r13d, %edi
	callq	_ARRAY_SIZE
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	%r12d, %ecx
	movl	%r14d, %r8d
	callq	_cx88_print_irqbits
	testl	$65536, %r12d                   ## imm = 0x10000
	je	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_warn
	movq	_MO_VID_DMACNTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$17, %esi
	callq	_cx_clear
	movq	_VID_CAPTURE_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$6, %esi
	callq	_cx_clear
	movq	_cx88_sram_channels@GOTPCREL(%rip), %rax
	movq	_SRAM_CH21@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	shlq	$2, %rsi
	addq	(%rax), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_cx88_sram_channel_dump
	testb	$1, %r12b
	je	LBB0_8
LBB0_7:
	movq	%r15, %rdi
	callq	_spin_lock
	movq	_MO_VIDY_GPCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	leaq	8(%r15), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_cx88_wakeup
	movq	%r15, %rdi
	callq	_spin_unlock
	testb	$8, %r12b
	je	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_spin_lock
	movq	_MO_VBI_GPCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	leaq	4(%r15), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_cx88_wakeup
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MO_VID_INTSTAT,4,2             ## @MO_VID_INTSTAT
	.comm	_MO_VID_INTMSK,4,2              ## @MO_VID_INTMSK
	.comm	_irq_debug,8,3                  ## @irq_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"irq vid"

	.comm	_cx88_vid_irqs,4,2              ## @cx88_vid_irqs
L_.str.1:                               ## @.str.1
	.asciz	"video risc op code error\n"

	.comm	_MO_VID_DMACNTRL,4,2            ## @MO_VID_DMACNTRL
	.comm	_VID_CAPTURE_CONTROL,4,2        ## @VID_CAPTURE_CONTROL
	.comm	_cx88_sram_channels,8,3         ## @cx88_sram_channels
	.comm	_SRAM_CH21,8,3                  ## @SRAM_CH21
	.comm	_MO_VIDY_GPCNT,4,2              ## @MO_VIDY_GPCNT
	.comm	_MO_VBI_GPCNT,4,2               ## @MO_VBI_GPCNT
	.no_dead_strip	_cx8800_vid_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx8800_vid_irq
_cx8800_vid_irq:                        ; @cx8800_vid_irq
	.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	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x23, _MO_VID_INTSTAT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MO_VID_INTSTAT@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_cx_read
	mov	x21, x0
Lloh2:
	adrp	x8, _MO_VID_INTMSK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MO_VID_INTMSK@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_cx_read
	ands	w24, w0, w21
	b.eq	LBB0_6
; %bb.1:
	mov	x22, x0
	ldr	w0, [x23]
	mov	x1, x21
	bl	_cx_write
Lloh5:
	adrp	x8, _irq_debug@GOTPAGE
Lloh6:
	ldr	x8, [x8, _irq_debug@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbnz	x8, LBB0_7
; %bb.2:
	cmp	w24, #256
	b.hs	LBB0_7
; %bb.3:
	tbnz	w21, #16, LBB0_8
LBB0_4:
	tbnz	w21, #0, LBB0_9
LBB0_5:
	tbnz	w21, #3, LBB0_10
LBB0_6:
	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
LBB0_7:
Lloh8:
	adrp	x8, _cx88_vid_irqs@GOTPAGE
Lloh9:
	ldr	x8, [x8, _cx88_vid_irqs@GOTPAGEOFF]
Lloh10:
	ldr	w23, [x8]
	mov	x0, x23
	bl	_ARRAY_SIZE
	mov	x2, x0
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x3, x21
	mov	x4, x22
	bl	_cx88_print_irqbits
	tbz	w21, #16, LBB0_4
LBB0_8:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_warn
Lloh15:
	adrp	x8, _MO_VID_DMACNTRL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MO_VID_DMACNTRL@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	w1, #17
	bl	_cx_clear
Lloh18:
	adrp	x8, _VID_CAPTURE_CONTROL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VID_CAPTURE_CONTROL@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	w1, #6
	bl	_cx_clear
Lloh21:
	adrp	x8, _cx88_sram_channels@GOTPAGE
Lloh22:
	ldr	x8, [x8, _cx88_sram_channels@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
Lloh24:
	adrp	x9, _SRAM_CH21@GOTPAGE
Lloh25:
	ldr	x9, [x9, _SRAM_CH21@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x1, x8, x9, lsl #2
	mov	x0, x20
	bl	_cx88_sram_channel_dump
	tbz	w21, #0, LBB0_5
LBB0_9:
	mov	x0, x19
	bl	_spin_lock
Lloh27:
	adrp	x8, _MO_VIDY_GPCNT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MO_VIDY_GPCNT@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_cx_read
	mov	x2, x0
	add	x1, x19, #8
	mov	x0, x20
	bl	_cx88_wakeup
	mov	x0, x19
	bl	_spin_unlock
	tbz	w21, #3, LBB0_6
LBB0_10:
	mov	x0, x19
	bl	_spin_lock
Lloh30:
	adrp	x8, _MO_VBI_GPCNT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MO_VBI_GPCNT@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_cx_read
	mov	x2, x0
	add	x1, x19, #4
	mov	x0, x20
	bl	_cx88_wakeup
	mov	x0, x19
	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
	b	_spin_unlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_MO_VID_INTSTAT,4,2             ; @MO_VID_INTSTAT
	.comm	_MO_VID_INTMSK,4,2              ; @MO_VID_INTMSK
	.comm	_irq_debug,8,3                  ; @irq_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"irq vid"

	.comm	_cx88_vid_irqs,4,2              ; @cx88_vid_irqs
l_.str.1:                               ; @.str.1
	.asciz	"video risc op code error\n"

	.comm	_MO_VID_DMACNTRL,4,2            ; @MO_VID_DMACNTRL
	.comm	_VID_CAPTURE_CONTROL,4,2        ; @VID_CAPTURE_CONTROL
	.comm	_cx88_sram_channels,8,3         ; @cx88_sram_channels
	.comm	_SRAM_CH21,8,3                  ; @SRAM_CH21
	.comm	_MO_VIDY_GPCNT,4,2              ; @MO_VIDY_GPCNT
	.comm	_MO_VBI_GPCNT,4,2               ; @MO_VBI_GPCNT
	.no_dead_strip	_cx8800_vid_irq
.subsections_via_symbols
