	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa7146_set_position
_saa7146_set_position:                  ## @saa7146_set_position
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	(%rdi), %r15
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%r9, %rsi
	callq	_saa7146_format_by_fourcc
	movq	32(%r15), %rcx
	movl	(%rcx), %edx
	movl	24(%r15), %r13d
	movq	16(%r15), %rcx
	leal	(%r13,%r13), %esi
	movl	%esi, -112(%rbp)
	cmpq	$0, (%r15)
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_1
## %bb.2:
	addl	%r12d, %r14d
	imull	%r13d, %r14d
	movslq	%r14d, %rax
	addq	%rax, %rcx
	leal	7(%rdx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$3, %eax
	imull	%ebx, %eax
	movslq	%eax, %rbx
	addq	%rcx, %rbx
	movl	%r13d, %eax
	negl	%eax
	cltq
	addq	%rbx, %rax
	imull	%r13d, %r12d
	movslq	%r12d, %rcx
	movq	%rax, %r14
	subq	%rcx, %r14
	jmp	LBB0_3
LBB0_1:
	movslq	%r13d, %rax
	imull	%r13d, %r14d
	movslq	%r14d, %rsi
	addq	%rsi, %rcx
	leal	7(%rdx), %esi
	testl	%edx, %edx
	cmovnsl	%edx, %esi
	sarl	$3, %esi
	imull	%ebx, %esi
	movslq	%esi, %rbx
	addq	%rcx, %rbx
	addq	%rbx, %rax
	imull	%r13d, %r12d
	movslq	%r12d, %r14
	addq	%rbx, %r14
LBB0_3:
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movq	%rbx, -80(%rbp)
	movq	%rax, -72(%rbp)
	movq	%r14, -88(%rbp)
	movl	%r12d, %edi
	callq	_V4L2_FIELD_HAS_BOTH
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	jmp	LBB0_10
LBB0_5:
	movq	_V4L2_FIELD_ALTERNATE@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_6
## %bb.7:
	movq	_V4L2_FIELD_TOP@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_8
LBB0_6:
	movq	%r14, -72(%rbp)
	movl	%r13d, -112(%rbp)
	movl	%r13d, %ecx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
LBB0_10:
	cmpq	$0, (%r15)
	je	LBB0_12
## %bb.11:
	negl	%ecx
	movl	%ecx, -112(%rbp)
LBB0_12:
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movq	8(%r15), %rax
	movl	(%rax), %ecx
	shll	$16, %ecx
	movslq	%ecx, %rcx
	addq	8(%rax), %rcx
	movq	%rcx, -104(%rbp)
	leaq	-112(%rbp), %rdx
	movl	$1, %esi
	callq	_saa7146_write_out_dma
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_V4L2_FIELD_BOTTOM@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	jne	LBB0_10
## %bb.9:
	movq	%rbx, -72(%rbp)
	movq	%r14, -80(%rbp)
	movl	%r13d, -112(%rbp)
	movl	%r13d, %ecx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_FIELD_ALTERNATE,4,2       ## @V4L2_FIELD_ALTERNATE
	.comm	_V4L2_FIELD_TOP,4,2             ## @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,4,2          ## @V4L2_FIELD_BOTTOM
	.no_dead_strip	_saa7146_set_position
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa7146_set_position
_saa7146_set_position:                  ; @saa7146_set_position
	.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	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	ldr	x25, [x0]
	mov	x1, x5
	bl	_saa7146_format_by_fourcc
	mov	x20, x0
	ldr	x8, [x25, #32]
	ldr	w8, [x8]
	ldr	w27, [x25, #24]
	sxtw	x9, w27
	ldr	x10, [x25, #16]
	lsl	w26, w27, #1
	str	w26, [sp]
	ldr	x11, [x25]
	add	w12, w22, w23
	mul	w12, w27, w12
	add	x12, x10, w12, sxtw
	add	w13, w8, #7
	cmp	w8, #0
	csel	w14, w13, w8, lt
	asr	w14, w14, #3
	smaddl	x12, w14, w24, x12
	neg	w14, w27
	add	x14, x12, w14, sxtw
	mul	w15, w27, w22
	sub	x16, x14, w15, sxtw
	mul	w17, w27, w23
	add	x10, x10, w17, sxtw
	cmp	w8, #0
	csel	w8, w13, w8, lt
	asr	w8, w8, #3
	smaddl	x8, w8, w24, x10
	add	x9, x8, x9
	add	x10, x8, w15, sxtw
	cmp	x11, #0
	csel	x22, x12, x8, ne
	csel	x8, x14, x9, ne
	stp	x22, x8, [sp, #32]
	csel	x23, x16, x10, ne
	str	x23, [sp, #24]
	mov	x0, x21
	bl	_V4L2_FIELD_HAS_BOTH
	cbnz	x0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _V4L2_FIELD_ALTERNATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_FIELD_ALTERNATE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _V4L2_FIELD_TOP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_FIELD_TOP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_7
LBB0_3:
	str	x23, [sp, #40]
	str	w27, [sp]
	mov	x26, x27
LBB0_4:
	ldr	x8, [x25]
	cbz	x8, LBB0_6
; %bb.5:
	neg	w8, w26
	str	w8, [sp]
LBB0_6:
	ldr	w8, [x20]
	str	w8, [sp, #16]
	ldr	x8, [x25, #8]
	ldr	w9, [x8]
	lsl	w9, w9, #16
	ldr	x8, [x8, #8]
	add	x8, x8, w9, sxtw
	str	x8, [sp, #8]
	mov	x2, sp
	mov	x0, x19
	mov	w1, #1
	bl	_saa7146_write_out_dma
	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
LBB0_7:
Lloh6:
	adrp	x8, _V4L2_FIELD_BOTTOM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_FIELD_BOTTOM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.8:
	stp	x23, x22, [sp, #32]
	mov	x26, x27
	str	w27, [sp]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_FIELD_ALTERNATE,4,2       ; @V4L2_FIELD_ALTERNATE
	.comm	_V4L2_FIELD_TOP,4,2             ; @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,4,2          ; @V4L2_FIELD_BOTTOM
	.no_dead_strip	_saa7146_set_position
.subsections_via_symbols
