	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_size
_set_size:                              ## @set_size
	.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
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r13d
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	cmpl	$1, %r8d
	movl	$2, %eax
	sbbl	$0, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	8(%rdi), %r14d
	movl	12(%rdi), %eax
	movl	%eax, %r15d
	shrl	$31, %r15d
	addl	%eax, %r15d
	movl	%r15d, %ecx
	shrl	%ecx
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	16(%rdi), %ecx
	leal	(%r14,%rcx), %r12d
	decl	%r12d
	movl	20(%rdi), %ecx
	leal	(%rax,%rcx), %edx
	addl	%ecx, %eax
	decl	%eax
	shrl	$31, %eax
	leal	(%rax,%rdx), %ebx
	decl	%ebx
	movl	%ebx, %eax
	shrl	%eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%esi, %edi
	callq	_SAA7134_VIDEO_H_START1
	movzbl	%r14b, %esi
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_H_START2
	sarl	$8, %r14d
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_H_STOP1
	movzbl	%r12b, %esi
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_H_STOP2
	sarl	$8, %r12d
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_V_START1
	movzbl	-56(%rbp), %esi                 ## 1-byte Folded Reload
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_V_START2
	sarl	$9, %r15d
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_V_STOP1
	movzbl	-60(%rbp), %esi                 ## 1-byte Folded Reload
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_V_STOP2
	sarl	$9, %ebx
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_saa_writeb
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	16(%r12), %ecx
	movl	%ecx, %eax
	cltd
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	idivl	%esi
	testl	%eax, %eax
	movl	$1, %ebx
	cmovnel	%eax, %ebx
	shll	$10, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	cltd
	idivl	%esi
	movl	%eax, %r15d
	movl	20(%r12), %eax
	imull	-48(%rbp), %eax                 ## 4-byte Folded Reload
	shll	$9, %eax
	cltd
	idivl	-52(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_video_dbg
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	callq	_set_h_prescale
	movl	%r13d, %edi
	callq	_SAA7134_H_SCALE_INC1
	movzbl	%r15b, %esi
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_H_SCALE_INC2
	sarl	$8, %r15d
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_saa_writeb
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	callq	_set_v_scale
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_PIXELS1
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movzbl	%bl, %esi
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_PIXELS2
	sarl	$8, %ebx
	movl	%ebx, %esi
	movl	%eax, %edi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_LINES1
	movl	%eax, %edi
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	-48(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %ebx
	movzbl	%bl, %esi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_VIDEO_LINES2
	sarl	$8, %ebx
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_saa_writeb
	movl	(%r12), %ebx
	movl	4(%r12), %r14d
	movl	%r13d, %edi
	callq	_SAA7134_V_PHASE_OFFSET0
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_V_PHASE_OFFSET1
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_V_PHASE_OFFSET2
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_saa_writeb
	movl	%r13d, %edi
	callq	_SAA7134_V_PHASE_OFFSET3
	movl	%eax, %edi
	movl	%r14d, %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_saa_writeb                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"prescale=%d xscale=%d yscale=%d\n"

	.no_dead_strip	_set_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_size
_set_size:                              ; @set_size
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	cmp	w4, #0
	mov	w8, #1
	cinc	w26, w8, ne
	ldp	w25, w8, [x0, #8]
	cmp	w8, #0
	cinc	w24, w8, lt
	ldp	w9, w10, [x0, #16]
	add	w9, w25, w9
	sub	w27, w9, #1
	add	w8, w8, w10
	sub	w9, w8, #1
	cmp	w9, #0
	csel	w23, w8, w9, lt
	mov	x0, x1
	bl	_SAA7134_VIDEO_H_START1
	and	w1, w25, #0xff
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_H_START2
	asr	w1, w25, #8
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_H_STOP1
	and	w1, w27, #0xff
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_H_STOP2
	asr	w1, w27, #8
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_V_START1
	ubfx	w1, w24, #1, #8
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_V_START2
	asr	w1, w24, #9
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_V_STOP1
	ubfx	w1, w23, #1, #8
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_V_STOP2
	asr	w1, w23, #9
	bl	_saa_writeb
	ldp	w8, w9, [x20, #16]
	sdiv	w10, w8, w22
	cmp	w10, #0
	csinc	w23, w10, wzr, ne
	lsl	w8, w8, #10
	sdiv	w8, w8, w23
	sdiv	w24, w8, w22
	mul	w8, w26, w9
	lsl	w8, w8, #9
	sdiv	w25, w8, w21
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x2, x24
	mov	x3, x25
	bl	_video_dbg
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	bl	_set_h_prescale
	mov	x0, x19
	bl	_SAA7134_H_SCALE_INC1
	and	w1, w24, #0xff
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_H_SCALE_INC2
	asr	w1, w24, #8
	bl	_saa_writeb
	mov	x0, x20
	mov	x1, x19
	mov	x2, x25
	bl	_set_v_scale
	mov	x0, x19
	bl	_SAA7134_VIDEO_PIXELS1
	and	w1, w22, #0xff
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_PIXELS2
	asr	w1, w22, #8
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_LINES1
	sdiv	w21, w21, w26
	and	w1, w21, #0xff
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_VIDEO_LINES2
	asr	w1, w21, #8
	bl	_saa_writeb
	ldp	w21, w20, [x20]
	mov	x0, x19
	bl	_SAA7134_V_PHASE_OFFSET0
	mov	x1, x21
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_V_PHASE_OFFSET1
	mov	x1, x20
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_V_PHASE_OFFSET2
	mov	x1, x21
	bl	_saa_writeb
	mov	x0, x19
	bl	_SAA7134_V_PHASE_OFFSET3
	mov	x1, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_saa_writeb
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"prescale=%d xscale=%d yscale=%d\n"

	.no_dead_strip	_set_size
.subsections_via_symbols
