	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_hlcdc_plane_update_clut
_atmel_hlcdc_plane_update_clut:         ## @atmel_hlcdc_plane_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	cmpl	$0, 8(%rax)
	je	LBB0_7
## %bb.3:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	_ATMEL_HLCDC_CLUT_SIZE@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_7
## %bb.5:
	movq	%rdi, %r14
	movq	(%rax), %rbx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	8(%rbx), %edx
	shll	$8, %eax
	andl	$16711680, %eax                 ## imm = 0xFF0000
	movzbl	5(%rbx), %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	sarl	$8, %edx
	orl	%ecx, %edx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_atmel_hlcdc_layer_write_clut
	incl	%r12d
	addq	$12, %rbx
	cmpl	(%r15), %r12d
	jl	LBB0_6
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATMEL_HLCDC_CLUT_SIZE,4,2      ## @ATMEL_HLCDC_CLUT_SIZE
	.no_dead_strip	_atmel_hlcdc_plane_update_clut
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_hlcdc_plane_update_clut
_atmel_hlcdc_plane_update_clut:         ; @atmel_hlcdc_plane_update_clut
	.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
	ldr	x8, [x1]
	cbz	x8, LBB0_6
; %bb.1:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	w9, [x8, #8]
	cbz	w9, LBB0_6
; %bb.3:
	ldr	x8, [x8]
Lloh0:
	adrp	x21, _ATMEL_HLCDC_CLUT_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ATMEL_HLCDC_CLUT_SIZE@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	x8, #0
	ccmp	w9, #1, #8, ne
	b.lt	LBB0_6
; %bb.4:
	mov	x19, x0
	mov	w20, #0
	ldr	x22, [x8]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	lsl	w8, w8, #8
	and	w8, w8, #0xff0000
	ldrb	w9, [x22, #5]
	bfi	w8, w9, #8, #8
	ldr	w9, [x22, #8]
	orr	w2, w8, w9, asr #8
	mov	x0, x19
	mov	x1, x20
	bl	_atmel_hlcdc_layer_write_clut
	add	w20, w20, #1
	ldr	w8, [x21]
	add	x22, x22, #12
	cmp	w20, w8
	b.lt	LBB0_5
LBB0_6:
	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	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ATMEL_HLCDC_CLUT_SIZE,4,2      ; @ATMEL_HLCDC_CLUT_SIZE
	.no_dead_strip	_atmel_hlcdc_plane_update_clut
.subsections_via_symbols
