	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cherryview_load_csc_matrix
_cherryview_load_csc_matrix:            ## @cherryview_load_csc_matrix
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	16(%rdi), %edi
	callq	_to_intel_crtc
	movq	%rax, %r14
	movl	4(%rax), %edi
	callq	_to_i915
	movl	(%r14), %r14d
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movl	%r14d, -100(%rbp)               ## 4-byte Spill
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	movq	(%rax), %r13
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movl	$0, -64(%rbp)
	leaq	-96(%rbp), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_6
## %bb.2:
	xorl	%ebx, %ebx
	movl	$524288, %r14d                  ## imm = 0x80000
	movq	_CTM_COEFF_8_0@GOTPCREL(%rip), %r15
	leaq	-96(%rbp), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movq	%r12, %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movl	(%rax,%rbx,8), %edi
	addl	%r14d, %edi
	movq	(%r15), %rdx
	decq	%rdx
	xorl	%esi, %esi
	callq	_clamp_val
	movq	(%r13), %rax
	cmpq	$0, (%rax,%rbx,8)
	jns	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$32768, -96(%rbp,%rbx,4)        ## imm = 0x8000
	jmp	LBB0_5
LBB0_6:
	movl	-100(%rbp), %r14d               ## 4-byte Reload
	movl	%r14d, %edi
	callq	_CGM_PIPE_CSC_COEFF01
	movl	-92(%rbp), %esi
	shll	$16, %esi
	orl	-96(%rbp), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movl	%r14d, %edi
	callq	_CGM_PIPE_CSC_COEFF23
	movl	-84(%rbp), %esi
	shll	$16, %esi
	orl	-88(%rbp), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movl	%r14d, %edi
	callq	_CGM_PIPE_CSC_COEFF45
	movl	-76(%rbp), %esi
	shll	$16, %esi
	orl	-80(%rbp), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movl	%r14d, %edi
	callq	_CGM_PIPE_CSC_COEFF67
	movl	-68(%rbp), %esi
	shll	$16, %esi
	orl	-72(%rbp), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movl	%r14d, %edi
	callq	_CGM_PIPE_CSC_COEFF8
	movl	-64(%rbp), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movq	-112(%rbp), %rbx                ## 8-byte Reload
LBB0_7:
	movl	%r14d, %edi
	callq	_CGM_PIPE_MODE
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CTM_COEFF_8_0,8,3              ## @CTM_COEFF_8_0
	.no_dead_strip	_cherryview_load_csc_matrix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cherryview_load_csc_matrix
_cherryview_load_csc_matrix:            ; @cherryview_load_csc_matrix
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	w0, [x0, #16]
	bl	_to_intel_crtc
	mov	x20, x0
	ldr	w0, [x0, #4]
	bl	_to_i915
	ldr	w20, [x20]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
; %bb.1:
	ldr	x21, [x8]
	str	wzr, [sp, #32]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	mov	x22, sp
	mov	x0, sp
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x23, #0
Lloh3:
	adrp	x24, _CTM_COEFF_8_0@GOTPAGE
Lloh4:
	ldr	x24, [x24, _CTM_COEFF_8_0@GOTPAGEOFF]
	mov	w25, #32768
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	mov	x0, sp
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	lsl	x26, x23, #3
	ldr	w8, [x8, x26]
	add	w0, w8, #128, lsl #12           ; =524288
	ldr	x8, [x24]
	sub	x2, x8, #1
	mov	w1, #0
	bl	_clamp_val
	ldr	x8, [x21]
	ldr	x8, [x8, x26]
	tbz	x8, #63, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w25, [x22, x23, lsl #2]
	b	LBB0_3
LBB0_6:
	mov	x0, x20
	bl	_CGM_PIPE_CSC_COEFF01
	ldp	w9, w8, [sp]
	orr	w1, w9, w8, lsl #16
	bl	_I915_WRITE
	mov	x0, x20
	bl	_CGM_PIPE_CSC_COEFF23
	ldp	w9, w8, [sp, #8]
	orr	w1, w9, w8, lsl #16
	bl	_I915_WRITE
	mov	x0, x20
	bl	_CGM_PIPE_CSC_COEFF45
	ldp	w9, w8, [sp, #16]
	orr	w1, w9, w8, lsl #16
	bl	_I915_WRITE
	mov	x0, x20
	bl	_CGM_PIPE_CSC_COEFF67
	ldp	w9, w8, [sp, #24]
	orr	w1, w9, w8, lsl #16
	bl	_I915_WRITE
	mov	x0, x20
	bl	_CGM_PIPE_CSC_COEFF8
	ldr	w1, [sp, #32]
	bl	_I915_WRITE
LBB0_7:
	mov	x0, x20
	bl	_CGM_PIPE_MODE
	ldr	w1, [x19]
	bl	_I915_WRITE
	ldr	x8, [sp, #40]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_CTM_COEFF_8_0,8,3              ; @CTM_COEFF_8_0
	.no_dead_strip	_cherryview_load_csc_matrix
.subsections_via_symbols
