	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_dm_update_crtc_color_mgmt ## -- Begin function amdgpu_dm_update_crtc_color_mgmt
	.p2align	4, 0x90
_amdgpu_dm_update_crtc_color_mgmt:      ## @amdgpu_dm_update_crtc_color_mgmt
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	24(%rdi), %rax
	movq	32(%rdi), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_CHIP_RAVEN@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	setle	%r13b
	movl	20(%rdi), %edi
	leaq	-72(%rbp), %rsi
	callq	___extract_blob_lut
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	-72(%rbp), %rax
	movq	_MAX_COLOR_LUT_ENTRIES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
LBB0_3:
	movl	16(%r12), %edi
	leaq	-64(%rbp), %rsi
	callq	___extract_blob_lut
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	-64(%rbp), %rax
	movq	_MAX_COLOR_LUT_ENTRIES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	movq	_MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_23
LBB0_6:
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.8:
	movq	-72(%rbp), %rsi
	movq	%rbx, %rdi
	callq	___is_lut_linear
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_9
LBB0_7:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_9:
	movb	%r13b, %r14b
	movq	-64(%rbp), %rdx
	testq	%r15, %r15
	je	LBB0_12
## %bb.10:
	movq	%r15, %rdi
	movq	%rdx, %rsi
	callq	___is_lut_linear
	movq	-64(%rbp), %rdx
	movq	_MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	movq	$0, (%r12)
	jne	LBB0_15
## %bb.11:
	leaq	4(%r12), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_12:
	movq	_MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	movq	$0, (%r12)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_18
## %bb.13:
	leaq	4(%r12), %rax
LBB0_14:
	movl	$1, (%rax)
	movq	_TF_TYPE_DISTRIBUTED_POINTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%rbx), %rdi
	movq	%rax, 8(%rdi)
	movq	_TRANSFER_FUNCTION_SRGB@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	movq	%r15, %rsi
	movl	%r14d, %ecx
	callq	___set_legacy_tf
	jmp	LBB0_17
LBB0_15:
	testl	%eax, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_16
LBB0_18:
	movq	_TF_TYPE_BYPASS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movq	_TRANSFER_FUNCTION_LINEAR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	jmp	LBB0_19
LBB0_16:
	movq	_TF_TYPE_DISTRIBUTED_POINTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%rbx), %rdi
	movq	%rax, 8(%rdi)
	movq	_TRANSFER_FUNCTION_LINEAR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	movq	%r15, %rsi
	movl	%r14d, %ecx
	callq	___set_output_tf
LBB0_17:
	testl	%eax, %eax
	jne	LBB0_23
LBB0_19:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r12)
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	(%rax), %rdi
	movl	8(%rbx), %esi
	callq	___drm_ctm_to_dc_matrix
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, (%rbx)
	jmp	LBB0_22
LBB0_21:
	movq	$0, (%rbx)
LBB0_22:
	xorl	%eax, %eax
LBB0_23:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_RAVEN,8,3                 ## @CHIP_RAVEN
	.comm	_MAX_COLOR_LUT_ENTRIES,8,3      ## @MAX_COLOR_LUT_ENTRIES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_COLOR_LEGACY_LUT_ENTRIES,8,3 ## @MAX_COLOR_LEGACY_LUT_ENTRIES
	.comm	_TF_TYPE_DISTRIBUTED_POINTS,8,3 ## @TF_TYPE_DISTRIBUTED_POINTS
	.comm	_TRANSFER_FUNCTION_SRGB,8,3     ## @TRANSFER_FUNCTION_SRGB
	.comm	_TRANSFER_FUNCTION_LINEAR,8,3   ## @TRANSFER_FUNCTION_LINEAR
	.comm	_TF_TYPE_BYPASS,8,3             ## @TF_TYPE_BYPASS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function amdgpu_dm_update_crtc_color_mgmt
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_amdgpu_dm_update_crtc_color_mgmt
	.p2align	2
