	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_risc_packed               ## -- Begin function bttv_risc_packed
	.p2align	4, 0x90
_bttv_risc_packed:                      ## @bttv_risc_packed
	.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	$56, %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, %r13d
	movl	%ecx, %r14d
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movl	24(%rbp), %esi
	movl	16(%rbp), %r15d
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	leal	(%r9,%r13), %eax
	imull	%esi, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	divl	(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%r15,4), %ecx
	addl	%esi, %eax
	leal	(%rcx,%rax,8), %edx
	addl	$24, %edx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	8(%rdi), %edi
	movq	%rbx, %rsi
	callq	_btcx_riscmem_alloc
	testl	%eax, %eax
	js	LBB0_23
## %bb.1:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rbx
	movq	_BT848_RISC_SYNC@GOTPCREL(%rip), %rax
	movq	_BT848_FIFO_STATUS_FM1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movl	%eax, (%rbx)
	xorl	%edi, %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%rbx)
	addq	$8, %rbx
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.10:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_BT848_RISC_SKIP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	%r13d, %edi
	movq	_BT848_RISC_SOL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_BT848_RISC_EOL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_cpu_to_le32
	leaq	4(%rbx), %rcx
	movl	%eax, (%rbx)
	movq	%rcx, %rbx
	decl	%r15d
	jne	LBB0_11
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rcx
LBB0_3:
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	24(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_22
## %bb.4:
	xorl	%edx, %edx
	movq	_BT848_RISC_WRITE@GOTPCREL(%rip), %rbx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	orl	%ecx, %edi
	orl	%r14d, %edi
	movq	_BT848_RISC_EOL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	%rcx, %r14
	callq	_cpu_to_le32
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r13), %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%rbx)
	addq	$8, %rbx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	addl	%r14d, %r13d
	movl	24(%rbp), %ecx
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movq	%r15, %rbx
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addl	-88(%rbp), %r13d                ## 4-byte Folded Reload
	movl	%r13d, %r14d
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	%edx
	cmpl	%ecx, %edx
	je	LBB0_22
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_17 Depth 2
	cmpq	$0, (%rdi)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ecx, %eax
	movq	_VCR_HACK_LINES@GOTPCREL(%rip), %rsi
	subl	(%rsi), %eax
	cmpl	%eax, %edx
	jae	LBB0_21
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	testl	%r14d, %r14d
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	je	LBB0_13
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r14d
	jb	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=2
	movq	%r12, %rdi
	callq	_sg_dma_len
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_sg_next
	movq	%rax, %r12
	subl	%r15d, %r14d
	jne	LBB0_8
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%r14d, %r13d
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	callq	_sg_dma_len
	subl	%r13d, %eax
	movq	%rbx, %r15
	movl	(%rbx), %edi
	movq	_BT848_RISC_SOL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpl	%ecx, %eax
	jae	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	orl	%edi, %r14d
	movq	%r12, %rdi
	callq	_sg_dma_len
	subl	%r13d, %eax
	orl	%eax, %r14d
	movl	%r14d, %edi
	callq	_cpu_to_le32
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r13), %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%rbx)
	movq	%r12, %rdi
	callq	_sg_dma_len
	addl	-72(%rbp), %r13d                ## 4-byte Folded Reload
	subl	%eax, %r13d
	movq	%r12, %rdi
	callq	_sg_next
	movq	%rax, %r12
	leaq	8(%rbx), %r14
	movq	%rax, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r13d
	jle	LBB0_16
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r15), %ebx
	movq	%r12, %rdi
	callq	_sg_dma_len
	orl	%eax, %ebx
	movl	%ebx, %edi
	movq	%r15, %rbx
	callq	_cpu_to_le32
	movl	%eax, (%r14)
	movq	%r12, %rdi
	callq	_sg_dma_address
	movl	%eax, %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%r14)
	movq	%r12, %rdi
	callq	_sg_dma_len
	subl	%eax, %r13d
	movq	%r12, %rdi
	callq	_sg_next
	movq	%rax, %r12
	addq	$8, %r14
	movq	%rax, %rdi
	callq	_sg_dma_len
	cmpl	%eax, %r13d
	jg	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	leaq	-8(%r14), %r15
	jmp	LBB0_19
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rbx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rbx), %edi
	orl	%r13d, %edi
	movq	_BT848_RISC_EOL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movl	%eax, (%r14)
	movq	%r12, %rdi
	callq	_sg_dma_address
	movl	%eax, %edi
	callq	_cpu_to_le32
	movl	%eax, 12(%r15)
	addq	$16, %r15
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	24(%rbp), %ecx
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	jmp	LBB0_20
LBB0_22:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	-80(%rbp), %rax                 ## 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_23:
	addq	$56, %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_FM1,4,2      ## @BT848_FIFO_STATUS_FM1
	.comm	_BT848_RISC_SKIP,4,2            ## @BT848_RISC_SKIP
	.comm	_BT848_RISC_SOL,4,2             ## @BT848_RISC_SOL
	.comm	_BT848_RISC_EOL,4,2             ## @BT848_RISC_EOL
	.comm	_VCR_HACK_LINES,4,2             ## @VCR_HACK_LINES
	.comm	_BT848_RISC_WRITE,4,2           ## @BT848_RISC_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_risc_packed               ; -- Begin function bttv_risc_packed
	.p2align	2
