	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PicoVideoRead                  ## -- Begin function PicoVideoRead
	.p2align	4, 0x90
_PicoVideoRead:                         ## @PicoVideoRead
	.cfi_startproc
## %bb.0:
	andl	$28, %edi
	je	LBB0_11
## %bb.1:
	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
	cmpl	$8, %edi
	je	LBB0_6
## %bb.2:
	xorl	%ebx, %ebx
	cmpl	$4, %edi
	jne	LBB0_10
## %bb.3:
	movq	_Pico@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	xorl	%eax, %eax
	callq	_SekCyclesDone
	movq	_line_base_cycles@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%ebx, %ecx
	orl	$4, %ecx
	cmpl	$400, %eax                      ## imm = 0x190
	cmovll	%ebx, %ecx
	movq	8(%r14), %rax
	movl	4(%rax), %eax
	shrl	$3, %eax
	notl	%eax
	andl	$8, %eax
	movl	16(%r14), %ebx
	andl	$32, %ebx
	shll	$2, %ebx
	orl	%ecx, %ebx
	orl	%eax, %ebx
	testl	$256, %ecx                      ## imm = 0x100
	je	LBB0_5
## %bb.4:
	andb	$-2, 1(%r14)
LBB0_5:
	movq	$0, 24(%r14)
	movq	_EL_SR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekPc@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_elprintf
	jmp	LBB0_10
LBB0_11:
	xorl	%eax, %eax
	jmp	_VideoRead                      ## TAILCALL
LBB0_6:
	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), %r12
	movq	8(%r12), %rcx
	testb	$1, 48(%rcx)
	jne	LBB0_7
## %bb.8:
	movq	_hcounts_32@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_7:
	movq	_hcounts_40@GOTPCREL(%rip), %rcx
LBB0_9:
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %r14d
	movq	_EL_HVCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	20(%r12), %r15d
	xorl	%eax, %eax
	callq	_SekCyclesDone
	movq	_SekPc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_elprintf
	movl	20(%r12), %ebx
	shll	$8, %ebx
	orl	%r14d, %ebx
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico,32,3                      ## @Pico
	.comm	_line_base_cycles,4,2           ## @line_base_cycles
	.comm	_EL_SR,4,2                      ## @EL_SR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SR read: %04x @ %06x"

	.comm	_SekPc,4,2                      ## @SekPc
	.comm	_hcounts_40,8,3                 ## @hcounts_40
	.comm	_hcounts_32,8,3                 ## @hcounts_32
	.comm	_EL_HVCNT,4,2                   ## @EL_HVCNT
L_.str.1:                               ## @.str.1
	.asciz	"hv: %02x %02x (%i) @ %06x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PicoVideoRead                  ; -- Begin function PicoVideoRead
	.p2align	2
_PicoVideoRead:                         ; @PicoVideoRead
	.cfi_startproc
; %bb.0:
	ands	w8, w0, #0x1c
	b.eq	LBB0_6
; %bb.1:
	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
	.cfi_remember_state
	cmp	w8, #8
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #4
	b.ne	LBB0_8
; %bb.3:
Lloh0:
	adrp	x20, _Pico@GOTPAGE
Lloh1:
	ldr	x20, [x20, _Pico@GOTPAGEOFF]
	ldr	w19, [x20]
	bl	_SekCyclesDone
Lloh2:
	adrp	x8, _line_base_cycles@GOTPAGE
Lloh3:
	ldr	x8, [x8, _line_base_cycles@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	sub	w8, w0, w8
	orr	w9, w19, #0x4
	cmp	w8, #399
	csel	w8, w9, w19, gt
	ldr	x9, [x20, #8]
	ldr	w9, [x9, #4]
	mov	w10, #8
	bic	w9, w10, w9, lsr #3
	orr	w9, w9, w8
	ldr	w10, [x20, #16]
	lsl	w10, w10, #2
	and	w10, w10, #0x80
	orr	w19, w9, w10
	tbz	w8, #8, LBB0_5
; %bb.4:
	ldr	w8, [x20]
	and	w8, w8, #0xfffffeff
	str	w8, [x20]
LBB0_5:
	str	xzr, [x20, #24]
Lloh5:
	adrp	x8, _EL_SR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EL_SR@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x8, _SekPc@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_elprintf
	b	LBB0_9
LBB0_6:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	b	_VideoRead
LBB0_7:
	.cfi_restore_state
	bl	_SekCyclesDone
Lloh13:
	adrp	x8, _line_base_cycles@GOTPAGE
Lloh14:
	ldr	x8, [x8, _line_base_cycles@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	sub	w8, w0, w8
	and	w8, w8, #0x1ff
Lloh16:
	adrp	x22, _Pico@GOTPAGE
Lloh17:
	ldr	x22, [x22, _Pico@GOTPAGEOFF]
	ldr	x9, [x22, #8]
Lloh18:
	adrp	x10, _hcounts_40@GOTPAGE
Lloh19:
	ldr	x10, [x10, _hcounts_40@GOTPAGEOFF]
	ldr	w9, [x9, #48]
Lloh20:
	adrp	x11, _hcounts_32@GOTPAGE
Lloh21:
	ldr	x11, [x11, _hcounts_32@GOTPAGEOFF]
	tst	w9, #0x1
	csel	x9, x11, x10, eq
	ldr	x9, [x9]
	ldr	w19, [x9, w8, uxtw #2]
Lloh22:
	adrp	x8, _EL_HVCNT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EL_HVCNT@GOTPAGEOFF]
Lloh24:
	ldr	w20, [x8]
	ldr	w21, [x22, #20]
	bl	_SekCyclesDone
                                        ; kill: def $w0 killed $w0 def $x0
Lloh25:
	adrp	x8, _SekPc@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SekPc@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	stp	x0, x8, [sp]
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	mov	x3, x21
	bl	_elprintf
	ldr	w8, [x22, #20]
	orr	w19, w19, w8, lsl #8
	b	LBB0_9
LBB0_8:
	mov	w19, #0
LBB0_9:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico,32,3                      ; @Pico
	.comm	_line_base_cycles,4,2           ; @line_base_cycles
	.comm	_EL_SR,4,2                      ; @EL_SR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SR read: %04x @ %06x"

	.comm	_SekPc,4,2                      ; @SekPc
	.comm	_hcounts_40,8,3                 ; @hcounts_40
	.comm	_hcounts_32,8,3                 ; @hcounts_32
	.comm	_EL_HVCNT,4,2                   ; @EL_HVCNT
l_.str.1:                               ; @.str.1
	.asciz	"hv: %02x %02x (%i) @ %06x"

.subsections_via_symbols
