	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function buffer_activate
_buffer_activate:                       ## @buffer_activate
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	8(%rsi), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_video_dbg
	movq	$0, (%r12)
	movq	_TASK_A@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%rbx), %r15
	movq	8(%rbx), %r13
	movl	16(%rbx), %edi
	callq	_V4L2_FIELD_HAS_BOTH
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	movq	%rbx, %r15
	movq	%r13, %rcx
	movq	%rax, %r8
	callq	_set_size
	movq	24(%rbx), %rax
	xorl	%ebx, %ebx
	cmpq	$0, 64(%rax)
	setne	%bl
	movq	_TASK_A@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SAA7134_DATA_PATH
	leal	(%rbx,%rbx), %edx
	incl	%edx
	movl	%eax, %edi
	movl	$63, %esi
	callq	_saa_andorb
	movq	_SAA7134_OFMT_VIDEO_A@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r15), %rax
	movl	56(%rax), %esi
	callq	_saa_writeb
	movq	%r12, %rdi
	callq	_saa7134_buffer_base
	movq	%rax, %r12
	movq	(%r15), %r14
	movq	24(%r15), %rsi
	cmpq	$0, 32(%rsi)
	jne	LBB0_2
## %bb.1:
	movslq	(%rsi), %rcx
	imulq	%rcx, %r14
	shrq	$3, %r14
LBB0_2:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	_SAA7134_RS_CONTROL_BURST_16@GOTPCREL(%rip), %rcx
	movq	_SAA7134_RS_CONTROL_ME@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	4(%rdi), %ecx
	sarl	$12, %ecx
	orl	%edx, %ecx
	movslq	%ecx, %rdx
	movq	40(%rsi), %rcx
	movq	48(%rsi), %rbx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.3:
	movq	_SAA7134_RS_CONTROL_BSWAP@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rbx
LBB0_4:
	orq	%rdx, %rbx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	movq	_SAA7134_RS_CONTROL_WSWAP@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
LBB0_6:
	orq	%rcx, %rbx
	movl	16(%r15), %edi
	callq	_V4L2_FIELD_HAS_BOTH
	movq	%rax, %r13
	xorl	%edi, %edi
	callq	_SAA7134_RS_BA1
	movl	%eax, %edi
	movq	%r12, %rsi
	callq	_saa_writel
	xorl	%edi, %edi
	callq	_SAA7134_RS_BA2
	testq	%r13, %r13
	je	LBB0_8
## %bb.7:
	leaq	(%r14,%r12), %rsi
	movl	%eax, %edi
	callq	_saa_writel
	xorl	%edi, %edi
	callq	_SAA7134_RS_PITCH
	leaq	(%r14,%r14), %rsi
	movl	%eax, %edi
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %edi
	movq	%r12, %rsi
	callq	_saa_writel
	xorl	%edi, %edi
	callq	_SAA7134_RS_PITCH
	movl	%eax, %edi
	movq	%r14, %rsi
LBB0_9:
	callq	_saa_writel
	xorl	%edi, %edi
	callq	_SAA7134_RS_CONTROL
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_saa_writel
	movq	24(%r15), %rsi
	cmpq	$0, 32(%rsi)
	je	LBB0_14
## %bb.10:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movb	8(%rsi), %cl
	movb	16(%rsi), %al
	movq	%r14, %r13
	shrq	%cl, %r13
	movq	8(%r15), %rdi
	movq	%rdi, %rdx
	movl	%eax, %ecx
	shrq	%cl, %rdx
	imulq	%r14, %rdi
	addq	%r12, %rdi
	movq	%rdx, %r14
	imulq	%r13, %r14
	addq	%rdi, %r14
	cmpq	$0, 24(%rsi)
	movq	%r14, %rbx
	cmoveq	%rdi, %rbx
	cmovneq	%rdi, %r14
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rcx
	movq	%r14, %r8
	xorl	%eax, %eax
	callq	_video_dbg
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	16(%r15), %edi
	callq	_V4L2_FIELD_HAS_BOTH
	movq	%rax, %r15
	movl	$4, %edi
	callq	_SAA7134_RS_BA1
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_saa_writel
	movl	$4, %edi
	callq	_SAA7134_RS_BA2
	testq	%r15, %r15
	je	LBB0_12
## %bb.11:
	addq	%r13, %rbx
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_saa_writel
	movl	$4, %edi
	callq	_SAA7134_RS_PITCH
	movq	%r13, %rbx
	addq	%r13, %rbx
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_saa_writel
	movl	$5, %edi
	callq	_SAA7134_RS_BA1
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_saa_writel
	movl	$5, %edi
	callq	_SAA7134_RS_BA2
	addq	%r13, %r14
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_saa_writel
	movq	%rbx, %r13
	jmp	LBB0_13
