	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function ym2612_pack_state
LCPI0_0:
	.quad	0x40f0000000000000              ## double 65536
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_ym2612_pack_state
	.p2align	4, 0x90
_ym2612_pack_state:                     ## @ym2612_pack_state
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ym2612@GOTPCREL(%rip), %rax
	movl	$1024, %ecx                     ## imm = 0x400
	subl	(%rax), %ecx
	movl	$256, %ebx                      ## imm = 0x100
	movq	_timer_a_next_oflow@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movq	_TIMER_NO_OFLOW@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	xorl	%r14d, %r14d
	movl	$0, %r15d
	cmpq	%rdx, %rsi
	je	LBB0_2
## %bb.1:
	movq	_timer_a_step@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	cvtsi2sd	%rdi, %xmm0
	subq	%rsi, %rdi
	cvtsi2sd	%rdi, %xmm1
	divsd	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ecx, %xmm0
	mulsd	%xmm1, %xmm0
	mulsd	LCPI0_0(%rip), %xmm0
	cvttsd2si	%xmm0, %r15d
LBB0_2:
	subl	4(%rax), %ebx
	movq	_timer_b_next_oflow@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rdx, %rax
	je	LBB0_4
## %bb.3:
	movq	_timer_b_step@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rdx, %xmm0
	subq	%rax, %rdx
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rdx, %xmm1
	divsd	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ebx, %xmm0
	mulsd	%xmm1, %xmm0
	mulsd	LCPI0_0(%rip), %xmm0
	cvttsd2si	%xmm0, %r14d
LBB0_4:
	movq	_EL_YMTIMER@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	%r15d, %edx
	sarl	$16, %edx
	leaq	L_.str(%rip), %rsi
	callq	_elprintf
	movl	(%r12), %edi
	movl	%r14d, %edx
	sarl	$16, %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %ecx
	callq	_elprintf
	movl	%r15d, %edi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_YM2612PicoStateSave2           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ym2612,8,2                     ## @ym2612
	.comm	_timer_a_next_oflow,8,3         ## @timer_a_next_oflow
	.comm	_TIMER_NO_OFLOW,8,3             ## @TIMER_NO_OFLOW
	.comm	_timer_a_step,8,3               ## @timer_a_step
	.comm	_timer_b_next_oflow,8,3         ## @timer_b_next_oflow
	.comm	_timer_b_step,8,3               ## @timer_b_step
	.comm	_EL_YMTIMER,4,2                 ## @EL_YMTIMER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"save: timer a %i/%i"

L_.str.1:                               ## @.str.1
	.asciz	"save: timer b %i/%i"

	.comm	_POPT_EXT_FM,4,2                ## @POPT_EXT_FM
	.comm	_PicoOpt,4,2                    ## @PicoOpt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ym2612_pack_state              ; -- Begin function ym2612_pack_state
	.p2align	2
_ym2612_pack_state:                     ; @ym2612_pack_state
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _ym2612@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ym2612@GOTPAGEOFF]
	mov	w9, #1024
	ldp	w10, w8, [x8]
	sub	w3, w9, w10
	mov	w9, #256
Lloh2:
	adrp	x10, _timer_a_next_oflow@GOTPAGE
Lloh3:
	ldr	x10, [x10, _timer_a_next_oflow@GOTPAGEOFF]
	sub	w19, w9, w8
Lloh4:
	ldr	x9, [x10]
Lloh5:
	adrp	x8, _TIMER_NO_OFLOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TIMER_NO_OFLOW@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x10, _timer_a_step@GOTPAGE
Lloh9:
	ldr	x10, [x10, _timer_a_step@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	sub	x9, x10, x9
	scvtf	d0, x9
	scvtf	d1, x10
	fdiv	d0, d0, d1
	scvtf	d1, w3
	fmul	d0, d0, d1
	fcvtzs	w20, d0, #16
LBB0_3:
Lloh11:
	adrp	x9, _timer_b_next_oflow@GOTPAGE
Lloh12:
	ldr	x9, [x9, _timer_b_next_oflow@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	mov	w21, #0
	b	LBB0_6
LBB0_5:
Lloh14:
	adrp	x8, _timer_b_step@GOTPAGE
Lloh15:
	ldr	x8, [x8, _timer_b_step@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	sub	x9, x8, x9
	scvtf	d0, x9
	scvtf	d1, x8
	fdiv	d0, d0, d1
	scvtf	d1, w19
	fmul	d0, d0, d1
	fcvtzs	w21, d0, #16
LBB0_6:
Lloh17:
	adrp	x22, _EL_YMTIMER@GOTPAGE
Lloh18:
	ldr	x22, [x22, _EL_YMTIMER@GOTPAGEOFF]
	ldr	w0, [x22]
	asr	w2, w20, #16
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elprintf
	ldr	w0, [x22]
	asr	w2, w21, #16
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x19
	bl	_elprintf
	mov	x0, x20
	mov	x1, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_YM2612PicoStateSave2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ym2612,8,2                     ; @ym2612
	.comm	_timer_a_next_oflow,8,3         ; @timer_a_next_oflow
	.comm	_TIMER_NO_OFLOW,8,3             ; @TIMER_NO_OFLOW
	.comm	_timer_a_step,8,3               ; @timer_a_step
	.comm	_timer_b_next_oflow,8,3         ; @timer_b_next_oflow
	.comm	_timer_b_step,8,3               ; @timer_b_step
	.comm	_EL_YMTIMER,4,2                 ; @EL_YMTIMER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"save: timer a %i/%i"

l_.str.1:                               ; @.str.1
	.asciz	"save: timer b %i/%i"

	.comm	_POPT_EXT_FM,4,2                ; @POPT_EXT_FM
	.comm	_PicoOpt,4,2                    ; @PicoOpt
.subsections_via_symbols
