	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adjust_colour_depth_from_display_info
_adjust_colour_depth_from_display_info: ## @adjust_colour_depth_from_display_info
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rcx
	movq	_COLOR_DEPTH_888@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rcx
	jle	LBB0_13
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_PIXEL_ENCODING_YCBCR420@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rax
	movl	$20, %esi
	cmpq	(%r12), %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$10, %esi
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%rbx), %eax
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	cmpq	$128, %rcx
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$129, %rcx
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$130, %rcx
	jne	LBB0_13
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ecx
	shll	$5, %ecx
	subl	%eax, %ecx
	subl	%eax, %ecx
	movslq	%ecx, %rax
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	%eax, %eax
	cmpl	(%r14), %eax
	jg	LBB0_12
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	shll	$2, %eax
	leal	(%rax,%rax,8), %eax
	cltq
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	imulq	$715827883, %rax, %rax          ## imm = 0x2AAAAAAB
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	cmpl	(%r14), %eax
	jle	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_reduce_mode_colour_depth
	movq	(%rbx), %rcx
	cmpq	(%r15), %rcx
	jg	LBB0_2
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COLOR_DEPTH_888,8,3            ## @COLOR_DEPTH_888
	.comm	_PIXEL_ENCODING_YCBCR420,8,3    ## @PIXEL_ENCODING_YCBCR420
	.no_dead_strip	_adjust_colour_depth_from_display_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adjust_colour_depth_from_display_info
_adjust_colour_depth_from_display_info: ; @adjust_colour_depth_from_display_info
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x0]
Lloh0:
	adrp	x21, _COLOR_DEPTH_888@GOTPAGE
Lloh1:
	ldr	x21, [x21, _COLOR_DEPTH_888@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.le	LBB0_11
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh2:
	adrp	x22, _PIXEL_ENCODING_YCBCR420@GOTPAGE
Lloh3:
	ldr	x22, [x22, _PIXEL_ENCODING_YCBCR420@GOTPAGEOFF]
	mov	w23, #10
	mov	w24, #20
	mov	w25, #43691
	movk	w25, #10922, lsl #16
	mov	w26, #30
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x20, #8]
	ldr	x10, [x20, #16]
	ldr	x11, [x22]
	cmp	x10, x11
	csel	w10, w24, w23, eq
	sdiv	w9, w9, w10
	cmp	x8, #128
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	x8, #129
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	x8, #130
	b.ne	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mul	w8, w9, w26
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	lsl	w8, w9, #1
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	w8, w9, w9, lsl #3
	lsl	w8, w8, #2
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	smull	x8, w8, w25
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x19]
	cmp	w8, w9
	b.le	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_reduce_mode_colour_depth
	ldr	x8, [x20]
	ldr	x9, [x21]
	cmp	x8, x9
	b.gt	LBB0_2
LBB0_11:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_COLOR_DEPTH_888,8,3            ; @COLOR_DEPTH_888
	.comm	_PIXEL_ENCODING_YCBCR420,8,3    ; @PIXEL_ENCODING_YCBCR420
	.no_dead_strip	_adjust_colour_depth_from_display_info
.subsections_via_symbols