LBB0_12:
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_saa_writel
	movl	$4, %edi
	callq	_SAA7134_RS_PITCH
	movl	%eax, %edi
	movq	%r13, %rsi
	callq	_saa_writel
	movl	$5, %edi
	callq	_SAA7134_RS_BA1
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_saa_writel
	movl	$5, %edi
	callq	_SAA7134_RS_BA2
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_saa_writel
LBB0_13:
	movl	$5, %edi
	callq	_SAA7134_RS_PITCH
	movl	%eax, %edi
	movq	%r13, %rsi
	callq	_saa_writel
	movl	$4, %edi
	callq	_SAA7134_RS_CONTROL
	movl	%eax, %edi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_saa_writel
	movl	$5, %edi
	callq	_SAA7134_RS_CONTROL
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_saa_writel
	movq	-64(%rbp), %r15                 ## 8-byte Reload
LBB0_14:
	movq	%r15, %rdi
	callq	_saa7134_set_dmabits
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	_BUFFER_TIMEOUT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mod_timer
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"buffer_activate buf=%p\n"

	.comm	_TASK_A,4,2                     ## @TASK_A
	.comm	_SAA7134_OFMT_VIDEO_A,4,2       ## @SAA7134_OFMT_VIDEO_A
	.comm	_SAA7134_RS_CONTROL_BURST_16,4,2 ## @SAA7134_RS_CONTROL_BURST_16
	.comm	_SAA7134_RS_CONTROL_ME,4,2      ## @SAA7134_RS_CONTROL_ME
	.comm	_SAA7134_RS_CONTROL_BSWAP,8,3   ## @SAA7134_RS_CONTROL_BSWAP
	.comm	_SAA7134_RS_CONTROL_WSWAP,8,3   ## @SAA7134_RS_CONTROL_WSWAP
L_.str.1:                               ## @.str.1
	.asciz	"uv: bpl=%ld lines=%ld base2/3=%ld/%ld\n"

	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_BUFFER_TIMEOUT,8,3             ## @BUFFER_TIMEOUT
	.no_dead_strip	_buffer_activate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function buffer_activate
_buffer_activate:                       ; @buffer_activate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x1, #8]
	ldr	x19, [x8]
	str	x1, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_video_dbg
	str	xzr, [x21]
Lloh2:
	adrp	x25, _TASK_A@GOTPAGE
