	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_ref
_calc_ref:                              ## @calc_ref
	.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
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movq	%rdi, %r12
	leal	(,%r15,8), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %esi
	movzbl	%sil, %r13d
	movl	%edx, %esi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	callq	_calc_bias
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r13), %edi
	xorl	%esi, %esi
	movl	$31, %edx
	callq	_clamp
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r15d, %edx
	movl	$1, %ecx
	callq	_calc_bias
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r13), %edi
	xorl	%esi, %esi
	movl	$31, %edx
	callq	_clamp
	movl	%eax, %ebx
	shll	$8, %ebx
	orl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	$2, %ecx
	callq	_calc_bias
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r13), %edi
	xorl	%esi, %esi
	movl	$31, %edx
	callq	_clamp
	movl	%eax, %r14d
	shll	$16, %r14d
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	$3, %ecx
	callq	_calc_bias
	addl	%eax, %r13d
	movl	%r13d, %edi
	xorl	%esi, %esi
	movl	$31, %edx
	callq	_clamp
	shll	$24, %eax
	orl	%r14d, %eax
	orl	%ebx, %eax
	orl	$-2139062144, %eax              ## imm = 0x80808080
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calc_ref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_ref
_calc_ref:                              ; @calc_ref
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x0
	lsl	w8, w3, #3
	asr	w8, w1, w8
	and	w23, w8, #0xff
	mov	x1, x2
	mov	x2, x3
	mov	w3, #0
	bl	_calc_bias
	add	w0, w0, w23
	mov	w1, #0
	mov	w2, #31
	bl	_clamp
	mov	x22, x0
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w3, #1
	bl	_calc_bias
	add	w0, w0, w23
	mov	w1, #0
	mov	w2, #31
	bl	_clamp
	orr	w22, w22, w0, lsl #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w3, #2
	bl	_calc_bias
	add	w0, w0, w23
	mov	w1, #0
	mov	w2, #31
	bl	_clamp
	orr	w22, w22, w0, lsl #16
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w3, #3
	bl	_calc_bias
	add	w0, w0, w23
	mov	w1, #0
	mov	w2, #31
	bl	_clamp
	orr	w8, w22, w0, lsl #24
	orr	w0, w8, #0x80808080
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calc_ref
.subsections_via_symbols
