	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	40(%rdi), %rdx
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,4), %rsi
	movslq	24(%rdx,%rsi,8), %r9
	movq	_V4L2_FIELD_ANY@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	%r9, %rcx
	cmpq	%r9, %r8
	jne	LBB0_5
## %bb.1:
	cmpl	$0, 8(%rdi)
	je	LBB0_3
## %bb.2:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rax
LBB0_4:
	movq	(%rax), %rcx
LBB0_5:
	movq	%rcx, 32(%rdi)
	movq	_V4L2_MEMORY_USERPTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%rdx,%rsi,8), %rax
	jne	LBB0_7
## %bb.6:
	leaq	(%rdx,%rsi,8), %rax
	addq	$28, %rax
	jmp	LBB0_8
LBB0_7:
	movq	_config_params@GOTPCREL(%rip), %rbx
	movq	(%rdi), %rax
	shlq	$2, %rax
	addq	(%rbx), %rax
LBB0_8:
	movl	(%rax), %ebx
	movl	32(%rdx,%rsi,8), %r10d
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %r11
	cmpq	%rcx, %r14
	je	LBB0_10
## %bb.9:
	cmpq	%rcx, (%r11)
	je	LBB0_10
## %bb.11:
	movq	_V4L2_FIELD_SEQ_TB@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jne	LBB0_13
## %bb.12:
	movl	$0, 8(%rdx,%rsi,8)
	movl	%ebx, %eax
	shrl	$2, %eax
	movl	%eax, 12(%rdx,%rsi,8)
	shrl	%ebx
	movl	%ebx, 16(%rdx,%rsi,8)
	addl	%eax, %ebx
	movl	%ebx, 20(%rdx,%rsi,8)
	jmp	LBB0_15
LBB0_10:
	movl	$0, 8(%rdx,%rsi,8)
	movl	%r10d, 12(%rdx,%rsi,8)
	shrl	%ebx
	movl	%ebx, 16(%rdx,%rsi,8)
	addl	%r10d, %ebx
	movl	%ebx, 20(%rdx,%rsi,8)
	jmp	LBB0_15
LBB0_13:
	movq	_V4L2_FIELD_SEQ_BT@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jne	LBB0_15
## %bb.14:
	movl	$0, 12(%rdx,%rsi,8)
	movl	%ebx, %eax
	shrl	$2, %eax
	movl	%eax, 8(%rdx,%rsi,8)
	shrl	%ebx
	movl	%ebx, 20(%rdx,%rsi,8)
	addl	%eax, %ebx
	movl	%ebx, 16(%rdx,%rsi,8)
LBB0_15:
	cmpq	%rcx, %r14
	sete	%dl
	movq	(%r11), %rax
	cmpq	%rcx, %rax
	sete	%cl
	orb	%dl, %cl
	movzbl	%cl, %ecx
	movl	%ecx, 16(%rdi)
	cmpl	$1, 8(%rdi)
	je	LBB0_17
## %bb.16:
	movl	%r9d, %ecx
	cmpq	%rcx, %r8
	sete	%dl
	cmpq	%rcx, %rax
	sete	%cl
	orb	%dl, %cl
	shll	%cl, %r10d
LBB0_17:
	movl	%r10d, 20(%rdi)
	movl	12(%rdi), %eax
	movl	%eax, 24(%rdi)
	popq	%rbx
	popq	%r14
	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_MEMORY_USERPTR,8,3        ## @V4L2_MEMORY_USERPTR
	.comm	_config_params,8,3              ## @config_params
	.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	x12, [x0, #40]
Lloh0:
	adrp	x8, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x13, [x8]
	mov	w8, #40
	madd	x8, x13, x8, x12
	ldrsw	x8, [x8, #24]
Lloh3:
	adrp	x9, _V4L2_FIELD_ANY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_FIELD_ANY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x15, _V4L2_FIELD_NONE@GOTPAGE
Lloh7:
	ldr	x15, [x15, _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, #8]
	cbz	w11, LBB0_3
; %bb.2:
	ldr	x11, [x15]
	b	LBB0_4
LBB0_3:
	ldr	x11, [x10]
LBB0_4:
	str	x11, [x0, #32]
Lloh10:
	adrp	x14, _V4L2_MEMORY_USERPTR@GOTPAGE
Lloh11:
	ldr	x14, [x14, _V4L2_MEMORY_USERPTR@GOTPAGEOFF]
Lloh12:
	ldr	x14, [x14]
	mov	w16, #40
	mul	x16, x13, x16
	ldr	x16, [x12, x16]
	cmp	x14, x16
	b.ne	LBB0_6
; %bb.5:
	mov	w14, #40
	madd	x14, x13, x14, x12
	add	x14, x14, #28
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x14, _config_params@GOTPAGE
Lloh14:
	ldr	x14, [x14, _config_params@GOTPAGEOFF]
Lloh15:
	ldr	x14, [x14]
	ldr	x16, [x0]
	add	x14, x14, x16, lsl #2
LBB0_7:
	ldr	w16, [x14]
	mov	w14, #40
	madd	x14, x13, x14, x12
	ldr	w14, [x14, #32]
	ldr	x15, [x15]
	ldr	x17, [x10]
	cmp	x15, x11
	ccmp	x17, x11, #4, ne
	b.ne	LBB0_9
; %bb.8:
	mov	w17, #40
	madd	x12, x13, x17, x12
	stp	wzr, w14, [x12, #8]
	lsr	w13, w16, #1
	add	w16, w13, w14
	b	LBB0_13
LBB0_9:
Lloh16:
	adrp	x17, _V4L2_FIELD_SEQ_TB@GOTPAGE
Lloh17:
	ldr	x17, [x17, _V4L2_FIELD_SEQ_TB@GOTPAGEOFF]
Lloh18:
	ldr	x17, [x17]
	cmp	x17, x11
	b.ne	LBB0_11
; %bb.10:
	mov	w17, #40
	madd	x12, x13, x17, x12
	lsr	w13, w16, #2
	stp	wzr, w13, [x12, #8]
	lsr	w16, w16, #1
	add	w13, w16, w13
	stp	w16, w13, [x12, #16]
	b	LBB0_14
LBB0_11:
Lloh19:
	adrp	x17, _V4L2_FIELD_SEQ_BT@GOTPAGE
Lloh20:
	ldr	x17, [x17, _V4L2_FIELD_SEQ_BT@GOTPAGEOFF]
Lloh21:
	ldr	x17, [x17]
	cmp	x17, x11
	b.ne	LBB0_14
; %bb.12:
	mov	w17, #40
	madd	x12, x13, x17, x12
	lsr	w13, w16, #2
	stp	w13, wzr, [x12, #8]
	lsr	w16, w16, #1
	add	w13, w16, w13
LBB0_13:
	stp	w13, w16, [x12, #16]
LBB0_14:
	cmp	x15, 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, w14, w8
	ldp	w9, w10, [x0, #8]
	cmp	w9, #1
	csel	w8, w14, w8, eq
	stp	w11, w8, [x0, #16]
	str	w10, [x0, #24]
	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
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.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_MEMORY_USERPTR,8,3        ; @V4L2_MEMORY_USERPTR
	.comm	_config_params,8,3              ; @config_params
	.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
