	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vicam_decode_color
_vicam_decode_color:                    ## @vicam_decode_color
	.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
	movq	%rsi, %r14
	movq	_VICAM_HEADER_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(%rdi,%rax,4), %r15
	movl	$512, %eax                      ## imm = 0x200
	xorl	%r13d, %r13d
	movl	$3435973837, %edx               ## imm = 0xCCCCCCCD
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	cltq
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $eax killed $eax killed $rax
	orl	$1, %eax
	cltq
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %ecx
	xorl	%r12d, %r12d
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r12d, %eax
	imulq	%rdx, %rax
	shrq	$40, %rax
	leaq	(%r15,%rax,4), %rdi
	movslq	%ecx, %rbx
	movl	(%rdi,%rbx,4), %r10d
	movl	(%r15,%rax,4), %r8d
	movl	4(%r15,%rax,4), %r11d
	subl	%r8d, %r10d
	subl	%r8d, %r11d
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	leal	(%rbx,%rsi), %ecx
	movslq	%ecx, %r9
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rdi,%rcx,4), %ecx
	addl	(%rdi,%r9,4), %ecx
	movl	2048(%r15,%rax,4), %edx
	addl	$512, %ebx                      ## imm = 0x200
	addl	(%rdi,%rsi,4), %edx
	addl	(%rdi,%rbx,4), %ecx
	leal	(%r11,%r10), %esi
	movl	%esi, %ebx
	shrl	$31, %ebx
	addl	%esi, %ebx
	sarl	%ebx
	addl	%edx, %edx
	addl	2052(%r15,%rax,4), %ecx
	subl	%ecx, %edx
	leal	3(%rdx), %edi
	testl	%edx, %edx
	cmovnsl	%edx, %edi
	leal	(%r11,%r10), %ecx
	addl	$3, %ecx
	sarl	$2, %edi
	testl	%esi, %esi
	cmovnsl	%esi, %ecx
	sarl	$2, %ecx
	addl	%r8d, %ecx
	imull	$1160, %ecx, %r15d              ## imm = 0x488
	testb	$1, %r13b
	movl	%edi, %ecx
	cmovel	%ebx, %ecx
	cmovnel	%ebx, %edi
	xorl	%r13d, %eax
	movl	%ecx, %r13d
	negl	%r13d
	movl	%edi, %ebx
	negl	%ebx
	testb	$1, %al
	cmovel	%ecx, %r13d
	cmovel	%edi, %ebx
	imull	$2017, %ebx, %eax               ## imm = 0x7E1
	addl	%r15d, %eax
	addl	$-18060, %eax                   ## imm = 0xB974
	movslq	%eax, %rdi
	imulq	$-1851608123, %rdi, %rax        ## imm = 0x91A2B3C5
	shrq	$32, %rax
	addl	%eax, %edi
	movl	%edi, %eax
	shrl	$31, %eax
	sarl	$9, %edi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_clamp
	movl	%eax, (%r14)
	imull	$-392, %ebx, %eax               ## imm = 0xFE78
	imull	$-813, %r13d, %ecx              ## imm = 0xFCD3
	addl	%r15d, %eax
	addl	$-18060, %eax                   ## imm = 0xB974
	addl	%ecx, %eax
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_clamp
	movl	%eax, 4(%r14)
	imull	$1594, %r13d, %eax              ## imm = 0x63A
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	addl	%r15d, %eax
	addl	$-18060, %eax                   ## imm = 0xB974
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	cltq
	imulq	$1691556351, %rax, %rdi         ## imm = 0x64D319FF
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$41, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_clamp
	movl	$3435973837, %edx               ## imm = 0xCCCCCCCD
	movl	%eax, 8(%r14)
	addq	$12, %r14
	addl	$512, %r12d                     ## imm = 0x200
	movl	$-1, %ecx
	cmpl	$163840, %r12d                  ## imm = 0x28000
	jne	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	incl	%r13d
	addq	$2048, %r15                     ## imm = 0x800
	movl	$-512, %eax                     ## imm = 0xFE00
	cmpl	$240, %r13d
	jne	LBB0_1