_bttv_risc_packed:                      ; @bttv_risc_packed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x7
	mov	x26, x6
	mov	x21, x5
	mov	x22, x4
	mov	x25, x3
	mov	x24, x2
	mov	x19, x1
	mov	x23, x0
	add	w8, w5, w4
	mul	w8, w8, w7
Lloh0:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	udiv	w8, w8, w9
	add	w8, w7, w8
	lsl	w8, w8, #3
	add	w8, w8, w6, lsl #2
	add	w2, w8, #24
	ldr	w0, [x0, #8]
	bl	_btcx_riscmem_alloc
	tbnz	w0, #31, LBB0_20
; %bb.1:
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	str	w21, [sp, #20]                  ; 4-byte Folded Spill
Lloh3:
	adrp	x8, _BT848_RISC_SYNC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BT848_RISC_SYNC@GOTPAGEOFF]
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	ldr	x21, [x19, #8]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _BT848_FIFO_STATUS_FM1@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BT848_FIFO_STATUS_FM1@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_cpu_to_le32
	str	w0, [x21]
	mov	w0, #0
	bl	_cpu_to_le32
	add	x19, x21, #8
	str	w0, [x21, #4]
	cbz	w26, LBB0_4
; %bb.2:
Lloh9:
	adrp	x27, _BT848_RISC_SKIP@GOTPAGE
Lloh10:
	ldr	x27, [x27, _BT848_RISC_SKIP@GOTPAGEOFF]
Lloh11:
	adrp	x28, _BT848_RISC_SOL@GOTPAGE
Lloh12:
	ldr	x28, [x28, _BT848_RISC_SOL@GOTPAGEOFF]
Lloh13:
	adrp	x21, _BT848_RISC_EOL@GOTPAGE
Lloh14:
	ldr	x21, [x21, _BT848_RISC_EOL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	w26, w26, #1
	ldr	w8, [x27]
	ldr	w9, [x28]
	ldr	w10, [x21]
	orr	w8, w8, w22
	orr	w8, w8, w9
	orr	w0, w8, w10
	bl	_cpu_to_le32
	str	w0, [x19], #4
	cbnz	w26, LBB0_3
LBB0_4:
	ldr	x28, [sp, #24]                  ; 8-byte Folded Reload
	cbz	w20, LBB0_19
; %bb.5:
	mov	w26, #0
Lloh15:
	adrp	x27, _BT848_RISC_WRITE@GOTPAGE
Lloh16:
	ldr	x27, [x27, _BT848_RISC_WRITE@GOTPAGEOFF]
Lloh17:
	adrp	x23, _BT848_RISC_SOL@GOTPAGE
Lloh18:
	ldr	x23, [x23, _BT848_RISC_SOL@GOTPAGEOFF]
	ldr	w21, [sp, #20]                  ; 4-byte Folded Reload
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_9 Depth=1
Lloh19:
	adrp	x10, _BT848_RISC_EOL@GOTPAGE
Lloh20:
	ldr	x10, [x10, _BT848_RISC_EOL@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	orr	w8, w8, w22
	orr	w8, w8, w9
	orr	w0, w8, w10
	bl	_cpu_to_le32
	str	w0, [x19]
	mov	x0, x24
	bl	_sg_dma_address
	add	w0, w0, w25
	bl	_cpu_to_le32
	add	x8, x19, #8
	str	w0, [x19, #4]
	add	w25, w25, w22
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w25, w25, w21
	mov	x19, x8
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w26, w26, #1
	cmp	w26, w20
	b.eq	LBB0_19
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
                                        ;     Child Loop BB0_16 Depth 2
	ldr	x8, [x28]
	cbz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh22:
	adrp	x8, _VCR_HACK_LINES@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VCR_HACK_LINES@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	sub	w8, w20, w8
	cmp	w26, w8
	b.hs	LBB0_8
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	cbz	w25, LBB0_14
LBB0_12:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x24
	bl	_sg_dma_len
	cmp	w25, w0
	b.lo	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	mov	x0, x24
	bl	_sg_dma_len
	sub	w25, w25, w0
	mov	x0, x24
	bl	_sg_next
	mov	x24, x0
	cbnz	w25, LBB0_12
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	bl	_sg_dma_len
	ldr	w8, [x27]
	ldr	w9, [x23]
	sub	w10, w0, w25
	cmp	w10, w22
	b.hs	LBB0_6
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	orr	w21, w9, w8
	mov	x0, x24
	bl	_sg_dma_len
	sub	w8, w0, w25
	orr	w0, w21, w8
	bl	_cpu_to_le32
	str	w0, [x19]
	mov	x0, x24
	bl	_sg_dma_address
	add	w0, w0, w25
	bl	_cpu_to_le32
	str	w0, [x19, #4]
	mov	x0, x24
	bl	_sg_dma_len
	add	w8, w25, w22
	sub	w25, w8, w0
	mov	x0, x24
	bl	_sg_next
	mov	x24, x0
	add	x28, x19, #8
	bl	_sg_dma_len
	cmp	w25, w0
	b.le	LBB0_18
LBB0_16:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w19, [x27]
	mov	x0, x24
	bl	_sg_dma_len
	orr	w0, w0, w19
	bl	_cpu_to_le32
	str	w0, [x28]
	mov	x0, x24
	bl	_sg_dma_address
	bl	_cpu_to_le32
	str	w0, [x28, #4]
	mov	x0, x24
	bl	_sg_dma_len
	sub	w25, w25, w0
	mov	x0, x24
	bl	_sg_next
	mov	x24, x0
	add	x28, x28, #8
	bl	_sg_dma_len
	cmp	w25, w0
	b.gt	LBB0_16
; %bb.17:                               ;   in Loop: Header=BB0_9 Depth=1
	sub	x19, x28, #8
LBB0_18:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w21, [sp, #20]                  ; 4-byte Folded Reload
	ldr	w8, [x27]
Lloh25:
	adrp	x9, _BT848_RISC_EOL@GOTPAGE
Lloh26:
	ldr	x9, [x9, _BT848_RISC_EOL@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w8, w25
	orr	w0, w8, w9
	bl	_cpu_to_le32
	str	w0, [x28]
	mov	x0, x24
	bl	_sg_dma_address
	bl	_cpu_to_le32
	add	x8, x19, #16
	str	w0, [x19, #12]
	ldr	x28, [sp, #24]                  ; 8-byte Folded Reload
	b	LBB0_7
LBB0_19:
	ldr	x9, [sp, #8]                    ; 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_20:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_BT848_RISC_SYNC,4,2            ; @BT848_RISC_SYNC
	.comm	_BT848_FIFO_STATUS_FM1,4,2      ; @BT848_FIFO_STATUS_FM1
	.comm	_BT848_RISC_SKIP,4,2            ; @BT848_RISC_SKIP
	.comm	_BT848_RISC_SOL,4,2             ; @BT848_RISC_SOL
	.comm	_BT848_RISC_EOL,4,2             ; @BT848_RISC_EOL
	.comm	_VCR_HACK_LINES,4,2             ; @VCR_HACK_LINES
	.comm	_BT848_RISC_WRITE,4,2           ; @BT848_RISC_WRITE
.subsections_via_symbols
