	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bttv_risc_planar
_bttv_risc_planar:                      ## @bttv_risc_planar
	.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
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
	movl	%r8d, %r14d
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movl	16(%rbp), %r12d
	movq	%r9, -128(%rbp)                 ## 8-byte Spill
	leal	(%r9,%r14), %eax
	imull	%r12d, %eax
	addl	%eax, %eax
	addl	$3, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	divl	(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	addl	%r12d, %eax
	movq	%rdi, -136(%rbp)                ## 8-byte Spill
	movl	8(%rdi), %edi
	leal	(%rax,%rax,4), %eax
	leal	40(,%rax,4), %edx
	callq	_btcx_riscmem_alloc
	testl	%eax, %eax
	js	LBB0_61
## %bb.1:
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	movq	8(%rbx), %rbx
	movq	_BT848_RISC_SYNC@GOTPCREL(%rip), %rax
	movq	_BT848_FIFO_STATUS_FM3@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movl	%eax, (%rbx)
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	xorl	%edi, %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%rbx)
	addq	$8, %rbx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	testl	%r12d, %r12d
	je	LBB0_60
## %bb.2:
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movl	32(%rbp), %r14d
	movl	24(%rbp), %r13d
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	movq	%r15, %rdx
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%esi, %r14d
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	cmpl	16(%rbp), %eax
	je	LBB0_60
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_24 Depth 2
                                        ##       Child Loop BB0_25 Depth 3
                                        ##       Child Loop BB0_35 Depth 3
                                        ##       Child Loop BB0_42 Depth 3
	movq	-136(%rbp), %rax                ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	16(%rbp), %eax
	movq	_VCR_HACK_LINES@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	cmpl	%eax, -52(%rbp)                 ## 4-byte Folded Reload
	jae	LBB0_4
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	48(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$2, %eax
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$1, %eax
	jne	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	-52(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $al killed $al killed $eax def $eax
	andb	$1, %al
	jmp	LBB0_19
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	andl	$3, %eax
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$2, %eax
	jmp	LBB0_18
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movb	$1, %al
	jmp	LBB0_19
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_20
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	testb	$1, -52(%rbp)                   ## 1-byte Folded Reload
	jmp	LBB0_18
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	testl	%eax, %eax
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=1
	sete	%al
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-104(%rbp), %rax                ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_57
## %bb.21:                              ##   in Loop: Header=BB0_5 Depth=1
                                        ## kill: def $eax killed $eax killed $rax def $rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_24 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r13), %edi
	callq	_cpu_to_le32
	movl	%eax, 12(%r14)
	addl	%ebx, %r13d
	movq	%r12, %rdi
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	leal	(%rax,%r12), %edi
	callq	_cpu_to_le32
	movl	%eax, 16(%r14)
	addq	$20, %r14
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	addl	%r12d, %ebx
	movl	%ebx, %esi
LBB0_23:                                ##   in Loop: Header=BB0_24 Depth=2
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	addl	%edx, %ecx
	movl	%ecx, %r12d
	movl	%esi, %r14d
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	subl	%edx, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	je	LBB0_58
LBB0_24:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_25 Depth 3
                                        ##       Child Loop BB0_35 Depth 3
                                        ##       Child Loop BB0_42 Depth 3
	xorl	%eax, %eax
	testl	%r12d, %r12d
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_30
	.p2align	4, 0x90
LBB0_25:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_24 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r15, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r12d
	jb	LBB0_29
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=3
	movq	%r15, %rdi
	callq	_sg_dma_len
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_sg_next
	movq	%rax, %r15
	subl	%ebx, %r12d
	jne	LBB0_25
## %bb.27:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	xorl	%eax, %eax
	jmp	LBB0_31
	.p2align	4, 0x90
LBB0_29:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	%r12d, %eax
LBB0_30:                                ##   in Loop: Header=BB0_24 Depth=2
	movq	-96(%rbp), %r12                 ## 8-byte Reload
LBB0_31:                                ##   in Loop: Header=BB0_24 Depth=2
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	addl	%ebx, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_sg_dma_len
	movl	%ebx, %esi
	cmpl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	jbe	LBB0_33
## %bb.32:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	%r15, %rdi
	callq	_sg_dma_len
	movl	%eax, %esi
	subl	-112(%rbp), %esi                ## 4-byte Folded Reload
LBB0_33:                                ##   in Loop: Header=BB0_24 Depth=2
	cmpb	$0, -48(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_39
## %bb.34:                              ##   in Loop: Header=BB0_24 Depth=2
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_40
	.p2align	4, 0x90
LBB0_35:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_24 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rbx, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r13d
	jb	LBB0_38
## %bb.36:                              ##   in Loop: Header=BB0_35 Depth=3
	movq	%rbx, %rdi
	callq	_sg_dma_len
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_sg_next
	movq	%rax, %rbx
	subl	%r12d, %r13d
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_35
## %bb.37:                              ##   in Loop: Header=BB0_24 Depth=2
	xorl	%r13d, %r13d
LBB0_38:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_41
	.p2align	4, 0x90
LBB0_39:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	%r14d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_BT848_RISC_WRITE1S23@GOTPCREL(%rip), %rax
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_51
LBB0_40:                                ##   in Loop: Header=BB0_24 Depth=2
	xorl	%r13d, %r13d
LBB0_41:                                ##   in Loop: Header=BB0_24 Depth=2
	testl	%r14d, %r14d
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_46
	.p2align	4, 0x90
LBB0_42:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_24 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r12, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r14d
	jb	LBB0_44
## %bb.43:                              ##   in Loop: Header=BB0_42 Depth=3
	movq	%r12, %rdi
	callq	_sg_dma_len
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_sg_next
	movq	%rax, %r12
	subl	%ebx, %r14d
	jne	LBB0_42
	jmp	LBB0_45
LBB0_44:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	%r14d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
LBB0_45:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	-44(%rbp), %esi                 ## 4-byte Reload
LBB0_46:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	%esi, %ebx
	movl	40(%rbp), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %ebx
	leal	(%rbx,%r13), %r14d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_len
	cmpl	%eax, %r14d
	jbe	LBB0_48
## %bb.47:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_len
	subl	%r13d, %eax
	movl	40(%rbp), %ecx
	shll	%cl, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %ebx
LBB0_48:                                ##   in Loop: Header=BB0_24 Depth=2
	addl	-64(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	%r12, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %ebx
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jbe	LBB0_50
## %bb.49:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	%r12, %rdi
	callq	_sg_dma_len
	movl	%eax, %esi
	subl	-64(%rbp), %esi                 ## 4-byte Folded Reload
	movl	40(%rbp), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movq	_BT848_RISC_WRITE123@GOTPCREL(%rip), %rax
	jmp	LBB0_51
	.p2align	4, 0x90
LBB0_50:                                ##   in Loop: Header=BB0_24 Depth=2
	movq	_BT848_RISC_WRITE123@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %esi                 ## 4-byte Reload
LBB0_51:                                ##   in Loop: Header=BB0_24 Depth=2
	xorl	%ecx, %ecx
	movl	$0, %edx
	cmpl	%ebx, -88(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_53
## %bb.52:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	_BT848_RISC_SOL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_53:                                ##   in Loop: Header=BB0_24 Depth=2
	cmpl	%esi, -88(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_55
## %bb.54:                              ##   in Loop: Header=BB0_24 Depth=2
	movq	_BT848_RISC_EOL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_55:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	(%rax), %edi
	orl	%esi, %edi
	orl	%edx, %edi
	orl	%ecx, %edi
	movl	%esi, %ebx
	callq	_cpu_to_le32
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	40(%rbp), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %ebx
	movl	%eax, (%r14)
	movl	%ebx, %edi
	shll	$16, %edi
	orl	%ebx, %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%r14)
	movq	%r15, %rdi
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	leal	(%rax,%rcx), %edi
	callq	_cpu_to_le32
	movl	%eax, 8(%r14)
	cmpb	$0, -48(%rbp)                   ## 1-byte Folded Reload
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	jne	LBB0_22
## %bb.56:                              ##   in Loop: Header=BB0_24 Depth=2
	addq	$12, %r14
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_57:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%r14d, %esi
	movl	%r12d, %ecx
LBB0_58:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%ecx, %r12d
	addl	-128(%rbp), %r12d               ## 4-byte Folded Reload
	cmpb	$0, -48(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_3
## %bb.59:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	56(%rbp), %eax
	addl	%eax, %r13d
	addl	%eax, %esi
	jmp	LBB0_3
LBB0_60:
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 16(%rax)
	subq	8(%rax), %rcx
	addq	$8, %rcx
	movslq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	%rax, %rcx
	seta	%dil
	callq	_BUG_ON
	xorl	%eax, %eax
LBB0_61:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_BT848_RISC_SYNC,4,2            ## @BT848_RISC_SYNC
	.comm	_BT848_FIFO_STATUS_FM3,4,2      ## @BT848_FIFO_STATUS_FM3
	.comm	_VCR_HACK_LINES,4,2             ## @VCR_HACK_LINES
	.comm	_BT848_RISC_WRITE123,4,2        ## @BT848_RISC_WRITE123
	.comm	_BT848_RISC_WRITE1S23,4,2       ## @BT848_RISC_WRITE1S23
	.comm	_BT848_RISC_SOL,4,2             ## @BT848_RISC_SOL
	.comm	_BT848_RISC_EOL,4,2             ## @BT848_RISC_EOL
	.no_dead_strip	_bttv_risc_planar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bttv_risc_planar
_bttv_risc_planar:                      ; @bttv_risc_planar
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x7
	mov	x21, x6
	stp	w5, w3, [sp, #24]               ; 8-byte Folded Spill
	mov	x26, x2
	mov	x19, x1
	str	w4, [sp, #44]                   ; 4-byte Folded Spill
	add	w8, w5, w4
	mul	w8, w6, w8
	lsl	w8, w8, #1
	add	w8, w8, #3
Lloh0:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	udiv	w8, w8, w9
	add	w8, w8, w6
	str	x0, [sp, #32]                   ; 8-byte Folded Spill
	ldr	w0, [x0, #8]
	mov	w9, #20
	mul	w8, w8, w9
	add	w2, w8, #40
	bl	_btcx_riscmem_alloc
	tbnz	w0, #31, LBB0_31
; %bb.1:
Lloh3:
	adrp	x8, _BT848_RISC_SYNC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BT848_RISC_SYNC@GOTPAGEOFF]
	str	x19, [sp]                       ; 8-byte Folded Spill
	ldr	x20, [x19, #8]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _BT848_FIFO_STATUS_FM3@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BT848_FIFO_STATUS_FM3@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_cpu_to_le32
	str	w0, [x20]
	mov	w0, #0
	bl	_cpu_to_le32
	add	x19, x20, #8
	str	w0, [x20, #4]
	cbz	w21, LBB0_30
; %bb.2:
	mov	w13, #0
	ldr	w8, [x29, #28]
	str	w8, [sp, #16]                   ; 4-byte Folded Spill
	ldr	w8, [x29, #24]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldr	w8, [x29, #20]
	str	w8, [sp, #56]                   ; 4-byte Folded Spill
	ldr	w20, [x29, #16]
	ldr	w23, [sp, #28]                  ; 4-byte Folded Reload
	mov	x27, x26
	mov	x28, x26
	str	w21, [sp, #20]                  ; 4-byte Folded Spill
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldp	w21, w8, [sp, #20]              ; 8-byte Folded Reload
	add	w23, w23, w8
	ldr	w9, [sp, #16]                   ; 4-byte Folded Reload
	add	w8, w24, w9
	add	w9, w20, w9
	ldr	w10, [sp, #60]                  ; 4-byte Folded Reload
	cmp	w10, #0
	csel	w20, w20, w9, eq
	csel	w24, w24, w8, eq
	ldr	w13, [sp, #40]                  ; 4-byte Folded Reload
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w13, w13, #1
	cmp	w13, w21
	b.eq	LBB0_30
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;       Child Loop BB0_11 Depth 3
                                        ;       Child Loop BB0_17 Depth 3
                                        ;       Child Loop BB0_20 Depth 3
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh9:
	adrp	x8, _VCR_HACK_LINES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VCR_HACK_LINES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	sub	w8, w21, w8
	cmp	w13, w8
	b.hs	LBB0_4
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	and	w8, w13, #0x3
	cmp	w8, #2
	cset	w9, eq
	cmp	w8, #0
	cset	w8, eq
	ldr	w11, [sp, #28]                  ; 4-byte Folded Reload
	cmp	w11, #0
	csel	w8, w9, w8, ne
	and	w9, w13, #0x1
	tst	w13, #0x1
	cset	w10, eq
	cmp	w11, #0
	csel	w9, w9, w10, ne
	ldr	w10, [sp, #12]                  ; 4-byte Folded Reload
	cmp	w10, #1
	csel	w9, wzr, w9, ne
	cmp	w10, #2
	csel	w8, w8, w9, eq
	cmp	w10, #0
	mov	w9, #1
	csel	w8, w9, w8, eq
	str	w8, [sp, #60]                   ; 4-byte Folded Spill
	ldr	w25, [sp, #44]                  ; 4-byte Folded Reload
	str	w13, [sp, #40]                  ; 4-byte Folded Spill
	cbnz	w25, LBB0_10
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x27
	bl	_sg_dma_address
	add	w0, w0, w24
	bl	_cpu_to_le32
	str	w0, [x19, #12]
	add	w24, w21, w24
	mov	x0, x26
	bl	_sg_dma_address
	add	w0, w0, w20
	bl	_cpu_to_le32
	str	w0, [x19, #16]
	add	x19, x19, #20
	add	w20, w21, w20
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	w23, w22, w23
	subs	w25, w25, w22
	b.eq	LBB0_3
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_11 Depth 3
                                        ;       Child Loop BB0_17 Depth 3
                                        ;       Child Loop BB0_20 Depth 3
	str	x19, [sp, #48]                  ; 8-byte Folded Spill
	cbz	w23, LBB0_13
LBB0_11:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x28
	bl	_sg_dma_len
	cmp	w23, w0
	b.lo	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=3
	mov	x0, x28
	bl	_sg_dma_len
	sub	w23, w23, w0
	mov	x0, x28
	bl	_sg_next
	mov	x28, x0
	cbnz	w23, LBB0_11
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=2
	add	w21, w23, w25
	mov	x0, x28
	bl	_sg_dma_len
	mov	x22, x25
	cmp	w21, w0
	b.ls	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x28
	bl	_sg_dma_len
	sub	w22, w0, w23
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=2
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_27
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=2
	cbz	w24, LBB0_19
LBB0_17:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x27
	bl	_sg_dma_len
	cmp	w24, w0
	b.lo	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=3
	mov	x0, x27
	bl	_sg_dma_len
	sub	w24, w24, w0
	mov	x0, x27
	bl	_sg_next
	mov	x27, x0
	cbnz	w24, LBB0_17
LBB0_19:                                ;   in Loop: Header=BB0_10 Depth=2
	cbz	w20, LBB0_22
LBB0_20:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x26
	bl	_sg_dma_len
	cmp	w20, w0
	b.lo	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=3
	mov	x0, x26
	bl	_sg_dma_len
	sub	w20, w20, w0
	mov	x0, x26
	bl	_sg_next
	mov	x26, x0
	cbnz	w20, LBB0_20
LBB0_22:                                ;   in Loop: Header=BB0_10 Depth=2
	ldr	w8, [sp, #56]                   ; 4-byte Folded Reload
	lsr	w21, w22, w8
	add	w19, w24, w21
	mov	x0, x27
	bl	_sg_dma_len
	cmp	w19, w0
	b.ls	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x27
	bl	_sg_dma_len
	sub	w8, w0, w24
	ldr	w9, [sp, #56]                   ; 4-byte Folded Reload
	lsl	w22, w8, w9
	lsr	w21, w22, w9
LBB0_24:                                ;   in Loop: Header=BB0_10 Depth=2
	add	w19, w21, w20
	mov	x0, x26
	bl	_sg_dma_len
	cmp	w19, w0
	b.ls	LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x26
	bl	_sg_dma_len
	sub	w8, w0, w20
	ldr	w9, [sp, #56]                   ; 4-byte Folded Reload
	lsl	w22, w8, w9
LBB0_26:                                ;   in Loop: Header=BB0_10 Depth=2
Lloh12:
	adrp	x8, _BT848_RISC_WRITE123@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BT848_RISC_WRITE123@GOTPAGEOFF]
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_10 Depth=2
Lloh14:
	adrp	x8, _BT848_RISC_WRITE1S23@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BT848_RISC_WRITE1S23@GOTPAGEOFF]
LBB0_28:                                ;   in Loop: Header=BB0_10 Depth=2
	ldr	w10, [sp, #44]                  ; 4-byte Folded Reload
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _BT848_RISC_SOL@GOTPAGE
Lloh17:
	ldr	x9, [x9, _BT848_RISC_SOL@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w25, w10
	csel	w9, w9, wzr, eq
Lloh19:
	adrp	x10, _BT848_RISC_EOL@GOTPAGE
Lloh20:
	ldr	x10, [x10, _BT848_RISC_EOL@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	cmp	w25, w22
	csel	w10, w10, wzr, eq
	orr	w8, w8, w22
	orr	w8, w8, w9
	orr	w0, w8, w10
	bl	_cpu_to_le32
	ldr	x19, [sp, #48]                  ; 8-byte Folded Reload
	str	w0, [x19]
	ldr	w8, [sp, #56]                   ; 4-byte Folded Reload
	lsr	w21, w22, w8
	orr	w0, w21, w21, lsl #16
	bl	_cpu_to_le32
	str	w0, [x19, #4]
	mov	x0, x28
	bl	_sg_dma_address
	add	w0, w0, w23
	bl	_cpu_to_le32
	str	w0, [x19, #8]
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	cbnz	w8, LBB0_8
; %bb.29:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x19, x19, #12
	b	LBB0_9
LBB0_30:
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	str	x19, [x9, #16]
	ldr	x8, [x9, #8]
	sub	x8, x19, x8
	add	x8, x8, #8
	ldrsw	x9, [x9]
	cmp	x8, x9
	cset	w0, hi
	bl	_BUG_ON
	mov	w0, #0
LBB0_31:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_BT848_RISC_SYNC,4,2            ; @BT848_RISC_SYNC
	.comm	_BT848_FIFO_STATUS_FM3,4,2      ; @BT848_FIFO_STATUS_FM3
	.comm	_VCR_HACK_LINES,4,2             ; @VCR_HACK_LINES
	.comm	_BT848_RISC_WRITE123,4,2        ; @BT848_RISC_WRITE123
	.comm	_BT848_RISC_WRITE1S23,4,2       ; @BT848_RISC_WRITE1S23
	.comm	_BT848_RISC_SOL,4,2             ; @BT848_RISC_SOL
	.comm	_BT848_RISC_EOL,4,2             ; @BT848_RISC_EOL
	.no_dead_strip	_bttv_risc_planar
.subsections_via_symbols
