	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function generate_sync
LCPI0_0:
	.quad	0xbfe0000000000000              ## double -0.5
LCPI0_1:
	.quad	0x40efffe000000000              ## double 65535
LCPI0_2:
	.quad	0x3fd0000000000000              ## double 0.25
LCPI0_3:
	.quad	0x3fee666666666666              ## double 0.94999999999999996
LCPI0_4:
	.quad	0x3fe0000000000000              ## double 0.5
LCPI0_5:
	.quad	0xbfd0000000000000              ## double -0.25
LCPI0_6:
	.quad	0x406fe00000000000              ## double 255
LCPI0_7:
	.quad	0x4060000000000000              ## double 128
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_generate_sync:                         ## @generate_sync
	.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
	movl	%edi, %r13d
	movq	_POKEYSND_process_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_POKEYSND_process_buffer_fill@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(%r14,%rax,8), %r12
	movq	_POKEYSND_process_buffer_length@GOTPCREL(%rip), %rax
	movslq	(%rax), %r15
	movq	_samp_pos@GOTPCREL(%rip), %rcx
	movq	_ticks_per_sample@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	(%rcx), %eax
	cvtsi2sd	%rax, %xmm0
	leaq	-56(%rbp), %rdi
	callq	_modf
	cvttsd2si	-56(%rbp), %rbx
	cmpl	%r13d, %ebx
	jbe	LBB0_1
LBB0_11:
	movq	_samp_pos@GOTPCREL(%rip), %rax
	subl	%r13d, (%rax)
LBB0_12:
	movq	_POKEYSND_process_buffer@GOTPCREL(%rip), %rax
	subq	(%rax), %r12
	shrq	$3, %r12
	movq	_POKEYSND_process_buffer_fill@GOTPCREL(%rip), %rax
	movl	%r12d, (%rax)
	testl	%r13d, %r13d
	je	LBB0_16
## %bb.13:
	movq	_num_cur_pokeys@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_16
