	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function copy_vbi_data
_copy_vbi_data:                         ## @copy_vbi_data
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rdi, %rbx
	movq	$0, -48(%rbp)
	movl	(%rdi), %eax
	movq	_IVTV_VBI_FRAMES@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	8(%rdi), %rax
	movslq	%edx, %r15
	movq	(%rax,%r15,8), %r12
	testl	%esi, %esi
	jle	LBB0_1
## %bb.3:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %eax
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	addq	$564, %r12                      ## imm = 0x234
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %r14
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	orl	%eax, -44(%rbp)
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	callq	_ivtv_service2vbi
	imull	$43, %r13d, %ecx
	movslq	%ecx, %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, 560(%rdx,%rcx,4)
	leaq	(%r12,%rcx,4), %rdi
	movq	24(%rbx), %rax
	movq	16(%rax,%r15), %rsi
	movl	$42, %edx
	xorl	%eax, %eax
	callq	_memcpy
	incl	%r13d
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	addq	$24, %r15
	cmpq	%r15, %r14
	je	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %rax
	movq	(%rax,%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, 12(%rax,%r15)
	movl	$-6, %ecx
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$12, %ecx
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	addl	8(%rax,%r15), %ecx
	movl	$1, %eax
	cmpl	$31, %ecx
	jg	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	orl	%eax, -48(%rbp)
	jmp	LBB0_10
LBB0_12:
	leaq	_copy_vbi_data.mpeg_hdr_data(%rip), %rsi
	movl	$128, %edx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_memcpy
	cmpl	$36, %r13d
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_2
## %bb.13:
	leaq	512(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	$4, %edx
	xorl	%eax, %eax
	callq	_memcpy
	leaq	528(%r12), %rdi
	leaq	560(%r12), %rsi
	movl	$1548, %edx                     ## imm = 0x60C
	callq	_memmove
	movl	$1552, %eax                     ## imm = 0x610
	jmp	LBB0_14
LBB0_1:
	leaq	_copy_vbi_data.mpeg_hdr_data(%rip), %rsi
	xorl	%r13d, %r13d
	movl	$128, %edx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_memcpy
LBB0_2:
	leaq	512(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$4, %edx
	xorl	%eax, %eax
	callq	_memcpy
	leaq	-48(%rbp), %rdi
	callq	_cpu_to_le32s
	leaq	-44(%rbp), %rdi
	callq	_cpu_to_le32s
	leaq	528(%r12), %rdi
	leaq	-48(%rbp), %rsi
	movl	$8, %edx
	xorl	%eax, %eax
	callq	_memcpy
	imull	$43, %r13d, %eax
	addl	$15, %eax
	andl	$65532, %eax                    ## imm = 0xFFFC
LBB0_14:
	leal	10(%rax), %ecx
	movl	%ecx, %edx
	shrl	$8, %edx
	movl	%edx, 80(%r12)
	andl	$254, %ecx
	movl	%ecx, 84(%r12)
	movl	%r14d, %ecx
	shrl	$29, %ecx
	orl	$33, %ecx
	movl	%ecx, 100(%r12)
	movl	%r14d, %ecx
	shrl	$22, %ecx
	movzbl	%cl, %ecx
	movl	%ecx, 104(%r12)
	movl	%r14d, %ecx
	shrl	$14, %ecx
	orl	$1, %ecx
	movzbl	%cl, %ecx
	movl	%ecx, 108(%r12)
	movl	%r14d, %ecx
	shrl	$7, %ecx
	movzbl	%cl, %ecx
	movl	%ecx, 112(%r12)
	leal	(%r14,%r14), %ecx
	incl	%ecx
	movzbl	%cl, %ecx
	movl	%ecx, 116(%r12)
	subl	$-128, %eax
	movq	16(%rbx), %rcx
	movl	%eax, (%rcx,%r15,4)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @copy_vbi_data.mpeg_hdr_data
_copy_vbi_data.mpeg_hdr_data:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	186                             ## 0xba
	.long	68                              ## 0x44
	.long	0                               ## 0x0
	.long	12                              ## 0xc
	.long	102                             ## 0x66
	.long	36                              ## 0x24
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	209                             ## 0xd1
	.long	211                             ## 0xd3
	.long	250                             ## 0xfa
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	189                             ## 0xbd
	.long	0                               ## 0x0
	.long	26                              ## 0x1a
	.long	132                             ## 0x84
	.long	128                             ## 0x80
	.long	7                               ## 0x7
	.long	33                              ## 0x21
	.long	0                               ## 0x0
	.long	93                              ## 0x5d
	.long	99                              ## 0x63
	.long	167                             ## 0xa7
	.long	255                             ## 0xff
	.long	255                             ## 0xff

	.comm	_IVTV_VBI_FRAMES,4,2            ## @IVTV_VBI_FRAMES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ITV0"

L_.str.1:                               ## @.str.1
	.asciz	"itv0"

	.no_dead_strip	_copy_vbi_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function copy_vbi_data
_copy_vbi_data:                         ; @copy_vbi_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x22, x2
	mov	x19, x0
	str	xzr, [sp, #40]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _IVTV_VBI_FRAMES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IVTV_VBI_FRAMES@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	ldr	x9, [x0, #8]
	sxtw	x24, w8
	ldr	x21, [x9, w8, sxtw #3]
	cmp	w1, #0
	b.le	LBB0_10
; %bb.1:
	str	x24, [sp, #24]                  ; 8-byte Folded Spill
	str	w22, [sp, #36]                  ; 4-byte Folded Spill
	mov	x24, #0
	mov	w23, #0
	add	x25, x21, #564
	mov	w8, #24
	umull	x26, w1, w8
	mov	w28, #-6
	mov	w22, #1
	mov	w20, #43
	mov	w27, #42
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w22, w8
	ldr	w9, [sp, #44]
	orr	w8, w9, w8
	str	w8, [sp, #44]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_ivtv_service2vbi
	smull	x8, w23, w20
	add	x9, x21, w8, sxtw #2
	str	w0, [x9, #560]
	add	x0, x25, x8, lsl #2
	ldr	x8, [x19, #24]
	add	x8, x8, x24
	ldr	x8, [x8, #16]
	stp	x8, x27, [sp]
	bl	_memcpy
	add	w23, w23, #1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, #24
	cmp	x26, x24
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldr	x0, [x8, x24]
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x8, x24
	ldp	w9, w8, [x8, #8]
	cmp	w8, #0
	mov	w8, #12
	csel	w8, w28, w8, eq
	add	w8, w8, w9
	cmp	w8, #31
	b.gt	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w22, w8
	ldr	w9, [sp, #40]
	orr	w8, w9, w8
	str	w8, [sp, #40]
	b	LBB0_3
LBB0_8:
	mov	w8, #128
Lloh3:
	adrp	x9, _copy_vbi_data.mpeg_hdr_data@PAGE
Lloh4:
	add	x9, x9, _copy_vbi_data.mpeg_hdr_data@PAGEOFF
	stp	x9, x8, [sp]
	mov	x0, x21
	bl	_memcpy
	cmp	w23, #36
	ldr	w22, [sp, #36]                  ; 4-byte Folded Reload
	ldr	x24, [sp, #24]                  ; 8-byte Folded Reload
	b.ne	LBB0_11
; %bb.9:
	add	x0, x21, #512
	mov	w8, #4
Lloh5:
	adrp	x9, l_.str@PAGE
Lloh6:
	add	x9, x9, l_.str@PAGEOFF
	stp	x9, x8, [sp]
	bl	_memcpy
	add	x0, x21, #528
	add	x1, x21, #560
	mov	w2, #1548
	bl	_memmove
	mov	w8, #1552
	b	LBB0_12
LBB0_10:
	mov	w8, #128
Lloh7:
	adrp	x9, _copy_vbi_data.mpeg_hdr_data@PAGE
Lloh8:
	add	x9, x9, _copy_vbi_data.mpeg_hdr_data@PAGEOFF
	stp	x9, x8, [sp]
	mov	x0, x21
	bl	_memcpy
	mov	w23, #0
LBB0_11:
	add	x0, x21, #512
	mov	w8, #4
Lloh9:
	adrp	x9, l_.str.1@PAGE
Lloh10:
	add	x9, x9, l_.str.1@PAGEOFF
	stp	x9, x8, [sp]
	bl	_memcpy
	add	x20, sp, #40
	add	x0, sp, #40
	bl	_cpu_to_le32s
	orr	x0, x20, #0x4
	bl	_cpu_to_le32s
	add	x0, x21, #528
	mov	w8, #8
	stp	x20, x8, [sp]
	bl	_memcpy
	mov	w8, #43
	orr	w9, wzr, #0xf
	madd	w8, w23, w8, w9
	and	w8, w8, #0xfffc
LBB0_12:
	add	w9, w8, #10
	lsr	w10, w9, #8
	and	w9, w9, #0xfe
	stp	w10, w9, [x21, #80]
	mov	w9, #33
	orr	w9, w9, w22, lsr #29
	ubfx	w10, w22, #22, #8
	stp	w9, w10, [x21, #100]
	lsr	w9, w22, #14
	and	w9, w9, #0xfe
	orr	w9, w9, #0x1
	ubfx	w10, w22, #7, #8
	stp	w9, w10, [x21, #108]
	mov	w9, #1
	bfi	w9, w22, #1, #7
	str	w9, [x21, #116]
	add	w8, w8, #128
	ldr	x9, [x19, #16]
	str	w8, [x9, x24, lsl #2]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @copy_vbi_data.mpeg_hdr_data
_copy_vbi_data.mpeg_hdr_data:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	186                             ; 0xba
	.long	68                              ; 0x44
	.long	0                               ; 0x0
	.long	12                              ; 0xc
	.long	102                             ; 0x66
	.long	36                              ; 0x24
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	209                             ; 0xd1
	.long	211                             ; 0xd3
	.long	250                             ; 0xfa
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	189                             ; 0xbd
	.long	0                               ; 0x0
	.long	26                              ; 0x1a
	.long	132                             ; 0x84
	.long	128                             ; 0x80
	.long	7                               ; 0x7
	.long	33                              ; 0x21
	.long	0                               ; 0x0
	.long	93                              ; 0x5d
	.long	99                              ; 0x63
	.long	167                             ; 0xa7
	.long	255                             ; 0xff
	.long	255                             ; 0xff

	.comm	_IVTV_VBI_FRAMES,4,2            ; @IVTV_VBI_FRAMES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ITV0"

l_.str.1:                               ; @.str.1
	.asciz	"itv0"

	.no_dead_strip	_copy_vbi_data
.subsections_via_symbols
