	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viacam_irq
_viacam_irq:                            ## @viacam_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, %r12
	leaq	4(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_viacam_next_buffer
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r15
	movq	_VCR_INTCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_viacam_read_reg
	movl	%eax, %ebx
	movq	_VCR_IC_ACTBUF@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	cmpl	$7, %ebx
	jg	LBB0_2
## %bb.3:
	movl	(%r12), %ebx
	jmp	LBB0_4
LBB0_2:
	sarl	$3, %ebx
LBB0_4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_sg_plane_desc
	movq	%rax, %r13
	xorl	%eax, %eax
	callq	_ktime_get_ns
	movl	%eax, (%r15)
	movq	16(%r12), %rax
	movslq	%ebx, %rcx
	movl	-4(%rax,%rcx,4), %edi
	movl	(%r13), %edx
	movl	4(%r13), %esi
	callq	_viafb_dma_copy_out_sg
	movslq	8(%r12), %rax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%r12)
	movq	%rax, 8(%r15)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	%r15, %rdi
	addq	$16, %rdi
	callq	_list_del
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vb2_buffer_done
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VCR_INTCTRL,4,2                ## @VCR_INTCTRL
	.comm	_VCR_IC_ACTBUF,4,2              ## @VCR_IC_ACTBUF
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_viacam_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viacam_irq
_viacam_irq:                            ; @viacam_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	x21, x1
	add	x19, x1, #4
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x21
	bl	_viacam_next_buffer
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _VCR_INTCTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VCR_INTCTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_viacam_read_reg
Lloh3:
	adrp	x8, _VCR_IC_ACTBUF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VCR_IC_ACTBUF@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
	cmp	w8, #7
	b.gt	LBB0_3
; %bb.2:
	ldr	w8, [x21]
	b	LBB0_4
LBB0_3:
	asr	w8, w8, #3
LBB0_4:
	sub	w23, w8, #1
	mov	x0, x20
	mov	w1, #0
	bl	_vb2_dma_sg_plane_desc
	mov	x22, x0
	bl	_ktime_get_ns
	str	w0, [x20]
	ldr	x8, [x21, #16]
	ldr	w0, [x8, w23, sxtw #2]
	ldp	w2, w1, [x22]
	bl	_viafb_dma_copy_out_sg
	ldrsw	x8, [x21, #8]
	add	w9, w8, #1
	str	w9, [x21, #8]
	str	x8, [x20, #8]
Lloh6:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x20, #4]
	add	x0, x20, #16
	bl	_list_del
Lloh9:
	adrp	x8, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_vb2_buffer_done
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
Lloh12:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_VCR_INTCTRL,4,2                ; @VCR_INTCTRL
	.comm	_VCR_IC_ACTBUF,4,2              ; @VCR_IC_ACTBUF
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_viacam_irq
.subsections_via_symbols
