	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ym2612_unpack_state            ## -- Begin function ym2612_unpack_state
	.p2align	4, 0x90
_ym2612_unpack_state:                   ## @ym2612_unpack_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_YM2612PicoStateLoad
	movl	$32, %ebx
	movq	_ym2612@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %esi
	movl	$1, %edi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	incq	%rbx
	cmpq	$160, %rbx
	jne	LBB0_1
## %bb.2:
	movl	$48, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$2, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	movq	(%r14), %rax
	movl	%ebx, %ecx
	orl	$256, %ecx                      ## imm = 0x100
	movl	(%rax,%rcx,4), %esi
	movl	$3, %edi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	incl	%ebx
	cmpl	$160, %ebx
	jne	LBB0_3
## %bb.4:
	movl	$175, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$2, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	movq	(%r14), %rax
	leaq	(,%rbx,4), %rcx
	orq	$1024, %rcx                     ## imm = 0x400
	movl	(%rax,%rcx), %esi
	movl	$3, %edi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	xorl	%edi, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %esi
	movl	$1, %edi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	leaq	-1(%rbx), %rax
	cmpq	$160, %rbx
	movq	%rax, %rbx
	ja	LBB0_5
## %bb.6:
	movl	$176, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %esi
	movl	$1, %edi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	movl	$2, %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	movq	(%r14), %rax
	movl	%ebx, %ecx
	shlq	$2, %rcx
	orq	$1024, %rcx                     ## imm = 0x400
	movl	(%rax,%rcx), %esi
	movl	$3, %edi
	xorl	%edx, %edx
	callq	_ym2612_write_local
	incq	%rbx
	cmpq	$184, %rbx
	jne	LBB0_7
