	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpif_calculate_offsets
_vpif_calculate_offsets:                ## @vpif_calculate_offsets
	.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	%rbx
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	32(%rdi), %rsi
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	(%rcx,%rcx,8), %rax
	leaq	(%rax,%rax,2), %rax
	addq	%rcx, %rax
	movslq	16(%rsi,%rax), %r9
	movq	_V4L2_FIELD_ANY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	movq	%r9, %rcx
	cmpq	%r9, %r8
	jne	LBB0_5
## %bb.1:
	cmpl	$0, (%rdi)
	je	LBB0_3
## %bb.2:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_3:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rcx
LBB0_4:
	movq	(%rcx), %rcx
LBB0_5:
	leaq	(%rsi,%rax), %r14
	movq	%rcx, 24(%rdi)
	movl	20(%rsi,%rax), %ebx
	movl	24(%rsi,%rax), %r10d
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r15
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %r11
	cmpq	%rcx, %r15
	je	LBB0_7
## %bb.6:
	cmpq	%rcx, (%r11)
	je	LBB0_7
## %bb.8:
	movq	_V4L2_FIELD_SEQ_TB@GOTPCREL(%rip), %rdx
	cmpq	%rcx, (%rdx)
	jne	LBB0_10
## %bb.9:
	movl	$0, (%r14)
	movl	%ebx, %edx
	shrl	$2, %edx
	movl	%edx, 4(%rsi,%rax)
	shrl	%ebx
	movl	%ebx, 8(%rsi,%rax)
	addl	%edx, %ebx
	movl	%ebx, 12(%rsi,%rax)
	jmp	LBB0_12
LBB0_7:
	movl	$0, (%r14)
	movl	%r10d, 4(%rsi,%rax)
	shrl	%ebx
	movl	%ebx, 8(%rsi,%rax)
	addl	%r10d, %ebx
	movl	%ebx, 12(%rsi,%rax)
	jmp	LBB0_12
LBB0_10:
	movq	_V4L2_FIELD_SEQ_BT@GOTPCREL(%rip), %rdx
	cmpq	%rcx, (%rdx)
	jne	LBB0_12
## %bb.11:
	movl	$0, 4(%rsi,%rax)
	movl	%ebx, %edx
	shrl	$2, %edx
	movl	%edx, (%r14)
	shrl	%ebx
	movl	%ebx, 12(%rsi,%rax)
	addl	%edx, %ebx
	movl	%ebx, 8(%rsi,%rax)
LBB0_12:
	cmpq	%rcx, %r15
	sete	%dl
	movq	(%r11), %rax
	cmpq	%rcx, %rax
	sete	%cl
	orb	%dl, %cl
	movzbl	%cl, %ecx
	movl	%ecx, 8(%rdi)
	cmpl	$1, (%rdi)
	je	LBB0_14
## %bb.13:
	movl	%r9d, %ecx
	cmpq	%rcx, %r8
	sete	%dl
	cmpq	%rcx, %rax
	sete	%cl
	orb	%dl, %cl
	shll	%cl, %r10d
LBB0_14:
	movl	%r10d, 12(%rdi)
	movl	4(%rdi), %eax
	movl	%eax, 16(%rdi)
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ## @VPIF_VIDEO_INDEX
	.comm	_V4L2_FIELD_ANY,8,3             ## @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_NONE,8,3            ## @V4L2_FIELD_NONE
	.comm	_V4L2_FIELD_INTERLACED,8,3      ## @V4L2_FIELD_INTERLACED
	.comm	_V4L2_FIELD_SEQ_TB,8,3          ## @V4L2_FIELD_SEQ_TB
	.comm	_V4L2_FIELD_SEQ_BT,8,3          ## @V4L2_FIELD_SEQ_BT
	.no_dead_strip	_vpif_calculate_offsets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpif_calculate_offsets
_vpif_calculate_offsets:                ; @vpif_calculate_offsets
	.cfi_startproc
