	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpp20_program_3dlut            ## -- Begin function dpp20_program_3dlut
	.p2align	4, 0x90
_dpp20_program_3dlut:                   ## @dpp20_program_3dlut
	.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	%rdi, %r13
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_get3dlut_config
	movq	_LUT_BYPASS@GOTPCREL(%rip), %rcx
	movq	_LUT_RAM_B@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r14d
	cmpl	%r14d, %eax
	movq	_LUT_RAM_A@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmovel	%edx, %r14d
	cmpl	(%rcx), %eax
	cmovel	%edx, %r14d
	xorl	%eax, %eax
	cmpl	$0, 72(%rbx)
	sete	%al
	movl	%eax, -48(%rbp)
	movl	(%rbx), %edx
	movl	%edx, -44(%rbp)
	je	LBB0_3
## %bb.4:
	leaq	32(%rbx), %rax
	leaq	8(%rbx), %rsi
	leaq	24(%rbx), %rcx
	addq	$16, %rbx
	jmp	LBB0_5
LBB0_1:
	movq	_LUT_BYPASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_dpp20_set_3dlut_mode
	jmp	LBB0_18
LBB0_3:
	leaq	64(%rbx), %rax
	leaq	40(%rbx), %rsi
	leaq	56(%rbx), %rcx
	addq	$48, %rbx
LBB0_5:
	movq	(%rsi), %rsi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %r12
	movq	(%rcx), %rbx
	movq	(%rax), %r15
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_dpp20_select_3dlut_ram
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_dpp20_select_3dlut_ram_mask
	cmpl	$0, -44(%rbp)
	je	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram12
	jmp	LBB0_8
LBB0_7:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram10
LBB0_8:
	movq	%r13, %rdi
	movl	$2, %esi
	callq	_dpp20_select_3dlut_ram_mask
	cmpl	$0, -44(%rbp)
	je	LBB0_10
## %bb.9:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram12
	jmp	LBB0_11
LBB0_10:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram10
LBB0_11:
	movq	%r13, %rdi
	movl	$4, %esi
	callq	_dpp20_select_3dlut_ram_mask
	cmpl	$0, -44(%rbp)
	je	LBB0_13
## %bb.12:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram12
	jmp	LBB0_14
LBB0_13:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram10
LBB0_14:
	movq	%r13, %rdi
	movl	$8, %esi
	callq	_dpp20_select_3dlut_ram_mask
	cmpl	$0, -44(%rbp)
	je	LBB0_16
## %bb.15:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram12
	jmp	LBB0_17
LBB0_16:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$2, %edx
	callq	_dpp20_set3dlut_ram10
LBB0_17:
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %ecx
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_dpp20_set_3dlut_mode
	movl	$1, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LUT_BYPASS,4,2                 ## @LUT_BYPASS
	.comm	_LUT_RAM_B,4,2                  ## @LUT_RAM_B
	.comm	_LUT_RAM_A,4,2                  ## @LUT_RAM_A
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpp20_program_3dlut            ; -- Begin function dpp20_program_3dlut
	.p2align	2
_dpp20_program_3dlut:                   ; @dpp20_program_3dlut
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	cbz	x1, LBB0_3
; %bb.1:
	mov	x21, x1
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x19
	bl	_get3dlut_config
Lloh0:
	adrp	x8, _LUT_BYPASS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LUT_BYPASS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _LUT_RAM_B@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LUT_RAM_B@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w0, w9
	ccmp	w0, w8, #4, ne
Lloh6:
	adrp	x8, _LUT_RAM_A@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LUT_RAM_A@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	csel	w20, w8, w9, eq
	ldr	w8, [x21, #72]
	cmp	w8, #0
	cset	w9, eq
	ldr	w2, [x21]
	stp	w2, w9, [sp, #8]
	add	x9, x21, #32
	add	x10, x21, #8
	add	x11, x21, #24
	add	x12, x21, #16
	add	x13, x21, #64
	add	x14, x21, #40
	add	x15, x21, #56
	add	x16, x21, #48
	cmp	w8, #0
	csel	x8, x9, x13, ne
	csel	x9, x11, x15, ne
	csel	x11, x12, x16, ne
	csel	x10, x10, x14, ne
	ldr	x21, [x10]
	ldr	x22, [x11]
	ldr	x23, [x9]
	ldr	x24, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_dpp20_select_3dlut_ram
	mov	x0, x19
	mov	w1, #1
	bl	_dpp20_select_3dlut_ram_mask
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_4
; %bb.2:
	mov	x0, x19
	mov	x1, x24
	mov	w2, #2
	bl	_dpp20_set3dlut_ram12
	b	LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _LUT_BYPASS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LUT_BYPASS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_dpp20_set_3dlut_mode
	mov	w0, #0
	b	LBB0_15
LBB0_4:
	mov	x0, x19
	mov	x1, x24
	mov	w2, #2
	bl	_dpp20_set3dlut_ram10
LBB0_5:
	mov	x0, x19
	mov	w1, #2
	bl	_dpp20_select_3dlut_ram_mask
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	x1, x23
	mov	w2, #2
	bl	_dpp20_set3dlut_ram12
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	x1, x23
	mov	w2, #2
	bl	_dpp20_set3dlut_ram10
LBB0_8:
	mov	x0, x19
	mov	w1, #4
	bl	_dpp20_select_3dlut_ram_mask
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_10
; %bb.9:
	mov	x0, x19
	mov	x1, x22
	mov	w2, #2
	bl	_dpp20_set3dlut_ram12
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	mov	x1, x22
	mov	w2, #2
	bl	_dpp20_set3dlut_ram10
LBB0_11:
	mov	x0, x19
	mov	w1, #8
	bl	_dpp20_select_3dlut_ram_mask
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_13
; %bb.12:
	mov	x0, x19
	mov	x1, x21
	mov	w2, #2
	bl	_dpp20_set3dlut_ram12
	b	LBB0_14
LBB0_13:
	mov	x0, x19
	mov	x1, x21
	mov	w2, #2
	bl	_dpp20_set3dlut_ram10
LBB0_14:
	ldp	w2, w3, [sp, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_dpp20_set_3dlut_mode
	mov	w0, #1
LBB0_15:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_LUT_BYPASS,4,2                 ; @LUT_BYPASS
	.comm	_LUT_RAM_B,4,2                  ; @LUT_RAM_B
	.comm	_LUT_RAM_A,4,2                  ; @LUT_RAM_A
.subsections_via_symbols
