	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov7670_calc_cmatrix
_ov7670_calc_cmatrix:                   ## @ov7670_calc_cmatrix
	.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
	movl	%ecx, %r15d
	movq	%rsi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_CMATRIX_LEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	movq	(%rdi), %rax
	movq	(%rax), %rcx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %eax
	imull	%edx, %eax
	sarl	$7, %eax
	movl	%eax, (%r13,%rsi,4)
	incq	%rsi
	movslq	(%rbx), %rax
	cmpq	%rax, %rsi
	jl	LBB0_2
LBB0_3:
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	movq	%rsp, %r12
	movl	%eax, %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rdi
	movl	(%rbx), %edx
	shll	$2, %edx
	movq	%r13, %rsi
	callq	_memcpy
	movl	%r15d, %edi
	callq	_ov7670_sine
	movl	%eax, %r14d
	movl	%r15d, %edi
	callq	_ov7670_cosine
	movl	12(%r13), %r9d
	movl	16(%r13), %r8d
	movl	%r9d, %ecx
	imull	%r14d, %ecx
	movl	(%r13), %edx
	imull	%eax, %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	imulq	$274877907, %rcx, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rdi
	addl	%ecx, %edi
	movl	%edi, (%r13)
	movl	%r8d, %ecx
	imull	%r14d, %ecx
	movl	4(%r13), %edx
	imull	%eax, %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	movl	%ecx, 4(%r13)
	movl	20(%r13), %esi
	movl	%esi, %edx
	imull	%r14d, %edx
	movl	8(%r13), %ebx
	imull	%eax, %ebx
	addl	%edx, %ebx
	movslq	%ebx, %rdx
	imulq	$274877907, %rdx, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rbx
	shrq	$63, %rbx
	sarq	$38, %rdx
	addl	%ebx, %edx
	movl	%edx, 8(%r13)
	imull	%eax, %r9d
	imull	%r14d, %edi
	subl	%edi, %r9d
	movslq	%r9d, %rdi
	imulq	$274877907, %rdi, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rbx
	shrq	$63, %rbx
	sarq	$38, %rdi
	addl	%ebx, %edi
	movl	%edi, 12(%r13)
	imull	%eax, %r8d
	imull	%r14d, %ecx
	subl	%ecx, %r8d
	movslq	%r8d, %rcx
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rdi
	shrq	$63, %rdi
	sarq	$38, %rcx
	addl	%edi, %ecx
	movl	%ecx, 16(%r13)
	imull	%eax, %esi
	imull	%r14d, %edx
	subl	%edx, %esi
	movslq	%esi, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	movl	%eax, 20(%r13)
	movq	%r12, %rsp
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CMATRIX_LEN,4,2                ## @CMATRIX_LEN
	.no_dead_strip	_ov7670_calc_cmatrix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov7670_calc_cmatrix
_ov7670_calc_cmatrix:                   ; @ov7670_calc_cmatrix
	.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
	sub	sp, sp, #16
	mov	x20, x3
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x12, _CMATRIX_LEN@GOTPAGE
Lloh4:
	ldr	x12, [x12, _CMATRIX_LEN@GOTPAGEOFF]
	ldr	w9, [x12]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x8, #0
	ldr	x9, [x0]
	ldr	x10, [x9]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x9, x8, #2
	ldr	w11, [x10, x9]
	mul	w11, w11, w2
	asr	w11, w11, #7
	str	w11, [x19, x9]
	add	x8, x8, #1
	ldrsw	x9, [x12]
	cmp	x8, x9
	b.lt	LBB0_2
LBB0_3:
	cbz	w20, LBB0_5
; %bb.4:
	mov	x22, sp
	mov	w8, w9
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x0, x9, x8
	mov	sp, x0
	ldr	w8, [x12]
	lsl	w2, w8, #2
	mov	x1, x19
	bl	_memcpy
	mov	x0, x20
	bl	_ov7670_sine
	mov	x21, x0
	mov	x0, x20
	bl	_ov7670_cosine
	ldp	w9, w8, [x19, #8]
	mul	w10, w8, w21
	ldp	w11, w12, [x19]
	madd	w10, w11, w0, w10
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	smull	x10, w10, w11
	lsr	x13, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w13
	ldp	w13, w14, [x19, #16]
	mul	w15, w13, w21
	madd	w12, w12, w0, w15
	smull	x12, w12, w11
	lsr	x15, x12, #63
	asr	x12, x12, #38
	add	w12, w12, w15
	stp	w10, w12, [x19]
	mul	w15, w14, w21
	madd	w9, w9, w0, w15
	smull	x9, w9, w11
	lsr	x15, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w15
	mul	w10, w10, w21
	neg	w10, w10
	madd	w8, w8, w0, w10
	smull	x8, w8, w11
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	stp	w9, w8, [x19, #8]
	mul	w8, w12, w21
	neg	w8, w8
	madd	w8, w13, w0, w8
	smull	x8, w8, w11
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	mul	w9, w9, w21
	neg	w9, w9
	madd	w9, w14, w0, w9
	smull	x9, w9, w11
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	stp	w8, w9, [x19, #16]
	mov	sp, x22
LBB0_5:
	ldur	x8, [x29, #-40]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	sub	sp, x29, #32
	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
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CMATRIX_LEN,4,2                ; @CMATRIX_LEN
	.no_dead_strip	_ov7670_calc_cmatrix
.subsections_via_symbols
