	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh2_read16_cs0
_sh2_read16_cs0:                        ## @sh2_read16_cs0
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	%rsi, %rdi
	movl	$2, %esi
	callq	_sh2_burn_cycles
	movl	%ebx, %eax
	andl	$262080, %eax                   ## imm = 0x3FFC0
	cmpl	$16384, %eax                    ## imm = 0x4000
	jne	LBB0_3
## %bb.1:
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_p32x_sh2reg_read16
	movl	%eax, %r15d
	movl	%ebx, %eax
	notl	%eax
	testb	$48, %al
	jne	LBB0_14
## %bb.2:
	movq	_EL_LOGMASK@GOTPCREL(%rip), %rax
	movq	_EL_PWM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	je	LBB0_15
	jmp	LBB0_14
LBB0_3:
	movl	%ebx, %eax
	andl	$262128, %eax                   ## imm = 0x3FFF0
	cmpl	$16640, %eax                    ## imm = 0x4100
	jne	LBB0_5
## %bb.4:
	movl	%ebx, %edi
	callq	_p32x_vdp_read16
	movl	%eax, %r15d
	movq	_SH2_STATE_VPOLL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$7, %ecx
	callq	_sh2_poll_detect
LBB0_14:
	movq	_EL_32X@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r14, %rdi
	callq	_sh2_pc
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%ebx, %ecx
	movl	%r15d, %r8d
	movl	%eax, %r9d
	callq	_elprintf_sh2
	jmp	LBB0_15
LBB0_5:
	movq	(%r14), %rax
	cmpl	$7, %ebx
	ja	LBB0_9
## %bb.6:
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:
	movq	_Pico32xMem@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%rax), %rax
	jmp	LBB0_8
LBB0_9:
	cmpl	$7, %ebx
	ja	LBB0_12
## %bb.10:
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_Pico32xMem@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rax
LBB0_8:
	shrl	%ebx
	movl	(%rax,%rbx,4), %r15d
LBB0_15:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%ebx, %eax
	andl	$261632, %eax                   ## imm = 0x3FE00
	cmpl	$16896, %eax                    ## imm = 0x4200
	jne	LBB0_16
## %bb.13:
	movq	_Pico32xMem@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	shrl	%ecx
	movzbl	%cl, %ecx
	movl	(%rax,%rcx,4), %r15d
	jmp	LBB0_14
LBB0_16:
	movl	%ebx, %edi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sh2_read16_unmapped            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EL_LOGMASK,4,2                 ## @EL_LOGMASK
	.comm	_EL_PWM,4,2                     ## @EL_PWM
	.comm	_SH2_STATE_VPOLL,4,2            ## @SH2_STATE_VPOLL
	.comm	_Pico32xMem,8,3                 ## @Pico32xMem
	.comm	_EL_32X,4,2                     ## @EL_32X
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r16 [%08x]     %04x @%06x"

	.no_dead_strip	_sh2_read16_cs0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh2_read16_cs0
_sh2_read16_cs0:                        ; @sh2_read16_cs0
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	mov	w1, #2
	bl	_sh2_burn_cycles
	and	w8, w19, #0x3ffc0
	cmp	w8, #4, lsl #12                 ; =16384
	b.ne	LBB0_3
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_p32x_sh2reg_read16
	mov	x21, x0
	mvn	w8, w19
	tst	w8, #0x30
	b.ne	LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _EL_LOGMASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EL_LOGMASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _EL_PWM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EL_PWM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w8, LBB0_13
	b	LBB0_5
LBB0_3:
	and	w8, w19, #0x3fff0
	mov	w9, #16640
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_p32x_vdp_read16
	mov	x21, x0
Lloh6:
	adrp	x8, _SH2_STATE_VPOLL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SH2_STATE_VPOLL@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w3, #7
	bl	_sh2_poll_detect
LBB0_5:
Lloh9:
	adrp	x8, _EL_32X@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EL_32X@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_sh2_pc
	mov	x5, x0
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x22
	mov	x3, x19
	mov	x4, x21
	bl	_elprintf_sh2
	b	LBB0_13
LBB0_6:
	ldr	x8, [x20]
	cmp	w19, #7
	b.hi	LBB0_9
; %bb.7:
	cbnz	x8, LBB0_9
; %bb.8:
Lloh14:
	adrp	x8, _Pico32xMem@GOTPAGE
Lloh15:
	ldr	x8, [x8, _Pico32xMem@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	x8, [x8, #16]
	b	LBB0_12
LBB0_9:
	cmp	w19, #7
	b.hi	LBB0_14
; %bb.10:
	cbz	x8, LBB0_14
; %bb.11:
Lloh17:
	adrp	x8, _Pico32xMem@GOTPAGE
Lloh18:
	ldr	x8, [x8, _Pico32xMem@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
LBB0_12:
	lsr	w9, w19, #1
	ldr	w21, [x8, w9, uxtw #2]
LBB0_13:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_14:
	and	w8, w19, #0x3fe00
	mov	w9, #16896
	cmp	w8, w9
	b.ne	LBB0_16
; %bb.15:
Lloh20:
	adrp	x8, _Pico32xMem@GOTPAGE
Lloh21:
	ldr	x8, [x8, _Pico32xMem@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ubfx	w9, w19, #1, #8
	ldr	w21, [x8, w9, uxtw #2]
	b	LBB0_5
LBB0_16:
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_sh2_read16_unmapped
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EL_LOGMASK,4,2                 ; @EL_LOGMASK
	.comm	_EL_PWM,4,2                     ; @EL_PWM
	.comm	_SH2_STATE_VPOLL,4,2            ; @SH2_STATE_VPOLL
	.comm	_Pico32xMem,8,3                 ; @Pico32xMem
	.comm	_EL_32X,4,2                     ; @EL_32X
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r16 [%08x]     %04x @%06x"

	.no_dead_strip	_sh2_read16_cs0
.subsections_via_symbols
