	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PicoVideoRead8                 ## -- Begin function PicoVideoRead8
	.p2align	4, 0x90
_PicoVideoRead8:                        ## @PicoVideoRead8
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edi killed $edi def $rdi
	andl	$29, %edi
	xorl	%ebx, %ebx
	cmpl	$9, %edi
	ja	LBB0_14
## %bb.1:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rdi,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	xorl	%eax, %eax
	callq	_VideoRead
	movl	%eax, %ebx
	sarl	$8, %ebx
	jmp	LBB0_14
LBB0_4:
	movq	_Pico@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %ebx
	sarl	$8, %ebx
	testl	$256, %ecx                      ## imm = 0x100
	je	LBB0_6
## %bb.5:
	andl	$-257, %ecx                     ## imm = 0xFEFF
	movl	%ecx, (%rax)
LBB0_6:
	movl	$0, 24(%rax)
	movq	_EL_SR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_10:
	xorl	%eax, %eax
	callq	_SekCyclesDone
                                        ## kill: def $eax killed $eax def $rax
	movq	_line_base_cycles@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	andl	$511, %eax                      ## imm = 0x1FF
	movq	_Pico@GOTPCREL(%rip), %rcx
	movq	8(%rcx), %rcx
	testb	$1, 48(%rcx)
	jne	LBB0_11
## %bb.12:
	movq	_hcounts_32@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_3:
	xorl	%eax, %eax
	callq	_VideoRead
	movzbl	%al, %ebx
	jmp	LBB0_14
LBB0_8:
	movq	_Pico@GOTPCREL(%rip), %r14
	movzbl	(%r14), %eax
	movq	8(%r14), %rcx
	movl	4(%rcx), %ecx
	shrl	$3, %ecx
	notl	%ecx
	andl	$8, %ecx
	movl	16(%r14), %r15d
	andl	$32, %r15d
	shll	$2, %r15d
	orl	%eax, %r15d
	orl	%ecx, %r15d
	xorl	%eax, %eax
	callq	_SekCyclesDone
	movq	_line_base_cycles@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%r15d, %ebx
	orl	$4, %ebx
	cmpl	$400, %eax                      ## imm = 0x190
	cmovll	%r15d, %ebx
	movl	$0, 24(%r14)
	movq	_EL_SR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_elprintf
	jmp	LBB0_14
LBB0_9:
	movq	_EL_HVCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_Pico@GOTPCREL(%rip), %r15
	movl	20(%r15), %r14d
	xorl	%eax, %eax
	callq	_SekCyclesDone
	movq	_SekPc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_elprintf
	movl	20(%r15), %ebx
	jmp	LBB0_14
LBB0_11:
	movq	_hcounts_40@GOTPCREL(%rip), %rcx
LBB0_13:
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %ebx
	movq	_EL_HVCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_SekCyclesDone
	movq	_SekPc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_elprintf
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_3
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_4
	.long	L0_0_set_8
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_9
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_Pico,32,3                      ## @Pico
	.comm	_EL_SR,4,2                      ## @EL_SR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SR read (h): %02x @ %06x"

	.comm	_SekPc,4,2                      ## @SekPc
	.comm	_line_base_cycles,4,2           ## @line_base_cycles
L_.str.1:                               ## @.str.1
	.asciz	"SR read (l): %02x @ %06x"

	.comm	_EL_HVCNT,4,2                   ## @EL_HVCNT
L_.str.2:                               ## @.str.2
	.asciz	"vcounter: %02x (%i) @ %06x"

	.comm	_hcounts_40,8,3                 ## @hcounts_40
	.comm	_hcounts_32,8,3                 ## @hcounts_32
L_.str.3:                               ## @.str.3
	.asciz	"hcounter: %02x (%i) @ %06x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PicoVideoRead8                 ; -- Begin function PicoVideoRead8
	.p2align	2
_PicoVideoRead8:                        ; @PicoVideoRead8
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	w19, #0
	mov	w8, #29
	and	w8, w0, w8
	cmp	w8, #9
	b.hi	LBB0_11
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	bl	_VideoRead
	asr	w19, w0, #8
	b	LBB0_11
LBB0_3:
	bl	_VideoRead
	and	w19, w0, #0xff
	b	LBB0_11
LBB0_4:
Lloh2:
	adrp	x8, _Pico@GOTPAGE
