	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function RB_CalcWaveColor
LCPI0_0:
	.long	0x3f800000                      ## float 1
LCPI0_1:
	.long	0x437f0000                      ## float 255
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_RB_CalcWaveColor
	.p2align	4, 0x90
_RB_CalcWaveColor:                      ## @RB_CalcWaveColor
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	_GF_NOISE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movss	8(%r14), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -20(%rbp)                ## 4-byte Spill
	movq	_tess@GOTPCREL(%rip), %rax
	movl	12(%r14), %ecx
	addl	(%rax), %ecx
	imull	16(%r14), %ecx
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_R_NoiseGet4f
	mulss	20(%r14), %xmm0
	addss	-20(%rbp), %xmm0                ## 4-byte Folded Reload
	jmp	LBB0_3
LBB0_2:
	movq	%r14, %rdi
	callq	_EvalWaveForm
	movq	_tr@GOTPCREL(%rip), %rax
	mulss	(%rax), %xmm0
LBB0_3:
	xorps	%xmm1, %xmm1
	ucomiss	%xmm0, %xmm1
	ja	LBB0_6
## %bb.4:
	ucomiss	LCPI0_0(%rip), %xmm0
	movaps	%xmm0, %xmm1
	jbe	LBB0_6
## %bb.5:
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
LBB0_6:
	mulss	LCPI0_1(%rip), %xmm1
	cvttss2si	%xmm1, %edi
	callq	_myftol
	movq	_tess@GOTPCREL(%rip), %rcx
	cmpl	$0, 4(%rcx)
	jle	LBB0_9
## %bb.7:
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, (%rbx,%rdx,4)
	incq	%rdx
	cmpl	4(%rcx), %edx
	jl	LBB0_8
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GF_NOISE,8,3                   ## @GF_NOISE
	.comm	_tess,8,2                       ## @tess
	.comm	_tr,4,2                         ## @tr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RB_CalcWaveColor               ; -- Begin function RB_CalcWaveColor
	.p2align	2
_RB_CalcWaveColor:                      ; @RB_CalcWaveColor
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -56
	.cfi_offset b9, -64
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _GF_NOISE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GF_NOISE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x21, _tess@GOTPAGE
Lloh4:
	ldr	x21, [x21, _tess@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	s8, [x20, #8]
	ldr	w8, [x21]
	ldp	w9, w10, [x20, #12]
	add	w8, w9, w8
	mul	w3, w8, w10
	mov	w0, #0
	mov	w1, #0
	mov	w2, #0
	bl	_R_NoiseGet4f
	ldr	s1, [x20, #20]
	fmadd	s0, s0, s1, s8
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	bl	_EvalWaveForm
Lloh5:
	adrp	x8, _tr@GOTPAGE
Lloh6:
	ldr	x8, [x8, _tr@GOTPAGEOFF]
Lloh7:
	ldr	s1, [x8]
	fmul	s0, s0, s1
LBB0_3:
	movi	d1, #0000000000000000
	fcmp	s0, #0.0
	b.mi	LBB0_6
; %bb.4:
	fmov	s1, #1.00000000
	fcmp	s0, s1
	fmov	s1, s0
	b.le	LBB0_6
; %bb.5:
	fmov	s1, #1.00000000
LBB0_6:
	mov	w8, #1132396544
	fmov	s0, w8
	fmul	s0, s1, s0
	fcvtzs	w0, s0
	bl	_myftol
	ldr	w8, [x21, #4]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x8, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	str	w0, [x19, x8, lsl #2]
	ldr	w9, [x21, #4]
	add	x8, x8, #1
	cmp	w8, w9
	b.lt	LBB0_8
LBB0_9:
	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	d9, d8, [sp], #64               ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GF_NOISE,8,3                   ; @GF_NOISE
	.comm	_tess,8,2                       ; @tess
	.comm	_tr,4,2                         ; @tr
.subsections_via_symbols
