	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcam_write_yuv_bases
_mcam_write_yuv_bases:                  ## @mcam_write_yuv_bases
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	4(%rdi), %eax
	movl	8(%rdi), %ecx
	imull	(%rdi), %eax
	cmpl	$128, %ecx
	je	LBB0_3
## %bb.1:
	xorl	%r12d, %r12d
	movl	$0, %r15d
	cmpl	$129, %ecx
	jne	LBB0_4
## %bb.2:
	leal	(%rax,%rdx), %r12d
	leal	3(%rax), %r15d
	testl	%eax, %eax
	cmovnsl	%eax, %r15d
	sarl	$2, %r15d
	addl	%r12d, %r15d
	jmp	LBB0_4
LBB0_3:
	leal	(%rax,%rdx), %r15d
	leal	3(%rax), %r12d
	testl	%eax, %eax
	cmovnsl	%eax, %r12d
	sarl	$2, %r12d
	addl	%r15d, %r12d
LBB0_4:
	movq	_REG_Y0BAR@GOTPCREL(%rip), %rax
	shll	$2, %r14d
	movq	(%rax), %rsi
	addq	%r14, %rsi
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_mcam_reg_write
	movl	8(%rbx), %edi
	callq	_mcam_fmt_is_planar
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	_REG_U0BAR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r14, %rsi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_mcam_reg_write
	movq	_REG_V0BAR@GOTPCREL(%rip), %rax
	addq	(%rax), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mcam_reg_write                 ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_Y0BAR,8,3                  ## @REG_Y0BAR
	.comm	_REG_U0BAR,8,3                  ## @REG_U0BAR
	.comm	_REG_V0BAR,8,3                  ## @REG_V0BAR
	.no_dead_strip	_mcam_write_yuv_bases
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcam_write_yuv_bases
_mcam_write_yuv_bases:                  ; @mcam_write_yuv_bases
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldp	w8, w9, [x0]
	mul	w8, w9, w8
	ldr	w9, [x0, #8]
	add	w10, w8, w2
	add	w11, w8, #3
	cmp	w8, #0
	csel	w8, w11, w8, lt
	add	w8, w10, w8, asr #2
	cmp	w9, #129
	csel	w11, wzr, w10, ne
	csel	w12, wzr, w8, ne
	cmp	w9, #128
	csel	w21, w8, w11, eq
	csel	w20, w10, w12, eq
Lloh0:
	adrp	x8, _REG_Y0BAR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_Y0BAR@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	lsl	w22, w1, #2
	add	x1, x8, x22
	bl	_mcam_reg_write
	ldr	w0, [x19, #8]
	bl	_mcam_fmt_is_planar
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _REG_U0BAR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_U0BAR@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x1, x8, x22
	mov	x0, x19
	mov	x2, x21
	bl	_mcam_reg_write
Lloh6:
	adrp	x8, _REG_V0BAR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_V0BAR@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	add	x1, x8, x22
	mov	x0, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mcam_reg_write
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_Y0BAR,8,3                  ; @REG_Y0BAR
	.comm	_REG_U0BAR,8,3                  ; @REG_U0BAR
	.comm	_REG_V0BAR,8,3                  ; @REG_V0BAR
	.no_dead_strip	_mcam_write_yuv_bases
.subsections_via_symbols
