	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ltdc_crtc_update_clut
_ltdc_crtc_update_clut:                 ## @ltdc_crtc_update_clut
	.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, %r14
	callq	_crtc_to_ltdc
	movq	%rax, %r15
	movq	(%r14), %rax
	cmpl	$0, 8(%rax)
	je	LBB0_5
## %bb.1:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	_CLUT_SIZE@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_5
## %bb.3:
	movq	(%rax), %rbx
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	8(%rbx), %ecx
	shll	$8, %eax
	andl	$16711680, %eax                 ## imm = 0xFF0000
	movzbl	5(%rbx), %edx
	shll	$8, %edx
	sarl	$8, %ecx
	orl	%r12d, %edx
	orl	%eax, %edx
	orl	%ecx, %edx
	movl	(%r15), %edi
	movq	_LTDC_L1CLUTWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_reg_write
	incl	%r14d
	addl	$16777216, %r12d                ## imm = 0x1000000
	addq	$12, %rbx
	cmpl	(%r13), %r14d
	jl	LBB0_4
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CLUT_SIZE,4,2                  ## @CLUT_SIZE
	.comm	_LTDC_L1CLUTWR,4,2              ## @LTDC_L1CLUTWR
	.no_dead_strip	_ltdc_crtc_update_clut
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ltdc_crtc_update_clut
_ltdc_crtc_update_clut:                 ; @ltdc_crtc_update_clut
	.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
	mov	x20, x0
	bl	_crtc_to_ltdc
	ldr	x8, [x20]
	ldr	w9, [x8, #8]
	cbz	w9, LBB0_4
; %bb.1:
	ldr	x8, [x8]
Lloh0:
	adrp	x20, _CLUT_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CLUT_SIZE@GOTPAGEOFF]
	ldr	w9, [x20]
	cmp	x8, #0
	ccmp	w9, #1, #8, ne
	b.lt	LBB0_4
; %bb.2:
	mov	x19, x0
	mov	w21, #0
	mov	w22, #0
	ldr	x23, [x8]
Lloh2:
	adrp	x24, _LTDC_L1CLUTWR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _LTDC_L1CLUTWR@GOTPAGEOFF]
	mov	w25, #16777216
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	lsl	w8, w8, #8
	and	w8, w8, #0xff0000
	ldrb	w9, [x23, #5]
	ldr	w10, [x23, #8]
	orr	w9, w21, w9, lsl #8
	orr	w8, w9, w8
	orr	w2, w8, w10, asr #8
	ldr	w0, [x19]
	ldr	w1, [x24]
	bl	_reg_write
	add	w22, w22, #1
	ldr	w8, [x20]
	add	w21, w21, w25
	add	x23, x23, #12
	cmp	w22, w8
	b.lt	LBB0_3
LBB0_4:
	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	_CLUT_SIZE,4,2                  ; @CLUT_SIZE
	.comm	_LTDC_L1CLUTWR,4,2              ; @LTDC_L1CLUTWR
	.no_dead_strip	_ltdc_crtc_update_clut
.subsections_via_symbols
