	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_vou_hw_init
_sh_vou_hw_init:                        ## @sh_vou_hw_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	movl	4(%r12), %edi
	callq	_sh_vou_ntsc_mode
	movl	%eax, %r15d
	movq	_VOUIR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_sh_vou_reg_a_write
	movq	_VOUSRR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	$257, %edx                      ## imm = 0x101
	callq	_sh_vou_reg_a_write
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_sh_vou_reg_a_read
	movl	$100, %r14d
	testl	$257, %eax                      ## imm = 0x101
	je	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_udelay
	cmpl	$2, %r14d
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_sh_vou_reg_a_read
	decl	%r14d
	testl	$257, %eax                      ## imm = 0x101
	jne	LBB0_4
LBB0_2:
	shll	$29, %r15d
	movl	4(%rbx), %edi
	movl	$101, %edx
	subl	%r14d, %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movl	(%r12), %eax
	movq	_SH_VOU_PCLK_FALLING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movl	%r15d, %edx
	orl	$268435456, %edx                ## imm = 0x10000000
	testl	%ecx, %ecx
	cmovel	%r15d, %edx
	movq	_SH_VOU_HSYNC_LOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movl	%edx, %esi
	orl	$134217728, %esi                ## imm = 0x8000000
	testl	%ecx, %ecx
	cmovel	%edx, %esi
	movq	_SH_VOU_VSYNC_LOW@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%esi, %edx
	orl	$67108864, %edx                 ## imm = 0x4000000
	testl	%eax, %eax
	cmovel	%esi, %edx
	movq	_VOUCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-67108864, %ecx                ## imm = 0xFC000000
	callq	_sh_vou_reg_ab_set
	movq	_VOURCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_sh_vou_reg_a_write
	movq	_VOUMSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$8388608, %edx                  ## imm = 0x800000
	callq	_sh_vou_reg_ab_write
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_sh_vou_set_fmt_vid_out
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_5:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VOUIR,4,2                      ## @VOUIR
	.comm	_VOUSRR,4,2                     ## @VOUSRR
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reset took %dus\n"

	.comm	_SH_VOU_PCLK_FALLING,4,2        ## @SH_VOU_PCLK_FALLING
	.comm	_SH_VOU_HSYNC_LOW,4,2           ## @SH_VOU_HSYNC_LOW
	.comm	_SH_VOU_VSYNC_LOW,4,2           ## @SH_VOU_VSYNC_LOW
	.comm	_VOUCR,4,2                      ## @VOUCR
	.comm	_VOURCR,4,2                     ## @VOURCR
	.comm	_VOUMSR,4,2                     ## @VOUMSR
	.no_dead_strip	_sh_vou_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_vou_hw_init
_sh_vou_hw_init:                        ; @sh_vou_hw_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x21, [x0, #8]
	ldr	w0, [x21, #4]
	bl	_sh_vou_ntsc_mode
	mov	x20, x0
Lloh0:
	adrp	x8, _VOUIR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VOUIR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_sh_vou_reg_a_write
Lloh3:
	adrp	x22, _VOUSRR@GOTPAGE
Lloh4:
	ldr	x22, [x22, _VOUSRR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w23, #257
	mov	x0, x19
	mov	w2, #257
	bl	_sh_vou_reg_a_write
	ldr	w1, [x22]
	mov	x0, x19
	bl	_sh_vou_reg_a_read
	mov	w24, #100
	tst	w0, w23
	b.eq	LBB0_3
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_udelay
	cmp	w24, #2
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_sh_vou_reg_a_read
	sub	w24, w24, #1
	and	w8, w0, w23
	cbnz	w8, LBB0_1
LBB0_3:
	lsl	w20, w20, #29
	ldr	w0, [x19, #4]
	mov	w8, #101
	sub	w2, w8, w24
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x21]
Lloh7:
	adrp	x9, _SH_VOU_PCLK_FALLING@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SH_VOU_PCLK_FALLING@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w10, w20, #0x10000000
	tst	w9, w8
	csel	w9, w20, w10, eq
Lloh10:
	adrp	x10, _SH_VOU_HSYNC_LOW@GOTPAGE
Lloh11:
	ldr	x10, [x10, _SH_VOU_HSYNC_LOW@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	orr	w11, w9, #0x8000000
	tst	w10, w8
	csel	w9, w9, w11, eq
Lloh13:
	adrp	x10, _SH_VOU_VSYNC_LOW@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SH_VOU_VSYNC_LOW@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w11, w9, #0x4000000
	tst	w10, w8
	csel	w2, w9, w11, eq
Lloh16:
	adrp	x8, _VOUCR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VOUCR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #-67108864
	bl	_sh_vou_reg_ab_set
Lloh19:
	adrp	x8, _VOURCR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VOURCR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #4
	bl	_sh_vou_reg_a_write
Lloh22:
	adrp	x8, _VOUMSR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VOUMSR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #8388608
	bl	_sh_vou_reg_ab_write
	mov	x0, x19
	mov	x1, x19
	bl	_sh_vou_set_fmt_vid_out
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh25:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_VOUIR,4,2                      ; @VOUIR
	.comm	_VOUSRR,4,2                     ; @VOUSRR
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reset took %dus\n"

	.comm	_SH_VOU_PCLK_FALLING,4,2        ; @SH_VOU_PCLK_FALLING
	.comm	_SH_VOU_HSYNC_LOW,4,2           ; @SH_VOU_HSYNC_LOW
	.comm	_SH_VOU_VSYNC_LOW,4,2           ; @SH_VOU_VSYNC_LOW
	.comm	_VOUCR,4,2                      ; @VOUCR
	.comm	_VOURCR,4,2                     ; @VOURCR
	.comm	_VOUMSR,4,2                     ; @VOUMSR
	.no_dead_strip	_sh_vou_hw_init
.subsections_via_symbols