_amdgpu_dm_update_crtc_color_mgmt:      ; @amdgpu_dm_update_crtc_color_mgmt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldp	x8, x23, [x0, #24]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _CHIP_RAVEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_RAVEN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w20, le
	ldr	w0, [x0, #20]
	add	x1, sp, #8
	bl	___extract_blob_lut
	mov	x22, x0
Lloh3:
	adrp	x25, _MAX_COLOR_LUT_ENTRIES@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MAX_COLOR_LUT_ENTRIES@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [sp, #8]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_10
LBB0_2:
	ldr	w0, [x19, #16]
	mov	x1, sp
	bl	___extract_blob_lut
	mov	x21, x0
Lloh5:
	adrp	x24, _MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPAGEOFF]
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [sp]
	ldr	x9, [x25]
	ldr	x10, [x24]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_10
LBB0_4:
	cbz	x22, LBB0_6
; %bb.5:
	ldr	x1, [sp, #8]
	mov	x0, x22
	bl	___is_lut_linear
	cmp	w0, #0
	cset	w22, eq
LBB0_6:
	ldr	x2, [sp]
	cbz	x21, LBB0_11
; %bb.7:
	mov	x0, x21
	mov	x1, x2
	bl	___is_lut_linear
	ldr	x2, [sp]
	ldr	x8, [x24]
	str	xzr, [x19]
	cmp	x2, x8
	b.eq	LBB0_12
; %bb.8:
	cbnz	w0, LBB0_13
; %bb.9:
Lloh7:
	adrp	x8, _TF_TYPE_DISTRIBUTED_POINTS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TF_TYPE_DISTRIBUTED_POINTS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x0, [x23, #16]
Lloh10:
	adrp	x9, _TRANSFER_FUNCTION_LINEAR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _TRANSFER_FUNCTION_LINEAR@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	stp	x9, x8, [x0]
	mov	x1, x21
	mov	x3, x20
	bl	___set_output_tf
	cbnz	w0, LBB0_17
	b	LBB0_14
LBB0_10:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_11:
	ldr	x8, [x24]
	str	xzr, [x19]
	cmp	x2, x8
	b.ne	LBB0_13
LBB0_12:
	mov	w8, #1
	str	w8, [x19, #4]
Lloh16:
	adrp	x8, _TF_TYPE_DISTRIBUTED_POINTS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TF_TYPE_DISTRIBUTED_POINTS@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	x0, [x23, #16]
Lloh19:
	adrp	x9, _TRANSFER_FUNCTION_SRGB@GOTPAGE
Lloh20:
	ldr	x9, [x9, _TRANSFER_FUNCTION_SRGB@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	stp	x9, x8, [x0]
	mov	x1, x21
	mov	x3, x20
	bl	___set_legacy_tf
	cbnz	w0, LBB0_17
	b	LBB0_14
LBB0_13:
Lloh22:
	adrp	x8, _TF_TYPE_BYPASS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TF_TYPE_BYPASS@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	ldr	x9, [x23, #16]
Lloh25:
	adrp	x10, _TRANSFER_FUNCTION_LINEAR@GOTPAGE
Lloh26:
	ldr	x10, [x10, _TRANSFER_FUNCTION_LINEAR@GOTPAGEOFF]
Lloh27:
	ldr	x10, [x10]
	stp	x10, x8, [x9]
LBB0_14:
	str	w22, [x19]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_16
; %bb.15:
	ldr	x0, [x8]
	ldr	w1, [x23, #8]
	bl	___drm_ctm_to_dc_matrix
	mov	w0, #0
Lloh28:
	adrp	x8, lCPI0_0@PAGE
Lloh29:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x23]
	b	LBB0_17
LBB0_16:
	mov	w0, #0
	str	xzr, [x23]
LBB0_17:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdr	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_RAVEN,8,3                 ; @CHIP_RAVEN
	.comm	_MAX_COLOR_LUT_ENTRIES,8,3      ; @MAX_COLOR_LUT_ENTRIES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_COLOR_LEGACY_LUT_ENTRIES,8,3 ; @MAX_COLOR_LEGACY_LUT_ENTRIES
	.comm	_TF_TYPE_DISTRIBUTED_POINTS,8,3 ; @TF_TYPE_DISTRIBUTED_POINTS
	.comm	_TRANSFER_FUNCTION_SRGB,8,3     ; @TRANSFER_FUNCTION_SRGB
	.comm	_TRANSFER_FUNCTION_LINEAR,8,3   ; @TRANSFER_FUNCTION_LINEAR
	.comm	_TF_TYPE_BYPASS,8,3             ; @TF_TYPE_BYPASS
.subsections_via_symbols
