	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_mapper_korea_8k
_read_mapper_korea_8k:                  ## @read_mapper_korea_8k
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $edi killed $edi def $rdi
	movq	_z80_readmap@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%edi, %ecx
	shrl	$10, %ecx
	movq	(%rax,%rcx,8), %rax
	movl	%edi, %ecx
	andl	$1023, %ecx                     ## imm = 0x3FF
	movb	(%rax,%rcx), %al
	shrl	$14, %edi
	cmpb	$2, %dil
	je	LBB0_3
## %bb.1:
	cmpb	$1, %dil
	jne	LBB0_5
## %bb.2:
	movq	_slot@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	testb	$-128, 8(%rcx)
	jne	LBB0_4
	jmp	LBB0_5
LBB0_3:
	movq	_slot@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	testb	$-128, (%rcx)
	je	LBB0_5
LBB0_4:
	rolb	$4, %al
	movl	%eax, %ecx
	andb	$51, %cl
	shlb	$2, %cl
	shrb	$2, %al
	andb	$51, %al
	orb	%cl, %al
	movl	%eax, %ecx
	andb	$85, %cl
	addb	%cl, %cl
	shrb	%al
	andb	$85, %al
	orb	%cl, %al
LBB0_5:
	movzbl	%al, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_z80_readmap,8,3                ## @z80_readmap
	.comm	_slot,8,3                       ## @slot
	.no_dead_strip	_read_mapper_korea_8k
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_mapper_korea_8k
_read_mapper_korea_8k:                  ; @read_mapper_korea_8k
	.cfi_startproc
; %bb.0:
	mov	x8, x0
Lloh0:
	adrp	x9, _z80_readmap@GOTPAGE
Lloh1:
	ldr	x9, [x9, _z80_readmap@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	lsr	w10, w0, #10
	ldr	x9, [x9, w10, uxtw #3]
	and	x10, x8, #0x3ff
	ldrb	w0, [x9, x10]
	ubfx	w8, w8, #14, #8
	cmp	w8, #2
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #1
	b.ne	LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _slot@GOTPAGE
Lloh4:
	ldr	x8, [x8, _slot@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldrb	w8, [x8, #8]
	tbnz	w8, #7, LBB0_4
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _slot@GOTPAGE
Lloh7:
	ldr	x8, [x8, _slot@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldrb	w8, [x8]
	tbz	w8, #7, LBB0_5
LBB0_4:
	rbit	w8, w0
	lsr	w0, w8, #24
LBB0_5:
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_z80_readmap,8,3                ; @z80_readmap
	.comm	_slot,8,3                       ; @slot
	.no_dead_strip	_read_mapper_korea_8k
.subsections_via_symbols
