	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function gma_crtc_load_lut
LCPI0_0:
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.byte	255                             ## 0xff
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_gma_crtc_load_lut
	.p2align	4, 0x90
_gma_crtc_load_lut:                     ## @gma_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	24(%rdi), %rbx
	movq	(%rbx), %r13
	callq	_to_gma_crtc
	cmpl	$0, 16(%r15)
	je	LBB0_13
## %bb.1:
	movq	8(%r13), %rdx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rcx
	movl	(%rdx,%rcx,4), %r12d
	movq	%rbx, %rdi
	movq	8(%r15), %rbx
	movslq	(%r15), %r14
	leaq	(%rbx,%r14,4), %r15
	leaq	(%r15,%r14,4), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	callq	_gma_power_begin
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	xorl	%r13d, %r13d
	movq	%r15, %r14
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r13), %eax
	shrl	$8, %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rcx
	movl	(%rcx,%r13), %ecx
	addl	%ecx, %eax
	shll	$16, %eax
	movl	(%r15,%r13), %esi
	sarl	$8, %esi
	addl	%ecx, %esi
	shll	$8, %ecx
	addl	(%r14,%r13), %ecx
	andl	$-256, %ecx
	orl	%eax, %esi
	orl	%ecx, %esi
	leal	(%r12,%r13), %edi
	callq	_REG_WRITE
	addq	$4, %r13
	cmpq	$1024, %r13                     ## imm = 0x400
	jne	LBB0_3
## %bb.4:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gma_power_end                  ## TAILCALL
LBB0_5:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r8
	movq	(%r13), %rcx
	movq	(%rcx), %rcx
	leaq	(%rbx,%r14,8), %rdx
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	cmpq	$16, %rsi
	jb	LBB0_11
## %bb.6:
	movq	%rcx, %rdx
	subq	%r15, %rdx
	cmpq	$16, %rdx
	jb	LBB0_11
## %bb.7:
	movq	%rcx, %rdx
	subq	%rbx, %rdx
	cmpq	$16, %rdx
	jb	LBB0_11
## %bb.8:
	movq	%rcx, %rdx
	subq	%r8, %rdx
	cmpq	$16, %rdx
	jb	LBB0_11
## %bb.9:
	movl	$256, %edx                      ## imm = 0x100
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255]
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx), %xmm1
	psrld	$8, %xmm1
	movdqu	(%r8), %xmm2
	paddd	%xmm2, %xmm1
	pslld	$16, %xmm1
	movdqu	(%rbx,%r14,4), %xmm3
	movdqu	(%rbx,%r14,8), %xmm4
	psrad	$8, %xmm4
	paddd	%xmm2, %xmm4
	pslld	$8, %xmm2
	paddd	%xmm3, %xmm2
	pand	%xmm0, %xmm2
	por	%xmm1, %xmm4
	por	%xmm2, %xmm4
	movdqu	%xmm4, (%rcx)
	addq	$16, %r8
	addq	$16, %rcx
	addq	$16, %rbx
	addq	$-4, %rdx
	jne	LBB0_10
	jmp	LBB0_13
LBB0_11:
	xorl	%edx, %edx
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rdx,4), %esi
	shrl	$8, %esi
	movl	(%r8,%rdx,4), %edi
	addl	%edi, %esi
	shll	$16, %esi
	movl	(%r9,%rdx,4), %eax
	sarl	$8, %eax
	addl	%edi, %eax
	shll	$8, %edi
	addl	(%r15,%rdx,4), %edi
	andl	$-256, %edi
	orl	%esi, %eax
	orl	%edi, %eax
	movl	%eax, (%rcx,%rdx,4)
	incq	%rdx
	cmpq	$256, %rdx                      ## imm = 0x100
	jne	LBB0_12
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gma_crtc_load_lut              ; -- Begin function gma_crtc_load_lut
	.p2align	2
