	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function TruncToValidBPP
LCPI0_0:
	.quad	0x4020000000000000              ## double 8
LCPI0_1:
	.quad	0x4030000000000000              ## double 16
LCPI0_2:
	.quad	0x401c000000000000              ## double 7
LCPI0_3:
	.quad	0x4018000000000000              ## double 6
LCPI0_4:
	.quad	0x3ff8000000000000              ## double 1.5
LCPI0_5:
	.quad	0x4042000000000000              ## double 36
LCPI0_6:
	.quad	0x403e000000000000              ## double 30
LCPI0_7:
	.quad	0x4038000000000000              ## double 24
LCPI0_8:
	.quad	0x4032000000000000              ## double 18
LCPI0_9:
	.quad	0x4034000000000000              ## double 20
LCPI0_10:
	.quad	0x402e000000000000              ## double 15
LCPI0_11:
	.quad	0x4028000000000000              ## double 12
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_TruncToValidBPP:                       ## @TruncToValidBPP
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	%ecx, %eax
	movq	_dm_hdmi@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	jne	LBB0_8
## %bb.1:
	movq	_dm_420@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	je	LBB0_14
## %bb.2:
	movq	_dm_444@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	je	LBB0_22
## %bb.3:
	divsd	LCPI0_4(%rip), %xmm0
LBB0_4:
	movl	$24, %eax
	ucomisd	LCPI0_7(%rip), %xmm0
	jae	LBB0_7
## %bb.5:
	movl	$20, %eax
	ucomisd	LCPI0_9(%rip), %xmm0
	jae	LBB0_7
## %bb.6:
	movl	$16, %eax
	ucomisd	LCPI0_1(%rip), %xmm0
	jb	LBB0_27
LBB0_7:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_8:
	movq	_dm_420@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%edi, %edi
	je	LBB0_13
## %bb.9:
	cmpl	%edx, %ecx
	jne	LBB0_17
## %bb.10:
	movsd	LCPI0_3(%rip), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	ja	LBB0_27
