	.file	"extr_saa7146_hlp.c_saa7146_set_capture.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"buf:%p, next:%p\n"
.LC1:
	.string	"forcing sync to new frame\n"
	.text
	.p2align 4
	.globl	saa7146_set_capture
	.type	saa7146_set_capture, @function
saa7146_set_capture:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, QWORD PTR [rsi]
	mov	esi, DWORD PTR 12[rax]
	call	saa7146_format_by_fourcc@PLT
	mov	rsi, r12
	mov	rdx, r13
	mov	r14, QWORD PTR 8[rbp]
	lea	rdi, .LC0[rip]
	mov	rbx, rax
	xor	eax, eax
	call	DEB_CAP@PLT
	mov	esi, DWORD PTR PROT_ADDR1[rip]
	mov	rdi, rbp
	call	saa7146_read@PLT
	test	rax, rax
	je	.L9
.L2:
	mov	rax, QWORD PTR [r12]
	mov	rdi, rbp
	mov	edx, DWORD PTR 4[rax]
	mov	ecx, DWORD PTR [rax]
	mov	esi, DWORD PTR 8[rax]
	call	saa7146_set_window@PLT
	mov	esi, DWORD PTR [rbx]
	mov	rdi, rbp
	call	saa7146_set_output_format@PLT
	mov	rdi, rbp
	call	saa7146_disable_clipping@PLT
	mov	rax, QWORD PTR [r14]
	cmp	rax, QWORD PTR V4L2_FIELD_INTERLACED[rip]
	je	.L3
	mov	rdx, QWORD PTR V4L2_FIELD_TOP[rip]
	mov	rcx, QWORD PTR V4L2_FIELD_BOTTOM[rip]
	cmp	rax, rdx
	je	.L10
	cmp	rax, rcx
	je	.L11
.L3:
	mov	edi, DWORD PTR [rbx]
	call	IS_PLANAR@PLT
	mov	rsi, r12
	mov	rdi, rbp
	test	rax, rax
	je	.L5
	call	calculate_video_dma_grab_planar@PLT
	mov	esi, 1
	mov	rdi, rbp
	call	program_capture_engine@PLT
.L6:
	mov	edx, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR RPS_ADDR0[rip]
	mov	rdi, rbp
	call	saa7146_write@PLT
	mov	esi, DWORD PTR MC1[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	mov	edx, DWORD PTR MASK_12[rip]
	pop	rbp
	.cfi_def_cfa_offset 32
	or	edx, DWORD PTR MASK_28[rip]
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	saa7146_write@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	call	calculate_video_dma_grab_packed@PLT
	xor	esi, esi
	mov	rdi, rbp
	call	program_capture_engine@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	mov	QWORD PTR [r14], rcx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	lea	rdi, .LC1[rip]
	call	DEB_CAP@PLT
	mov	edx, DWORD PTR MASK_27[rip]
	mov	esi, DWORD PTR MC2[rip]
	mov	rdi, rbp
	call	saa7146_write@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	mov	QWORD PTR [r14], rdx
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	saa7146_set_capture, .-saa7146_set_capture
	.comm	V4L2_FIELD_TOP,8,8
	.comm	V4L2_FIELD_INTERLACED,8,8
	.comm	V4L2_FIELD_BOTTOM,8,8
	.comm	RPS_ADDR0,4,4
	.comm	PROT_ADDR1,4,4
	.comm	MC2,4,4
	.comm	MC1,4,4
	.comm	MASK_28,4,4
	.comm	MASK_27,4,4
	.comm	MASK_12,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_saa7146_hlp.c_saa7146_set_capture.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"buf:%p, next:%p\012\000"
	.align	2
.LC1:
	.ascii	"forcing sync to new frame\012\000"
	.text
	.align	2
	.global	saa7146_set_capture
	.syntax unified
	.arm
	.fpu softvfp
	.type	saa7146_set_capture, %function
saa7146_set_capture:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r1]
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	ldr	r1, [r3, #12]
	mov	r7, r2
	mov	r4, r0
	bl	saa7146_format_by_fourcc
	mov	r2, r7
	mov	r1, r5
	mov	r6, r0
	ldr	r0, .L10
	ldr	r7, [r4, #4]
	bl	DEB_CAP
	ldr	r3, .L10+4
	mov	r0, r4
	ldr	r1, [r3]
	bl	saa7146_read
	cmp	r0, #0
	beq	.L9
.L2:
	ldr	r1, [r5]
	mov	r0, r4
	ldr	r3, [r1]
	ldr	r2, [r1, #4]
	ldr	r1, [r1, #8]
	bl	saa7146_set_window
	ldr	r1, [r6]
	mov	r0, r4
	bl	saa7146_set_output_format
	mov	r0, r4
	bl	saa7146_disable_clipping
	ldr	r2, .L10+8
	ldr	r3, [r7]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L3
	ldr	r2, .L10+12
	ldr	r1, .L10+16
	ldr	r2, [r2]
	ldr	r1, [r1]
	cmp	r3, r2
	streq	r1, [r7]
	beq	.L3
	cmp	r3, r1
	streq	r2, [r7]
.L3:
	ldr	r0, [r6]
	bl	IS_PLANAR
	subs	r6, r0, #0
	mov	r1, r5
	mov	r0, r4
	beq	.L5
	bl	calculate_video_dma_grab_planar
	mov	r1, #1
	mov	r0, r4
	bl	program_capture_engine
.L6:
	ldr	r3, .L10+20
	ldr	r2, [r4]
	ldr	r1, [r3]
	mov	r0, r4
	bl	saa7146_write
	ldr	r2, .L10+24
	ldr	r3, .L10+28
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L10+32
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	orr	r2, r1, r2
	ldr	r1, [r3]
	b	saa7146_write
.L5:
	bl	calculate_video_dma_grab_packed
	mov	r1, r6
	mov	r0, r4
	bl	program_capture_engine
	b	.L6
.L9:
	ldr	r0, .L10+36
	bl	DEB_CAP
	ldr	r3, .L10+40
	ldr	r2, .L10+44
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	saa7146_write
	b	.L2
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	PROT_ADDR1
	.word	V4L2_FIELD_INTERLACED
	.word	V4L2_FIELD_TOP
	.word	V4L2_FIELD_BOTTOM
	.word	RPS_ADDR0
	.word	MASK_12
	.word	MASK_28
	.word	MC1
	.word	.LC1
	.word	MC2
	.word	MASK_27
	.size	saa7146_set_capture, .-saa7146_set_capture
	.comm	V4L2_FIELD_TOP,4,4
	.comm	V4L2_FIELD_INTERLACED,4,4
	.comm	V4L2_FIELD_BOTTOM,4,4
	.comm	RPS_ADDR0,4,4
	.comm	PROT_ADDR1,4,4
	.comm	MC2,4,4
	.comm	MC1,4,4
	.comm	MASK_28,4,4
	.comm	MASK_27,4,4
	.comm	MASK_12,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
