	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apply_lut
_apply_lut:                             ## @apply_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movl	%r8d, %r15d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	16(%rbp), %r14d
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, 8(%rdi)
	je	LBB0_1
## %bb.2:
	testl	%r14d, %r14d
	jg	LBB0_3
	jmp	LBB0_10
LBB0_1:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_create_lut
	testl	%r14d, %r14d
	jle	LBB0_10
LBB0_3:
	movslq	%r15d, %rcx
	movslq	%ebx, %rdx
	movl	%r14d, %r9d
	movl	%r12d, %r11d
	movl	%r11d, %edi
	andl	$-2, %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	$8, %rax
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	leaq	(,%rcx,8), %r13
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	8(%rcx), %rsi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,8), %r10
	xorl	%ecx, %ecx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rcx
	addq	%r13, %rax
	addq	%r10, %rsi
	cmpq	%r9, %rcx
	je	LBB0_10
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	testl	%r12d, %r12d
	jle	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %r14
	xorl	%r15d, %r15d
	cmpl	$1, %r12d
	je	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-8(%rax,%r15,8), %r8
	movq	(%r14,%r8,8), %rdx
	movq	%rdx, -8(%rsi,%r15,8)
	movq	(%rax,%r15,8), %rdx
	movq	(%r14,%rdx,8), %rdx
	movq	%rdx, (%rsi,%r15,8)
	addq	$2, %r15
	cmpq	%r15, %rdi
	jne	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	testb	$1, %r11b
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rcx, %rdx
	imulq	-80(%rbp), %rdx                 ## 8-byte Folded Reload
	movq	%rcx, %r8
	imulq	-72(%rbp), %r8                  ## 8-byte Folded Reload
	addq	%r15, %rdx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx,%rdx,8), %rdx
	movq	(%r14,%rdx,8), %rdx
	addq	%r15, %r8
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rdx, (%rbx,%r8,8)
	jmp	LBB0_9
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_apply_lut
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apply_lut
_apply_lut:                             ; @apply_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	x25, x6
	mov	x19, x5
	mov	x23, x4
	mov	x20, x3
	mov	x24, x2
	mov	x21, x1
	mov	x22, x0
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_2
; %bb.1:
	cmp	w25, #1
	b.ge	LBB0_3
	b	LBB0_8
LBB0_2:
	mov	x0, x22
	bl	_create_lut
	cmp	w25, #1
	b.lt	LBB0_8
LBB0_3:
	mov	x8, #0
	mov	w9, w25
	sbfiz	x10, x24, #3, #32
	sbfiz	x11, x23, #3, #32
	mov	w12, w19
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x8, #1
	add	x21, x21, x10
	add	x20, x20, x11
	cmp	x8, x9
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	w19, #1
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x13, [x22]
	mov	x14, x12
	mov	x15, x20
	mov	x16, x21
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x17, [x15], #8
	ldr	x17, [x13, x17, lsl #3]
	str	x17, [x16], #8
	subs	x14, x14, #1
	b.ne	LBB0_7
	b	LBB0_4
LBB0_8:
	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
	.no_dead_strip	_apply_lut
.subsections_via_symbols
