	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpc2_set_output_gamma          ## -- Begin function mpc2_set_output_gamma
	.p2align	4, 0x90
_mpc2_set_output_gamma:                 ## @mpc2_set_output_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_TO_DCN20_MPC
	movq	(%rbx), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
LBB0_1:
	movq	_MPCC_OGAM_MODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movslq	%r14d, %rax
	movl	(%rdx,%rax,4), %edi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	jmp	LBB0_2
LBB0_3:
	testq	%r15, %r15
	je	LBB0_1
## %bb.4:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mpc20_get_ogam_current
	movl	%eax, %r13d
	movq	_LUT_BYPASS@GOTPCREL(%rip), %rax
	movq	_LUT_RAM_A@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	cmpl	%r12d, %r13d
	movq	_LUT_RAM_B@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmovel	%ecx, %r12d
	cmpl	(%rax), %r13d
	cmovel	%ecx, %r12d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_mpc20_power_on_ogam_lut
	xorl	%edx, %edx
	movq	_LUT_RAM_A@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	sete	%dl
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mpc20_configure_ogam_lut
	movq	_LUT_RAM_A@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	callq	_mpc2_program_luta
	jmp	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	callq	_mpc2_program_lutb
LBB0_7:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_apply_DEDCN20_305_wa
	movl	(%r15), %ecx
	movl	4(%r15), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mpc20_program_ogam_pwl
	movq	_MPCC_OGAM_MODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movslq	%r14d, %rax
	movl	(%rdx,%rax,4), %edi
	xorl	%eax, %eax
	movq	_LUT_RAM_A@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	sete	%al
	movl	$2, %ecx
	subl	%eax, %ecx
	xorl	%esi, %esi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_SET                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MPCC_OGAM_MODE,8,3             ## @MPCC_OGAM_MODE
	.comm	_LUT_BYPASS,4,2                 ## @LUT_BYPASS
	.comm	_LUT_RAM_A,4,2                  ## @LUT_RAM_A
	.comm	_LUT_RAM_B,4,2                  ## @LUT_RAM_B
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpc2_set_output_gamma          ; -- Begin function mpc2_set_output_gamma
	.p2align	2
_mpc2_set_output_gamma:                 ; @mpc2_set_output_gamma
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_TO_DCN20_MPC
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _MPCC_OGAM_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MPCC_OGAM_MODE@GOTPAGEOFF]
Lloh2:
	ldr	x2, [x8]
	ldr	w0, [x2, w19, sxtw #2]
	mov	w1, #0
	mov	w3, #0
	b	LBB0_7
LBB0_2:
	cbz	x21, LBB0_1
; %bb.3:
	mov	x0, x20
	mov	x1, x19
	bl	_mpc20_get_ogam_current
	mov	x23, x0
Lloh3:
	adrp	x8, _LUT_BYPASS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LUT_BYPASS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x24, _LUT_RAM_A@GOTPAGE
Lloh7:
	ldr	x24, [x24, _LUT_RAM_A@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	w0, w9
	ccmp	w0, w8, #4, ne
Lloh8:
	adrp	x8, _LUT_RAM_B@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LUT_RAM_B@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	csel	w22, w8, w9, eq
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_mpc20_power_on_ogam_lut
	ldr	w8, [x24]
	cmp	w22, w8
	cset	w2, eq
	mov	x0, x20
	mov	x1, x19
	bl	_mpc20_configure_ogam_lut
	ldr	w8, [x24]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	cmp	w22, w8
	b.ne	LBB0_5
; %bb.4:
	bl	_mpc2_program_luta
	b	LBB0_6
LBB0_5:
	bl	_mpc2_program_lutb
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	mov	x3, x22
	bl	_apply_DEDCN20_305_wa
	ldp	w3, w2, [x21]
	mov	x0, x20
	mov	x1, x19
	bl	_mpc20_program_ogam_pwl
Lloh11:
	adrp	x8, _MPCC_OGAM_MODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MPCC_OGAM_MODE@GOTPAGEOFF]
Lloh13:
	ldr	x2, [x8]
	ldr	w0, [x2, w19, sxtw #2]
	ldr	w8, [x24]
	cmp	w22, w8
	mov	w8, #1
	cinc	w3, w8, ne
	mov	w1, #0
LBB0_7:
	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	_REG_SET
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MPCC_OGAM_MODE,8,3             ; @MPCC_OGAM_MODE
	.comm	_LUT_BYPASS,4,2                 ; @LUT_BYPASS
	.comm	_LUT_RAM_A,4,2                  ; @LUT_RAM_A
	.comm	_LUT_RAM_B,4,2                  ; @LUT_RAM_B
.subsections_via_symbols
