	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function md_cart_context_save
LCPI0_0:
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_md_cart_context_save
	.p2align	4, 0x90
_md_cart_context_save:                  ## @md_cart_context_save
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_m68k@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_sram@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r10
	movq	_cart@GOTPCREL(%rip), %r8
	movq	(%r8), %rsi
	leaq	512(%rax), %rcx
	cmpq	%rdi, %rcx
	jbe	LBB0_4
## %bb.1:
	leaq	256(%rdi), %rcx
	cmpq	%rcx, %rax
	jae	LBB0_4
## %bb.2:
	xorl	%ecx, %ecx
	movl	$255, %r9d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rcx,8), %rbx
	movl	%ebx, %edx
	subl	%esi, %edx
	shrl	$18, %edx
	cmpq	%r10, %rbx
	movzbl	%dl, %edx
	cmovel	%r9d, %edx
	movl	%edx, (%rdi,%rcx,4)
	movq	8(%rax,%rcx,8), %rdx
	movl	%edx, %ebx
	subl	%esi, %ebx
	shrl	$18, %ebx
	cmpq	%r10, %rdx
	movzbl	%bl, %edx
	cmovel	%r9d, %edx
	movl	%edx, 4(%rdi,%rcx,4)
	addq	$2, %rcx
	cmpq	$64, %rcx
	jne	LBB0_3
	jmp	LBB0_6
LBB0_4:
	movq	%r10, %xmm0
	pshufd	$68, %xmm0, %xmm1               ## xmm1 = xmm0[0,1,0,1]
	movq	%rsi, %xmm0
	pshufd	$68, %xmm0, %xmm2               ## xmm2 = xmm0[0,1,0,1]
	xorl	%edx, %edx
	movdqa	LCPI0_0(%rip), %xmm3            ## xmm3 = [255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0]
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rax,%rdx,8), %xmm4
	movdqa	%xmm4, %xmm0
	pcmpeqq	%xmm1, %xmm0
	pshufd	$232, %xmm0, %xmm0              ## xmm0 = xmm0[0,2,2,3]
	psubq	%xmm2, %xmm4
	pshufd	$232, %xmm4, %xmm4              ## xmm4 = xmm4[0,2,2,3]
	psrld	$18, %xmm4
	pand	%xmm3, %xmm4
	blendvps	%xmm0, %xmm3, %xmm4
	movlps	%xmm4, (%rdi,%rdx,4)
	movdqu	16(%rax,%rdx,8), %xmm4
	movdqa	%xmm4, %xmm0
	pcmpeqq	%xmm1, %xmm0
	pshufd	$232, %xmm0, %xmm0              ## xmm0 = xmm0[0,2,2,3]
	psubq	%xmm2, %xmm4
	pshufd	$232, %xmm4, %xmm4              ## xmm4 = xmm4[0,2,2,3]
	psrld	$18, %xmm4
	pand	%xmm3, %xmm4
	blendvps	%xmm0, %xmm3, %xmm4
	movlps	%xmm4, 8(%rdi,%rdx,4)
	addq	$4, %rdx
	cmpq	$64, %rdx
	jne	LBB0_5
LBB0_6:
	movq	8(%r8), %rdi
	movl	$8, %esi
	callq	_save_param
	movq	_svp@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	16(%rax), %rdi
	movl	$2048, %esi                     ## imm = 0x800
	callq	_save_param
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	movl	$8, %esi
	callq	_save_param
	movq	(%rbx), %rdi
	movl	$4, %esi
	callq	_save_param
LBB0_8:
	movl	$64, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_m68k,8,3                       ## @m68k
	.comm	_sram,8,3                       ## @sram
	.comm	_cart,16,3                      ## @cart
	.comm	_svp,8,3                        ## @svp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_md_cart_context_save           ; -- Begin function md_cart_context_save
	.p2align	2
_md_cart_context_save:                  ; @md_cart_context_save
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _m68k@GOTPAGE
Lloh1:
	ldr	x8, [x8, _m68k@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x10, _sram@GOTPAGE
Lloh4:
	ldr	x10, [x10, _sram@GOTPAGEOFF]
Lloh5:
	adrp	x9, _cart@GOTPAGE
Lloh6:
	ldr	x9, [x9, _cart@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x10]
	ldr	x10, [x9]
	add	x12, x0, #256
	add	x13, x8, #512
	cmp	x13, x0
	ccmp	x8, x12, #2, hi
	b.lo	LBB0_3
; %bb.1:
	mov	x12, #0
	dup.2d	v0, x11
	dup.2d	v1, x10
	movi	d2, #0x0000ff000000ff
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	q3, [x8], #16
	cmeq.2d	v4, v3, v0
	xtn.2s	v4, v4
	sub.2d	v3, v3, v1
	xtn.2s	v3, v3
	ushr.2s	v3, v3, #18
	orr.8b	v3, v3, v4
	and.8b	v3, v3, v2
	str	d3, [x0, x12]
	add	x12, x12, #8
	cmp	x12, #256
	b.ne	LBB0_2
	b	LBB0_5
LBB0_3:
	mov	x12, #0
	mov	w13, #255
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x8, x12, lsl #3]
	sub	w15, w14, w10
	ubfx	w15, w15, #18, #8
	cmp	x14, x11
	csel	w14, w13, w15, eq
	str	w14, [x0, x12, lsl #2]
	add	x12, x12, #1
	cmp	x12, #64
	b.ne	LBB0_4
LBB0_5:
	ldr	x0, [x9, #8]
	mov	w1, #8
	bl	_save_param
Lloh8:
	adrp	x19, _svp@GOTPAGE
Lloh9:
	ldr	x19, [x19, _svp@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	x0, [x8, #16]
	mov	w1, #2048
	bl	_save_param
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
	mov	w1, #8
	bl	_save_param
	ldr	x0, [x19]
	mov	w1, #4
	bl	_save_param
LBB0_7:
	mov	w0, #64
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_m68k,8,3                       ; @m68k
	.comm	_sram,8,3                       ; @sram
	.comm	_cart,16,3                      ; @cart
	.comm	_svp,8,3                        ; @svp
.subsections_via_symbols
