	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function legacy_crtc_load_lut
_legacy_crtc_load_lut:                  ## @legacy_crtc_load_lut
	.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	%rdi, %r15
	callq	_to_radeon_crtc
	movq	%rax, %r14
	movq	_RADEON_DAC_CNTL2@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_RREG32
	movq	_RADEON_DAC2_PALETTE_ACC_CTL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%esi, %ecx
	notl	%ecx
	andl	%eax, %ecx
	orl	%eax, %esi
	cmpq	$0, (%r14)
	cmovel	%ecx, %esi
	movl	(%rbx), %edi
	callq	_WREG32
	movq	_RADEON_PALETTE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_WREG8
	movq	8(%r15), %r14
	movslq	(%r15), %rax
	leaq	(%r14,%rax,4), %r15
	leaq	(%r15,%rax,4), %r12
	movq	_RADEON_PALETTE_30_DATA@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movl	(%r14,%rbx,4), %eax
	shll	$14, %eax
	andl	$1072693248, %eax               ## imm = 0x3FF00000
	movl	(%r15,%rbx,4), %ecx
	shll	$4, %ecx
	andl	$1047552, %ecx                  ## imm = 0xFFC00
	orl	%eax, %ecx
	movl	(%r12,%rbx,4), %esi
	sarl	$6, %esi
	orl	%ecx, %esi
	callq	_WREG32
	incq	%rbx
	cmpl	$256, %ebx                      ## imm = 0x100
	jne	LBB0_1
## %bb.2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_DAC_CNTL2,4,2           ## @RADEON_DAC_CNTL2
	.comm	_RADEON_DAC2_PALETTE_ACC_CTL,4,2 ## @RADEON_DAC2_PALETTE_ACC_CTL
	.comm	_RADEON_PALETTE_INDEX,4,2       ## @RADEON_PALETTE_INDEX
	.comm	_RADEON_PALETTE_30_DATA,4,2     ## @RADEON_PALETTE_30_DATA
	.no_dead_strip	_legacy_crtc_load_lut
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function legacy_crtc_load_lut
_legacy_crtc_load_lut:                  ; @legacy_crtc_load_lut
	.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, x0
	bl	_to_radeon_crtc
	mov	x20, x0
Lloh0:
	adrp	x21, _RADEON_DAC_CNTL2@GOTPAGE
Lloh1:
	ldr	x21, [x21, _RADEON_DAC_CNTL2@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_RREG32
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _RADEON_DAC2_PALETTE_ACC_CTL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _RADEON_DAC2_PALETTE_ACC_CTL@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	bic	w10, w0, w9
	orr	w9, w9, w0
	cmp	x8, #0
	csel	w1, w10, w9, eq
	ldr	w0, [x21]
	bl	_WREG32
Lloh5:
	adrp	x8, _RADEON_PALETTE_INDEX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RADEON_PALETTE_INDEX@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG8
	mov	x20, #0
	ldr	x21, [x19, #8]
	ldrsw	x8, [x19]
	lsl	x8, x8, #2
	add	x19, x21, x8
	add	x22, x19, x8
Lloh8:
	adrp	x23, _RADEON_PALETTE_30_DATA@GOTPAGE
Lloh9:
	ldr	x23, [x23, _RADEON_PALETTE_30_DATA@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	ldr	w8, [x21, x20]
	lsl	w8, w8, #14
	ldr	w9, [x19, x20]
	and	w8, w8, #0x3ff00000
	lsr	w9, w9, #6
	bfi	w8, w9, #10, #10
	ldr	w9, [x22, x20]
	orr	w1, w8, w9, asr #6
	bl	_WREG32
	add	x20, x20, #4
	cmp	w20, #1024
	b.ne	LBB0_1
; %bb.2:
	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
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_DAC_CNTL2,4,2           ; @RADEON_DAC_CNTL2
	.comm	_RADEON_DAC2_PALETTE_ACC_CTL,4,2 ; @RADEON_DAC2_PALETTE_ACC_CTL
	.comm	_RADEON_PALETTE_INDEX,4,2       ; @RADEON_PALETTE_INDEX
	.comm	_RADEON_PALETTE_30_DATA,4,2     ; @RADEON_PALETTE_30_DATA
	.no_dead_strip	_legacy_crtc_load_lut
.subsections_via_symbols