## %bb.14:
	xorl	%ebx, %ebx
	movq	_pokey_states@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_advance_ticks
	incq	%rbx
	movl	(%r14), %eax
	cmpq	%rax, %rbx
	jb	LBB0_15
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	(%r14,%r15,8), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_pokey_states@GOTPCREL(%rip), %r15
	movq	_ticks_per_sample@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_samp_pos@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	movq	_ticks_per_sample@GOTPCREL(%rip), %r14
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	(%r14), %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	leaq	-56(%rbp), %rdi
	callq	_modf
	cvttsd2si	-56(%rbp), %rbx
	cmpl	%ebx, %r13d
	jb	LBB0_11
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	cmpq	-72(%rbp), %r12                 ## 8-byte Folded Reload
	jae	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cvttsd2si	%xmm0, %rax
	movq	_samp_pos@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	subl	%ebx, %r13d
	movq	_num_cur_pokeys@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	je	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	movsd	LCPI0_6(%rip), %xmm0            ## xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	mulsd	LCPI0_2(%rip), %xmm0
	movq	_M_PI@GOTPCREL(%rip), %rax
	mulsd	(%rax), %xmm0
	mulsd	LCPI0_3(%rip), %xmm0
	mulsd	%xmm0, %xmm2
	addsd	LCPI0_7(%rip), %xmm2
	movsd	LCPI0_4(%rip), %xmm0            ## xmm0 = mem[0],zero
	addsd	%xmm0, %xmm2
	movsd	%xmm2, -48(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	_rand
	mulsd	LCPI0_4(%rip), %xmm0
	movq	_RAND_MAX@GOTPCREL(%rip), %rax
	divsd	(%rax), %xmm0
	addsd	-48(%rbp), %xmm0                ## 8-byte Folded Reload
	addsd	LCPI0_5(%rip), %xmm0
	callq	_floor
	movq	%rax, (%r12)
	addq	$8, %r12
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	incq	%r14
	movq	_num_cur_pokeys@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %r14
	jae	LBB0_9
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r15), %rdi
	addq	%r14, %rdi
	movl	%ebx, %esi
	callq	_advance_ticks
	movq	_POKEYSND_BIT16@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_POKEYSND_snd_flags@GOTPCREL(%rip), %rax
	andl	(%rax), %r13d
	movq	(%r15), %rdi
	addq	%r14, %rdi
	movq	_samp_pos@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_interp_read_resam_all
	movq	_MAX_SAMPLE@GOTPCREL(%rip), %rax
	movsd	(%rax), %xmm1                   ## xmm1 = mem[0],zero
	movapd	%xmm1, %xmm2
	mulsd	LCPI0_0(%rip), %xmm2
	addsd	%xmm0, %xmm2
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	mulsd	LCPI0_2(%rip), %xmm0
	movq	_M_PI@GOTPCREL(%rip), %rax
	mulsd	(%rax), %xmm0
	mulsd	LCPI0_3(%rip), %xmm0
	mulsd	%xmm0, %xmm2
	movsd	LCPI0_4(%rip), %xmm0            ## xmm0 = mem[0],zero
	addsd	%xmm0, %xmm2
	movsd	%xmm2, -48(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	_rand
	mulsd	LCPI0_4(%rip), %xmm0
	movq	_RAND_MAX@GOTPCREL(%rip), %rax
	divsd	(%rax), %xmm0
	addsd	-48(%rbp), %xmm0                ## 8-byte Folded Reload
	addsd	LCPI0_5(%rip), %xmm0
	callq	_floor
	movq	%rax, (%r12)
	addq	$16, %r12
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_POKEYSND_process_buffer,8,3    ## @POKEYSND_process_buffer
	.comm	_POKEYSND_process_buffer_fill,4,2 ## @POKEYSND_process_buffer_fill
	.comm	_POKEYSND_process_buffer_length,4,2 ## @POKEYSND_process_buffer_length
	.comm	_samp_pos,4,2                   ## @samp_pos
	.comm	_ticks_per_sample,4,2           ## @ticks_per_sample
	.comm	_num_cur_pokeys,4,2             ## @num_cur_pokeys
	.comm	_pokey_states,8,3               ## @pokey_states
	.comm	_POKEYSND_snd_flags,4,2         ## @POKEYSND_snd_flags
	.comm	_POKEYSND_BIT16,4,2             ## @POKEYSND_BIT16
	.comm	_MAX_SAMPLE,8,3                 ## @MAX_SAMPLE
	.comm	_M_PI,8,3                       ## @M_PI
	.comm	_RAND_MAX,8,3                   ## @RAND_MAX
	.no_dead_strip	_generate_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function generate_sync
_generate_sync:                         ; @generate_sync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	d13, d12, [sp, #32]             ; 16-byte Folded Spill
	stp	d11, d10, [sp, #48]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #64]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	.cfi_offset b10, -120
	.cfi_offset b11, -128
	.cfi_offset b12, -136
	.cfi_offset b13, -144
	mov	x25, x0
Lloh0:
	adrp	x8, _POKEYSND_process_buffer@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POKEYSND_process_buffer@GOTPAGEOFF]
Lloh2:
	ldr	x19, [x8]
Lloh3:
	adrp	x8, _POKEYSND_process_buffer_fill@GOTPAGE
Lloh4:
	ldr	x8, [x8, _POKEYSND_process_buffer_fill@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	add	x23, x19, x8, lsl #3
Lloh6:
	adrp	x8, _POKEYSND_process_buffer_length@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POKEYSND_process_buffer_length@GOTPAGEOFF]
Lloh8:
	ldrsw	x21, [x8]
Lloh9:
	adrp	x8, _samp_pos@GOTPAGE
Lloh10:
	ldr	x8, [x8, _samp_pos@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x22, _ticks_per_sample@GOTPAGE
Lloh13:
	ldr	x22, [x22, _ticks_per_sample@GOTPAGEOFF]
	ldr	w9, [x22]
	add	w8, w9, w8
	ucvtf	d0, w8
	add	x0, sp, #24
	bl	_modf
	ldr	d1, [sp, #24]
	fcvtzu	w20, d1
	cmp	w20, w25
	b.ls	LBB0_7
LBB0_1:
Lloh14:
	adrp	x9, _samp_pos@GOTPAGE
Lloh15:
	ldr	x9, [x9, _samp_pos@GOTPAGEOFF]
	ldr	w8, [x9]
	sub	w8, w8, w25
	str	w8, [x9]
LBB0_2:
Lloh16:
	adrp	x8, _POKEYSND_process_buffer@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POKEYSND_process_buffer@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	sub	x8, x23, x8
	lsr	x8, x8, #3
Lloh19:
	adrp	x9, _POKEYSND_process_buffer_fill@GOTPAGE
Lloh20:
	ldr	x9, [x9, _POKEYSND_process_buffer_fill@GOTPAGEOFF]
Lloh21:
	str	w8, [x9]
	cbz	w25, LBB0_6
; %bb.3:
Lloh22:
	adrp	x19, _num_cur_pokeys@GOTPAGE
Lloh23:
	ldr	x19, [x19, _num_cur_pokeys@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.4:
	mov	x20, #0
Lloh24:
	adrp	x21, _pokey_states@GOTPAGE
Lloh25:
	ldr	x21, [x21, _pokey_states@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	add	x0, x20, x8
	mov	x1, x25
	bl	_advance_ticks
	add	x20, x20, #1
	ldr	w8, [x19]
	cmp	x20, x8
	b.lo	LBB0_5
LBB0_6:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #64]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #48]             ; 16-byte Folded Reload
	ldp	d13, d12, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_7:
	add	x8, x19, x21, lsl #3
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
Lloh26:
	adrp	x27, _num_cur_pokeys@GOTPAGE
Lloh27:
	ldr	x27, [x27, _num_cur_pokeys@GOTPAGEOFF]
Lloh28:
	adrp	x28, _pokey_states@GOTPAGE
Lloh29:
	ldr	x28, [x28, _pokey_states@GOTPAGEOFF]
	fmov	d8, #-0.50000000
	fmov	d9, #0.25000000
Lloh30:
	adrp	x26, _MAX_SAMPLE@GOTPAGE
Lloh31:
	ldr	x26, [x26, _MAX_SAMPLE@GOTPAGEOFF]
	mov	x19, #7378697629483820646
	movk	x19, #16366, lsl #48
	mov	x21, x22
Lloh32:
	adrp	x22, _M_PI@GOTPAGE
Lloh33:
	ldr	x22, [x22, _M_PI@GOTPAGEOFF]
	fmov	d10, #0.50000000
Lloh34:
	adrp	x24, _RAND_MAX@GOTPAGE
Lloh35:
	ldr	x24, [x24, _RAND_MAX@GOTPAGEOFF]
	fmov	d11, #-0.25000000
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
Lloh36:
	adrp	x8, _samp_pos@GOTPAGE
Lloh37:
	ldr	x8, [x8, _samp_pos@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	ldr	w25, [sp, #20]                  ; 4-byte Folded Reload
Lloh39:
	adrp	x21, _ticks_per_sample@GOTPAGE
Lloh40:
	ldr	x21, [x21, _ticks_per_sample@GOTPAGEOFF]
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	w9, [x21]
	add	w8, w9, w8
	ucvtf	d0, w8
	add	x0, sp, #24
	bl	_modf
	ldr	d1, [sp, #24]
	fcvtzu	w20, d1
	cmp	w25, w20
	b.lo	LBB0_1
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	cmp	x23, x8
	b.hs	LBB0_2
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	fcvtzu	w8, d0
Lloh41:
	adrp	x9, _samp_pos@GOTPAGE
Lloh42:
	ldr	x9, [x9, _samp_pos@GOTPAGEOFF]
Lloh43:
	str	w8, [x9]
	sub	w25, w25, w20
	ldr	w9, [x27]
	cbz	w9, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	str	w25, [sp, #20]                  ; 4-byte Folded Spill
	mov	x21, #0
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=2
	mov	x8, #246290604621824
	movk	x8, #16495, lsl #48
	fmov	d2, x8
	fdiv	d1, d2, d1
	fmul	d1, d1, d9
	ldr	d2, [x22]
	fmul	d1, d2, d1
	fmov	d2, x19
	fmul	d1, d1, d2
	mov	x8, #4638707616191610880
	fmov	d2, x8
	fmadd	d0, d0, d1, d2
	fadd	d12, d0, d10
	bl	_rand
	fmul	d0, d0, d10
	ldr	d1, [x24]
	fdiv	d0, d0, d1
	fadd	d0, d0, d12
	fadd	d0, d0, d11
	bl	_floor
	str	x0, [x23], #8
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	add	x21, x21, #1
	ldr	w8, [x27]
	cmp	x21, x8
	b.hs	LBB0_8
LBB0_15:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x28]
	add	x0, x21, x8
	mov	x1, x20
	bl	_advance_ticks
Lloh44:
	adrp	x8, _POKEYSND_snd_flags@GOTPAGE
Lloh45:
	ldr	x8, [x8, _POKEYSND_snd_flags@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
Lloh47:
	adrp	x9, _POKEYSND_BIT16@GOTPAGE
Lloh48:
	ldr	x9, [x9, _POKEYSND_BIT16@GOTPAGEOFF]
Lloh49:
	ldr	w9, [x9]
	and	w25, w9, w8
	ldr	x8, [x28]
	add	x0, x21, x8
Lloh50:
	adrp	x8, _samp_pos@GOTPAGE
Lloh51:
	ldr	x8, [x8, _samp_pos@GOTPAGEOFF]
Lloh52:
	ldr	w1, [x8]
	bl	_interp_read_resam_all
	ldr	d1, [x26]
	fmul	d2, d1, d8
	fadd	d0, d0, d2
	cbz	w25, LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	mov	x8, #281337537757184
	movk	x8, #16623, lsl #48
	fmov	d2, x8
	fdiv	d1, d2, d1
	fmul	d1, d1, d9
	ldr	d2, [x22]
	fmul	d1, d2, d1
	fmov	d2, x19
	fmul	d1, d1, d2
	fmadd	d12, d0, d1, d10
	bl	_rand
	fmul	d0, d0, d10
	ldr	d1, [x24]
	fdiv	d0, d0, d1
	fadd	d0, d0, d12
	fadd	d0, d0, d11
	bl	_floor
	str	x0, [x23], #16
	b	LBB0_14
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotStr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_POKEYSND_process_buffer,8,3    ; @POKEYSND_process_buffer
	.comm	_POKEYSND_process_buffer_fill,4,2 ; @POKEYSND_process_buffer_fill
	.comm	_POKEYSND_process_buffer_length,4,2 ; @POKEYSND_process_buffer_length
	.comm	_samp_pos,4,2                   ; @samp_pos
	.comm	_ticks_per_sample,4,2           ; @ticks_per_sample
	.comm	_num_cur_pokeys,4,2             ; @num_cur_pokeys
	.comm	_pokey_states,8,3               ; @pokey_states
	.comm	_POKEYSND_snd_flags,4,2         ; @POKEYSND_snd_flags
	.comm	_POKEYSND_BIT16,4,2             ; @POKEYSND_BIT16
	.comm	_MAX_SAMPLE,8,3                 ; @MAX_SAMPLE
	.comm	_M_PI,8,3                       ; @M_PI
	.comm	_RAND_MAX,8,3                   ; @RAND_MAX
	.no_dead_strip	_generate_sync
.subsections_via_symbols
