	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function VIDEO_Init
LCPI0_0:
	.long	40                              ## 0x28
	.long	40                              ## 0x28
	.long	40                              ## 0x28
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_VIDEO_Init
	.p2align	4, 0x90
_VIDEO_Init:                            ## @VIDEO_Init
	.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
	callq	__CPU_ISR_Disable
	movq	__viReg@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	testb	$1, 4(%rax)
	jne	LBB0_2
## %bb.1:
	movq	_VI_TVMODE_NTSC_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___VIInit
	movq	(%r14), %rax
LBB0_2:
	movq	_retraceCount@GOTPCREL(%rip), %rcx
	movq	$0, (%rcx)
	movq	_changed@GOTPCREL(%rip), %rcx
	movq	$0, (%rcx)
	movq	_shdw_changed@GOTPCREL(%rip), %rcx
	movq	$0, (%rcx)
	movq	_shdw_changeMode@GOTPCREL(%rip), %rcx
	movq	$0, (%rcx)
	movq	_flushFlag@GOTPCREL(%rip), %rcx
	movq	$0, (%rcx)
	movq	_taps@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movl	4(%rcx), %edx
	movl	8(%rcx), %esi
	sarl	$6, %edx
	shll	$4, %esi
	orl	%edx, %esi
	movl	%esi, 152(%rax)
	movl	(%rcx), %ebx
	movl	4(%rcx), %edi
	movl	$10, %esi
	movl	$6, %edx
	callq	__SHIFTL
	orl	%ebx, %eax
	movq	(%r14), %rcx
	movl	%eax, 156(%rcx)
	movq	(%r15), %rax
	movl	16(%rax), %edx
	movl	20(%rax), %esi
	sarl	$6, %edx
	shll	$4, %esi
	orl	%edx, %esi
	movl	%esi, 160(%rcx)
	movl	12(%rax), %ebx
	movl	16(%rax), %edi
	movl	$10, %esi
	movl	$6, %edx
	callq	__SHIFTL
	orl	%ebx, %eax
	movq	(%r14), %rcx
	movl	%eax, 164(%rcx)
	movq	(%r15), %rax
	movl	28(%rax), %edx
	movl	32(%rax), %esi
	sarl	$6, %edx
	shll	$4, %esi
	orl	%edx, %esi
	movl	%esi, 168(%rcx)
	movl	24(%rax), %ebx
	movl	28(%rax), %edi
	movl	$10, %esi
	movl	$6, %edx
	callq	__SHIFTL
	orl	%ebx, %eax
	movq	(%r14), %rcx
	movl	%eax, 172(%rcx)
	movq	(%r15), %rax
	movl	48(%rax), %edx
	shll	$8, %edx
	orl	44(%rax), %edx
	movl	%edx, 176(%rcx)
	movl	40(%rax), %edx
	shll	$8, %edx
	orl	36(%rax), %edx
	movl	%edx, 180(%rcx)
	movl	64(%rax), %edx
	shll	$8, %edx
	orl	60(%rax), %edx
	movl	%edx, 184(%rcx)
	movl	56(%rax), %edx
	shll	$8, %edx
	orl	52(%rax), %edx
	movl	%edx, 188(%rcx)
	movl	80(%rax), %edx
	shll	$8, %edx
	orl	76(%rax), %edx
	movl	%edx, 192(%rcx)
	movl	72(%rax), %edx
	shll	$8, %edx
	orl	68(%rax), %edx
	movl	%edx, 196(%rcx)
	movl	96(%rax), %edx
	shll	$8, %edx
	orl	92(%rax), %edx
	movl	%edx, 200(%rcx)
	movl	88(%rax), %edx
	shll	$8, %edx
	orl	84(%rax), %edx
	movl	%edx, 204(%rcx)
	movl	$640, 224(%rcx)                 ## imm = 0x280
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	___importAdjustingValues
	movq	(%r14), %rax
	movl	4(%rax), %edi
	movl	$2, %esi
	movl	$1, %edx
	callq	__SHIFTR
	movq	_HorVer@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	movq	(%r14), %rax
	movl	4(%rax), %edi
	movl	$8, %esi
	movl	$2, %edx
	callq	__SHIFTR
	movl	%eax, 4(%rbx)
	movq	_VI_DEBUG@GOTPCREL(%rip), %rcx
	leal	(,%rax,4), %edi
	cmpl	%eax, (%rcx)
	cmovel	%r15d, %edi
	addl	(%rbx), %edi
	callq	___gettiming
	movq	_currTiming@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	movl	4(%rbx), %ecx
	movq	_currTvMode@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	movq	(%r14), %rcx
	movl	4(%rcx), %ecx
	movq	_regs@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%ecx, 4(%rdx)
	movq	%rax, 136(%rbx)
	movl	$640, 8(%rbx)                   ## imm = 0x280
	movl	(%rax), %edi
	leal	(%rdi,%rdi), %eax
	movl	%eax, 12(%rbx)
	movq	_VI_MAX_WIDTH_NTSC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	addl	$-640, %ecx                     ## imm = 0xFD80
	shrl	$31, %ecx
	addl	%ecx, %eax
	addl	$-640, %eax                     ## imm = 0xFD80
	sarl	%eax
	movl	%eax, 16(%rbx)
	movq	$0, 128(%rbx)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	___adjustPosition
	movl	$640, 20(%rbx)                  ## imm = 0x280
	movq	(%r15), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	movl	%eax, 24(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 112(%rbx)
	movl	$640, 28(%rbx)                  ## imm = 0x280
	movl	%eax, 32(%rbx)
	movq	_VI_XFBMODE_SF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 104(%rbx)
	movaps	LCPI0_0(%rip), %xmm1            ## xmm1 = [40,40,40,1]
	movups	%xmm1, 36(%rbx)
	movups	%xmm0, 72(%rbx)
	movups	%xmm0, 56(%rbx)
	movups	%xmm0, 88(%rbx)
	movq	(%r14), %rax
	andl	$-32769, 96(%rax)               ## imm = 0xFFFF7FFF
	andb	$127, 105(%rax)
	movq	_preRetraceCB@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_postRetraceCB@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_video_queue@GOTPCREL(%rip), %rdi
	callq	_LWP_InitQueue
	movq	_IRQ_PI_VI@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	___VIRetraceHandler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_IRQ_Request
	movl	(%rbx), %edi
	callq	_IRQMASK
	movl	%eax, %edi
	callq	___UnmaskIrq
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	__CPU_ISR_Restore               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	__viReg,8,3                     ## @_viReg
	.comm	_VI_TVMODE_NTSC_INT,4,2         ## @VI_TVMODE_NTSC_INT
	.comm	_retraceCount,8,3               ## @retraceCount
	.comm	_changed,8,3                    ## @changed
	.comm	_shdw_changed,8,3               ## @shdw_changed
	.comm	_shdw_changeMode,8,3            ## @shdw_changeMode
	.comm	_flushFlag,8,3                  ## @flushFlag
	.comm	_taps,8,3                       ## @taps
	.comm	_HorVer,144,3                   ## @HorVer
	.comm	_VI_DEBUG,4,2                   ## @VI_DEBUG
	.comm	_currTiming,8,3                 ## @currTiming
	.comm	_currTvMode,4,2                 ## @currTvMode
	.comm	_regs,8,3                       ## @regs
	.comm	_VI_MAX_WIDTH_NTSC,4,2          ## @VI_MAX_WIDTH_NTSC
	.comm	_VI_XFBMODE_SF,4,2              ## @VI_XFBMODE_SF
	.comm	_preRetraceCB,8,3               ## @preRetraceCB
	.comm	_postRetraceCB,8,3              ## @postRetraceCB
	.comm	_video_queue,4,2                ## @video_queue
	.comm	_IRQ_PI_VI,4,2                  ## @IRQ_PI_VI
	.comm	___VIRetraceHandler,4,2         ## @__VIRetraceHandler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VIDEO_Init                     ; -- Begin function VIDEO_Init
	.p2align	2
_VIDEO_Init:                            ; @VIDEO_Init
	.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
	bl	__CPU_ISR_Disable
Lloh0:
	adrp	x19, __viReg@GOTPAGE
Lloh1:
	ldr	x19, [x19, __viReg@GOTPAGEOFF]
	ldr	x8, [x19]
	ldrb	w9, [x8, #4]
	tbnz	w9, #0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _VI_TVMODE_NTSC_INT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VI_TVMODE_NTSC_INT@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	___VIInit
	ldr	x8, [x19]
LBB0_2:
Lloh5:
	adrp	x9, _retraceCount@GOTPAGE
Lloh6:
	ldr	x9, [x9, _retraceCount@GOTPAGEOFF]
Lloh7:
	str	xzr, [x9]
Lloh8:
	adrp	x9, _changed@GOTPAGE
Lloh9:
	ldr	x9, [x9, _changed@GOTPAGEOFF]
Lloh10:
	adrp	x10, _shdw_changed@GOTPAGE
Lloh11:
	ldr	x10, [x10, _shdw_changed@GOTPAGEOFF]
Lloh12:
	str	xzr, [x9]
Lloh13:
	str	xzr, [x10]
Lloh14:
	adrp	x9, _shdw_changeMode@GOTPAGE
Lloh15:
	ldr	x9, [x9, _shdw_changeMode@GOTPAGEOFF]
Lloh16:
	adrp	x10, _flushFlag@GOTPAGE
Lloh17:
	ldr	x10, [x10, _flushFlag@GOTPAGEOFF]
Lloh18:
	str	xzr, [x9]
Lloh19:
	str	xzr, [x10]
Lloh20:
	adrp	x20, _taps@GOTPAGE
Lloh21:
	ldr	x20, [x20, _taps@GOTPAGEOFF]
	ldr	x9, [x20]
	ldp	w10, w11, [x9, #4]
	lsl	w11, w11, #4
	orr	w10, w11, w10, asr #6
	str	w10, [x8, #152]
	ldp	w21, w0, [x9]
	mov	w1, #10
	mov	w2, #6
	bl	__SHIFTL
	orr	w8, w0, w21
	ldr	x9, [x19]
	str	w8, [x9, #156]
	ldr	x8, [x20]
	ldp	w10, w11, [x8, #16]
	lsl	w11, w11, #4
	orr	w10, w11, w10, asr #6
	str	w10, [x9, #160]
	ldp	w21, w0, [x8, #12]
	mov	w1, #10
	mov	w2, #6
	bl	__SHIFTL
	orr	w8, w0, w21
	ldr	x9, [x19]
	str	w8, [x9, #164]
	ldr	x8, [x20]
	ldp	w10, w11, [x8, #28]
	lsl	w11, w11, #4
	orr	w10, w11, w10, asr #6
	str	w10, [x9, #168]
	ldp	w21, w0, [x8, #24]
	mov	w1, #10
	mov	w2, #6
	bl	__SHIFTL
	orr	w8, w0, w21
	ldr	x9, [x19]
	str	w8, [x9, #172]
	ldr	x8, [x20]
	ldp	w10, w11, [x8, #44]
	orr	w10, w10, w11, lsl #8
	str	w10, [x9, #176]
	ldp	w10, w11, [x8, #36]
	orr	w10, w10, w11, lsl #8
	str	w10, [x9, #180]
	ldp	w10, w11, [x8, #60]
	orr	w10, w10, w11, lsl #8
	str	w10, [x9, #184]
	ldp	w10, w11, [x8, #52]
	orr	w10, w10, w11, lsl #8
	str	w10, [x9, #188]
	ldp	w10, w11, [x8, #76]
	orr	w10, w10, w11, lsl #8
	str	w10, [x9, #192]
	ldp	w10, w11, [x8, #68]
	orr	w10, w10, w11, lsl #8
	str	w10, [x9, #196]
	ldp	w10, w11, [x8, #92]
	orr	w10, w10, w11, lsl #8
	str	w10, [x9, #200]
	ldp	w10, w8, [x8, #84]
	orr	w8, w10, w8, lsl #8
	str	w8, [x9, #204]
	mov	w20, #640
	str	w20, [x9, #224]
	bl	___importAdjustingValues
	ldr	x8, [x19]
	ldr	w0, [x8, #4]
	mov	w1, #2
	mov	w2, #1
	bl	__SHIFTR
Lloh22:
	adrp	x21, _HorVer@GOTPAGE
Lloh23:
	ldr	x21, [x21, _HorVer@GOTPAGEOFF]
	str	w0, [x21]
	ldr	x8, [x19]
	ldr	w0, [x8, #4]
	mov	w1, #8
	mov	w2, #2
	bl	__SHIFTR
	str	w0, [x21, #4]
Lloh24:
	adrp	x8, _VI_DEBUG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VI_DEBUG@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh26:
	ldr	w8, [x8]
	lsl	w10, w0, #2
	cmp	w8, w0
	csel	w8, wzr, w10, eq
	add	w0, w8, w9
	bl	___gettiming
Lloh27:
	adrp	x22, _currTiming@GOTPAGE
Lloh28:
	ldr	x22, [x22, _currTiming@GOTPAGEOFF]
Lloh29:
	adrp	x8, _currTvMode@GOTPAGE
Lloh30:
	ldr	x8, [x8, _currTvMode@GOTPAGEOFF]
	ldr	w9, [x21, #4]
Lloh31:
	str	w9, [x8]
	ldr	x8, [x19]
	ldr	w8, [x8, #4]
Lloh32:
	adrp	x9, _regs@GOTPAGE
Lloh33:
	ldr	x9, [x9, _regs@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	str	w8, [x9, #4]
	ldr	w8, [x0]
	lsl	w9, w8, #1
	stp	w20, w9, [x21, #8]
Lloh35:
	adrp	x9, _VI_MAX_WIDTH_NTSC@GOTPAGE
Lloh36:
	ldr	x9, [x9, _VI_MAX_WIDTH_NTSC@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	sub	w10, w9, #640
	sub	w9, w9, #639
	cmp	w10, #0
	csel	w9, w9, w10, lt
	str	x0, [x22]
	asr	w9, w9, #1
	str	w9, [x21, #16]
	stp	xzr, x0, [x21, #128]
	mov	x0, x8
	bl	___adjustPosition
	ldr	x8, [x22]
	ldr	w8, [x8]
	lsl	w8, w8, #1
	stp	w20, w8, [x21, #20]
	stp	xzr, xzr, [x21, #112]
	stp	w20, w8, [x21, #28]
Lloh38:
	adrp	x8, _VI_XFBMODE_SF@GOTPAGE
Lloh39:
	ldr	x8, [x8, _VI_XFBMODE_SF@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	str	w8, [x21, #104]
	movi.2s	v0, #40
	stur	d0, [x21, #36]
	mov	x8, #40
	movk	x8, #1, lsl #32
	stur	x8, [x21, #44]
	stp	xzr, xzr, [x21, #88]
	movi.2d	v0, #0000000000000000
	stur	q0, [x21, #72]
	stur	q0, [x21, #56]
	ldr	x8, [x19]
	ldr	w9, [x8, #96]
	and	w9, w9, #0xffff7fff
	str	w9, [x8, #96]
	ldr	w9, [x8, #104]
	and	w9, w9, #0xffff7fff
	str	w9, [x8, #104]
Lloh41:
	adrp	x8, _preRetraceCB@GOTPAGE
Lloh42:
	ldr	x8, [x8, _preRetraceCB@GOTPAGEOFF]
Lloh43:
	str	xzr, [x8]
Lloh44:
	adrp	x8, _postRetraceCB@GOTPAGE
Lloh45:
	ldr	x8, [x8, _postRetraceCB@GOTPAGEOFF]
Lloh46:
	str	xzr, [x8]
Lloh47:
	adrp	x0, _video_queue@GOTPAGE
Lloh48:
	ldr	x0, [x0, _video_queue@GOTPAGEOFF]
	bl	_LWP_InitQueue
Lloh49:
	adrp	x19, _IRQ_PI_VI@GOTPAGE
Lloh50:
	ldr	x19, [x19, _IRQ_PI_VI@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh51:
	adrp	x8, ___VIRetraceHandler@GOTPAGE
Lloh52:
	ldr	x8, [x8, ___VIRetraceHandler@GOTPAGEOFF]
Lloh53:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_IRQ_Request
	ldr	w0, [x19]
	bl	_IRQMASK
	bl	___UnmaskIrq
	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	__CPU_ISR_Restore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGotStr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotStr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotStr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	__viReg,8,3                     ; @_viReg
	.comm	_VI_TVMODE_NTSC_INT,4,2         ; @VI_TVMODE_NTSC_INT
	.comm	_retraceCount,8,3               ; @retraceCount
	.comm	_changed,8,3                    ; @changed
	.comm	_shdw_changed,8,3               ; @shdw_changed
	.comm	_shdw_changeMode,8,3            ; @shdw_changeMode
	.comm	_flushFlag,8,3                  ; @flushFlag
	.comm	_taps,8,3                       ; @taps
	.comm	_HorVer,144,3                   ; @HorVer
	.comm	_VI_DEBUG,4,2                   ; @VI_DEBUG
	.comm	_currTiming,8,3                 ; @currTiming
	.comm	_currTvMode,4,2                 ; @currTvMode
	.comm	_regs,8,3                       ; @regs
	.comm	_VI_MAX_WIDTH_NTSC,4,2          ; @VI_MAX_WIDTH_NTSC
	.comm	_VI_XFBMODE_SF,4,2              ; @VI_XFBMODE_SF
	.comm	_preRetraceCB,8,3               ; @preRetraceCB
	.comm	_postRetraceCB,8,3              ; @postRetraceCB
	.comm	_video_queue,4,2                ; @video_queue
	.comm	_IRQ_PI_VI,4,2                  ; @IRQ_PI_VI
	.comm	___VIRetraceHandler,4,2         ; @__VIRetraceHandler
.subsections_via_symbols
