	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function RunNoise
_RunNoise:                              ## @RunNoise
	.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	%edi, %r14d
	movq	_SN76489@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	cmpl	$128, %r12d
	jne	LBB0_2
## %bb.1:
	movq	8(%r15), %rax
	movq	16(%r15), %rcx
	movl	16(%rax), %r12d
	movl	8(%rcx), %eax
	movl	%eax, 12(%rcx)
LBB0_2:
	movl	24(%r15), %edi
	callq	_UpdateNoiseAmplitude
	movq	16(%r15), %rax
	movl	12(%rax), %ebx
	cmpl	%r14d, %ebx
	jge	LBB0_11
## %bb.3:
	movq	_PSG_MCYCLES_RATIO@GOTPCREL(%rip), %r13
	jmp	LBB0_4
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %edx
	andl	$1, %edx
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movzbl	48(%r15), %ecx
	decb	%cl
	shll	%cl, %edx
	sarl	%eax
	orl	%eax, %edx
	movl	%edx, 40(%r15)
	movl	%ebx, %edi
	callq	_UpdateNoiseAmplitude
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r13), %eax
	imull	%r12d, %eax
	addl	%eax, %ebx
	cmpl	%r14d, %ebx
	jge	LBB0_10
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r15), %rax
	movl	12(%rax), %ecx
	movl	%ecx, %edx
	negl	%edx
	movl	%edx, 12(%rax)
	cmpl	$-1, %ecx
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	40(%r15), %eax
	movq	8(%r15), %rcx
	testb	$4, 24(%rcx)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	44(%r15), %ecx
	movl	%ecx, %edx
	andl	%eax, %edx
	setne	%sil
	cmpl	%ecx, %edx
	setne	%cl
	andb	%sil, %cl
	movzbl	%cl, %edx
	jmp	LBB0_8
LBB0_10:
	movq	16(%r15), %rax
LBB0_11:
	movl	%ebx, 12(%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SN76489,56,3                   ## @SN76489
	.comm	_PSG_MCYCLES_RATIO,4,2          ## @PSG_MCYCLES_RATIO
	.no_dead_strip	_RunNoise
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function RunNoise
_RunNoise:                              ; @RunNoise
	.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, x0
Lloh0:
	adrp	x21, _SN76489@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SN76489@GOTPAGEOFF]
	ldr	w22, [x21]
	cmp	w22, #128
	b.ne	LBB0_2
; %bb.1:
	ldp	x8, x9, [x21, #8]
	ldr	w22, [x8, #16]
	ldr	w8, [x9, #8]
	str	w8, [x9, #12]
LBB0_2:
	ldr	w0, [x21, #24]
	bl	_UpdateNoiseAmplitude
	ldr	x8, [x21, #16]
	ldr	w20, [x8, #12]
	cmp	w20, w19
	b.ge	LBB0_11
; %bb.3:
Lloh2:
	adrp	x23, _PSG_MCYCLES_RATIO@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PSG_MCYCLES_RATIO@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:                                 ;   in Loop: Header=BB0_7 Depth=1
	and	w9, w8, #0x1
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w10, [x21, #48]
	sub	w10, w10, #1
	lsl	w9, w9, w10
	orr	w8, w9, w8, asr #1
	str	w8, [x21, #40]
	mov	x0, x20
	bl	_UpdateNoiseAmplitude
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x23]
	madd	w20, w8, w22, w20
	cmp	w20, w19
	b.ge	LBB0_10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #32]
	ldr	w9, [x8, #12]
	neg	w10, w9
	str	w10, [x8, #12]
	cmn	w9, #1
	b.ne	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x21, #40]
	ldr	x9, [x21, #8]
	ldrb	w9, [x9, #24]
	tbz	w9, #2, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w9, [x21, #44]
	ands	w10, w9, w8
	cset	w11, ne
	cmp	w10, w9
	cset	w9, ne
	and	w9, w11, w9
	b	LBB0_5
LBB0_10:
	ldr	x8, [x21, #16]
LBB0_11:
	str	w20, [x8, #12]
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_SN76489,56,3                   ; @SN76489
	.comm	_PSG_MCYCLES_RATIO,4,2          ; @PSG_MCYCLES_RATIO
	.no_dead_strip	_RunNoise
.subsections_via_symbols
