	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	24(%rdi), %r12
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,8), %rcx
	leaq	(%rcx,%rcx,2), %rbx
	addq	%rax, %rbx
	movl	16(%r12,%rbx), %r14d
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	$2, %edi
	callq	_vpif_dbg
	movq	_V4L2_FIELD_ANY@GOTPCREL(%rip), %r8
	cmpl	%r14d, (%r8)
	jne	LBB0_3
## %bb.1:
	cmpl	$0, (%r15)
	je	LBB0_4
## %bb.2:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	leaq	(%r12,%rbx), %rax
	addq	$16, %rax
	movslq	(%rax), %rcx
	jmp	LBB0_6
LBB0_4:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rax
LBB0_5:
	movq	(%rax), %rcx
LBB0_6:
	leaq	(%r12,%rbx), %r10
	movq	%rcx, 32(%r15)
	movl	20(%r12,%rbx), %eax
	movl	24(%r12,%rbx), %edx
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %r9
	cmpq	%rcx, %rsi
	je	LBB0_10
## %bb.7:
	cmpq	%rcx, (%r9)
	je	LBB0_10
## %bb.8:
	movq	_V4L2_FIELD_SEQ_TB@GOTPCREL(%rip), %rdi
	cmpq	%rcx, (%rdi)
	jne	LBB0_11
## %bb.9:
	movl	$0, (%r10)
	movl	%eax, %edi
	shrl	$2, %edi
	movl	%edi, 4(%r12,%rbx)
	shrl	%eax
	movl	%eax, 8(%r12,%rbx)
	addl	%edi, %eax
	movl	%eax, 12(%r12,%rbx)
	jmp	LBB0_13
LBB0_10:
	movl	$0, (%r10)
	movl	%edx, 4(%r12,%rbx)
	shrl	%eax
	movl	%eax, 8(%r12,%rbx)
	addl	%edx, %eax
	movl	%eax, 12(%r12,%rbx)
	jmp	LBB0_13
LBB0_11:
	movq	_V4L2_FIELD_SEQ_BT@GOTPCREL(%rip), %rdi
	cmpq	%rcx, (%rdi)
	jne	LBB0_13
## %bb.12:
	movl	$0, 4(%r12,%rbx)
	movl	%eax, %edi
	shrl	$2, %edi
	movl	%edi, (%r10)
	shrl	%eax
	movl	%eax, 12(%r12,%rbx)
	addl	%edi, %eax
	movl	%eax, 8(%r12,%rbx)
LBB0_13:
	cmpq	%rcx, %rsi
	sete	%bl
	movq	(%r9), %rax
	cmpq	%rcx, %rax
	sete	%cl
	orb	%bl, %cl
	movzbl	%cl, %ecx
	movl	%ecx, 8(%r15)
	cmpl	$1, (%r15)
	je	LBB0_15
## %bb.14:
	cmpl	(%r8), %r14d
	sete	%bl
	cmpq	%r14, %rax
	sete	%cl
	orb	%bl, %cl
	shll	%cl, %edx
LBB0_15:
	movl	%edx, 12(%r15)
	movl	4(%r15), %eax
	movl	%eax, 16(%r15)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ## @VPIF_VIDEO_INDEX
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vpif_calculate_offsets\n"

	.comm	_V4L2_FIELD_ANY,4,2             ## @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:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x21, [x0, #24]
Lloh0:
	adrp	x8, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	mov	w8, #28
	madd	x23, x22, x8, x21
	mov	x24, x23
	ldr	w20, [x24, #16]!
Lloh3:
	adrp	x8, _debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	bl	_vpif_dbg
Lloh8:
	adrp	x8, _V4L2_FIELD_ANY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _V4L2_FIELD_ANY@GOTPAGEOFF]
	ldr	w10, [x8]
Lloh10:
	adrp	x12, _V4L2_FIELD_NONE@GOTPAGE
Lloh11:
	ldr	x12, [x12, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh12:
	adrp	x9, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh13:
	ldr	x9, [x9, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
	cmp	w10, w20
	b.ne	LBB0_3
; %bb.1:
	ldr	w10, [x19]
	cbz	w10, LBB0_4
; %bb.2:
	ldr	x11, [x12]
	b	LBB0_5
LBB0_3:
	ldrsw	x11, [x24]
	b	LBB0_5
LBB0_4:
	ldr	x11, [x9]
LBB0_5:
	str	x11, [x19, #32]
	mov	w10, #28
	madd	x10, x22, x10, x21
	ldp	w13, w10, [x10, #20]
	ldr	x12, [x12]
	ldr	x14, [x9]
	cmp	x12, x11
	ccmp	x14, x11, #4, ne
	b.ne	LBB0_7
; %bb.6:
	str	wzr, [x23]
	mov	w14, #28
	madd	x14, x22, x14, x21
	lsr	w13, w13, #1
	stp	w10, w13, [x14, #4]
	add	w13, w13, w10
	str	w13, [x14, #12]
	b	LBB0_11
LBB0_7:
Lloh14:
	adrp	x14, _V4L2_FIELD_SEQ_TB@GOTPAGE
Lloh15:
	ldr	x14, [x14, _V4L2_FIELD_SEQ_TB@GOTPAGEOFF]
Lloh16:
	ldr	x14, [x14]
	cmp	x14, x11
	b.ne	LBB0_9
; %bb.8:
	str	wzr, [x23]
	lsr	w14, w13, #2
	mov	w15, #28
	madd	x15, x22, x15, x21
	lsr	w13, w13, #1
	stp	w14, w13, [x15, #4]
	add	w13, w13, w14
	str	w13, [x15, #12]
	b	LBB0_11
LBB0_9:
Lloh17:
	adrp	x14, _V4L2_FIELD_SEQ_BT@GOTPAGE
Lloh18:
	ldr	x14, [x14, _V4L2_FIELD_SEQ_BT@GOTPAGEOFF]
Lloh19:
	ldr	x14, [x14]
	cmp	x14, x11
	b.ne	LBB0_11
; %bb.10:
	mov	w14, #28
	madd	x14, x22, x14, x21
	lsr	w15, w13, #2
	str	w15, [x23]
	lsr	w13, w13, #1
	str	w13, [x14, #12]
	add	w13, w13, w15
	stp	wzr, w13, [x14, #4]
LBB0_11:
	cmp	x12, x11
	ldr	x9, [x9]
	ccmp	x9, x11, #4, ne
	cset	w11, eq
	str	w11, [x19, #8]
	ldr	w11, [x19]
	cmp	w11, #1
	b.eq	LBB0_13
; %bb.12:
	ldr	w8, [x8]
	cmp	w20, w8
	ccmp	x9, x20, #4, ne
	cset	w8, eq
	lsl	w10, w10, w8
LBB0_13:
	ldr	w8, [x19, #4]
	stp	w10, w8, [x19, #12]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ; @VPIF_VIDEO_INDEX
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vpif_calculate_offsets\n"

	.comm	_V4L2_FIELD_ANY,4,2             ; @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
