	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_calculate_user_regamma_ramp    ## -- Begin function calculate_user_regamma_ramp
	.p2align	4, 0x90
_calculate_user_regamma_ramp:           ## @calculate_user_regamma_ramp
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.1:
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	_TF_TYPE_DISTRIBUTED_POINTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdi)
	movq	_GAMMA_RGB_256_ENTRIES@GOTPCREL(%rip), %rax
	movq	__EXTRA_POINTS@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	(%rax), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	_MAX_HW_POINTS@GOTPCREL(%rip), %rax
	movq	(%r12), %rdi
	addq	(%rax), %rdi
	movl	(%r14), %edx
	movl	$4, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	leaq	8(%r15), %rbx
	movl	$3, %edi
	movl	$2, %esi
	callq	_dc_fixpt_from_fraction
	movq	%rax, -56(%rbp)
	movl	$2, %edi
	callq	_dc_fixpt_from_int
	movl	%eax, -64(%rbp)
	movl	$5, %edi
	movl	$2, %esi
	callq	_dc_fixpt_from_fraction
	movq	%rax, -72(%rbp)
	leaq	4(%r13), %rsi
	movq	-56(%rbp), %rax
	movq	%rax, 16(%rsp)
	movups	-72(%rbp), %xmm0
	movups	%xmm0, (%rsp)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_scale_user_regamma_ramp
	movl	(%r13), %edx
	cmpl	$1, %edx
	jne	LBB0_6
## %bb.5:
	movq	_MAX_HW_POINTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_apply_degamma_for_user_regamma
	movq	_coordinates_x@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MAX_HW_POINTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdx
	callq	_copy_rgb_regamma_to_coordinates_x
	movl	(%r13), %edx
LBB0_6:
	movq	_MAX_HW_POINTS@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rcx
	callq	_interpolate_user_regamma
	movq	$0, 24(%r15)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 8(%r15)
	movl	$1, 16(%r15)
	movq	(%r13), %rdi
	movq	%rbx, %rsi
	callq	_build_new_custom_resulted_curve
	movq	%r12, %rdi
	callq	_kfree
	movl	$1, %ebx
	jmp	LBB0_7
LBB0_3:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_7:
	movq	%r14, %rdi
	callq	_kvfree
LBB0_8:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TF_TYPE_DISTRIBUTED_POINTS,4,2 ## @TF_TYPE_DISTRIBUTED_POINTS
	.comm	_GAMMA_RGB_256_ENTRIES,8,3      ## @GAMMA_RGB_256_ENTRIES
	.comm	__EXTRA_POINTS,8,3              ## @_EXTRA_POINTS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_MAX_HW_POINTS,8,3              ## @MAX_HW_POINTS
	.comm	_coordinates_x,4,2              ## @coordinates_x
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_calculate_user_regamma_ramp    ; -- Begin function calculate_user_regamma_ramp
	.p2align	2
_calculate_user_regamma_ramp:           ; @calculate_user_regamma_ramp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x1
	cbz	x1, LBB0_9
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _TF_TYPE_DISTRIBUTED_POINTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TF_TYPE_DISTRIBUTED_POINTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0]
Lloh3:
	adrp	x8, _GAMMA_RGB_256_ENTRIES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GAMMA_RGB_256_ENTRIES@GOTPAGEOFF]
Lloh5:
	adrp	x22, __EXTRA_POINTS@GOTPAGE
Lloh6:
	ldr	x22, [x22, __EXTRA_POINTS@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	x9, [x22]
	add	x0, x9, x8
Lloh8:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	w1, #4
	bl	_kcalloc
	cbz	x0, LBB0_6
; %bb.2:
	mov	x19, x0
Lloh10:
	adrp	x26, _MAX_HW_POINTS@GOTPAGE
Lloh11:
	ldr	x26, [x26, _MAX_HW_POINTS@GOTPAGEOFF]
	ldr	x8, [x26]
	ldr	x9, [x22]
	add	x0, x9, x8
	ldr	w2, [x23]
	mov	w1, #4
	bl	_kcalloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x22, x0
	add	x23, x20, #8
	mov	w0, #3
	mov	w1, #2
	bl	_dc_fixpt_from_fraction
	mov	x24, x0
	mov	w0, #2
	bl	_dc_fixpt_from_int
	mov	x25, x0
	mov	w0, #5
	mov	w1, #2
	bl	_dc_fixpt_from_fraction
	str	x0, [sp, #8]
	add	x1, x21, #4
	str	w25, [sp, #16]
	str	x24, [sp, #24]
	add	x2, sp, #8
	mov	x0, x19
	bl	_scale_user_regamma_ramp
	ldr	w2, [x21]
	cmp	w2, #1
	b.ne	LBB0_5
; %bb.4:
	ldr	x1, [x26]
	mov	x0, x22
	bl	_apply_degamma_for_user_regamma
Lloh12:
	adrp	x8, _coordinates_x@GOTPAGE
Lloh13:
	ldr	x8, [x8, _coordinates_x@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	x1, [x26]
	mov	x2, x22
	bl	_copy_rgb_regamma_to_coordinates_x
	ldr	w2, [x21]
LBB0_5:
	ldr	x0, [x26]
	mov	x1, x19
	mov	x3, x23
	bl	_interpolate_user_regamma
	str	xzr, [x20, #24]
	movi.2s	v0, #1
	str	d0, [x20, #8]
	mov	w21, #1
	str	w21, [x20, #16]
	ldr	x0, [x26]
	mov	x1, x23
	bl	_build_new_custom_resulted_curve
	mov	x0, x22
	bl	_kfree
	b	LBB0_8
LBB0_6:
	mov	w21, #0
	b	LBB0_9
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x19
	bl	_kvfree
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_TF_TYPE_DISTRIBUTED_POINTS,4,2 ; @TF_TYPE_DISTRIBUTED_POINTS
	.comm	_GAMMA_RGB_256_ENTRIES,8,3      ; @GAMMA_RGB_256_ENTRIES
	.comm	__EXTRA_POINTS,8,3              ; @_EXTRA_POINTS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_MAX_HW_POINTS,8,3              ; @MAX_HW_POINTS
	.comm	_coordinates_x,4,2              ; @coordinates_x
.subsections_via_symbols