## %bb.4:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VICAM_HEADER_SIZE,4,2          ## @VICAM_HEADER_SIZE
	.no_dead_strip	_vicam_decode_color
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vicam_decode_color
_vicam_decode_color:                    ; @vicam_decode_color
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	w20, #0
Lloh0:
	adrp	x8, _VICAM_HEADER_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VICAM_HEADER_SIZE@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	add	x21, x0, x8, lsl #2
	mov	w8, #512
	mov	w17, #1160
	mov	w0, #2017
	mov	w1, #-18060
	mov	w2, #46021
	movk	w2, #37282, lsl #16
	mov	w24, #-392
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	mov	w25, #0
	sxtw	x26, w8
	orr	x27, x26, #0x1
	mov	w8, #1
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	umull	x9, w25, w9
	lsr	x9, x9, #40
	add	x10, x21, x9, lsl #2
	ldr	w11, [x10, w8, sxtw #2]
	ldp	w12, w13, [x10]
	sub	w11, w11, w12
	ldr	w14, [x10, x26, lsl #2]
	add	w15, w8, w26
	ldr	w15, [x10, w15, sxtw #2]
	ldr	w16, [x10, x27, lsl #2]
	sub	w13, w13, w12
	add	w11, w13, w11
	ldr	w13, [x10, #2048]
	add	w8, w8, #512
	ldr	w8, [x10, w8, uxtw #2]
	ldr	w10, [x10, #2052]
	add	w13, w13, w14
	lsl	w13, w13, #1
	add	w14, w16, w15
	add	w8, w14, w8
	add	w8, w8, w10
	sub	w8, w13, w8
	add	w10, w8, #3
	cmp	w8, #0
	csel	w8, w10, w8, lt
	add	w10, w11, #3
	cmp	w11, #0
	csel	w10, w10, w11, lt
	cinc	w11, w11, lt
	asr	w11, w11, #1
	asr	w8, w8, #2
	add	w10, w12, w10, asr #2
	tst	w20, #0x1
	csel	w12, w11, w8, eq
	csel	w8, w8, w11, eq
	eor	w9, w9, w20
	tst	w9, #0x1
	cneg	w28, w12, ne
	cneg	w22, w8, ne
	madd	w23, w10, w17, w1
	madd	w8, w22, w0, w23
	smull	x9, w8, w2
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #9
	add	w0, w9, w8, lsr #31
	mov	w1, #0
	mov	w2, #255
	bl	_clamp
	str	w0, [x19]
	madd	w8, w22, w24, w23
	mov	w22, #1594
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	mov	w9, #-813
	madd	w8, w28, w9, w8
	smull	x8, w8, w10
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	mov	w1, #0
	mov	w2, #255
	bl	_clamp
	str	w0, [x19, #4]
	madd	w8, w28, w22, w23
	mov	w9, #6655
	movk	w9, #25811, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #41
	add	w0, w8, w9
	mov	w1, #0
	mov	w2, #255
	bl	_clamp
	mov	w2, #46021
	movk	w2, #37282, lsl #16
	mov	w1, #-18060
	mov	w17, #1160
	str	w0, [x19, #8]
	mov	w0, #2017
	add	x19, x19, #12
	add	w25, w25, #512
	mov	w8, #-1
	cmp	w25, #40, lsl #12               ; =163840
	b.ne	LBB0_2
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w20, w20, #1
	add	x21, x21, #2048
	mov	w8, #-512
	cmp	w20, #240
	b.ne	LBB0_1
; %bb.4:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VICAM_HEADER_SIZE,4,2          ; @VICAM_HEADER_SIZE
	.no_dead_strip	_vicam_decode_color
.subsections_via_symbols
