	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7146_set_capture            ## -- Begin function saa7146_set_capture
	.p2align	4, 0x90
_saa7146_set_capture:                   ## @saa7146_set_capture
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rsi), %rax
	movl	12(%rax), %esi
	callq	_saa7146_format_by_fourcc
	movq	%rax, %r15
	movq	8(%rbx), %r13
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_DEB_CAP
	movq	_PROT_ADDR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_saa7146_read
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DEB_CAP
	movq	_MC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MASK_27@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_saa7146_write
LBB0_2:
	movq	(%r14), %rax
	movl	8(%rax), %esi
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	movq	%rbx, %rdi
	callq	_saa7146_set_window
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_saa7146_set_output_format
	movq	%rbx, %rdi
	callq	_saa7146_disable_clipping
	movq	(%r13), %rcx
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	je	LBB0_7
## %bb.3:
	movq	_V4L2_FIELD_TOP@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_V4L2_FIELD_BOTTOM@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	%rax, %rcx
	jne	LBB0_5
## %bb.4:
	movq	%rdx, %rax
	jmp	LBB0_6
LBB0_5:
	cmpq	%rdx, %rcx
	jne	LBB0_7
LBB0_6:
	movq	%rax, (%r13)
LBB0_7:
	movl	(%r15), %edi
	callq	_IS_PLANAR
	movq	%rbx, %rdi
	movq	%r14, %rsi
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	callq	_calculate_video_dma_grab_planar
	movl	$1, %esi
	jmp	LBB0_10
LBB0_9:
	callq	_calculate_video_dma_grab_packed
	xorl	%esi, %esi
LBB0_10:
	movq	%rbx, %rdi
	callq	_program_capture_engine
	movq	_RPS_ADDR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%rbx, %rdi
	callq	_saa7146_write
	movq	_MC1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MASK_12@GOTPCREL(%rip), %rax
	movq	_MASK_28@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_saa7146_write                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"buf:%p, next:%p\n"

	.comm	_PROT_ADDR1,4,2                 ## @PROT_ADDR1
L_.str.1:                               ## @.str.1
	.asciz	"forcing sync to new frame\n"

	.comm	_MC2,4,2                        ## @MC2
	.comm	_MASK_27,4,2                    ## @MASK_27
	.comm	_V4L2_FIELD_INTERLACED,8,3      ## @V4L2_FIELD_INTERLACED
	.comm	_V4L2_FIELD_TOP,8,3             ## @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,8,3          ## @V4L2_FIELD_BOTTOM
	.comm	_RPS_ADDR0,4,2                  ## @RPS_ADDR0
	.comm	_MC1,4,2                        ## @MC1
	.comm	_MASK_12,4,2                    ## @MASK_12
	.comm	_MASK_28,4,2                    ## @MASK_28
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7146_set_capture            ; -- Begin function saa7146_set_capture
	.p2align	2
_saa7146_set_capture:                   ; @saa7146_set_capture
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1]
	ldr	w1, [x8, #12]
	bl	_saa7146_format_by_fourcc
	mov	x21, x0
	ldr	x23, [x19, #8]
	stp	x20, x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DEB_CAP
Lloh2:
	adrp	x8, _PROT_ADDR1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PROT_ADDR1@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_saa7146_read
	cbnz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DEB_CAP
Lloh7:
	adrp	x8, _MC2@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MC2@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _MASK_27@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MASK_27@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_saa7146_write
LBB0_2:
	ldr	x8, [x20]
	ldp	w2, w1, [x8, #4]
	ldr	w3, [x8]
	mov	x0, x19
	bl	_saa7146_set_window
	ldr	w1, [x21]
	mov	x0, x19
	bl	_saa7146_set_output_format
	mov	x0, x19
	bl	_saa7146_disable_clipping
	ldr	x8, [x23]
Lloh13:
	adrp	x9, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh14:
	ldr	x9, [x9, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.3:
Lloh16:
	adrp	x9, _V4L2_FIELD_TOP@GOTPAGE
Lloh17:
	ldr	x9, [x9, _V4L2_FIELD_TOP@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x9]
Lloh19:
	adrp	x9, _V4L2_FIELD_BOTTOM@GOTPAGE
Lloh20:
	ldr	x9, [x9, _V4L2_FIELD_BOTTOM@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x10
	b.eq	LBB0_5
; %bb.4:
	cmp	x8, x9
	mov	x9, x10
	b.ne	LBB0_6
LBB0_5:
	str	x9, [x23]
LBB0_6:
	ldr	w0, [x21]
	bl	_IS_PLANAR
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_calculate_video_dma_grab_planar
	mov	w1, #1
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_calculate_video_dma_grab_packed
	mov	w1, #0
LBB0_9:
	mov	x0, x19
	bl	_program_capture_engine
Lloh22:
	adrp	x8, _RPS_ADDR0@GOTPAGE
Lloh23:
	ldr	x8, [x8, _RPS_ADDR0@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x19
	bl	_saa7146_write
Lloh25:
	adrp	x8, _MC1@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MC1@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _MASK_12@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MASK_12@GOTPAGEOFF]
Lloh30:
	adrp	x9, _MASK_28@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MASK_28@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_saa7146_write
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh32
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"buf:%p, next:%p\n"

	.comm	_PROT_ADDR1,4,2                 ; @PROT_ADDR1
l_.str.1:                               ; @.str.1
	.asciz	"forcing sync to new frame\n"

	.comm	_MC2,4,2                        ; @MC2
	.comm	_MASK_27,4,2                    ; @MASK_27
	.comm	_V4L2_FIELD_INTERLACED,8,3      ; @V4L2_FIELD_INTERLACED
	.comm	_V4L2_FIELD_TOP,8,3             ; @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,8,3          ; @V4L2_FIELD_BOTTOM
	.comm	_RPS_ADDR0,4,2                  ; @RPS_ADDR0
	.comm	_MC1,4,2                        ; @MC1
	.comm	_MASK_12,4,2                    ; @MASK_12
	.comm	_MASK_28,4,2                    ; @MASK_28
.subsections_via_symbols
