	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	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	_RADEON_PALETTE_30_DATA@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movq	8(%r14), %rax
	movq	16(%r14), %rcx
	movl	(%rax,%rbx,4), %eax
	shll	$20, %eax
	movl	(%rcx,%rbx,4), %esi
	shll	$10, %esi
	orl	%eax, %esi
	movq	24(%r14), %rax
	orl	(%rax,%rbx,4), %esi
	callq	_WREG32
	incq	%rbx
	cmpq	$256, %rbx                      ## imm = 0x100
	jne	LBB0_1
## %bb.2:
	addq	$8, %rsp
	popq	%rbx
	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	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_to_radeon_crtc
	mov	x19, x0
Lloh0:
	adrp	x20, _RADEON_DAC_CNTL2@GOTPAGE
Lloh1:
	ldr	x20, [x20, _RADEON_DAC_CNTL2@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_RREG32
	ldr	x8, [x19]
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, [x20]
	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
Lloh8:
	adrp	x21, _RADEON_PALETTE_30_DATA@GOTPAGE
Lloh9:
	ldr	x21, [x21, _RADEON_PALETTE_30_DATA@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	ldp	x8, x9, [x19, #8]
	ldr	w8, [x8, x20]
	ldr	w9, [x9, x20]
	lsl	w9, w9, #10
	orr	w8, w9, w8, lsl #20
	ldr	x9, [x19, #24]
	ldr	w9, [x9, x20]
	orr	w1, w8, w9
	bl	_WREG32
	add	x20, x20, #4
	cmp	x20, #1024
	b.ne	LBB0_1
; %bb.2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 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
