	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7146_start_preview          ## -- Begin function saa7146_start_preview
	.p2align	4, 0x90
_saa7146_start_preview:                 ## @saa7146_start_preview
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rsi
	movq	(%rsi), %r12
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rdx
	callq	_DEB_EE
	cmpq	$0, 40(%r12)
	je	LBB0_5
## %bb.1:
	movq	%rbx, %rdi
	callq	_IS_CAPTURE_ACTIVE
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	leaq	L_.str.2(%rip), %rdi
LBB0_3:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DEB_D
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DEB_D
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_6:
	subl	(%rax), %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	callq	_IS_OVERLAY_ACTIVE
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	cmpq	%rbx, (%r12)
	je	LBB0_14
## %bb.10:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_3
LBB0_11:
	movq	_RESOURCE_DMA1_HPS@GOTPCREL(%rip), %r15
	movq	_RESOURCE_DMA2_CLP@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	orl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_saa7146_res_get
	testq	%rax, %rax
	je	LBB0_15
## %bb.12:
	movq	32(%r12), %rax
	movq	%rax, -48(%rbp)
	movups	16(%r12), %xmm0
	movaps	%xmm0, -64(%rbp)
	xorl	%r14d, %r14d
	leaq	-64(%rbp), %rdx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_vidioc_try_fmt_vid_overlay
	testl	%eax, %eax
	je	LBB0_16
## %bb.13:
	movq	(%r12), %rdi
	movl	(%r13), %esi
	orl	(%r15), %esi
	callq	_saa7146_res_free
	jmp	LBB0_4
LBB0_14:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DEB_D
	jmp	LBB0_7
