	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viacam_set_scale
_viacam_set_scale:                      ## @viacam_set_scale
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %eax
	movq	_VGA_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%ecx, %ecx
	cmpl	%esi, %eax
	je	LBB0_2
## %bb.1:
	shll	$11, %eax
	cltd
	idivl	%esi
	movl	%eax, %ecx
	movq	_VCR_AVS_HEN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
LBB0_2:
	movl	4(%rdi), %eax
	movq	_VGA_HEIGHT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cmpl	%esi, %eax
	jge	LBB0_4
## %bb.3:
	shll	$10, %eax
	cltd
	idivl	%esi
	movq	_VCR_AVS_VEN@GOTPCREL(%rip), %rdx
	shll	$16, %eax
	orl	%ecx, %eax
	orl	(%rdx), %eax
	movl	%eax, %ecx
LBB0_4:
	movq	_VCR_AVSCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ecx, %edx
	popq	%rbp
	jmp	_viacam_write_reg               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VGA_WIDTH,4,2                  ## @VGA_WIDTH
	.comm	_VCR_AVS_HEN,4,2                ## @VCR_AVS_HEN
	.comm	_VGA_HEIGHT,4,2                 ## @VGA_HEIGHT
	.comm	_VCR_AVS_VEN,4,2                ## @VCR_AVS_VEN
	.comm	_VCR_AVSCALE,4,2                ## @VCR_AVSCALE
	.no_dead_strip	_viacam_set_scale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viacam_set_scale
_viacam_set_scale:                      ; @viacam_set_scale
	.cfi_startproc
; %bb.0:
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _VGA_WIDTH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VGA_WIDTH@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	w2, #0
	b	LBB0_3
LBB0_2:
	lsl	w8, w8, #11
	sdiv	w8, w8, w9
Lloh3:
	adrp	x9, _VCR_AVS_HEN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VCR_AVS_HEN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w2, w9, w8
LBB0_3:
	ldr	w8, [x0, #4]
Lloh6:
	adrp	x9, _VGA_HEIGHT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VGA_HEIGHT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_5
; %bb.4:
	lsl	w8, w8, #10
	sdiv	w8, w8, w9
Lloh9:
	adrp	x9, _VCR_AVS_VEN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VCR_AVS_VEN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w2, w8, lsl #16
	orr	w2, w8, w9
LBB0_5:
Lloh12:
	adrp	x8, _VCR_AVSCALE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VCR_AVSCALE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	b	_viacam_write_reg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_VGA_WIDTH,4,2                  ; @VGA_WIDTH
	.comm	_VCR_AVS_HEN,4,2                ; @VCR_AVS_HEN
	.comm	_VGA_HEIGHT,4,2                 ; @VGA_HEIGHT
	.comm	_VCR_AVS_VEN,4,2                ; @VCR_AVS_VEN
	.comm	_VCR_AVSCALE,4,2                ; @VCR_AVSCALE
	.no_dead_strip	_viacam_set_scale
.subsections_via_symbols