Lloh3:
	ldr	x25, [x25, _TASK_A@GOTPAGEOFF]
	ldr	w22, [x25]
	ldp	x23, x24, [x20]
	ldr	w0, [x20, #16]
	bl	_V4L2_FIELD_HAS_BOTH
	mov	x4, x0
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	bl	_set_size
	ldr	x8, [x20, #24]
	ldr	x22, [x8, #64]
	ldr	w0, [x25]
	bl	_SAA7134_DATA_PATH
	cmp	x22, #0
	mov	w8, #3
	csinc	w2, w8, wzr, ne
	mov	w1, #63
	bl	_saa_andorb
Lloh4:
	adrp	x8, _SAA7134_OFMT_VIDEO_A@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SAA7134_OFMT_VIDEO_A@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	ldr	x8, [x20, #24]
	ldr	w1, [x8, #56]
	bl	_saa_writeb
	mov	x0, x21
	bl	_saa7134_buffer_base
	mov	x22, x0
	ldr	x8, [x20, #24]
	ldr	x9, [x8, #32]
	ldr	x23, [x20]
	cbnz	x9, LBB0_2
; %bb.1:
	ldrsw	x9, [x8]
	mul	x9, x23, x9
	lsr	x23, x9, #3
LBB0_2:
Lloh7:
	adrp	x9, _SAA7134_RS_CONTROL_BURST_16@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SAA7134_RS_CONTROL_BURST_16@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _SAA7134_RS_CONTROL_ME@GOTPAGE
Lloh11:
	ldr	x10, [x10, _SAA7134_RS_CONTROL_ME@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	orr	w9, w10, w9
	ldr	w10, [x19, #4]
	orr	w9, w9, w10, asr #12
	sxtw	x9, w9
Lloh13:
	adrp	x10, _SAA7134_RS_CONTROL_BSWAP@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SAA7134_RS_CONTROL_BSWAP@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	ldp	x8, x11, [x8, #40]
	cmp	x11, #0
	csel	x10, xzr, x10, eq
Lloh16:
	adrp	x11, _SAA7134_RS_CONTROL_WSWAP@GOTPAGE
Lloh17:
	ldr	x11, [x11, _SAA7134_RS_CONTROL_WSWAP@GOTPAGEOFF]
	orr	x9, x10, x9
Lloh18:
	ldr	x10, [x11]
	cmp	x8, #0
	csel	x8, xzr, x10, eq
	orr	x21, x9, x8
	ldr	w0, [x20, #16]
	bl	_V4L2_FIELD_HAS_BOTH
	mov	x24, x0
	mov	w0, #0
	bl	_SAA7134_RS_BA1
	mov	x1, x22
	bl	_saa_writel
	mov	w0, #0
	bl	_SAA7134_RS_BA2
	cbz	x24, LBB0_4
; %bb.3:
	add	x1, x23, x22
	bl	_saa_writel
	mov	w0, #0
	bl	_SAA7134_RS_PITCH
	lsl	x1, x23, #1
	b	LBB0_5
LBB0_4:
	mov	x1, x22
	bl	_saa_writel
	mov	w0, #0
	bl	_SAA7134_RS_PITCH
	mov	x1, x23
LBB0_5:
	bl	_saa_writel
	mov	w0, #0
	bl	_SAA7134_RS_CONTROL
	mov	x1, x21
	bl	_saa_writel
	ldr	x8, [x20, #24]
	ldr	x9, [x8, #32]
	cbz	x9, LBB0_10
; %bb.6:
	ldp	x9, x10, [x8, #8]
	lsr	x24, x23, x9
	ldr	x9, [x20, #8]
	lsr	x10, x9, x10
	madd	x9, x9, x23, x22
	madd	x11, x10, x24, x9
	ldr	x8, [x8, #24]
	cmp	x8, #0
	csel	x23, x9, x11, eq
	csel	x22, x11, x9, eq
	stp	x24, x10, [sp]
	stp	x23, x22, [sp, #16]
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_video_dbg
	ldr	w0, [x20, #16]
	bl	_V4L2_FIELD_HAS_BOTH
	mov	x25, x0
	mov	w0, #4
	bl	_SAA7134_RS_BA1
	mov	x1, x23
	bl	_saa_writel
	mov	w0, #4
	bl	_SAA7134_RS_BA2
	cbz	x25, LBB0_8
; %bb.7:
	add	x1, x23, x24
	bl	_saa_writel
	mov	w0, #4
	bl	_SAA7134_RS_PITCH
	lsl	x23, x24, #1
	mov	x1, x23
	bl	_saa_writel
	mov	w0, #5
	bl	_SAA7134_RS_BA1
	mov	x1, x22
	bl	_saa_writel
	mov	w0, #5
	bl	_SAA7134_RS_BA2
	add	x1, x22, x24
	bl	_saa_writel
	b	LBB0_9
LBB0_8:
	mov	x1, x23
	bl	_saa_writel
	mov	w0, #4
	bl	_SAA7134_RS_PITCH
	mov	x1, x24
	bl	_saa_writel
	mov	w0, #5
	bl	_SAA7134_RS_BA1
	mov	x1, x22
	bl	_saa_writel
	mov	w0, #5
	bl	_SAA7134_RS_BA2
	mov	x1, x22
	bl	_saa_writel
	mov	x23, x24
LBB0_9:
	mov	w0, #5
	bl	_SAA7134_RS_PITCH
	mov	x1, x23
	bl	_saa_writel
	mov	w0, #4
	bl	_SAA7134_RS_CONTROL
	mov	x1, x21
	bl	_saa_writel
	mov	w0, #5
	bl	_SAA7134_RS_CONTROL
	mov	x1, x21
	bl	_saa_writel
LBB0_10:
	mov	x0, x20
	bl	_saa7134_set_dmabits
Lloh21:
	adrp	x8, _jiffies@GOTPAGE
Lloh22:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
Lloh24:
	adrp	x9, _BUFFER_TIMEOUT@GOTPAGE
Lloh25:
	ldr	x9, [x9, _BUFFER_TIMEOUT@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	bl	_mod_timer
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"buffer_activate buf=%p\n"

	.comm	_TASK_A,4,2                     ; @TASK_A
	.comm	_SAA7134_OFMT_VIDEO_A,4,2       ; @SAA7134_OFMT_VIDEO_A
	.comm	_SAA7134_RS_CONTROL_BURST_16,4,2 ; @SAA7134_RS_CONTROL_BURST_16
	.comm	_SAA7134_RS_CONTROL_ME,4,2      ; @SAA7134_RS_CONTROL_ME
	.comm	_SAA7134_RS_CONTROL_BSWAP,8,3   ; @SAA7134_RS_CONTROL_BSWAP
	.comm	_SAA7134_RS_CONTROL_WSWAP,8,3   ; @SAA7134_RS_CONTROL_WSWAP
l_.str.1:                               ; @.str.1
	.asciz	"uv: bpl=%ld lines=%ld base2/3=%ld/%ld\n"

	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_BUFFER_TIMEOUT,8,3             ; @BUFFER_TIMEOUT
	.no_dead_strip	_buffer_activate
.subsections_via_symbols
