	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SH2SaveState                   ## -- Begin function SH2SaveState
	.p2align	4, 0x90
_SH2SaveState:                          ## @SH2SaveState
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	$0, -56(%rbp)
	cmpq	$0, (%rdi)
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_StateWriteHeader
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_yabsys@GOTPCREL(%rip), %rsi
	leaq	-56(%rbp), %rdi
	movl	$1, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_StateWriteHeader
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_3:
	leaq	-60(%rbp), %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_SH2GetRegisters
	leaq	-56(%rbp), %r13
	movl	$1, %r15d
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	leaq	60(%rbx), %rsi
	movq	%r13, %rdi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	leaq	56(%rbx), %rsi
	movb	56(%rbx), %cl
	shll	%cl, %r15d
	movl	%r15d, 56(%rbx)
	movq	%r13, %rdi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	movl	56(%rbx), %ecx
	xorl	%eax, %eax
	cmpl	$2, %ecx
	jb	LBB0_6
## %bb.4:
	xorl	%eax, %eax
	movl	%ecx, %edx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	sarl	%edx
	incl	%eax
	cmpl	$3, %ecx
	movl	%edx, %ecx
	ja	LBB0_5
LBB0_6:
	movl	%eax, 56(%rbx)
	movq	_SH2Core@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	48(%rbx), %rsi
	movq	%rbx, %rdi
	callq	*(%rax)
	leaq	40(%rbx), %r13
	movl	%eax, 40(%rbx)
	movq	48(%rbx), %rsi
	movq	_MAX_INTERRUPTS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %r12
	movq	%r12, %rdi
	movl	$4, %edx
	movq	%r14, %r8
	callq	_ywrite
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	movq	32(%rbx), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	movl	$256, %ecx                      ## imm = 0x100
	movq	%r14, %r8
	callq	_ywrite
	movq	24(%rbx), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	movl	$4096, %ecx                     ## imm = 0x1000
	movq	%r14, %r8
	callq	_ywrite
	leaq	20(%rbx), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	leaq	16(%rbx), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	leaq	12(%rbx), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	addq	$8, %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$4, %edx
	movl	$1, %ecx
	movq	%r14, %r8
	callq	_ywrite
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_StateFinishHeader
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MSH2"

L_.str.1:                               ## @.str.1
	.asciz	"SSH2"

	.comm	_yabsys,4,2                     ## @yabsys
	.comm	_SH2Core,8,3                    ## @SH2Core
	.comm	_MAX_INTERRUPTS,4,2             ## @MAX_INTERRUPTS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SH2SaveState                   ; -- Begin function SH2SaveState
	.p2align	2
_SH2SaveState:                          ; @SH2SaveState
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	bl	_StateWriteHeader
	mov	x21, x0
Lloh2:
	adrp	x1, _yabsys@GOTPAGE
Lloh3:
	ldr	x1, [x1, _yabsys@GOTPAGEOFF]
	add	x0, sp, #8
	mov	w2, #1
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	b	LBB0_3
LBB0_2:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	bl	_StateWriteHeader
	mov	x21, x0
LBB0_3:
	add	x1, sp, #4
	mov	x0, x20
	bl	_SH2GetRegisters
	mov	w23, #1
	add	x0, sp, #8
	add	x1, sp, #4
	mov	w2, #4
	mov	x4, x19
	mov	w3, #1
	bl	_ywrite
	add	x1, x20, #60
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	mov	x22, x20
	ldr	w8, [x22, #56]!
	lsl	w8, w23, w8
	str	w8, [x22]
	add	x0, sp, #8
	mov	x1, x22
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	ldr	w8, [x22]
	cmp	w8, #2
	b.hs	LBB0_5
; %bb.4:
	mov	w9, #0
	b	LBB0_7
LBB0_5:
	mov	w9, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	asr	w10, w8, #1
	add	w9, w9, #1
	cmp	w8, #3
	mov	x8, x10
	b.hi	LBB0_6
LBB0_7:
	str	w9, [x20, #56]
Lloh6:
	adrp	x8, _SH2Core@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SH2Core@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x1, [x20, #48]
	mov	x0, x20
	blr	x8
	mov	x22, x20
	str	w0, [x22, #40]!
	ldr	x1, [x20, #48]
Lloh9:
	adrp	x8, _MAX_INTERRUPTS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX_INTERRUPTS@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x0, sp, #8
	mov	w2, #4
	mov	x4, x19
	bl	_ywrite
	add	x0, sp, #8
	mov	x1, x22
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	ldr	x1, [x20, #32]
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #256
	mov	x4, x19
	bl	_ywrite
	ldr	x1, [x20, #24]
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #4096
	mov	x4, x19
	bl	_ywrite
	add	x1, x20, #20
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	add	x1, x20, #16
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	add	x0, sp, #8
	mov	x1, x20
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	add	x1, x20, #12
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	add	x1, x20, #8
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #1
	mov	x4, x19
	bl	_ywrite
	mov	x0, x19
	mov	x1, x21
	bl	_StateFinishHeader
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MSH2"

l_.str.1:                               ; @.str.1
	.asciz	"SSH2"

	.comm	_yabsys,4,2                     ; @yabsys
	.comm	_SH2Core,8,3                    ; @SH2Core
	.comm	_MAX_INTERRUPTS,4,2             ; @MAX_INTERRUPTS
.subsections_via_symbols