LBB0_15:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_3
LBB0_16:
	leaq	16(%r12), %rax
	movq	-48(%rbp), %rcx
	movq	%rcx, 16(%rax)
	movaps	-64(%rbp), %xmm0
	movups	%xmm0, (%rax)
	movl	36(%r12), %esi
	movl	32(%r12), %edx
	movl	28(%r12), %ecx
	movl	24(%r12), %r8d
	movq	48(%r12), %rax
	movl	(%rax), %r9d
	movq	_v4l2_field_names@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%r12), %rdi
	movl	(%rax,%rdi,4), %eax
	movl	%eax, (%rsp)
	leaq	L_.str.6(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DEB_D
	movq	%rbx, %rdi
	callq	_saa7146_enable_overlay
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r15d
	leaq	L_.str.7(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DEB_D
	movq	(%r12), %rdi
	movl	(%r13), %esi
	movq	_RESOURCE_DMA1_HPS@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_saa7146_res_free
	movl	%r15d, %r14d
	jmp	LBB0_7
LBB0_18:
	movq	_STATUS_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r12)
	movq	%rbx, (%r12)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dev:%p, fh:%p\n"

L_.str.1:                               ## @.str.1
	.asciz	"no overlay data available. try S_FMT first.\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.2:                               ## @.str.2
	.asciz	"streaming capture is active\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.3:                               ## @.str.3
	.asciz	"overlay is already active\n"

L_.str.4:                               ## @.str.4
	.asciz	"overlay is already active in another open\n"

	.comm	_RESOURCE_DMA1_HPS,4,2          ## @RESOURCE_DMA1_HPS
	.comm	_RESOURCE_DMA2_CLP,4,2          ## @RESOURCE_DMA2_CLP
L_.str.5:                               ## @.str.5
	.asciz	"cannot get necessary overlay resources\n"

L_.str.6:                               ## @.str.6
	.asciz	"%dx%d+%d+%d 0x%08x field=%s\n"

	.comm	_v4l2_field_names,8,3           ## @v4l2_field_names
L_.str.7:                               ## @.str.7
	.asciz	"enabling overlay failed: %d\n"

	.comm	_STATUS_OVERLAY,4,2             ## @STATUS_OVERLAY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7146_start_preview          ; -- Begin function saa7146_start_preview
	.p2align	2
_saa7146_start_preview:                 ; @saa7146_start_preview
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x19, x0
	ldr	x1, [x0]
	ldr	x21, [x1]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_DEB_EE
	ldr	x8, [x21, #40]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_IS_CAPTURE_ACTIVE
	cbz	x0, LBB0_8
; %bb.2:
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_3:
	bl	_DEB_D
LBB0_4:
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DEB_D
Lloh8:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	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
	add	sp, sp, #144
	ret
LBB0_8:
	mov	x0, x19
	bl	_IS_OVERLAY_ACTIVE
	cbz	x0, LBB0_11
; %bb.9:
	ldr	x8, [x21]
	cmp	x8, x19
	b.eq	LBB0_14
; %bb.10:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_3
LBB0_11:
Lloh12:
	adrp	x22, _RESOURCE_DMA1_HPS@GOTPAGE
Lloh13:
	ldr	x22, [x22, _RESOURCE_DMA1_HPS@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh14:
	adrp	x23, _RESOURCE_DMA2_CLP@GOTPAGE
Lloh15:
	ldr	x23, [x23, _RESOURCE_DMA2_CLP@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_saa7146_res_get
	cbz	x0, LBB0_15
; %bb.12:
	ldr	q0, [x21, #16]
	str	q0, [sp, #48]
	ldr	x8, [x21, #32]
	str	x8, [sp, #64]
	add	x2, sp, #48
	mov	x0, #0
	mov	x1, x19
	bl	_vidioc_try_fmt_vid_overlay
	cbz	w0, LBB0_16
; %bb.13:
	ldr	x0, [x21]
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w1, w9, w8
	bl	_saa7146_res_free
	b	LBB0_4
LBB0_14:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DEB_D
	mov	w20, #0
	b	LBB0_7
LBB0_15:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_3
LBB0_16:
	add	x8, x21, #16
	ldr	x9, [sp, #64]
	ldr	q0, [sp, #48]
	str	q0, [x8]
	str	x9, [x8, #16]
Lloh20:
	adrp	x8, _v4l2_field_names@GOTPAGE
Lloh21:
	ldr	x8, [x8, _v4l2_field_names@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ldr	x9, [x21, #16]
	ldr	w8, [x8, x9, lsl #2]
	ldr	x9, [x21, #48]
	ldp	w11, w10, [x21, #32]
	ldp	w13, w12, [x21, #24]
	ldr	w9, [x9]
	stp	x9, x8, [sp, #32]
	stp	x12, x13, [sp, #16]
	stp	x10, x11, [sp]
Lloh23:
	adrp	x0, l_.str.6@PAGE
Lloh24:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DEB_D
	mov	x0, x19
	bl	_saa7146_enable_overlay
	mov	x20, x0
	cbz	w0, LBB0_18
; %bb.17:
	str	x20, [sp]
Lloh25:
	adrp	x0, l_.str.7@PAGE
Lloh26:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_DEB_D
	ldr	x0, [x21]
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w1, w9, w8
	bl	_saa7146_res_free
	b	LBB0_7
LBB0_18:
Lloh27:
	adrp	x8, _STATUS_OVERLAY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _STATUS_OVERLAY@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	str	w8, [x21, #8]
	str	x19, [x21]
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dev:%p, fh:%p\n"

l_.str.1:                               ; @.str.1
	.asciz	"no overlay data available. try S_FMT first.\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.2:                               ; @.str.2
	.asciz	"streaming capture is active\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.3:                               ; @.str.3
	.asciz	"overlay is already active\n"

l_.str.4:                               ; @.str.4
	.asciz	"overlay is already active in another open\n"

	.comm	_RESOURCE_DMA1_HPS,4,2          ; @RESOURCE_DMA1_HPS
	.comm	_RESOURCE_DMA2_CLP,4,2          ; @RESOURCE_DMA2_CLP
l_.str.5:                               ; @.str.5
	.asciz	"cannot get necessary overlay resources\n"

l_.str.6:                               ; @.str.6
	.asciz	"%dx%d+%d+%d 0x%08x field=%s\n"

	.comm	_v4l2_field_names,8,3           ; @v4l2_field_names
l_.str.7:                               ; @.str.7
	.asciz	"enabling overlay failed: %d\n"

	.comm	_STATUS_OVERLAY,4,2             ; @STATUS_OVERLAY
.subsections_via_symbols
