	.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, -72(%rbp)                 ## 4-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movl	16(%rbp), %r15d
	movq	%r9, -128(%rbp)                 ## 8-byte Spill
	leal	(%r9,%r14), %eax
	imull	%r15d, %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	%r15d, %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_62
## %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, -48(%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	%r15d, %r15d
	je	LBB0_61
## %bb.2:
	movq	%r14, -112(%rbp)                ## 8-byte Spill
	movl	32(%rbp), %r13d
	movl	24(%rbp), %r14d
	movl	-72(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %edx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdx
	movl	56(%rbp), %eax
	addl	%eax, %ecx
	addl	%eax, %esi
LBB0_4:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	%esi, %r13d
	movl	%ecx, %r14d
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	cmpl	16(%rbp), %eax
	je	LBB0_61
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_25 Depth 2
                                        ##       Child Loop BB0_27 Depth 3
                                        ##       Child Loop BB0_34 Depth 3
                                        ##       Child Loop BB0_40 Depth 3
	movq	-136(%rbp), %rax                ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	16(%rbp), %eax
	movq	_VCR_HACK_LINES@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	cmpl	%eax, -48(%rbp)                 ## 4-byte Folded Reload
	jae	LBB0_5
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	48(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$2, %eax
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$1, %eax
	jne	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $al killed $al killed $eax def $eax
	andb	$1, %al
	jmp	LBB0_20
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	andl	$3, %eax
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$2, %eax
	jmp	LBB0_19
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	movb	$1, %al
	jmp	LBB0_20
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_21
LBB0_17:                                ##   in Loop: Header=BB0_6 Depth=1
	testb	$1, -48(%rbp)                   ## 1-byte Folded Reload
	jmp	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	testl	%eax, %eax
LBB0_19:                                ##   in Loop: Header=BB0_6 Depth=1
	sete	%al
LBB0_20:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_21:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-112(%rbp), %rax                ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_58
## %bb.22:                              ##   in Loop: Header=BB0_6 Depth=1
                                        ## kill: def $eax killed $eax killed $rax def $rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rbx
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_25 Depth=2
	movq	%r12, %rdi
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	-104(%rbp), %r13                ## 8-byte Reload
	leal	(%rax,%r13), %edi
	callq	_cpu_to_le32
	movl	%eax, 12(%rbx)
	addl	%r14d, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rax,%rcx), %edi
	callq	_cpu_to_le32
	movq	%r13, %rdx
	movl	%eax, 16(%rbx)
	addq	$20, %rbx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	addl	-88(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%r14d, %r13d
LBB0_24:                                ##   in Loop: Header=BB0_25 Depth=2
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	addl	%ecx, %ebx
	movl	%edx, %r14d
	movq	%r13, %rsi
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	subl	%ecx, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rcx
	je	LBB0_59
LBB0_25:                                ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_27 Depth 3
                                        ##       Child Loop BB0_34 Depth 3
                                        ##       Child Loop BB0_40 Depth 3
	xorl	%ecx, %ecx
	testl	%ebx, %ebx
	je	LBB0_30
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	%rbx, %rax
	.p2align	4, 0x90
LBB0_27:                                ##   Parent Loop BB0_6 Depth=1
                                        ##     Parent Loop BB0_25 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r15, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %ebx
	jb	LBB0_32
## %bb.28:                              ##   in Loop: Header=BB0_27 Depth=3
	movq	%r15, %rdi
	callq	_sg_dma_len
	addq	$4, %r15
	subl	%eax, %ebx
	jne	LBB0_27
## %bb.29:                              ##   in Loop: Header=BB0_25 Depth=2
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_33
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_25 Depth=2
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	jne	LBB0_34
	jmp	LBB0_38
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_25 Depth=2
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
LBB0_33:                                ##   in Loop: Header=BB0_25 Depth=2
	xorl	%ecx, %ecx
	testl	%r14d, %r14d
	je	LBB0_38
	.p2align	4, 0x90
LBB0_34:                                ##   Parent Loop BB0_6 Depth=1
                                        ##     Parent Loop BB0_25 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r12, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r14d
	jb	LBB0_37
## %bb.35:                              ##   in Loop: Header=BB0_34 Depth=3
	movq	%r12, %rdi
	callq	_sg_dma_len
	addq	$4, %r12
	subl	%eax, %r14d
	jne	LBB0_34
## %bb.36:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	jmp	LBB0_39
	.p2align	4, 0x90
LBB0_37:                                ##   in Loop: Header=BB0_25 Depth=2
	movl	%r14d, %ecx
LBB0_38:                                ##   in Loop: Header=BB0_25 Depth=2
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_39:                                ##   in Loop: Header=BB0_25 Depth=2
	xorl	%eax, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	je	LBB0_44
	.p2align	4, 0x90
LBB0_40:                                ##   Parent Loop BB0_6 Depth=1
                                        ##     Parent Loop BB0_25 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rbx, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r13d
	jb	LBB0_43
## %bb.41:                              ##   in Loop: Header=BB0_40 Depth=3
	movq	%rbx, %rdi
	callq	_sg_dma_len
	addq	$4, %rbx
	subl	%eax, %r13d
	jne	LBB0_40
## %bb.42:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_44
	.p2align	4, 0x90
LBB0_43:                                ##   in Loop: Header=BB0_25 Depth=2
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
LBB0_44:                                ##   in Loop: Header=BB0_25 Depth=2
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leal	(%rax,%r13), %r14d
	movq	%r15, %rdi
	callq	_sg_dma_len
	movl	%r13d, %esi
	cmpl	%eax, %r14d
	jbe	LBB0_46
## %bb.45:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	%r15, %rdi
	callq	_sg_dma_len
	movl	%eax, %esi
	subl	-64(%rbp), %esi                 ## 4-byte Folded Reload
LBB0_46:                                ##   in Loop: Header=BB0_25 Depth=2
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_51
## %bb.47:                              ##   in Loop: Header=BB0_25 Depth=2
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	movl	%esi, %r14d
	movl	40(%rbp), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %r14d
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leal	(%r14,%rax), %r13d
	movq	%r12, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r13d
	jbe	LBB0_49
## %bb.48:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	%r12, %rdi
	callq	_sg_dma_len
	subl	-104(%rbp), %eax                ## 4-byte Folded Reload
	movl	40(%rbp), %ecx
	shll	%cl, %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	%eax, %r14d
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %r14d
LBB0_49:                                ##   in Loop: Header=BB0_25 Depth=2
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	addl	%r13d, %r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_len
	movq	_BT848_RISC_WRITE123@GOTPCREL(%rip), %rcx
	cmpl	%eax, %r14d
	movq	-112(%rbp), %r14                ## 8-byte Reload
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	jbe	LBB0_52
## %bb.50:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_len
	movl	%eax, %esi
	subl	%r13d, %esi
	movl	40(%rbp), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movq	_BT848_RISC_WRITE123@GOTPCREL(%rip), %rcx
	jmp	LBB0_52
	.p2align	4, 0x90
LBB0_51:                                ##   in Loop: Header=BB0_25 Depth=2
	movq	_BT848_RISC_WRITE1S23@GOTPCREL(%rip), %rcx
	movq	-112(%rbp), %r14                ## 8-byte Reload
	movq	-88(%rbp), %r13                 ## 8-byte Reload
LBB0_52:                                ##   in Loop: Header=BB0_25 Depth=2
	xorl	%eax, %eax
	movl	$0, %edx
	cmpl	%r14d, -96(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_54
## %bb.53:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	_BT848_RISC_SOL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_54:                                ##   in Loop: Header=BB0_25 Depth=2
	cmpl	%esi, -96(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_56
## %bb.55:                              ##   in Loop: Header=BB0_25 Depth=2
	movq	_BT848_RISC_EOL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_56:                                ##   in Loop: Header=BB0_25 Depth=2
	movl	(%rcx), %edi
	orl	%esi, %edi
	orl	%edx, %edi
	orl	%eax, %edi
	movl	%esi, %r14d
	callq	_cpu_to_le32
	movl	%r14d, -68(%rbp)                ## 4-byte Spill
	movl	40(%rbp), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %r14d
	movl	%eax, (%rbx)
	movl	%r14d, %edi
	shll	$16, %edi
	orl	%r14d, %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%rbx)
	movq	%r15, %rdi
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rax,%rcx), %edi
	callq	_cpu_to_le32
	movl	%eax, 8(%rbx)
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_23
## %bb.57:                              ##   in Loop: Header=BB0_25 Depth=2
	addq	$12, %rbx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_58:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%r13d, %esi
	movl	%r14d, %ecx
	movq	%rdx, %rbx
LBB0_59:                                ##   in Loop: Header=BB0_6 Depth=1
	addl	-128(%rbp), %ebx                ## 4-byte Folded Reload
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_3
## %bb.60:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdx
	jmp	LBB0_4
LBB0_61:
	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_62:
	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	x25, x7
	mov	x21, x6
	stp	w5, w3, [sp, #24]               ; 8-byte Folded Spill
	mov	x24, 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	x12, 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, #48]                   ; 4-byte Folded Spill
	ldr	w20, [x29, #16]
	ldr	w23, [sp, #28]                  ; 4-byte Folded Reload
	mov	x27, x24
	mov	x28, x24
	str	w21, [sp, #20]                  ; 4-byte Folded Spill
	ldr	w19, [sp, #44]                  ; 4-byte Folded Reload
	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, w25, w9
	add	w9, w20, w9
	ldr	w10, [sp, #52]                  ; 4-byte Folded Reload
	cmp	w10, #0
	csel	w20, w20, w9, eq
	csel	w25, w25, w8, eq
	ldr	x12, [sp, #56]                  ; 8-byte Folded Reload
	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_11 Depth 2
                                        ;       Child Loop BB0_12 Depth 3
                                        ;       Child Loop BB0_15 Depth 3
                                        ;       Child Loop BB0_18 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, #52]                   ; 4-byte Folded Spill
	str	x12, [sp, #56]                  ; 8-byte Folded Spill
	str	w13, [sp, #40]                  ; 4-byte Folded Spill
	cbz	w19, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, x19
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=2
	mov	x0, x27
	bl	_sg_dma_address
	add	w0, w0, w25
	bl	_cpu_to_le32
	str	w0, [x19, #12]
	add	w25, w21, w25
	mov	x0, x24
	bl	_sg_dma_address
	add	w0, w0, w20
	bl	_cpu_to_le32
	str	w0, [x19, #16]
	add	x8, x19, #20
	add	w20, w21, w20
	str	x8, [sp, #56]                   ; 8-byte Folded Spill
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	add	w23, w22, w23
	subs	w26, w26, w22
	ldr	w19, [sp, #44]                  ; 4-byte Folded Reload
	b.eq	LBB0_3
LBB0_11:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_12 Depth 3
                                        ;       Child Loop BB0_15 Depth 3
                                        ;       Child Loop BB0_18 Depth 3
	cbz	w23, LBB0_14
LBB0_12:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_11 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x28
	bl	_sg_dma_len
	cmp	w23, w0
	b.lo	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=3
	mov	x0, x28
	bl	_sg_dma_len
	add	x28, x28, #4
	subs	w23, w23, w0
	b.ne	LBB0_12
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=2
	cbz	w25, LBB0_17
LBB0_15:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_11 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x27
	bl	_sg_dma_len
	cmp	w25, w0
	b.lo	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=3
	mov	x0, x27
	bl	_sg_dma_len
	add	x27, x27, #4
	subs	w25, w25, w0
	b.ne	LBB0_15
LBB0_17:                                ;   in Loop: Header=BB0_11 Depth=2
	cbz	w20, LBB0_20
LBB0_18:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_11 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x24
	bl	_sg_dma_len
	cmp	w20, w0
	b.lo	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=3
	mov	x0, x24
	bl	_sg_dma_len
	add	x24, x24, #4
	subs	w20, w20, w0
	b.ne	LBB0_18
LBB0_20:                                ;   in Loop: Header=BB0_11 Depth=2
	add	w21, w23, w26
	mov	x0, x28
	bl	_sg_dma_len
	mov	x22, x26
	cmp	w21, w0
	b.ls	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_11 Depth=2
	mov	x0, x28
	bl	_sg_dma_len
	sub	w22, w0, w23
LBB0_22:                                ;   in Loop: Header=BB0_11 Depth=2
	ldr	w8, [sp, #52]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_27
; %bb.23:                               ;   in Loop: Header=BB0_11 Depth=2
	ldr	w8, [sp, #48]                   ; 4-byte Folded Reload
	lsr	w21, w22, w8
	add	w19, w21, w25
	mov	x0, x27
	bl	_sg_dma_len
	cmp	w19, w0
	b.ls	LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_11 Depth=2
	mov	x0, x27
	bl	_sg_dma_len
	sub	w8, w0, w25
	ldr	w9, [sp, #48]                   ; 4-byte Folded Reload
	lsl	w22, w8, w9
	lsr	w21, w22, w9
LBB0_25:                                ;   in Loop: Header=BB0_11 Depth=2
	add	w19, w21, w20
	mov	x0, x24
	bl	_sg_dma_len
Lloh12:
	adrp	x8, _BT848_RISC_WRITE123@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BT848_RISC_WRITE123@GOTPAGEOFF]
	cmp	w19, w0
	ldr	w19, [sp, #44]                  ; 4-byte Folded Reload
	b.ls	LBB0_28
; %bb.26:                               ;   in Loop: Header=BB0_11 Depth=2
	mov	x0, x24
	bl	_sg_dma_len
	sub	w8, w0, w20
	ldr	w9, [sp, #48]                   ; 4-byte Folded Reload
	lsl	w22, w8, w9
Lloh14:
	adrp	x8, _BT848_RISC_WRITE123@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BT848_RISC_WRITE123@GOTPAGEOFF]
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_11 Depth=2
Lloh16:
	adrp	x8, _BT848_RISC_WRITE1S23@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BT848_RISC_WRITE1S23@GOTPAGEOFF]
LBB0_28:                                ;   in Loop: Header=BB0_11 Depth=2
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _BT848_RISC_SOL@GOTPAGE
Lloh19:
	ldr	x9, [x9, _BT848_RISC_SOL@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w26, w19
	csel	w9, w9, wzr, eq
Lloh21:
	adrp	x10, _BT848_RISC_EOL@GOTPAGE
Lloh22:
	ldr	x10, [x10, _BT848_RISC_EOL@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	cmp	w26, 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, #56]                  ; 8-byte Folded Reload
	str	w0, [x19]
	ldr	w8, [sp, #48]                   ; 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, #52]                   ; 4-byte Folded Reload
	cbnz	w8, LBB0_9
; %bb.29:                               ;   in Loop: Header=BB0_11 Depth=2
	add	x19, x19, #12
	str	x19, [sp, #56]                  ; 8-byte Folded Spill
	b	LBB0_10
LBB0_30:
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	str	x12, [x9, #16]
	ldr	x8, [x9, #8]
	sub	x8, x12, 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 AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.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