_gma_crtc_load_lut:                     ; @gma_crtc_load_lut
	.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	x21, x0
	ldr	x19, [x0, #24]
	ldr	x25, [x19]
	bl	_to_gma_crtc
	ldr	w8, [x21, #16]
	cbz	w8, LBB0_13
; %bb.1:
	mov	x20, x0
	ldr	x8, [x25, #8]
	ldr	x9, [x0]
	ldr	w24, [x8, x9, lsl #2]
	ldr	x22, [x21, #8]
	ldrsw	x26, [x21]
	lsl	x8, x26, #2
	add	x21, x22, x8
	add	x23, x21, x8
	mov	x0, x19
	mov	w1, #0
	bl	_gma_power_begin
	cbz	x0, LBB0_5
; %bb.2:
	mov	x25, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22, x25]
	ldr	x9, [x20, #8]
	ldr	w9, [x9, x25]
	add	w8, w9, w8, lsr #8
	ldr	w10, [x21, x25]
	add	w10, w10, w9, lsl #8
	and	w10, w10, #0xffffff00
	orr	w8, w10, w8, lsl #16
	ldr	w10, [x23, x25]
	add	w9, w9, w10, asr #8
	orr	w1, w8, w9
	add	w0, w24, w25
	bl	_REG_WRITE
	add	x25, x25, #4
	cmp	x25, #1024
	b.ne	LBB0_3
; %bb.4:
	mov	x0, x19
	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
	b	_gma_power_end
LBB0_5:
	ldr	x9, [x20, #8]
	ldr	x8, [x25]
	ldr	x10, [x8]
	add	x8, x22, x26, lsl #3
	sub	x8, x10, x8
	cmp	x8, #64
	b.lo	LBB0_11
; %bb.6:
	add	x8, x22, x26, lsl #2
	sub	x8, x10, x8
	cmp	x8, #64
	b.lo	LBB0_11
; %bb.7:
	sub	x8, x10, x22
	cmp	x8, #64
	b.lo	LBB0_11
; %bb.8:
	sub	x8, x10, x9
	cmp	x8, #64
	b.lo	LBB0_11
; %bb.9:
	mov	x8, #0
	add	x9, x9, #32
	add	x10, x10, #32
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x11, x22, x8
	ldp	q0, q1, [x11]
	ldp	q2, q3, [x11, #32]
	add	x11, x9, x8
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11]
	mov.16b	v16, v4
	usra.4s	v16, v0, #8
	mov.16b	v0, v5
	usra.4s	v0, v1, #8
	mov.16b	v1, v6
	usra.4s	v1, v2, #8
	mov.16b	v2, v7
	usra.4s	v2, v3, #8
	shl.4s	v3, v16, #16
	shl.4s	v0, v0, #16
	shl.4s	v1, v1, #16
	shl.4s	v2, v2, #16
	add	x11, x21, x8
	ldp	q16, q17, [x11]
	ldp	q18, q19, [x11, #32]
	shl.4s	v20, v4, #8
	shl.4s	v21, v5, #8
	shl.4s	v22, v6, #8
	shl.4s	v23, v7, #8
	add.4s	v16, v16, v20
	add.4s	v17, v17, v21
	add.4s	v18, v18, v22
	add.4s	v19, v19, v23
	bic.4s	v16, #255
	bic.4s	v17, #255
	bic.4s	v18, #255
	bic.4s	v19, #255
	orr.16b	v3, v16, v3
	orr.16b	v0, v17, v0
	orr.16b	v1, v18, v1
	orr.16b	v2, v19, v2
	add	x11, x23, x8
	ldp	q16, q17, [x11]
	ldp	q18, q19, [x11, #32]
	ssra.4s	v4, v16, #8
	ssra.4s	v5, v17, #8
	ssra.4s	v6, v18, #8
	ssra.4s	v7, v19, #8
	orr.16b	v3, v3, v4
	orr.16b	v0, v0, v5
	orr.16b	v1, v1, v6
	orr.16b	v2, v2, v7
	add	x11, x10, x8
	stp	q3, q0, [x11, #-32]
	stp	q1, q2, [x11]
	add	x8, x8, #64
	cmp	x8, #1024
	b.ne	LBB0_10
	b	LBB0_13
LBB0_11:
	mov	x8, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x22, x8]
	ldr	w12, [x9, x8]
	ldr	w13, [x21, x8]
	add	w11, w12, w11, lsr #8
	add	w13, w13, w12, lsl #8
	and	w13, w13, #0xffffff00
	orr	w11, w13, w11, lsl #16
	ldr	w13, [x23, x8]
	add	w12, w12, w13, asr #8
	orr	w11, w11, w12
	str	w11, [x10, x8]
	add	x8, x8, #4
	cmp	x8, #1024
	b.ne	LBB0_12
LBB0_13:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
