	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_v_scale
_set_v_scale:                           ## @set_v_scale
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	%esi, %edi
	callq	_SAA7134_V_SCALE_RATIO1
	movzbl	%r15b, %esi
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r14d, %edi
	callq	_SAA7134_V_SCALE_RATIO2
	movl	%r15d, %esi
	sarl	$8, %esi
	movl	%eax, %edi
	callq	_saa_writeb
	xorl	%ebx, %ebx
	cmpq	$0, (%r12)
	setne	%bl
	addl	%ebx, %ebx
	cmpl	$2047, %r15d                    ## imm = 0x7FF
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_video_dbg
	movl	%r14d, %edi
	callq	_SAA7134_V_FILTER
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_saa_writeb
	movl	$64, %r12d
	jmp	LBB0_3
LBB0_2:
	movl	$65536, %eax                    ## imm = 0x10000
	xorl	%edx, %edx
	divl	%r15d
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_video_dbg
	movl	%r14d, %edi
	callq	_SAA7134_V_FILTER
	orl	$1, %ebx
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_saa_writeb
LBB0_3:
	movl	%r14d, %edi
	callq	_SAA7134_LUMA_CONTRAST
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_saa_writeb
	movl	%r14d, %edi
	callq	_SAA7134_CHROMA_SATURATION
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_saa_writeb
	movl	%r14d, %edi
	callq	_SAA7134_LUMA_BRIGHT
	movl	%eax, %edi
	movl	$128, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_saa_writeb                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"yscale LPI yscale=%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"yscale ACM yscale=%d val=0x%x\n"

	.no_dead_strip	_set_v_scale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_v_scale
_set_v_scale:                           ; @set_v_scale
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	x0, x1
	bl	_SAA7134_V_SCALE_RATIO1
	and	w1, w20, #0xff
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_V_SCALE_RATIO2
	asr	w1, w20, #8
	bl	_saa_writeb
	ldr	x8, [x21]
	cmp	x8, #0
	cset	w8, ne
	lsl	w22, w8, #1
	cmp	w20, #2047
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_video_dbg
	mov	x0, x19
	bl	_SAA7134_V_FILTER
	mov	x1, x22
	bl	_saa_writeb
	mov	w21, #64
	b	LBB0_3
LBB0_2:
	mov	w8, #65536
	udiv	w21, w8, w20
	str	x21, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_video_dbg
	mov	x0, x19
	bl	_SAA7134_V_FILTER
	orr	w1, w22, #0x1
	bl	_saa_writeb
LBB0_3:
	mov	x0, x19
	bl	_SAA7134_LUMA_CONTRAST
	mov	x1, x21
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_CHROMA_SATURATION
	mov	x1, x21
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_LUMA_BRIGHT
	mov	w1, #128
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_saa_writeb
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"yscale LPI yscale=%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"yscale ACM yscale=%d val=0x%x\n"

	.no_dead_strip	_set_v_scale
.subsections_via_symbols
