	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viacam_ctlr_cbufs
_viacam_ctlr_cbufs:                     ## @viacam_ctlr_cbufs
	.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	40(%rdi), %rax
	movl	(%rax), %eax
	cltd
	idivl	16(%rdi)
	cmpl	$3, %eax
	jl	LBB0_2
## %bb.1:
	movl	$3, (%r15)
	movq	_VCR_CAPINTC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VCR_CI_3BUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%ecx, %edx
	jmp	LBB0_4
LBB0_2:
	cmpl	$2, %eax
	jne	LBB0_9
## %bb.3:
	movl	$2, (%r15)
	movq	_VCR_CAPINTC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VCR_CI_3BUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%edx, %edx
LBB0_4:
	callq	_viacam_write_reg_mask
	cmpl	$0, (%r15)
	jle	LBB0_7
## %bb.5:
	movl	4(%r15), %ebx
	movq	_VCR_VBUF_MASK@GOTPCREL(%rip), %r13
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	%ebx, (%rax,%r14)
	movl	%ebx, %eax
	addq	24(%r15), %rax
	movq	32(%r15), %rcx
	movq	%rax, (%rcx,%r14,2)
	movq	_VCR_VBUF1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r14, %rsi
	movl	(%r13), %edx
	andl	%ebx, %edx
	movq	%r15, %rdi
	callq	_viacam_write_reg
	addl	16(%r15), %ebx
	incq	%r12
	movslq	(%r15), %rax
	addq	$4, %r14
	cmpq	%rax, %r12
	jl	LBB0_6
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_cam_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VCR_CAPINTC,4,2                ## @VCR_CAPINTC
	.comm	_VCR_CI_3BUFS,4,2               ## @VCR_CI_3BUFS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Insufficient frame buffer memory\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VCR_VBUF1,8,3                  ## @VCR_VBUF1
	.comm	_VCR_VBUF_MASK,4,2              ## @VCR_VBUF_MASK
	.no_dead_strip	_viacam_ctlr_cbufs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viacam_ctlr_cbufs
_viacam_ctlr_cbufs:                     ; @viacam_ctlr_cbufs
	.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	x8, [x0, #40]
	ldr	w8, [x8]
	ldr	w9, [x0, #16]
	sdiv	w8, w8, w9
	cmp	w8, #3
	b.lt	LBB0_2
; %bb.1:
	mov	w8, #3
	str	w8, [x19]
Lloh0:
	adrp	x8, _VCR_CAPINTC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VCR_CAPINTC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _VCR_CI_3BUFS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VCR_CI_3BUFS@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x2
	b	LBB0_4
LBB0_2:
	cmp	w8, #2
	b.ne	LBB0_8
; %bb.3:
	str	w8, [x19]
Lloh6:
	adrp	x8, _VCR_CAPINTC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VCR_CAPINTC@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _VCR_CI_3BUFS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VCR_CI_3BUFS@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w2, #0
LBB0_4:
	bl	_viacam_write_reg_mask
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x20, #0
	mov	x21, #0
	ldr	w22, [x19, #4]
Lloh12:
	adrp	x23, _VCR_VBUF1@GOTPAGE
Lloh13:
	ldr	x23, [x23, _VCR_VBUF1@GOTPAGEOFF]
Lloh14:
	adrp	x24, _VCR_VBUF_MASK@GOTPAGE
Lloh15:
	ldr	x24, [x24, _VCR_VBUF_MASK@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	str	w22, [x8, x21, lsl #2]
	ldp	x8, x9, [x19, #24]
	add	x8, x8, w22, uxtw
	str	x8, [x9, x21, lsl #3]
	ldr	x8, [x23]
	add	x1, x20, x8
	ldr	w8, [x24]
	and	w2, w8, w22
	mov	x0, x19
	bl	_viacam_write_reg
	ldr	w8, [x19, #16]
	add	w22, w8, w22
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x20, x20, #4
	cmp	x21, x8
	b.lt	LBB0_6
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_cam_warn
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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 AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_VCR_CAPINTC,4,2                ; @VCR_CAPINTC
	.comm	_VCR_CI_3BUFS,4,2               ; @VCR_CI_3BUFS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Insufficient frame buffer memory\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VCR_VBUF1,8,3                  ; @VCR_VBUF1
	.comm	_VCR_VBUF_MASK,4,2              ; @VCR_VBUF_MASK
	.no_dead_strip	_viacam_ctlr_cbufs
.subsections_via_symbols