## %bb.11:
	movl	%eax, %eax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	mulsd	LCPI0_4(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jb	LBB0_30
## %bb.12:
	cvttsd2si	%xmm1, %rax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_13:
	cmpl	%edx, %ecx
	jne	LBB0_20
LBB0_14:
	movl	$18, %eax
	ucomisd	LCPI0_8(%rip), %xmm0
	jae	LBB0_7
## %bb.15:
	movl	$15, %eax
	ucomisd	LCPI0_10(%rip), %xmm0
	jae	LBB0_7
## %bb.16:
	movl	$12, %eax
	ucomisd	LCPI0_11(%rip), %xmm0
	jae	LBB0_7
	jmp	LBB0_27
LBB0_17:
	movq	_dm_n422@GOTPCREL(%rip), %rcx
	cmpl	%edx, (%rcx)
	jne	LBB0_26
## %bb.18:
	movsd	LCPI0_2(%rip), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	ja	LBB0_27
## %bb.19:
	addl	%eax, %eax
	jmp	LBB0_29
LBB0_20:
	movq	_dm_s422@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	je	LBB0_4
## %bb.21:
	movq	_dm_n422@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	je	LBB0_4
LBB0_22:
	movl	$36, %eax
	ucomisd	LCPI0_5(%rip), %xmm0
	jae	LBB0_7
## %bb.23:
	movl	$30, %eax
	ucomisd	LCPI0_6(%rip), %xmm0
	jae	LBB0_7
## %bb.24:
	movl	$24, %eax
	ucomisd	LCPI0_7(%rip), %xmm0
	jae	LBB0_7
## %bb.25:
	movl	$18, %eax
	ucomisd	LCPI0_8(%rip), %xmm0
	jae	LBB0_7
	jmp	LBB0_27
LBB0_26:
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	jbe	LBB0_28
LBB0_27:
	movq	_BPP_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_28:
	leal	(%rax,%rax,2), %eax
LBB0_29:
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	ucomisd	%xmm1, %xmm0
	jae	LBB0_7
LBB0_30:
	mulsd	LCPI0_1(%rip), %xmm0
	cvttsd2si	%xmm0, %edi
	movl	$1, %esi
	callq	_dml_floor
	movl	%eax, %ecx
	leal	15(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$4, %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dm_hdmi,4,2                    ## @dm_hdmi
	.comm	_dm_420,4,2                     ## @dm_420
	.comm	_BPP_INVALID,4,2                ## @BPP_INVALID
	.comm	_dm_444,4,2                     ## @dm_444
	.comm	_dm_n422,4,2                    ## @dm_n422
	.comm	_dm_s422,4,2                    ## @dm_s422
	.no_dead_strip	_TruncToValidBPP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function TruncToValidBPP
_TruncToValidBPP:                       ; @TruncToValidBPP
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _dm_hdmi@GOTPAGE
Lloh1:
	ldr	x8, [x8, _dm_hdmi@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
Lloh3:
	adrp	x8, _dm_420@GOTPAGE
Lloh4:
	ldr	x8, [x8, _dm_420@GOTPAGEOFF]
	cmp	w9, w1
	b.ne	LBB0_4
; %bb.1:
	ldr	w8, [x8]
	cmp	w8, w2
	b.eq	LBB0_10
; %bb.2:
Lloh5:
	adrp	x8, _dm_444@GOTPAGE
Lloh6:
	ldr	x8, [x8, _dm_444@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w2
	b.eq	LBB0_22
; %bb.3:
	fmov	d1, #1.50000000
	fdiv	d0, d0, d1
	b	LBB0_18
LBB0_4:
	ldr	w8, [x8]
	cmp	w8, w2
	cbz	w0, LBB0_9
; %bb.5:
	b.ne	LBB0_14
; %bb.6:
	fmov	d1, #6.00000000
	fcmp	d0, d1
	b.mi	LBB0_31
; %bb.7:
	ucvtf	d1, w3
	fmov	d2, #1.50000000
	fmul	d1, d1, d2
	fcmp	d1, d0
	b.hi	LBB0_37
; %bb.8:
	fcvtzu	w0, d1
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_9:
	b.ne	LBB0_17
LBB0_10:
	fmov	d1, #18.00000000
	fcmp	d0, d1
	b.ge	LBB0_26
; %bb.11:
	fmov	d1, #15.00000000
	fcmp	d0, d1
	b.ge	LBB0_28
; %bb.12:
	fmov	d1, #12.00000000
	fcmp	d0, d1
	b.lt	LBB0_31
; %bb.13:
	mov	w0, #12
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh8:
	adrp	x8, _dm_n422@GOTPAGE
Lloh9:
	ldr	x8, [x8, _dm_n422@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w2
	b.ne	LBB0_30
; %bb.15:
	fmov	d1, #7.00000000
	fcmp	d0, d1
	b.mi	LBB0_31
; %bb.16:
	lsl	w0, w3, #1
	b	LBB0_36
LBB0_17:
Lloh11:
	adrp	x8, _dm_s422@GOTPAGE
Lloh12:
	ldr	x8, [x8, _dm_s422@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _dm_n422@GOTPAGE
Lloh15:
	ldr	x9, [x9, _dm_n422@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w2
	ccmp	w9, w2, #4, ne
	b.ne	LBB0_22
LBB0_18:
	fmov	d1, #24.00000000
	fcmp	d0, d1
	b.ge	LBB0_27
; %bb.19:
	fmov	d1, #20.00000000
	fcmp	d0, d1
	b.ge	LBB0_33
; %bb.20:
	fmov	d1, #16.00000000
	fcmp	d0, d1
	b.lt	LBB0_31
; %bb.21:
	mov	w0, #16
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_22:
	mov	x8, #4630263366890291200
	fmov	d1, x8
	fcmp	d0, d1
	b.ge	LBB0_29
; %bb.23:
	fmov	d1, #30.00000000
	fcmp	d0, d1
	b.ge	LBB0_34
; %bb.24:
	fmov	d1, #24.00000000
	fcmp	d0, d1
	b.ge	LBB0_27
; %bb.25:
	fmov	d1, #18.00000000
	fcmp	d0, d1
	b.lt	LBB0_31
LBB0_26:
	mov	w0, #18
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_27:
	mov	w0, #24
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_28:
	mov	w0, #15
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_29:
	mov	w0, #36
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_30:
	fmov	d1, #8.00000000
	fcmp	d0, d1
	b.pl	LBB0_35
LBB0_31:
Lloh17:
	adrp	x8, _BPP_INVALID@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BPP_INVALID@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
LBB0_32:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_33:
	mov	w0, #20
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_34:
	mov	w0, #30
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_35:
	add	w0, w3, w3, lsl #1
LBB0_36:
	ucvtf	d1, w0
	fcmp	d1, d0
	b.ls	LBB0_32
LBB0_37:
	fcvtzs	w0, d0, #4
	mov	w1, #1
	bl	_dml_floor
	add	w8, w0, #15
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w0, w8, #4
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_dm_hdmi,4,2                    ; @dm_hdmi
	.comm	_dm_420,4,2                     ; @dm_420
	.comm	_BPP_INVALID,4,2                ; @BPP_INVALID
	.comm	_dm_444,4,2                     ; @dm_444
	.comm	_dm_n422,4,2                    ; @dm_n422
	.comm	_dm_s422,4,2                    ; @dm_s422
	.no_dead_strip	_TruncToValidBPP
.subsections_via_symbols
