	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_set_pipe_csc
_intel_set_pipe_csc:                    ## @intel_set_pipe_csc
	.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, %r15
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	callq	_to_intel_crtc
	movl	(%rax), %ebx
	movq	_INTEL_MODE_LIMITED_COLOR_RANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	movl	$30720, %eax                    ## imm = 0x7800
	movl	$3512, %r13d                    ## imm = 0xDB8
	cmovel	%eax, %r13d
	movl	%ebx, %edi
	callq	_PIPE_CSC_COEFF_RY_GY
	movl	%r13d, %r12d
	shll	$16, %r12d
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_COEFF_BY
	xorl	%r14d, %r14d
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_COEFF_RU_GU
	movl	%eax, %edi
	movl	%r13d, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_COEFF_BU
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_COEFF_RV_GV
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_COEFF_BV
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_PREOFF_HI
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_PREOFF_ME
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_PREOFF_LO
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_I915_WRITE
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_INTEL_INFO
	cmpl	$7, (%rax)
	jl	LBB0_2
## %bb.1:
	movq	_INTEL_MODE_LIMITED_COLOR_RANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	movl	$514, %r15d                     ## imm = 0x202
	cmovel	%eax, %r15d
	movl	%ebx, %edi
	callq	_PIPE_CSC_POSTOFF_HI
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_POSTOFF_ME
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_I915_WRITE
	movl	%ebx, %edi
	callq	_PIPE_CSC_POSTOFF_LO
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_I915_WRITE
	jmp	LBB0_5
LBB0_2:
	movq	_CSC_MODE_YUV_TO_RGB@GOTPCREL(%rip), %rax
	movq	_INTEL_MODE_LIMITED_COLOR_RANGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	andl	(%r15), %r14d
	je	LBB0_4
## %bb.3:
	movq	_CSC_BLACK_SCREEN_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
LBB0_4:
	orl	(%rax), %r14d
LBB0_5:
	movl	%ebx, %edi
	callq	_PIPE_CSC_MODE
	movl	%eax, %edi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_I915_WRITE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_MODE_LIMITED_COLOR_RANGE,4,2 ## @INTEL_MODE_LIMITED_COLOR_RANGE
	.comm	_CSC_MODE_YUV_TO_RGB,4,2        ## @CSC_MODE_YUV_TO_RGB
	.comm	_CSC_BLACK_SCREEN_OFFSET,4,2    ## @CSC_BLACK_SCREEN_OFFSET
	.no_dead_strip	_intel_set_pipe_csc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_set_pipe_csc
_intel_set_pipe_csc:                    ; @intel_set_pipe_csc
	.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	x20, x1
	ldr	x21, [x0]
	bl	_to_intel_crtc
	ldr	w19, [x0]
Lloh0:
	adrp	x24, _INTEL_MODE_LIMITED_COLOR_RANGE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _INTEL_MODE_LIMITED_COLOR_RANGE@GOTPAGEOFF]
	ldr	w8, [x20]
	ldr	w9, [x24]
	tst	w9, w8
	mov	w8, #3512
	mov	w9, #30720
	csel	w22, w9, w8, eq
	mov	x0, x19
	bl	_PIPE_CSC_COEFF_RY_GY
	lsl	w23, w22, #16
	mov	x1, x23
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_COEFF_BY
	mov	w1, #0
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_COEFF_RU_GU
	mov	x1, x22
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_COEFF_BU
	mov	w1, #0
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_COEFF_RV_GV
	mov	w1, #0
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_COEFF_BV
	mov	x1, x23
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_PREOFF_HI
	mov	w1, #0
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_PREOFF_ME
	mov	w1, #0
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_PREOFF_LO
	mov	w1, #0
	bl	_I915_WRITE
	mov	x0, x21
	bl	_INTEL_INFO
	ldr	w8, [x0]
	cmp	w8, #7
	b.lt	LBB0_2
; %bb.1:
	ldr	w8, [x20]
	ldr	w9, [x24]
	tst	w9, w8
	mov	w8, #514
	csel	w20, wzr, w8, eq
	mov	x0, x19
	bl	_PIPE_CSC_POSTOFF_HI
	mov	x1, x20
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_POSTOFF_ME
	mov	x1, x20
	bl	_I915_WRITE
	mov	x0, x19
	bl	_PIPE_CSC_POSTOFF_LO
	mov	x1, x20
	bl	_I915_WRITE
	mov	w20, #0
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _CSC_MODE_YUV_TO_RGB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSC_MODE_YUV_TO_RGB@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20]
	ldr	w10, [x24]
Lloh5:
	adrp	x11, _CSC_BLACK_SCREEN_OFFSET@GOTPAGE
Lloh6:
	ldr	x11, [x11, _CSC_BLACK_SCREEN_OFFSET@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, wzr, w11, eq
	orr	w20, w9, w8
LBB0_3:
	mov	x0, x19
	bl	_PIPE_CSC_MODE
	mov	x1, x20
	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
	b	_I915_WRITE
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_MODE_LIMITED_COLOR_RANGE,4,2 ; @INTEL_MODE_LIMITED_COLOR_RANGE
	.comm	_CSC_MODE_YUV_TO_RGB,4,2        ; @CSC_MODE_YUV_TO_RGB
	.comm	_CSC_BLACK_SCREEN_OFFSET,4,2    ; @CSC_BLACK_SCREEN_OFFSET
	.no_dead_strip	_intel_set_pipe_csc
.subsections_via_symbols