Lloh3:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
	ldr	w9, [x8]
	asr	w19, w9, #8
	tbz	w9, #8, LBB0_6
; %bb.5:
	and	w9, w9, #0xfffffeff
	str	w9, [x8]
LBB0_6:
	str	wzr, [x8, #24]
Lloh4:
	adrp	x8, _EL_SR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EL_SR@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _SekPc@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_7:
Lloh12:
	adrp	x20, _Pico@GOTPAGE
Lloh13:
	ldr	x20, [x20, _Pico@GOTPAGEOFF]
	ldrb	w8, [x20]
	ldr	x9, [x20, #8]
	ldr	w9, [x9, #4]
	mov	w10, #8
	bic	w9, w10, w9, lsr #3
	orr	w8, w9, w8
	ldr	w9, [x20, #16]
	lsl	w9, w9, #2
	and	w9, w9, #0x80
	orr	w19, w8, w9
	bl	_SekCyclesDone
Lloh14:
	adrp	x8, _line_base_cycles@GOTPAGE
Lloh15:
	ldr	x8, [x8, _line_base_cycles@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	sub	w8, w0, w8
	orr	w9, w19, #0x4
	cmp	w8, #399
	csel	w19, w9, w19, gt
	str	wzr, [x20, #24]
Lloh17:
	adrp	x8, _EL_SR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EL_SR@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x8, _SekPc@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_8:
Lloh25:
	adrp	x8, _EL_HVCNT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EL_HVCNT@GOTPAGEOFF]
Lloh27:
	ldr	w19, [x8]
Lloh28:
	adrp	x21, _Pico@GOTPAGE
Lloh29:
	ldr	x21, [x21, _Pico@GOTPAGEOFF]
	ldr	w20, [x21, #20]
	bl	_SekCyclesDone
	mov	x3, x0
Lloh30:
	adrp	x8, _SekPc@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_elprintf
	ldr	w19, [x21, #20]
	b	LBB0_11
LBB0_9:
	bl	_SekCyclesDone
Lloh35:
	adrp	x8, _line_base_cycles@GOTPAGE
Lloh36:
	ldr	x8, [x8, _line_base_cycles@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	sub	w8, w0, w8
	and	w8, w8, #0x1ff
Lloh38:
	adrp	x9, _Pico@GOTPAGE
Lloh39:
	ldr	x9, [x9, _Pico@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9, #8]
	ldr	w9, [x9, #48]
Lloh41:
	adrp	x10, _hcounts_40@GOTPAGE
Lloh42:
	ldr	x10, [x10, _hcounts_40@GOTPAGEOFF]
Lloh43:
	adrp	x11, _hcounts_32@GOTPAGE
Lloh44:
	ldr	x11, [x11, _hcounts_32@GOTPAGEOFF]
	tst	w9, #0x1
	csel	x9, x11, x10, eq
	ldr	x9, [x9]
	ldr	w19, [x9, w8, uxtw #2]
Lloh45:
	adrp	x8, _EL_HVCNT@GOTPAGE
Lloh46:
	ldr	x8, [x8, _EL_HVCNT@GOTPAGEOFF]
Lloh47:
	ldr	w20, [x8]
	bl	_SekCyclesDone
	mov	x3, x0
Lloh48:
	adrp	x8, _SekPc@GOTPAGE
Lloh49:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh51:
	adrp	x1, l_.str.3@PAGE
Lloh52:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
LBB0_10:
	mov	x2, x19
	bl	_elprintf
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
                                        ; -- End function
	.comm	_Pico,32,3                      ; @Pico
	.comm	_EL_SR,4,2                      ; @EL_SR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SR read (h): %02x @ %06x"

	.comm	_SekPc,4,2                      ; @SekPc
	.comm	_line_base_cycles,4,2           ; @line_base_cycles
l_.str.1:                               ; @.str.1
	.asciz	"SR read (l): %02x @ %06x"

	.comm	_EL_HVCNT,4,2                   ; @EL_HVCNT
l_.str.2:                               ; @.str.2
	.asciz	"vcounter: %02x (%i) @ %06x"

	.comm	_hcounts_40,8,3                 ; @hcounts_40
	.comm	_hcounts_32,8,3                 ; @hcounts_32
l_.str.3:                               ; @.str.3
	.asciz	"hcounter: %02x (%i) @ %06x"

.subsections_via_symbols
