	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __drm_lut_to_dc_gamma
___drm_lut_to_dc_gamma:                 ## @__drm_lut_to_dc_gamma
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	testl	%edx, %edx
	je	LBB0_4
## %bb.1:
	movq	_MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.2:
	addq	$8, %r15
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movl	$16, %esi
	callq	_drm_color_lut_extract
	movl	%eax, %ebx
	movl	-4(%r15), %edi
	movl	$16, %esi
	callq	_drm_color_lut_extract
	movl	%eax, %r12d
	movl	-8(%r15), %edi
	movl	$16, %esi
	callq	_drm_color_lut_extract
	movl	%eax, %r13d
	movl	%ebx, %edi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	callq	_dc_fixpt_from_int
	movq	16(%rbx), %rcx
	movq	%rax, (%rcx,%r14,8)
	movl	%r12d, %edi
	callq	_dc_fixpt_from_int
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx,%r14,8)
	movl	%r13d, %edi
	callq	_dc_fixpt_from_int
	movq	(%rbx), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	_MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPCREL(%rip), %rax
	incq	%r14
	movslq	(%rax), %rax
	addq	$12, %r15
	cmpq	%rax, %r14
	jl	LBB0_3
	jmp	LBB0_7
LBB0_4:
	movq	_MAX_COLOR_LUT_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.5:
	addq	$8, %r15
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movl	$16, %esi
	callq	_drm_color_lut_extract
	movl	%eax, %ebx
	movl	-4(%r15), %edi
	movl	$16, %esi
	callq	_drm_color_lut_extract
	movl	%eax, %r12d
	movl	-8(%r15), %edi
	movl	$16, %esi
	callq	_drm_color_lut_extract
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MAX_DRM_LUT_VALUE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%ebx, %edi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	callq	_dc_fixpt_from_fraction
	movq	16(%rbx), %rcx
	movq	%rax, (%rcx,%r13,8)
	movl	(%r14), %esi
	movl	%r12d, %edi
	callq	_dc_fixpt_from_fraction
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx,%r13,8)
	movl	(%r14), %esi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_dc_fixpt_from_fraction
	movq	(%rbx), %rcx
	movq	%rax, (%rcx,%r13,8)
	movq	_MAX_COLOR_LUT_ENTRIES@GOTPCREL(%rip), %rax
	incq	%r13
	movslq	(%rax), %rax
	addq	$12, %r15
	cmpq	%rax, %r13
	jl	LBB0_6
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_COLOR_LEGACY_LUT_ENTRIES,4,2 ## @MAX_COLOR_LEGACY_LUT_ENTRIES
	.comm	_MAX_COLOR_LUT_ENTRIES,4,2      ## @MAX_COLOR_LUT_ENTRIES
	.comm	_MAX_DRM_LUT_VALUE,4,2          ## @MAX_DRM_LUT_VALUE
	.no_dead_strip	___drm_lut_to_dc_gamma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __drm_lut_to_dc_gamma
___drm_lut_to_dc_gamma:                 ; @__drm_lut_to_dc_gamma
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	cbz	w2, LBB0_4
; %bb.1:
Lloh0:
	adrp	x23, _MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAX_COLOR_LEGACY_LUT_ENTRIES@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x24, #0
	add	x25, x0, #8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	mov	w1, #16
	bl	_drm_color_lut_extract
	mov	x20, x0
	ldur	w0, [x25, #-4]
	mov	w1, #16
	bl	_drm_color_lut_extract
	mov	x21, x0
	ldur	w0, [x25, #-8]
	mov	w1, #16
	bl	_drm_color_lut_extract
	mov	x22, x0
	mov	x0, x20
	bl	_dc_fixpt_from_int
	ldr	x8, [x19, #16]
	lsl	x20, x24, #3
	str	x0, [x8, x20]
	mov	x0, x21
	bl	_dc_fixpt_from_int
	ldr	x8, [x19, #8]
	str	x0, [x8, x20]
	mov	x0, x22
	bl	_dc_fixpt_from_int
	ldr	x8, [x19]
	str	x0, [x8, x20]
	add	x24, x24, #1
	ldrsw	x8, [x23]
	add	x25, x25, #12
	cmp	x24, x8
	b.lt	LBB0_3
	b	LBB0_7
LBB0_4:
Lloh2:
	adrp	x23, _MAX_COLOR_LUT_ENTRIES@GOTPAGE
Lloh3:
	ldr	x23, [x23, _MAX_COLOR_LUT_ENTRIES@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x24, #0
	add	x25, x0, #8
Lloh4:
	adrp	x26, _MAX_DRM_LUT_VALUE@GOTPAGE
Lloh5:
	ldr	x26, [x26, _MAX_DRM_LUT_VALUE@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	mov	w1, #16
	bl	_drm_color_lut_extract
	mov	x20, x0
	ldur	w0, [x25, #-4]
	mov	w1, #16
	bl	_drm_color_lut_extract
	mov	x21, x0
	ldur	w0, [x25, #-8]
	mov	w1, #16
	bl	_drm_color_lut_extract
	mov	x22, x0
	ldr	w1, [x26]
	mov	x0, x20
	bl	_dc_fixpt_from_fraction
	ldr	x8, [x19, #16]
	lsl	x20, x24, #3
	str	x0, [x8, x20]
	ldr	w1, [x26]
	mov	x0, x21
	bl	_dc_fixpt_from_fraction
	ldr	x8, [x19, #8]
	str	x0, [x8, x20]
	ldr	w1, [x26]
	mov	x0, x22
	bl	_dc_fixpt_from_fraction
	ldr	x8, [x19]
	str	x0, [x8, x20]
	add	x24, x24, #1
	ldrsw	x8, [x23]
	add	x25, x25, #12
	cmp	x24, x8
	b.lt	LBB0_6
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_COLOR_LEGACY_LUT_ENTRIES,4,2 ; @MAX_COLOR_LEGACY_LUT_ENTRIES
	.comm	_MAX_COLOR_LUT_ENTRIES,4,2      ; @MAX_COLOR_LUT_ENTRIES
	.comm	_MAX_DRM_LUT_VALUE,4,2          ; @MAX_DRM_LUT_VALUE
	.no_dead_strip	___drm_lut_to_dc_gamma
.subsections_via_symbols