## %bb.8:
	leaq	-32(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	callq	_YM2612PicoStateLoad2
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	_EL_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_elprintf
	jmp	LBB0_17
LBB0_10:
	movl	8(%r14), %edx
	movl	12(%r14), %eax
	shll	$16, %edx
	movl	$67108864, %ecx                 ## imm = 0x4000000
	subl	%edx, %ecx
	shll	$16, %eax
	movl	$16777216, %ebx                 ## imm = 0x1000000
	movl	16(%r14), %edx
	testb	$1, %dl
	jne	LBB0_11
## %bb.12:
	movq	_TIMER_NO_OFLOW@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	jmp	LBB0_13
LBB0_11:
	movl	%ecx, %esi
	subl	-32(%rbp), %esi
	cvtsi2sd	%esi, %xmm0
	cvtsi2sd	%ecx, %xmm1
	divsd	%xmm1, %xmm0
	movq	_timer_a_step@GOTPCREL(%rip), %rsi
	mulsd	(%rsi), %xmm0
	cvttsd2si	%xmm0, %r8d
LBB0_13:
	subl	%eax, %ebx
	movq	_timer_a_next_oflow@GOTPCREL(%rip), %rax
	movl	%r8d, (%rax)
	testb	$2, %dl
	jne	LBB0_14
## %bb.15:
	movq	_TIMER_NO_OFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_16
LBB0_14:
	movl	%ebx, %eax
	subl	-28(%rbp), %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2sd	%ebx, %xmm1
	divsd	%xmm1, %xmm0
	movq	_timer_b_step@GOTPCREL(%rip), %rax
	mulsd	(%rax), %xmm0
	cvttsd2si	%xmm0, %eax
LBB0_16:
	movq	_timer_b_next_oflow@GOTPCREL(%rip), %r14
	movl	%eax, (%r14)
	movq	_EL_YMTIMER@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movswl	-30(%rbp), %edx
	sarl	$16, %ecx
	sarl	$8, %r8d
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_elprintf
	movl	(%r15), %edi
	movswl	-26(%rbp), %edx
	sarl	$16, %ebx
	movl	(%r14), %r8d
	sarl	$8, %r8d
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_elprintf
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ym2612,24,3                    ## @ym2612
	.comm	_EL_STATUS,4,2                  ## @EL_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"old ym2612 state"

	.comm	_timer_a_step,8,3               ## @timer_a_step
	.comm	_timer_a_next_oflow,4,2         ## @timer_a_next_oflow
	.comm	_TIMER_NO_OFLOW,4,2             ## @TIMER_NO_OFLOW
	.comm	_timer_b_step,8,3               ## @timer_b_step
	.comm	_timer_b_next_oflow,4,2         ## @timer_b_next_oflow
	.comm	_EL_YMTIMER,4,2                 ## @EL_YMTIMER
L_.str.1:                               ## @.str.1
	.asciz	"load: %i/%i, timer_a_next_oflow %i"

L_.str.2:                               ## @.str.2
	.asciz	"load: %i/%i, timer_b_next_oflow %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_unpack_state            ; -- Begin function ym2612_unpack_state
	.p2align	2
_ym2612_unpack_state:                   ; @ym2612_unpack_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	bl	_YM2612PicoStateLoad
	mov	w19, #32
Lloh0:
	adrp	x20, _ym2612@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ym2612@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #0
	mov	x1, x19
	mov	w2, #0
	bl	_ym2612_write_local
	ldr	x8, [x20]
	ldr	w1, [x8, x19, lsl #2]
	mov	w0, #1
	mov	w2, #0
	bl	_ym2612_write_local
	add	x19, x19, #1
	cmp	x19, #160
	b.ne	LBB0_1
; %bb.2:
	mov	w19, #48
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #2
	mov	x1, x19
	mov	w2, #0
	bl	_ym2612_write_local
	ldr	x8, [x20]
	orr	w9, w19, #0x100
	ldr	w1, [x8, w9, uxtw #2]
	mov	w0, #3
	mov	w2, #0
	bl	_ym2612_write_local
	add	w19, w19, #1
	cmp	w19, #160
	b.ne	LBB0_3
; %bb.4:
	mov	w19, #175
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #2
	mov	x1, x19
	mov	w2, #0
	bl	_ym2612_write_local
	ldr	x8, [x20]
	lsl	x21, x19, #2
	orr	x9, x21, #0x400
	ldr	w1, [x8, x9]
	mov	w0, #3
	mov	w2, #0
	bl	_ym2612_write_local
	mov	w0, #0
	mov	x1, x19
	mov	w2, #0
	bl	_ym2612_write_local
	ldr	x8, [x20]
	ldr	w1, [x8, x21]
	mov	w0, #1
	mov	w2, #0
	bl	_ym2612_write_local
	sub	x8, x19, #1
	cmp	x19, #160
	mov	x19, x8
	b.hi	LBB0_5
; %bb.6:
	mov	w19, #176
	mov	w21, #-257
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #0
	mov	x1, x19
	mov	w2, #0
	bl	_ym2612_write_local
	ldr	x8, [x20]
	ldr	w1, [x8, x19, lsl #2]
	mov	w0, #1
	mov	w2, #0
	bl	_ym2612_write_local
	mov	w0, #2
	mov	x1, x19
	mov	w2, #0
	bl	_ym2612_write_local
	ldr	x8, [x20]
	and	x9, x19, x21
	add	x8, x8, x9, lsl #2
	ldr	w1, [x8, #1024]
	mov	w0, #3
	mov	w2, #0
	bl	_ym2612_write_local
	add	x19, x19, #1
	cmp	x19, #184
	b.ne	LBB0_7
; %bb.8:
	add	x0, sp, #28
	add	x1, sp, #24
	bl	_YM2612PicoStateLoad2
	cbz	w0, LBB0_10
; %bb.9:
Lloh2:
	adrp	x8, _EL_STATUS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EL_STATUS@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_17
LBB0_10:
	mov	w8, #67108864
	ldp	w9, w12, [x20, #8]
	sub	w8, w8, w9, lsl #16
	mov	w13, #16777216
	ldr	w11, [x20, #16]
Lloh7:
	adrp	x10, _TIMER_NO_OFLOW@GOTPAGE
Lloh8:
	ldr	x10, [x10, _TIMER_NO_OFLOW@GOTPAGEOFF]
	tbnz	w11, #0, LBB0_12
; %bb.11:
	ldr	w9, [x10]
	b	LBB0_13
LBB0_12:
	ldr	w9, [sp, #28]
	sub	w9, w8, w9
	scvtf	d0, w9
	scvtf	d1, w8
	fdiv	d0, d0, d1
Lloh9:
	adrp	x9, _timer_a_step@GOTPAGE
Lloh10:
	ldr	x9, [x9, _timer_a_step@GOTPAGEOFF]
Lloh11:
	ldr	d1, [x9]
	fmul	d0, d1, d0
	fcvtzs	w9, d0
LBB0_13:
	sub	w19, w13, w12, lsl #16
Lloh12:
	adrp	x12, _timer_a_next_oflow@GOTPAGE
Lloh13:
	ldr	x12, [x12, _timer_a_next_oflow@GOTPAGEOFF]
Lloh14:
	str	w9, [x12]
	tbnz	w11, #1, LBB0_15
; %bb.14:
	ldr	w10, [x10]
	b	LBB0_16
LBB0_15:
	ldr	w10, [sp, #24]
	sub	w10, w19, w10
	scvtf	d0, w10
	scvtf	d1, w19
	fdiv	d0, d0, d1
Lloh15:
	adrp	x10, _timer_b_step@GOTPAGE
Lloh16:
	ldr	x10, [x10, _timer_b_step@GOTPAGEOFF]
Lloh17:
	ldr	d1, [x10]
	fmul	d0, d1, d0
	fcvtzs	w10, d0
LBB0_16:
Lloh18:
	adrp	x20, _timer_b_next_oflow@GOTPAGE
Lloh19:
	ldr	x20, [x20, _timer_b_next_oflow@GOTPAGEOFF]
	str	w10, [x20]
Lloh20:
	adrp	x21, _EL_YMTIMER@GOTPAGE
Lloh21:
	ldr	x21, [x21, _EL_YMTIMER@GOTPAGEOFF]
	ldr	w0, [x21]
	asr	w8, w8, #16
	asr	w9, w9, #8
	ldrsh	x10, [sp, #30]
	stp	x8, x9, [sp, #8]
	str	x10, [sp]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elprintf
	ldr	w0, [x21]
	asr	w8, w19, #16
	ldr	w9, [x20]
	asr	w9, w9, #8
	ldrsh	x10, [sp, #26]
	stp	x8, x9, [sp, #8]
	str	x10, [sp]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_17:
	bl	_elprintf
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ym2612,24,3                    ; @ym2612
	.comm	_EL_STATUS,4,2                  ; @EL_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"old ym2612 state"

	.comm	_timer_a_step,8,3               ; @timer_a_step
	.comm	_timer_a_next_oflow,4,2         ; @timer_a_next_oflow
	.comm	_TIMER_NO_OFLOW,4,2             ; @TIMER_NO_OFLOW
	.comm	_timer_b_step,8,3               ; @timer_b_step
	.comm	_timer_b_next_oflow,4,2         ; @timer_b_next_oflow
	.comm	_EL_YMTIMER,4,2                 ; @EL_YMTIMER
l_.str.1:                               ; @.str.1
	.asciz	"load: %i/%i, timer_a_next_oflow %i"

l_.str.2:                               ; @.str.2
	.asciz	"load: %i/%i, timer_b_next_oflow %i"

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