	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv0299_init
_stv0299_init:                          ## @stv0299_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movl	(%r14), %edx
	orl	$48, %edx
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_stv0299_writeregI
	movl	$50, %edi
	callq	_msleep
	movq	8(%r14), %rax
	movq	(%rax), %rcx
	movl	(%rcx), %esi
	movl	4(%rcx), %edx
	cmpl	$255, %esi
	jne	LBB0_2
## %bb.1:
	cmpl	$255, %edx
	je	LBB0_9
LBB0_2:
	movl	$12, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$2, %esi
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$12, %esi
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%edx, %ecx
	andl	$-17, %ecx
	cmpq	$0, 8(%rax)
	cmovnel	%ecx, %edx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%edx, %eax
	andl	$15, %eax
	movl	%eax, (%r14)
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_stv0299_writeregI
	movq	8(%r14), %rax
	movq	(%rax), %rcx
	movl	-4(%rcx,%rbx), %esi
	movl	(%rcx,%rbx), %edx
	addq	$8, %rbx
	cmpl	$255, %esi
	jne	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$255, %edx
	jne	LBB0_3
LBB0_9:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"stv0299: init chip\n"

	.no_dead_strip	_stv0299_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv0299_init
_stv0299_init:                          ; @stv0299_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x19, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	ldr	w8, [x19]
	orr	w2, w8, #0x30
	mov	x0, x19
	mov	w1, #2
	bl	_stv0299_writeregI
	mov	w0, #50
	bl	_msleep
	ldr	x8, [x19, #8]
	ldr	x9, [x8]
	ldp	w1, w2, [x9]
	cmp	w1, #255
	b.ne	LBB0_2
; %bb.1:
	cmp	w2, #255
	b.eq	LBB0_9
LBB0_2:
	mov	x20, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w1, #2
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w1, #12
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x8, #8]
	and	w9, w2, #0xffffffef
	cmp	x8, #0
	csel	w2, w2, w9, eq
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	and	w8, w2, #0xf
	str	w8, [x19]
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_stv0299_writeregI
	ldr	x8, [x19, #8]
	ldr	x9, [x8]
	add	x9, x9, x20
	ldp	w1, w2, [x9, #8]
	add	x20, x20, #8
	cmp	w1, #255
	b.ne	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w2, #255
	b.ne	LBB0_3
LBB0_9:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"stv0299: init chip\n"

	.no_dead_strip	_stv0299_init
.subsections_via_symbols
