	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function program_bit_depth_reduction
_program_bit_depth_reduction:           ## @program_bit_depth_reduction
	.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	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_COLOR_DEPTH_121212@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%esi, (%rax)
	seta	%dil
	callq	_ASSERT
	movq	_DCP_OUT_TRUNC_ROUND_DEPTH_12BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_DCP_OUT_TRUNC_ROUND_MODE_TRUNCATE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	cmpq	$0, 32(%rbx)
	je	LBB0_1
## %bb.2:
	cmpq	$0, 24(%rbx)
	je	LBB0_4
## %bb.3:
	movq	_DCP_OUT_TRUNC_ROUND_MODE_ROUND@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_4:
	cmpl	$2, 4(%rbx)
	jae	LBB0_5
## %bb.7:
	movq	_DCP_OUT_TRUNC_ROUND_DEPTH_8BIT@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_1:
	movl	(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_10
LBB0_5:
	jne	LBB0_9
## %bb.6:
	movq	_DCP_OUT_TRUNC_ROUND_DEPTH_10BIT@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_10
LBB0_9:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	callq	_BREAK_TO_DEBUGGER
LBB0_10:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_set_clamp
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_set_round
	movq	_DCP_SPATIAL_DITHER_MODE_A_AA_A@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DCP_SPATIAL_DITHER_DEPTH_30BPP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	16(%rbx), %r8d
	movl	8(%rbx), %eax
	movl	12(%rbx), %r9d
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_set_dither
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COLOR_DEPTH_121212,4,2         ## @COLOR_DEPTH_121212
	.comm	_DCP_OUT_TRUNC_ROUND_DEPTH_12BIT,4,2 ## @DCP_OUT_TRUNC_ROUND_DEPTH_12BIT
	.comm	_DCP_OUT_TRUNC_ROUND_MODE_TRUNCATE,4,2 ## @DCP_OUT_TRUNC_ROUND_MODE_TRUNCATE
	.comm	_DCP_OUT_TRUNC_ROUND_MODE_ROUND,4,2 ## @DCP_OUT_TRUNC_ROUND_MODE_ROUND
	.comm	_DCP_OUT_TRUNC_ROUND_DEPTH_8BIT,4,2 ## @DCP_OUT_TRUNC_ROUND_DEPTH_8BIT
	.comm	_DCP_OUT_TRUNC_ROUND_DEPTH_10BIT,4,2 ## @DCP_OUT_TRUNC_ROUND_DEPTH_10BIT
	.comm	_DCP_SPATIAL_DITHER_MODE_A_AA_A,4,2 ## @DCP_SPATIAL_DITHER_MODE_A_AA_A
	.comm	_DCP_SPATIAL_DITHER_DEPTH_30BPP,4,2 ## @DCP_SPATIAL_DITHER_DEPTH_30BPP
	.no_dead_strip	_program_bit_depth_reduction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function program_bit_depth_reduction
_program_bit_depth_reduction:           ; @program_bit_depth_reduction
	.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	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _COLOR_DEPTH_121212@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COLOR_DEPTH_121212@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	cset	w0, hi
	bl	_ASSERT
Lloh3:
	adrp	x8, _DCP_OUT_TRUNC_ROUND_DEPTH_12BIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DCP_OUT_TRUNC_ROUND_DEPTH_12BIT@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
Lloh6:
	adrp	x8, _DCP_OUT_TRUNC_ROUND_MODE_TRUNCATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DCP_OUT_TRUNC_ROUND_MODE_TRUNCATE@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_3
; %bb.1:
Lloh9:
	adrp	x8, _DCP_OUT_TRUNC_ROUND_MODE_ROUND@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DCP_OUT_TRUNC_ROUND_MODE_ROUND@GOTPAGEOFF]
	ldr	x9, [x19, #24]
Lloh11:
	ldr	w8, [x8]
	cmp	x9, #0
	csel	w22, w22, w8, eq
	ldr	w8, [x19, #4]
	cmp	w8, #2
	b.hs	LBB0_4
; %bb.2:
	mov	w24, #0
Lloh12:
	adrp	x8, _DCP_OUT_TRUNC_ROUND_DEPTH_8BIT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DCP_OUT_TRUNC_ROUND_DEPTH_8BIT@GOTPAGEOFF]
Lloh14:
	ldr	w23, [x8]
	b	LBB0_7
LBB0_3:
	ldr	w24, [x19]
	b	LBB0_7
LBB0_4:
	b.ne	LBB0_6
; %bb.5:
	mov	w24, #0
Lloh15:
	adrp	x8, _DCP_OUT_TRUNC_ROUND_DEPTH_10BIT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DCP_OUT_TRUNC_ROUND_DEPTH_10BIT@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
	b	LBB0_7
LBB0_6:
	bl	_BREAK_TO_DEBUGGER
	mov	w24, #0
LBB0_7:
	mov	x0, x20
	mov	x1, x21
	bl	_set_clamp
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_set_round
Lloh18:
	adrp	x8, _DCP_SPATIAL_DITHER_MODE_A_AA_A@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DCP_SPATIAL_DITHER_MODE_A_AA_A@GOTPAGEOFF]
Lloh20:
	adrp	x9, _DCP_SPATIAL_DITHER_DEPTH_30BPP@GOTPAGE
Lloh21:
	ldr	x9, [x9, _DCP_SPATIAL_DITHER_DEPTH_30BPP@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	ldr	w3, [x9]
	ldp	w5, w4, [x19, #12]
	ldr	w6, [x19, #8]
	mov	x0, x20
	mov	x1, x24
	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	_set_dither
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_COLOR_DEPTH_121212,4,2         ; @COLOR_DEPTH_121212
	.comm	_DCP_OUT_TRUNC_ROUND_DEPTH_12BIT,4,2 ; @DCP_OUT_TRUNC_ROUND_DEPTH_12BIT
	.comm	_DCP_OUT_TRUNC_ROUND_MODE_TRUNCATE,4,2 ; @DCP_OUT_TRUNC_ROUND_MODE_TRUNCATE
	.comm	_DCP_OUT_TRUNC_ROUND_MODE_ROUND,4,2 ; @DCP_OUT_TRUNC_ROUND_MODE_ROUND
	.comm	_DCP_OUT_TRUNC_ROUND_DEPTH_8BIT,4,2 ; @DCP_OUT_TRUNC_ROUND_DEPTH_8BIT
	.comm	_DCP_OUT_TRUNC_ROUND_DEPTH_10BIT,4,2 ; @DCP_OUT_TRUNC_ROUND_DEPTH_10BIT
	.comm	_DCP_SPATIAL_DITHER_MODE_A_AA_A,4,2 ; @DCP_SPATIAL_DITHER_MODE_A_AA_A
	.comm	_DCP_SPATIAL_DITHER_DEPTH_30BPP,4,2 ; @DCP_SPATIAL_DITHER_DEPTH_30BPP
	.no_dead_strip	_program_bit_depth_reduction
.subsections_via_symbols
