	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function load_rom
LCPI0_0:
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_load_rom
	.p2align	4, 0x90
_load_rom:                              ## @load_rom
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ggenie_shutdown
	xorl	%eax, %eax
	callq	_areplay_shutdown
	movq	_cart@GOTPCREL(%rip), %r12
	cmpl	$8388609, (%r12)                ## imm = 0x800001
	jl	LBB0_2
## %bb.1:
	movq	_cdd@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
LBB0_2:
	movq	8(%r12), %rsi
	movq	%r14, %rdi
	callq	_cdd_load
	testl	%eax, %eax
	js	LBB0_136
## %bb.3:
	je	LBB0_5
## %bb.4:
	movl	%eax, %r15d
	movq	_SYSTEM_MCD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_system_hw@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_48:
	movl	%r15d, (%r12)
	movq	8(%r12), %rdi
	callq	_getrominfo
	movq	8(%r12), %rdi
	callq	_get_region
	movq	_system_hw@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movq	_SYSTEM_MCD@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jne	LBB0_52
## %bb.49:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_load_bios
	testq	%rax, %rax
	je	LBB0_50
## %bb.51:
	movq	_scd@GOTPCREL(%rip), %rax
	movl	$0, 8(%rax)
	movl	(%r13), %eax
LBB0_52:
	movq	_romtype@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_rominfo@GOTPCREL(%rip), %rbx
	movl	16(%rbx), %edi
	leaq	L_.str.7(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_54
## %bb.53:
	movq	%rbx, %r14
	movq	_SYSTEM_PICO@GOTPCREL(%rip), %rax
LBB0_64:
	movl	(%rax), %eax
	movl	%eax, (%r13)
	jmp	LBB0_65
LBB0_5:
	movq	8(%r12), %rsi
	leaq	-44(%rbp), %rcx
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_load_archive
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %r15d
	movl	$-17, %eax
	cmpl	$8388608, %r15d                 ## imm = 0x800000
	jg	LBB0_10
## %bb.8:
	cmpl	$4194305, %r15d                 ## imm = 0x400001
	jl	LBB0_11
## %bb.9:
	movq	_SYSTEM_SMS@GOTPCREL(%rip), %rcx
	movq	_SYSTEM_GG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	notl	%eax
LBB0_10:
	movq	_system_bios@GOTPCREL(%rip), %rcx
	andl	%eax, (%rcx)
LBB0_11:
	andl	$-538976289, -44(%rbp)          ## imm = 0xDFDFDFDF
	leaq	L_.str(%rip), %rdi
	leaq	-44(%rbp), %rsi
	movl	$3, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_12
## %bb.14:
	leaq	-43(%rbp), %rbx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movq	_SYSTEM_MD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_system_hw@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leaq	L_.str.3(%rip), %rdi
	leaq	-44(%rbp), %rsi
	movl	$3, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_31
## %bb.19:
	cmpl	$6, %r15d
	jl	LBB0_30
## %bb.20:
	leal	-1(%r15), %eax
	movq	8(%r12), %rcx
	leaq	-4(%rax), %r8
	movl	$4, %edx
	cmpq	$8, %r8
	jb	LBB0_29
## %bb.21:
	movq	%r8, %rdx
	andq	$-8, %rdx
	leaq	-8(%rdx), %rdi
	movq	%rdi, %rsi
	shrq	$3, %rsi
	incq	%rsi
	testq	%rdi, %rdi
	je	LBB0_22
## %bb.23:
	movq	%rsi, %rbx
	andq	$-2, %rbx
	xorl	%edi, %edi
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [64,64,64,64]
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movdqu	16(%rcx,%rdi,4), %xmm1
	movdqu	32(%rcx,%rdi,4), %xmm2
	movdqu	48(%rcx,%rdi,4), %xmm3
	movdqu	64(%rcx,%rdi,4), %xmm4
	pxor	%xmm0, %xmm1
	pxor	%xmm0, %xmm2
	movdqu	%xmm1, (%rcx,%rdi,4)
	movdqu	%xmm2, 16(%rcx,%rdi,4)
	pxor	%xmm0, %xmm3
	pxor	%xmm0, %xmm4
	movdqu	%xmm3, 32(%rcx,%rdi,4)
	movdqu	%xmm4, 48(%rcx,%rdi,4)
	addq	$16, %rdi
	addq	$-2, %rbx
	jne	LBB0_24
	jmp	LBB0_25
LBB0_54:
	movl	12(%rbx), %edi
	leaq	L_.str.8(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_56
## %bb.55:
	movq	%rbx, %r14
	movl	(%r15), %eax
	movl	%eax, (%r13)
	movq	_scd@GOTPCREL(%rip), %rax
	movl	$0, 8(%rax)
	movq	(%rax), %rdi
	movq	8(%r12), %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	_system_bios@GOTPCREL(%rip), %rax
	movl	$224, %ecx
	andl	(%rax), %ecx
	movq	_region_code@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	sarl	$4, %edx
	orl	%ecx, %edx
	orl	$16, %edx
	movl	%edx, (%rax)
LBB0_65:
	movq	_config@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_66:
	movq	_SYSTEM_MD@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_69
## %bb.67:
	testl	%ecx, (%r13)
	movq	%r14, %rbx
	jne	LBB0_74
## %bb.68:
	movq	_SYSTEM_PBC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	jmp	LBB0_73
LBB0_69:
	movq	_SYSTEM_GG@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	movq	%r14, %rbx
	jne	LBB0_72
## %bb.70:
	cmpl	%ecx, (%r13)
	je	LBB0_74
## %bb.71:
	movq	_SYSTEM_GGMS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	jmp	LBB0_73
LBB0_72:
	testl	%ecx, %ecx
	je	LBB0_74
LBB0_73:
	movl	%ecx, (%r13)
LBB0_74:
	movq	_old_system@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %ecx
	cmpl	$-1, %ecx
	je	LBB0_76
## %bb.75:
	movq	_input@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%ecx, (%rdx)
LBB0_76:
	movl	4(%rax), %eax
	movq	_input@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	cmpl	$-1, %eax
	je	LBB0_77
## %bb.78:
	movl	%eax, 4(%rcx)
	jmp	LBB0_79
LBB0_77:
	movl	4(%rcx), %eax
LBB0_79:
	cltq
	movq	_SYSTEM_MENACER@GOTPCREL(%rip), %r14
	xorl	%ecx, %ecx
	cmpq	%rax, (%r14)
	sete	%cl
	shll	$6, %ecx
	movl	%ecx, 8(%r15)
	movl	$0, 12(%r15)
	movl	(%rbx), %edi
	leaq	L_.str.13(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_85
## %bb.80:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_82
## %bb.81:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_82:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_84
## %bb.83:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_84:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movq	$82, 8(%r15)
	jmp	LBB0_135
LBB0_85:
	movl	(%rbx), %edi
	leaq	L_.str.14(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_92
## %bb.86:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_88
## %bb.87:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_88:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_90
## %bb.89:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_90:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movabsq	$-34359738235, %rax             ## imm = 0xFFFFFFF800000085
	movq	%rax, 8(%r15)
	jmp	LBB0_135
LBB0_50:
	xorl	%eax, %eax
	callq	_cdd_unload
	jmp	LBB0_136
LBB0_6:
	movq	_SYSTEM_SMS@GOTPCREL(%rip), %rax
	movq	_SYSTEM_GG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	movq	_system_bios@GOTPCREL(%rip), %rax
	andl	(%rax), %ecx
	andl	$-17, %ecx
	movl	%ecx, (%rax)
	jmp	LBB0_136
LBB0_56:
	movq	%r14, %r12
	movl	8(%rbx), %edi
	leaq	L_.str.9(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	jne	LBB0_59
## %bb.57:
	movl	8(%rbx), %edi
	leaq	L_.str.10(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_58
LBB0_59:
	movq	%rbx, %r14
	movq	_config@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_60:
	testl	%ecx, %ecx
	jne	LBB0_66
## %bb.61:
	movl	(%r15), %eax
	movl	%eax, (%r13)
	xorl	%eax, %eax
	callq	_load_bios
	testq	%rax, %rax
	je	LBB0_63
## %bb.62:
	movq	_scd@GOTPCREL(%rip), %rax
	movl	$64, 8(%rax)
	movq	%r12, %rbx
	movq	%r12, %rdi
	callq	_strlen
	cltq
	leaq	(%rax,%r12), %rdi
	addq	$-4, %rdi
	leaq	L_.str.12(%rip), %rsi
	movl	$4, %edx
	callq	_strncpy
	movq	_cdc@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_cdd_load
	jmp	LBB0_65
LBB0_92:
	movl	(%rbx), %edi
	leaq	L_.str.15(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_98
## %bb.93:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_95
## %bb.94:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_95:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_97
## %bb.96:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_97:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movabsq	$-103079215036, %rax            ## imm = 0xFFFFFFE800000044
	movq	%rax, 8(%r15)
	jmp	LBB0_135
LBB0_12:
	movq	_SYSTEM_SMS2@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_15:
	movq	_SYSTEM_GG@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_98:
	movl	(%rbx), %edi
	leaq	L_.str.16(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_104
## %bb.99:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_101
## %bb.100:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_101:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_103
## %bb.102:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_103:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movabsq	$-34359738304, %rax             ## imm = 0xFFFFFFF800000040
	movq	%rax, 8(%r15)
	jmp	LBB0_135
LBB0_17:
	movq	_SYSTEM_SG@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %eax
	movq	_system_hw@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_40:
	movl	$1024, %edi                     ## imm = 0x400
	addq	8(%r12), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	$4, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_48
## %bb.41:
	leal	511(%r15), %eax
	testl	%r15d, %r15d
	cmovnsl	%r15d, %eax
	btl	$9, %eax
	jae	LBB0_48
## %bb.42:
	movl	%r15d, %eax
	andl	$511, %eax                      ## imm = 0x1FF
	jne	LBB0_48
## %bb.43:
	leal	-512(%r15), %r13d
	movq	8(%r12), %rdi
	leaq	2048(%rdi), %rsi
	movl	%r13d, %edx
	callq	_memcpy
	movq	_system_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SYSTEM_MD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_47
## %bb.44:
	cmpl	$16896, %r15d                   ## imm = 0x4200
	jl	LBB0_47
## %bb.45:
	movl	%r13d, %r15d
	shrl	$14, %r15d
	shlq	$16, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_46:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rdi
	addq	%rbx, %rdi
	callq	_deinterleave_block
	addq	$65536, %rbx                    ## imm = 0x10000
	cmpq	%rbx, %r15
	jne	LBB0_46
LBB0_47:
	movl	%r13d, %r15d
	jmp	LBB0_48
LBB0_63:
	movq	_SYSTEM_MD@GOTPCREL(%rip), %rax
	jmp	LBB0_64
LBB0_58:
	movq	%rbx, %r14
	movl	4(%rbx), %edi
	leaq	L_.str.11(%rip), %rsi
	callq	_strstr
	movq	_config@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testq	%rax, %rax
	jne	LBB0_60
	jmp	LBB0_66
LBB0_104:
	movl	(%rbx), %edi
	leaq	L_.str.17(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_110
## %bb.105:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_107
## %bb.106:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_107:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_109
## %bb.108:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_109:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movq	$61, 8(%r15)
	jmp	LBB0_135
LBB0_110:
	movl	(%rbx), %edi
	leaq	L_.str.18(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_116
## %bb.111:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_113
## %bb.112:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_113:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_115
## %bb.114:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_115:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movabsq	$77309411398, %rax              ## imm = 0x1200000046
	movq	%rax, 8(%r15)
	jmp	LBB0_135
LBB0_22:
	xorl	%edi, %edi
LBB0_25:
	testb	$1, %sil
	je	LBB0_27
## %bb.26:
	leaq	(,%rdi,4), %rsi
	orq	$16, %rsi
	movdqu	(%rcx,%rsi), %xmm0
	movdqu	16(%rcx,%rsi), %xmm1
	movdqa	LCPI0_0(%rip), %xmm2            ## xmm2 = [64,64,64,64]
	pxor	%xmm2, %xmm0
	pxor	%xmm2, %xmm1
	movdqu	%xmm0, (%rcx,%rdi,4)
	movdqu	%xmm1, 16(%rcx,%rdi,4)
LBB0_27:
	cmpq	%rdx, %r8
	je	LBB0_30
## %bb.28:
	orq	$4, %rdx
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdx,4), %esi
	xorl	$64, %esi
	movl	%esi, -16(%rcx,%rdx,4)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_29
LBB0_30:
	addl	$-5, %r15d
LBB0_31:
	movl	$1024, %ebx                     ## imm = 0x400
	movq	8(%r12), %rdi
	addq	%rbx, %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	$16, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_33
## %bb.32:
	addq	8(%r12), %rbx
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	movl	$12, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_40
LBB0_33:
	testl	%r15d, %r15d
	jle	LBB0_40
## %bb.34:
	movq	8(%r12), %rax
	movl	%r15d, %ecx
	cmpq	$3, %rcx
	movl	$2, %esi
	cmovaeq	%rcx, %rsi
	decq	%rsi
	cmpq	$6, %rsi
	jae	LBB0_36
## %bb.35:
	xorl	%edx, %edx
	jmp	LBB0_39
LBB0_36:
	shrq	%rsi
	incq	%rsi
	movabsq	$9223372036854775804, %rdi      ## imm = 0x7FFFFFFFFFFFFFFC
	andq	%rsi, %rdi
	leaq	(%rdi,%rdi), %rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_37:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rax,%rbx,8), %xmm0
	movdqu	16(%rax,%rbx,8), %xmm1
	pshufd	$177, %xmm0, %xmm0              ## xmm0 = xmm0[1,0,3,2]
	movdqu	%xmm0, (%rax,%rbx,8)
	pshufd	$177, %xmm1, %xmm0              ## xmm0 = xmm1[1,0,3,2]
	movdqu	%xmm0, 16(%rax,%rbx,8)
	addq	$4, %rbx
	cmpq	%rbx, %rdi
	jne	LBB0_37
## %bb.38:
	cmpq	%rdi, %rsi
	je	LBB0_40
	.p2align	4, 0x90
LBB0_39:                                ## =>This Inner Loop Header: Depth=1
	rolq	$32, (%rax,%rdx,4)
	addq	$2, %rdx
	cmpq	%rcx, %rdx
	jb	LBB0_39
	jmp	LBB0_40
LBB0_116:
	movl	(%rbx), %edi
	leaq	L_.str.19(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_122
## %bb.117:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_119
## %bb.118:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_119:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_121
## %bb.120:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_121:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movq	$49, 8(%r15)
	jmp	LBB0_135
LBB0_122:
	movl	(%rbx), %edi
	leaq	L_.str.20(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_128
## %bb.123:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_125
## %bb.124:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_125:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_127
## %bb.126:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_127:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movl	%eax, 4(%rcx)
	movabsq	$128849018940, %rax             ## imm = 0x1E0000003C
	movq	%rax, 8(%r15)
	jmp	LBB0_135
LBB0_128:
	movl	(%rbx), %edi
	leaq	L_.str.21(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	jne	LBB0_130
## %bb.129:
	movl	(%rbx), %edi
	leaq	L_.str.22(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_135
LBB0_130:
	movq	(%r12), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_132
## %bb.131:
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
LBB0_132:
	cmpl	$-1, 4(%rax)
	movq	(%r15), %rcx
	jne	LBB0_134
## %bb.133:
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
LBB0_134:
	movq	_SYSTEM_MD_GAMEPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movq	_SYSTEM_JUSTIFIER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rcx)
	movl	(%rbx), %edi
	leaq	L_.str.23(%rip), %rsi
	callq	_strstr
	xorl	%ecx, %ecx
	testq	%rax, %rax
	movl	$24, %eax
	cmovel	%ecx, %eax
	movl	%eax, 8(%r15)
	movl	$0, 12(%r15)
LBB0_135:
	movl	$1, %ebx
LBB0_136:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cart,16,3                      ## @cart
	.comm	_cdd,8,3                        ## @cdd
	.comm	_SYSTEM_MCD,4,2                 ## @SYSTEM_MCD
	.comm	_system_hw,4,2                  ## @system_hw
	.comm	_SYSTEM_SMS,4,2                 ## @SYSTEM_SMS
	.comm	_SYSTEM_GG,4,2                  ## @SYSTEM_GG
	.comm	_system_bios,4,2                ## @system_bios
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SMS"

	.comm	_SYSTEM_SMS2,4,2                ## @SYSTEM_SMS2
L_.str.1:                               ## @.str.1
	.asciz	"GG"

L_.str.2:                               ## @.str.2
	.asciz	"SG"

	.comm	_SYSTEM_SG,4,2                  ## @SYSTEM_SG
	.comm	_SYSTEM_MD,4,2                  ## @SYSTEM_MD
L_.str.3:                               ## @.str.3
	.asciz	"MDX"

L_.str.4:                               ## @.str.4
	.asciz	"ESAGM GE ARDVI E"

L_.str.5:                               ## @.str.5
	.asciz	"ESAGG NESESI"

L_.str.6:                               ## @.str.6
	.asciz	"SEGA"

	.comm	_scd,16,3                       ## @scd
	.comm	_romtype,4,2                    ## @romtype
	.comm	_rominfo,20,2                   ## @rominfo
L_.str.7:                               ## @.str.7
	.asciz	"SEGA PICO"

	.comm	_SYSTEM_PICO,4,2                ## @SYSTEM_PICO
L_.str.8:                               ## @.str.8
	.asciz	"BR"

	.comm	_region_code,4,2                ## @region_code
L_.str.9:                               ## @.str.9
	.asciz	"FLUX"

L_.str.10:                              ## @.str.10
	.asciz	"WONDER LIBRARY"

L_.str.11:                              ## @.str.11
	.asciz	"T-5740"

	.comm	_config,4,2                     ## @config
L_.str.12:                              ## @.str.12
	.asciz	".iso"

	.comm	_cdc,8,3                        ## @cdc
	.comm	_SYSTEM_PBC,4,2                 ## @SYSTEM_PBC
	.comm	_SYSTEM_GGMS,4,2                ## @SYSTEM_GGMS
	.comm	_old_system,8,3                 ## @old_system
	.comm	_input,16,3                     ## @input
	.comm	_SYSTEM_MENACER,8,3             ## @SYSTEM_MENACER
L_.str.13:                              ## @.str.13
	.asciz	"MENACER"

	.comm	_SYSTEM_MD_GAMEPAD,8,3          ## @SYSTEM_MD_GAMEPAD
L_.str.14:                              ## @.str.14
	.asciz	"T2 ; THE ARCADE GAME"

L_.str.15:                              ## @.str.15
	.asciz	"BODY COUNT"

L_.str.16:                              ## @.str.16
	.asciz	"CORPSE KILLER"

L_.str.17:                              ## @.str.17
	.asciz	"CRIME PATROL"

L_.str.18:                              ## @.str.18
	.asciz	"MAD DOG II THE LOST GOLD"

L_.str.19:                              ## @.str.19
	.asciz	"MAD DOG MCCREE"

L_.str.20:                              ## @.str.20
	.asciz	"WHO SHOT JOHNNY ROCK?"

L_.str.21:                              ## @.str.21
	.asciz	"LETHAL ENFORCERS"

L_.str.22:                              ## @.str.22
	.asciz	"SNATCHER"

	.comm	_SYSTEM_JUSTIFIER,4,2           ## @SYSTEM_JUSTIFIER
L_.str.23:                              ## @.str.23
	.asciz	"GUN FIGHTERS"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function load_rom
lCPI0_0:
	.long	82                              ; 0x52
	.long	0                               ; 0x0
lCPI0_1:
	.long	133                             ; 0x85
	.long	4294967288                      ; 0xfffffff8
lCPI0_2:
	.long	68                              ; 0x44
	.long	4294967272                      ; 0xffffffe8
lCPI0_3:
	.long	64                              ; 0x40
	.long	4294967288                      ; 0xfffffff8
lCPI0_4:
	.long	61                              ; 0x3d
	.long	0                               ; 0x0
lCPI0_5:
	.long	70                              ; 0x46
	.long	18                              ; 0x12
lCPI0_6:
	.long	49                              ; 0x31
	.long	0                               ; 0x0
lCPI0_7:
	.long	60                              ; 0x3c
	.long	30                              ; 0x1e
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_load_rom
	.p2align	2
_load_rom:                              ; @load_rom
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	bl	_ggenie_shutdown
	bl	_areplay_shutdown
Lloh0:
	adrp	x24, _cart@GOTPAGE
Lloh1:
	ldr	x24, [x24, _cart@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #2048, lsl #12              ; =8388608
	b.le	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _cdd@GOTPAGE
Lloh3:
	ldr	x8, [x8, _cdd@GOTPAGEOFF]
Lloh4:
	str	xzr, [x8]
LBB0_2:
	ldr	x1, [x24, #8]
	mov	x0, x19
	bl	_cdd_load
	tbnz	w0, #31, LBB0_11
; %bb.3:
	mov	x20, x0
Lloh5:
	adrp	x22, _system_hw@GOTPAGE
Lloh6:
	ldr	x22, [x22, _system_hw@GOTPAGEOFF]
Lloh7:
	adrp	x23, _SYSTEM_MCD@GOTPAGE
Lloh8:
	ldr	x23, [x23, _SYSTEM_MCD@GOTPAGEOFF]
	cbz	w0, LBB0_12
; %bb.4:
	ldr	w8, [x23]
	str	w8, [x22]
LBB0_5:
	str	w20, [x24]
	ldr	x0, [x24, #8]
	bl	_getrominfo
	ldr	x0, [x24, #8]
	bl	_get_region
	ldr	w8, [x22]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
	bl	_load_bios
	cbz	x0, LBB0_43
; %bb.7:
Lloh9:
	adrp	x8, _scd@GOTPAGE
Lloh10:
	ldr	x8, [x8, _scd@GOTPAGEOFF]
Lloh11:
	str	wzr, [x8, #8]
	ldr	w8, [x22]
LBB0_8:
Lloh12:
	adrp	x9, _romtype@GOTPAGE
Lloh13:
	ldr	x9, [x9, _romtype@GOTPAGEOFF]
Lloh14:
	str	w8, [x9]
Lloh15:
	adrp	x20, _rominfo@GOTPAGE
Lloh16:
	ldr	x20, [x20, _rominfo@GOTPAGEOFF]
	ldr	w0, [x20, #16]
Lloh17:
	adrp	x1, l_.str.7@PAGE
Lloh18:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_strstr
Lloh19:
	adrp	x25, _config@GOTPAGE
Lloh20:
	ldr	x25, [x25, _config@GOTPAGEOFF]
Lloh21:
	adrp	x21, _SYSTEM_MD@GOTPAGE
Lloh22:
	ldr	x21, [x21, _SYSTEM_MD@GOTPAGEOFF]
	cbz	x0, LBB0_15
; %bb.9:
Lloh23:
	adrp	x8, _SYSTEM_PICO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SYSTEM_PICO@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
LBB0_10:
	str	w8, [x22]
	b	LBB0_17
LBB0_11:
	mov	w0, #0
	b	LBB0_133
LBB0_12:
	ldr	x1, [x24, #8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w2, #8
	bl	_load_archive
	cbz	w0, LBB0_44
; %bb.13:
	mov	x20, x0
	cmp	w0, #2048, lsl #12              ; =8388608
	b.le	LBB0_45
; %bb.14:
	mov	w8, #-17
	b	LBB0_47
LBB0_15:
	ldr	w0, [x20, #12]
Lloh26:
	adrp	x1, l_.str.8@PAGE
Lloh27:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_55
; %bb.16:
	ldr	w8, [x23]
	str	w8, [x22]
Lloh28:
	adrp	x8, _scd@GOTPAGE
Lloh29:
	ldr	x8, [x8, _scd@GOTPAGEOFF]
	str	wzr, [x8, #8]
	ldr	x0, [x8]
	ldr	x1, [x24, #8]
	mov	w2, #8
	bl	_memcpy
Lloh30:
	adrp	x8, _system_bios@GOTPAGE
Lloh31:
	ldr	x8, [x8, _system_bios@GOTPAGEOFF]
	ldr	w9, [x8]
	and	w9, w9, #0xe0
Lloh32:
	adrp	x10, _region_code@GOTPAGE
Lloh33:
	ldr	x10, [x10, _region_code@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	orr	w9, w9, w10, asr #4
	orr	w9, w9, #0x10
	str	w9, [x8]
LBB0_17:
	ldr	w8, [x25]
LBB0_18:
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_21
; %bb.19:
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_26
; %bb.20:
Lloh35:
	adrp	x8, _SYSTEM_PBC@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SYSTEM_PBC@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	b	LBB0_25
LBB0_21:
Lloh38:
	adrp	x9, _SYSTEM_GG@GOTPAGE
Lloh39:
	ldr	x9, [x9, _SYSTEM_GG@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_24
; %bb.22:
	ldr	w9, [x22]
	cmp	w9, w8
	b.eq	LBB0_26
; %bb.23:
Lloh41:
	adrp	x8, _SYSTEM_GGMS@GOTPAGE
Lloh42:
	ldr	x8, [x8, _SYSTEM_GGMS@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	b	LBB0_25
LBB0_24:
	cbz	w8, LBB0_26
LBB0_25:
	str	w8, [x22]
LBB0_26:
Lloh44:
	adrp	x22, _old_system@GOTPAGE
Lloh45:
	ldr	x22, [x22, _old_system@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w9, [x8]
Lloh46:
	adrp	x19, _input@GOTPAGE
Lloh47:
	ldr	x19, [x19, _input@GOTPAGEOFF]
	cmn	w9, #1
	b.eq	LBB0_28
; %bb.27:
	ldr	x10, [x19]
	str	w9, [x10]
LBB0_28:
	ldr	w8, [x8, #4]
	ldr	x9, [x19]
	cmn	w8, #1
	b.eq	LBB0_30
; %bb.29:
	str	w8, [x9, #4]
	b	LBB0_31
LBB0_30:
	ldr	w8, [x9, #4]
LBB0_31:
Lloh48:
	adrp	x21, _SYSTEM_MENACER@GOTPAGE
Lloh49:
	ldr	x21, [x21, _SYSTEM_MENACER@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x9, w8, sxtw
	cset	w8, eq
	lsl	w8, w8, #6
	stp	w8, wzr, [x19, #8]
	ldr	w0, [x20]
Lloh50:
	adrp	x1, l_.str.13@PAGE
Lloh51:
	add	x1, x1, l_.str.13@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_37
; %bb.32:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_34
; %bb.33:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_34:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_36
; %bb.35:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_36:
Lloh52:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh53:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh54:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh55:
	adrp	x8, lCPI0_0@PAGE
Lloh56:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_37:
	ldr	w0, [x20]
Lloh57:
	adrp	x1, l_.str.14@PAGE
Lloh58:
	add	x1, x1, l_.str.14@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_60
; %bb.38:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_40
; %bb.39:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_40:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_42
; %bb.41:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_42:
Lloh59:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh60:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh61:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh62:
	adrp	x8, lCPI0_1@PAGE
Lloh63:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_43:
	bl	_cdd_unload
	mov	w0, #0
	b	LBB0_133
LBB0_44:
Lloh64:
	adrp	x8, _SYSTEM_SMS@GOTPAGE
Lloh65:
	ldr	x8, [x8, _SYSTEM_SMS@GOTPAGEOFF]
Lloh66:
	ldr	w8, [x8]
Lloh67:
	adrp	x9, _SYSTEM_GG@GOTPAGE
Lloh68:
	ldr	x9, [x9, _SYSTEM_GG@GOTPAGEOFF]
Lloh69:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh70:
	adrp	x9, _system_bios@GOTPAGE
Lloh71:
	ldr	x9, [x9, _system_bios@GOTPAGEOFF]
	ldr	w10, [x9]
	bic	w8, w10, w8
	and	w8, w8, #0xffffffef
	str	w8, [x9]
	b	LBB0_133
LBB0_45:
	cmp	w20, #1024, lsl #12             ; =4194304
	b.le	LBB0_48
; %bb.46:
Lloh72:
	adrp	x8, _SYSTEM_SMS@GOTPAGE
Lloh73:
	ldr	x8, [x8, _SYSTEM_SMS@GOTPAGEOFF]
Lloh74:
	ldr	w8, [x8]
Lloh75:
	adrp	x9, _SYSTEM_GG@GOTPAGE
Lloh76:
	ldr	x9, [x9, _SYSTEM_GG@GOTPAGEOFF]
Lloh77:
	ldr	w9, [x9]
	orr	w8, w9, w8
	mvn	w8, w8
LBB0_47:
Lloh78:
	adrp	x9, _system_bios@GOTPAGE
Lloh79:
	ldr	x9, [x9, _system_bios@GOTPAGEOFF]
	ldr	w10, [x9]
	and	w8, w10, w8
	str	w8, [x9]
LBB0_48:
	ldr	w8, [sp, #12]
	and	w8, w8, #0xdfdfdfdf
	str	w8, [sp, #12]
Lloh80:
	adrp	x0, l_.str@PAGE
Lloh81:
	add	x0, x0, l_.str@PAGEOFF
	add	x21, sp, #12
	add	x1, sp, #12
	mov	w2, #3
	bl	_memcmp
	cbz	x0, LBB0_66
; %bb.49:
	orr	x21, x21, #0x1
Lloh82:
	adrp	x0, l_.str.1@PAGE
Lloh83:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	w2, #2
	bl	_memcmp
	cbz	x0, LBB0_67
; %bb.50:
Lloh84:
	adrp	x0, l_.str.2@PAGE
Lloh85:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	mov	w2, #2
	bl	_memcmp
	cbz	x0, LBB0_74
; %bb.51:
Lloh86:
	adrp	x8, _SYSTEM_MD@GOTPAGE
Lloh87:
	ldr	x8, [x8, _SYSTEM_MD@GOTPAGEOFF]
Lloh88:
	ldr	w8, [x8]
	str	w8, [x22]
Lloh89:
	adrp	x0, l_.str.3@PAGE
Lloh90:
	add	x0, x0, l_.str.3@PAGEOFF
	add	x1, sp, #12
	mov	w2, #3
	bl	_memcmp
	cbnz	x0, LBB0_98
; %bb.52:
	cmp	w20, #6
	b.lt	LBB0_97
; %bb.53:
	sub	w8, w20, #1
	ldr	x9, [x24, #8]
	sub	x11, x8, #4
	cmp	x11, #16
	b.hs	LBB0_92
; %bb.54:
	mov	w10, #4
	b	LBB0_95
LBB0_55:
	ldr	w0, [x20, #8]
Lloh91:
	adrp	x1, l_.str.9@PAGE
Lloh92:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_strstr
	cbnz	x0, LBB0_57
; %bb.56:
	ldr	w0, [x20, #8]
Lloh93:
	adrp	x1, l_.str.10@PAGE
Lloh94:
	add	x1, x1, l_.str.10@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_84
LBB0_57:
	ldr	w8, [x25]
	cbnz	w8, LBB0_18
LBB0_58:
	ldr	w8, [x23]
	str	w8, [x22]
	bl	_load_bios
	cbz	x0, LBB0_83
; %bb.59:
Lloh95:
	adrp	x8, _scd@GOTPAGE
Lloh96:
	ldr	x8, [x8, _scd@GOTPAGEOFF]
	mov	w9, #64
Lloh97:
	str	w9, [x8, #8]
	mov	x0, x19
	bl	_strlen
	sub	w8, w0, #4
	add	x0, x19, w8, sxtw
Lloh98:
	adrp	x1, l_.str.12@PAGE
Lloh99:
	add	x1, x1, l_.str.12@PAGEOFF
	mov	w2, #4
	bl	_strncpy
Lloh100:
	adrp	x8, _cdc@GOTPAGE
Lloh101:
	ldr	x8, [x8, _cdc@GOTPAGEOFF]
Lloh102:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_cdd_load
	b	LBB0_17
LBB0_60:
	ldr	w0, [x20]
Lloh103:
	adrp	x1, l_.str.15@PAGE
Lloh104:
	add	x1, x1, l_.str.15@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_68
; %bb.61:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_63
; %bb.62:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_63:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_65
; %bb.64:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_65:
Lloh105:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh106:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh107:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh108:
	adrp	x8, lCPI0_2@PAGE
Lloh109:
	ldr	d0, [x8, lCPI0_2@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_66:
Lloh110:
	adrp	x8, _SYSTEM_SMS2@GOTPAGE
Lloh111:
	ldr	x8, [x8, _SYSTEM_SMS2@GOTPAGEOFF]
	b	LBB0_75
LBB0_67:
Lloh112:
	adrp	x8, _SYSTEM_GG@GOTPAGE
Lloh113:
	ldr	x8, [x8, _SYSTEM_GG@GOTPAGEOFF]
	b	LBB0_75
LBB0_68:
	ldr	w0, [x20]
Lloh114:
	adrp	x1, l_.str.16@PAGE
Lloh115:
	add	x1, x1, l_.str.16@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_86
; %bb.69:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_71
; %bb.70:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_71:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_73
; %bb.72:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_73:
Lloh116:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh117:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh118:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh119:
	adrp	x8, lCPI0_3@PAGE
Lloh120:
	ldr	d0, [x8, lCPI0_3@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_74:
Lloh121:
	adrp	x8, _SYSTEM_SG@GOTPAGE
Lloh122:
	ldr	x8, [x8, _SYSTEM_SG@GOTPAGEOFF]
LBB0_75:
	ldr	w8, [x8]
	str	w8, [x22]
LBB0_76:
	ldr	x8, [x24, #8]
	add	x0, x8, #1024
Lloh123:
	adrp	x1, l_.str.6@PAGE
Lloh124:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w2, #4
	bl	_memcmp
	cbz	x0, LBB0_5
; %bb.77:
	add	w8, w20, #511
	cmp	w20, #0
	csel	w8, w8, w20, lt
	tbz	w8, #9, LBB0_5
; %bb.78:
	and	w8, w20, #0x1ff
	cbnz	w8, LBB0_5
; %bb.79:
	sub	w21, w20, #512
	ldr	x0, [x24, #8]
	add	x1, x0, #2048
	mov	x2, x21
	bl	_memcpy
	ldr	w8, [x22]
Lloh125:
	adrp	x9, _SYSTEM_MD@GOTPAGE
Lloh126:
	ldr	x9, [x9, _SYSTEM_MD@GOTPAGEOFF]
Lloh127:
	ldr	w9, [x9]
	cmp	w8, w9
	mov	w8, #16896
	ccmp	w20, w8, #8, eq
	b.lt	LBB0_82
; %bb.80:
	mov	x20, #0
	lsr	w8, w21, #14
	lsl	x25, x8, #16
LBB0_81:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	add	x0, x8, x20
	bl	_deinterleave_block
	add	x20, x20, #16, lsl #12          ; =65536
	cmp	x25, x20
	b.ne	LBB0_81
LBB0_82:
	mov	x20, x21
	b	LBB0_5
LBB0_83:
	ldr	w8, [x21]
	b	LBB0_10
LBB0_84:
	ldr	w0, [x20, #4]
Lloh128:
	adrp	x1, l_.str.11@PAGE
Lloh129:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_strstr
	ldr	w8, [x25]
	cbz	x0, LBB0_18
; %bb.85:
	cbz	w8, LBB0_58
	b	LBB0_18
LBB0_86:
	ldr	w0, [x20]
Lloh130:
	adrp	x1, l_.str.17@PAGE
Lloh131:
	add	x1, x1, l_.str.17@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_107
; %bb.87:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_89
; %bb.88:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_89:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_91
; %bb.90:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_91:
Lloh132:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh133:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh134:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh135:
	adrp	x8, lCPI0_4@PAGE
Lloh136:
	ldr	d0, [x8, lCPI0_4@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_92:
	and	x12, x11, #0xfffffffffffffff0
	orr	x10, x12, #0x4
	add	x13, x9, #32
	movi.4s	v0, #64
	mov	x14, x12
LBB0_93:                                ; =>This Inner Loop Header: Depth=1
	ldp	q1, q2, [x13, #-16]
	ldp	q3, q4, [x13, #16]
	eor.16b	v1, v1, v0
	eor.16b	v2, v2, v0
	eor.16b	v3, v3, v0
	eor.16b	v4, v4, v0
	stp	q1, q2, [x13, #-32]
	stp	q3, q4, [x13], #64
	subs	x14, x14, #16
	b.ne	LBB0_93
; %bb.94:
	cmp	x11, x12
	b.eq	LBB0_97
LBB0_95:
	add	x9, x9, x10, lsl #2
	sub	x8, x8, x10
LBB0_96:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	eor	w10, w10, #0x40
	stur	w10, [x9, #-16]
	add	x9, x9, #4
	subs	x8, x8, #1
	b.ne	LBB0_96
LBB0_97:
	sub	w20, w20, #5
LBB0_98:
	ldr	x8, [x24, #8]
	add	x0, x8, #1024
Lloh137:
	adrp	x1, l_.str.4@PAGE
Lloh138:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w2, #16
	bl	_memcmp
	cbz	x0, LBB0_100
; %bb.99:
	ldr	x8, [x24, #8]
	add	x0, x8, #1024
Lloh139:
	adrp	x1, l_.str.5@PAGE
Lloh140:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w2, #12
	bl	_memcmp
	cmp	x0, #0
	ccmp	w20, #0, #4, eq
	b.le	LBB0_76
	b	LBB0_101
LBB0_100:
	cmp	w20, #1
	b.lt	LBB0_76
LBB0_101:
	ldr	x8, [x24, #8]
	mov	w9, w20
	mov	w10, #2
	cmp	x9, #2
	csel	x10, x9, x10, hi
	sub	x10, x10, #1
	cmp	x10, #14
	b.hs	LBB0_103
; %bb.102:
	mov	x10, #0
	b	LBB0_106
LBB0_103:
	lsr	x10, x10, #1
	add	x11, x10, #1
	and	x12, x11, #0x7ffffffffffffff8
	lsl	x10, x12, #1
	add	x13, x8, #32
	mov	x14, x12
LBB0_104:                               ; =>This Inner Loop Header: Depth=1
	sub	x15, x13, #32
	ld2.4s	{ v0, v1 }, [x15]
	ld2.4s	{ v3, v4 }, [x13]
	mov.16b	v2, v0
	mov.16b	v5, v3
	st2.4s	{ v1, v2 }, [x15]
	st2.4s	{ v4, v5 }, [x13]
	add	x13, x13, #64
	subs	x14, x14, #8
	b.ne	LBB0_104
; %bb.105:
	cmp	x11, x12
	b.eq	LBB0_76
LBB0_106:                               ; =>This Inner Loop Header: Depth=1
	add	x11, x8, x10, lsl #2
	ldp	w12, w13, [x11]
	stp	w13, w12, [x11]
	add	x10, x10, #2
	cmp	x10, x9
	b.lo	LBB0_106
	b	LBB0_76
LBB0_107:
	ldr	w0, [x20]
Lloh141:
	adrp	x1, l_.str.18@PAGE
Lloh142:
	add	x1, x1, l_.str.18@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_113
; %bb.108:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_110
; %bb.109:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_110:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_112
; %bb.111:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_112:
Lloh143:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh144:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh145:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh146:
	adrp	x8, lCPI0_5@PAGE
Lloh147:
	ldr	d0, [x8, lCPI0_5@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_113:
	ldr	w0, [x20]
Lloh148:
	adrp	x1, l_.str.19@PAGE
Lloh149:
	add	x1, x1, l_.str.19@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_119
; %bb.114:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_116
; %bb.115:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_116:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_118
; %bb.117:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_118:
Lloh150:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh151:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh152:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh153:
	adrp	x8, lCPI0_6@PAGE
Lloh154:
	ldr	d0, [x8, lCPI0_6@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_119:
	ldr	w0, [x20]
Lloh155:
	adrp	x1, l_.str.20@PAGE
Lloh156:
	add	x1, x1, l_.str.20@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_125
; %bb.120:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_122
; %bb.121:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_122:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_124
; %bb.123:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_124:
Lloh157:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh158:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh159:
	ldr	x8, [x8]
	ldr	x10, [x21]
	stp	w8, w10, [x9]
Lloh160:
	adrp	x8, lCPI0_7@PAGE
Lloh161:
	ldr	d0, [x8, lCPI0_7@PAGEOFF]
	str	d0, [x19, #8]
	b	LBB0_132
LBB0_125:
	ldr	w0, [x20]
Lloh162:
	adrp	x1, l_.str.21@PAGE
Lloh163:
	add	x1, x1, l_.str.21@PAGEOFF
	bl	_strstr
	cbnz	x0, LBB0_127
; %bb.126:
	ldr	w0, [x20]
Lloh164:
	adrp	x1, l_.str.22@PAGE
Lloh165:
	add	x1, x1, l_.str.22@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_132
LBB0_127:
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_129
; %bb.128:
	ldr	x9, [x19]
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_129:
	ldr	w10, [x8, #4]
	ldr	x9, [x19]
	cmn	w10, #1
	b.ne	LBB0_131
; %bb.130:
	ldr	w10, [x9, #4]
	str	w10, [x8, #4]
LBB0_131:
Lloh166:
	adrp	x8, _SYSTEM_MD_GAMEPAD@GOTPAGE
Lloh167:
	ldr	x8, [x8, _SYSTEM_MD_GAMEPAD@GOTPAGEOFF]
Lloh168:
	ldr	x8, [x8]
	str	w8, [x9]
Lloh169:
	adrp	x8, _SYSTEM_JUSTIFIER@GOTPAGE
Lloh170:
	ldr	x8, [x8, _SYSTEM_JUSTIFIER@GOTPAGEOFF]
Lloh171:
	ldr	w8, [x8]
	str	w8, [x9, #4]
	ldr	w0, [x20]
Lloh172:
	adrp	x1, l_.str.23@PAGE
Lloh173:
	add	x1, x1, l_.str.23@PAGEOFF
	bl	_strstr
	cmp	x0, #0
	mov	w8, #24
	csel	w8, wzr, w8, eq
	stp	w8, wzr, [x19, #8]
LBB0_132:
	mov	w0, #1
LBB0_133:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdr	Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdr	Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGot	Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGot	Lloh78, Lloh79
	.loh AdrpAdd	Lloh80, Lloh81
	.loh AdrpAdd	Lloh82, Lloh83
	.loh AdrpAdd	Lloh84, Lloh85
	.loh AdrpAdd	Lloh89, Lloh90
	.loh AdrpLdrGotLdr	Lloh86, Lloh87, Lloh88
	.loh AdrpAdd	Lloh91, Lloh92
	.loh AdrpAdd	Lloh93, Lloh94
	.loh AdrpLdrGotLdr	Lloh100, Lloh101, Lloh102
	.loh AdrpAdd	Lloh98, Lloh99
	.loh AdrpLdrGotStr	Lloh95, Lloh96, Lloh97
	.loh AdrpAdd	Lloh103, Lloh104
	.loh AdrpLdr	Lloh108, Lloh109
	.loh AdrpLdrGotLdr	Lloh105, Lloh106, Lloh107
	.loh AdrpLdrGot	Lloh110, Lloh111
	.loh AdrpLdrGot	Lloh112, Lloh113
	.loh AdrpAdd	Lloh114, Lloh115
	.loh AdrpLdr	Lloh119, Lloh120
	.loh AdrpLdrGotLdr	Lloh116, Lloh117, Lloh118
	.loh AdrpLdrGot	Lloh121, Lloh122
	.loh AdrpAdd	Lloh123, Lloh124
	.loh AdrpLdrGotLdr	Lloh125, Lloh126, Lloh127
	.loh AdrpAdd	Lloh128, Lloh129
	.loh AdrpAdd	Lloh130, Lloh131
	.loh AdrpLdr	Lloh135, Lloh136
	.loh AdrpLdrGotLdr	Lloh132, Lloh133, Lloh134
	.loh AdrpAdd	Lloh137, Lloh138
	.loh AdrpAdd	Lloh139, Lloh140
	.loh AdrpAdd	Lloh141, Lloh142
	.loh AdrpLdr	Lloh146, Lloh147
	.loh AdrpLdrGotLdr	Lloh143, Lloh144, Lloh145
	.loh AdrpAdd	Lloh148, Lloh149
	.loh AdrpLdr	Lloh153, Lloh154
	.loh AdrpLdrGotLdr	Lloh150, Lloh151, Lloh152
	.loh AdrpAdd	Lloh155, Lloh156
	.loh AdrpLdr	Lloh160, Lloh161
	.loh AdrpLdrGotLdr	Lloh157, Lloh158, Lloh159
	.loh AdrpAdd	Lloh162, Lloh163
	.loh AdrpAdd	Lloh164, Lloh165
	.loh AdrpAdd	Lloh172, Lloh173
	.loh AdrpLdrGotLdr	Lloh169, Lloh170, Lloh171
	.loh AdrpLdrGotLdr	Lloh166, Lloh167, Lloh168
	.cfi_endproc
                                        ; -- End function
	.comm	_cart,16,3                      ; @cart
	.comm	_cdd,8,3                        ; @cdd
	.comm	_SYSTEM_MCD,4,2                 ; @SYSTEM_MCD
	.comm	_system_hw,4,2                  ; @system_hw
	.comm	_SYSTEM_SMS,4,2                 ; @SYSTEM_SMS
	.comm	_SYSTEM_GG,4,2                  ; @SYSTEM_GG
	.comm	_system_bios,4,2                ; @system_bios
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SMS"

	.comm	_SYSTEM_SMS2,4,2                ; @SYSTEM_SMS2
l_.str.1:                               ; @.str.1
	.asciz	"GG"

l_.str.2:                               ; @.str.2
	.asciz	"SG"

	.comm	_SYSTEM_SG,4,2                  ; @SYSTEM_SG
	.comm	_SYSTEM_MD,4,2                  ; @SYSTEM_MD
l_.str.3:                               ; @.str.3
	.asciz	"MDX"

l_.str.4:                               ; @.str.4
	.asciz	"ESAGM GE ARDVI E"

l_.str.5:                               ; @.str.5
	.asciz	"ESAGG NESESI"

l_.str.6:                               ; @.str.6
	.asciz	"SEGA"

	.comm	_scd,16,3                       ; @scd
	.comm	_romtype,4,2                    ; @romtype
	.comm	_rominfo,20,2                   ; @rominfo
l_.str.7:                               ; @.str.7
	.asciz	"SEGA PICO"

	.comm	_SYSTEM_PICO,4,2                ; @SYSTEM_PICO
l_.str.8:                               ; @.str.8
	.asciz	"BR"

	.comm	_region_code,4,2                ; @region_code
l_.str.9:                               ; @.str.9
	.asciz	"FLUX"

l_.str.10:                              ; @.str.10
	.asciz	"WONDER LIBRARY"

l_.str.11:                              ; @.str.11
	.asciz	"T-5740"

	.comm	_config,4,2                     ; @config
l_.str.12:                              ; @.str.12
	.asciz	".iso"

	.comm	_cdc,8,3                        ; @cdc
	.comm	_SYSTEM_PBC,4,2                 ; @SYSTEM_PBC
	.comm	_SYSTEM_GGMS,4,2                ; @SYSTEM_GGMS
	.comm	_old_system,8,3                 ; @old_system
	.comm	_input,16,3                     ; @input
	.comm	_SYSTEM_MENACER,8,3             ; @SYSTEM_MENACER
l_.str.13:                              ; @.str.13
	.asciz	"MENACER"

	.comm	_SYSTEM_MD_GAMEPAD,8,3          ; @SYSTEM_MD_GAMEPAD
l_.str.14:                              ; @.str.14
	.asciz	"T2 ; THE ARCADE GAME"

l_.str.15:                              ; @.str.15
	.asciz	"BODY COUNT"

l_.str.16:                              ; @.str.16
	.asciz	"CORPSE KILLER"

l_.str.17:                              ; @.str.17
	.asciz	"CRIME PATROL"

l_.str.18:                              ; @.str.18
	.asciz	"MAD DOG II THE LOST GOLD"

l_.str.19:                              ; @.str.19
	.asciz	"MAD DOG MCCREE"

l_.str.20:                              ; @.str.20
	.asciz	"WHO SHOT JOHNNY ROCK?"

l_.str.21:                              ; @.str.21
	.asciz	"LETHAL ENFORCERS"

l_.str.22:                              ; @.str.22
	.asciz	"SNATCHER"

	.comm	_SYSTEM_JUSTIFIER,4,2           ; @SYSTEM_JUSTIFIER
l_.str.23:                              ; @.str.23
	.asciz	"GUN FIGHTERS"

.subsections_via_symbols