; %bb.0:
	ldr	x13, [x0, #32]
Lloh0:
	adrp	x8, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x14, [x8]
	mov	w8, #28
	madd	x15, x14, x8, x13
	ldrsw	x8, [x15, #16]
Lloh3:
	adrp	x9, _V4L2_FIELD_ANY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_FIELD_ANY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x16, _V4L2_FIELD_NONE@GOTPAGE
Lloh7:
	ldr	x16, [x16, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh8:
	adrp	x10, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh9:
	ldr	x10, [x10, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
	mov	x11, x8
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.1:
	ldr	w11, [x0]
	cbz	w11, LBB0_3
; %bb.2:
	ldr	x11, [x16]
	b	LBB0_4
LBB0_3:
	ldr	x11, [x10]
LBB0_4:
	str	x11, [x0, #24]
	mov	w12, #28
	madd	x12, x14, x12, x13
	ldp	w17, w12, [x12, #20]
	ldr	x16, [x16]
	ldr	x1, [x10]
	cmp	x16, x11
	ccmp	x1, x11, #4, ne
	b.ne	LBB0_6
; %bb.5:
	str	wzr, [x15]
	mov	w15, #28
	madd	x13, x14, x15, x13
	lsr	w14, w17, #1
	stp	w12, w14, [x13, #4]
	add	w14, w14, w12
	str	w14, [x13, #12]
	b	LBB0_10
LBB0_6:
Lloh10:
	adrp	x1, _V4L2_FIELD_SEQ_TB@GOTPAGE
Lloh11:
	ldr	x1, [x1, _V4L2_FIELD_SEQ_TB@GOTPAGEOFF]
Lloh12:
	ldr	x1, [x1]
	cmp	x1, x11
	b.ne	LBB0_8
; %bb.7:
	str	wzr, [x15]
	lsr	w15, w17, #2
	mov	w1, #28
	madd	x13, x14, x1, x13
	lsr	w14, w17, #1
	stp	w15, w14, [x13, #4]
	add	w14, w14, w15
	str	w14, [x13, #12]
	b	LBB0_10
LBB0_8:
Lloh13:
	adrp	x1, _V4L2_FIELD_SEQ_BT@GOTPAGE
Lloh14:
	ldr	x1, [x1, _V4L2_FIELD_SEQ_BT@GOTPAGEOFF]
Lloh15:
	ldr	x1, [x1]
	cmp	x1, x11
	b.ne	LBB0_10
; %bb.9:
	mov	w1, #28
	madd	x13, x14, x1, x13
	lsr	w14, w17, #2
	str	w14, [x15]
	lsr	w15, w17, #1
	add	w14, w15, w14
	str	wzr, [x13, #4]
	stp	w14, w15, [x13, #8]
LBB0_10:
	cmp	x16, x11
	ldr	x10, [x10]
	ccmp	x10, x11, #4, ne
	cset	w11, eq
	and	x8, x8, #0xffffffff
	cmp	x9, x8
	ccmp	x10, x8, #4, ne
	cset	w8, eq
	lsl	w8, w12, w8
	ldp	w9, w10, [x0]
	cmp	w9, #1
	csel	w8, w12, w8, eq
	stp	w11, w8, [x0, #8]
	str	w10, [x0, #16]
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ; @VPIF_VIDEO_INDEX
	.comm	_V4L2_FIELD_ANY,8,3             ; @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_NONE,8,3            ; @V4L2_FIELD_NONE
	.comm	_V4L2_FIELD_INTERLACED,8,3      ; @V4L2_FIELD_INTERLACED
	.comm	_V4L2_FIELD_SEQ_TB,8,3          ; @V4L2_FIELD_SEQ_TB
	.comm	_V4L2_FIELD_SEQ_BT,8,3          ; @V4L2_FIELD_SEQ_BT
	.no_dead_strip	_vpif_calculate_offsets
.subsections_via_symbols
