	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function RunTone
_RunTone:                               ## @RunTone
	.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	%esi, %r14d
	movl	%edi, %r15d
	movq	_SN76489@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_UpdateToneAmplitude
	movq	8(%r13), %rax
	movslq	%r15d, %r12
	movl	(%rax,%r12,4), %ebx
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	cmpl	%r14d, %ebx
	jge	LBB0_6
## %bb.1:
	leal	(%r15,%r15), %eax
	movslq	%eax, %r14
	movq	16(%r13), %rax
	movl	(%rax,%r14,4), %eax
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%edx, (%rcx,%r12,4)
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_UpdateToneAmplitude
	movq	16(%r13), %rax
	movl	(%rax,%r14,4), %eax
	movq	_PSG_MCYCLES_RATIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%eax, %ecx
	addl	%ecx, %ebx
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rcx
	movl	$1, %edx
	movq	_PSG_CUTOFF@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %eax
	jle	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	subl	(%rcx,%r12,4), %edx
	jmp	LBB0_4
LBB0_5:
	movq	8(%r13), %rax
LBB0_6:
	movl	%ebx, (%rax,%r12,4)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SN76489,32,3                   ## @SN76489
	.comm	_PSG_CUTOFF,4,2                 ## @PSG_CUTOFF
	.comm	_PSG_MCYCLES_RATIO,4,2          ## @PSG_MCYCLES_RATIO
	.no_dead_strip	_RunTone
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function RunTone
_RunTone:                               ; @RunTone
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x23, _SN76489@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SN76489@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_UpdateToneAmplitude
	ldr	x8, [x23, #8]
	sxtw	x22, w20
	ldr	w21, [x8, w20, sxtw #2]
	cmp	w21, w19
	b.ge	LBB0_7
; %bb.1:
	lsl	x24, x22, #1
	ldr	x8, [x23, #16]
	lsl	x9, x22, #3
	ldr	w8, [x8, x9]
Lloh2:
	adrp	x25, _PSG_CUTOFF@GOTPAGE
Lloh3:
	ldr	x25, [x25, _PSG_CUTOFF@GOTPAGEOFF]
Lloh4:
	adrp	x26, _PSG_MCYCLES_RATIO@GOTPAGE
Lloh5:
	ldr	x26, [x26, _PSG_MCYCLES_RATIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x9, x22, lsl #2]
	neg	w8, w8
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	w8, [x9, x22, lsl #2]
	mov	x0, x20
	mov	x1, x21
	bl	_UpdateToneAmplitude
	ldr	x8, [x23, #16]
	ldr	w8, [x8, x24, lsl #2]
	ldr	w9, [x26]
	madd	w21, w9, w8, w21
	cmp	w21, w19
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x25]
	ldr	x9, [x23, #24]
	cmp	w8, w10
	b.gt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #1
	b	LBB0_3
LBB0_6:
	ldr	x8, [x23, #8]
LBB0_7:
	str	w21, [x8, x22, lsl #2]
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_SN76489,32,3                   ; @SN76489
	.comm	_PSG_CUTOFF,4,2                 ; @PSG_CUTOFF
	.comm	_PSG_MCYCLES_RATIO,4,2          ; @PSG_MCYCLES_RATIO
	.no_dead_strip	_RunTone
.subsections_via_symbols
