	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mod_freesync_build_vrr_params  ## -- Begin function mod_freesync_build_vrr_params
	.p2align	4, 0x90
_mod_freesync_build_vrr_params:         ## @mod_freesync_build_vrr_params
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.1:
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r14
	callq	_MOD_FREESYNC_TO_CORE
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_mod_freesync_calc_nominal_field_rate
	movq	(%r12), %rbx
	movq	8(%r12), %r13
	cmpq	%r13, %rbx
	cmovaeq	%r13, %rbx
	cmpq	%rax, %r13
	cmovaeq	%rax, %r13
	cmpq	%rax, %rbx
	cmovaeq	%rax, %rbx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movq	%r15, %r8
	callq	_vrr_settings_require_update
	testl	%eax, %eax
	je	LBB0_21
## %bb.2:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r12), %rax
	movq	%rax, (%r15)
	movl	40(%r12), %ecx
	movl	%ecx, 104(%r15)
	movq	_VRR_STATE_UNSUPPORTED@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_4
## %bb.3:
	movl	$0, 8(%r15)
	jmp	LBB0_18
LBB0_4:
	movl	%ebx, 12(%r15)
	movl	%ebx, %edi
	callq	_calc_duration_in_us_from_refresh_in_uhz
	movl	%eax, 16(%r15)
	movl	%r13d, 20(%r15)
	movl	%r13d, %edi
	callq	_calc_duration_in_us_from_refresh_in_uhz
	movl	%eax, 24(%r15)
	movl	20(%r15), %ecx
	movl	12(%r15), %esi
	movl	$1, 8(%r15)
	movq	32(%r12), %rdx
	movq	%rdx, 56(%r15)
	leal	(%rsi,%rsi), %ebx
	xorl	%edi, %edi
	cmpl	%ebx, %ecx
	jb	LBB0_6
## %bb.5:
	movl	24(%r12), %edi
LBB0_6:
	movl	%edi, 64(%r15)
	movl	$0, 68(%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 80(%r15)
	movq	$0, 96(%r15)
	addl	16(%r15), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	movl	%edi, 72(%r15)
	movq	(%r15), %rax
	cmpq	(%r14), %rax
	je	LBB0_18
## %bb.7:
	movq	_VRR_STATE_DISABLED@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rax
	je	LBB0_18
## %bb.8:
	movq	_VRR_STATE_INACTIVE@GOTPCREL(%rip), %rdi
	movq	(%rdi), %r8
	cmpq	%r8, %rax
	jne	LBB0_9
LBB0_18:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
LBB0_19:
	movq	%rax, 40(%r15)
LBB0_20:
	movq	%rax, 32(%r15)
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_VRR_STATE_ACTIVE_VARIABLE@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_12
## %bb.10:
	movl	%ecx, %ebx
	subl	%esi, %ebx
	movq	_MIN_REFRESH_RANGE_IN_US@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %ebx
	jb	LBB0_12
## %bb.11:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%ecx, %esi
	callq	_calc_v_total_from_refresh
	movq	%rax, 40(%r15)
	movl	12(%r15), %esi
	movq	%rbx, %rdi
	callq	_calc_v_total_from_refresh
	jmp	LBB0_20
LBB0_12:
	movq	_VRR_STATE_ACTIVE_FIXED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.13:
	movl	%esi, 48(%r15)
	testq	%rdx, %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_16
## %bb.14:
	cmpl	$0, 52(%r15)
	je	LBB0_16
## %bb.15:
	movl	$1, 52(%r15)
	jmp	LBB0_21
LBB0_17:
	movq	%r8, (%r15)
	jmp	LBB0_18
LBB0_16:
	movl	$1, 52(%r15)
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_calc_v_total_from_refresh
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_VRR_STATE_UNSUPPORTED,8,3      ## @VRR_STATE_UNSUPPORTED
	.comm	_VRR_STATE_DISABLED,8,3         ## @VRR_STATE_DISABLED
	.comm	_VRR_STATE_INACTIVE,8,3         ## @VRR_STATE_INACTIVE
	.comm	_VRR_STATE_ACTIVE_VARIABLE,8,3  ## @VRR_STATE_ACTIVE_VARIABLE
	.comm	_MIN_REFRESH_RANGE_IN_US,4,2    ## @MIN_REFRESH_RANGE_IN_US
	.comm	_VRR_STATE_ACTIVE_FIXED,8,3     ## @VRR_STATE_ACTIVE_FIXED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mod_freesync_build_vrr_params  ; -- Begin function mod_freesync_build_vrr_params
	.p2align	2
_mod_freesync_build_vrr_params:         ; @mod_freesync_build_vrr_params
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	bl	_MOD_FREESYNC_TO_CORE
	mov	x24, x0
	mov	x0, x20
	bl	_mod_freesync_calc_nominal_field_rate
	ldp	x8, x9, [x21]
	cmp	x8, x9
	csel	x8, x8, x9, lo
	cmp	x9, x0
	csel	x22, x9, x0, lo
	cmp	x8, x0
	csel	x23, x8, x0, lo
	mov	x0, x24
	mov	x1, x21
	mov	x2, x23
	mov	x3, x22
	mov	x4, x19
	bl	_vrr_settings_require_update
	cbz	w0, LBB0_8
; %bb.2:
	ldr	x8, [x21, #16]
	str	x8, [x19]
	ldr	w9, [x21, #40]
	str	w9, [x19, #104]
Lloh0:
	adrp	x24, _VRR_STATE_UNSUPPORTED@GOTPAGE
Lloh1:
	ldr	x24, [x24, _VRR_STATE_UNSUPPORTED@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	str	wzr, [x19, #8]
	b	LBB0_7
LBB0_4:
	str	w23, [x19, #12]
	mov	x0, x23
	bl	_calc_duration_in_us_from_refresh_in_uhz
	stp	w0, w22, [x19, #16]
	mov	x0, x22
	bl	_calc_duration_in_us_from_refresh_in_uhz
	str	w0, [x19, #24]
	ldp	w11, w8, [x19, #16]
	mov	w9, #1
	str	w9, [x19, #8]
	ldr	x9, [x21, #32]
	str	x9, [x19, #56]
	ldr	w10, [x21, #24]
	ldr	w1, [x19, #12]
	cmp	w8, w1, lsl #1
	csel	w10, wzr, w10, lo
	stp	w10, wzr, [x19, #64]
	stp	xzr, xzr, [x19, #88]
	str	xzr, [x19, #80]
	add	w10, w11, w0
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	str	w10, [x19, #72]
	ldr	x10, [x19]
	ldr	x11, [x24]
	cmp	x10, x11
	b.eq	LBB0_7
; %bb.5:
Lloh2:
	adrp	x11, _VRR_STATE_DISABLED@GOTPAGE
Lloh3:
	ldr	x11, [x11, _VRR_STATE_DISABLED@GOTPAGEOFF]
Lloh4:
	ldr	x11, [x11]
	cmp	x10, x11
	b.eq	LBB0_7
; %bb.6:
Lloh5:
	adrp	x11, _VRR_STATE_INACTIVE@GOTPAGE
Lloh6:
	ldr	x11, [x11, _VRR_STATE_INACTIVE@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_9
LBB0_7:
	ldr	x8, [x20]
	stp	x8, x8, [x19, #32]
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh8:
	adrp	x12, _VRR_STATE_ACTIVE_VARIABLE@GOTPAGE
Lloh9:
	ldr	x12, [x12, _VRR_STATE_ACTIVE_VARIABLE@GOTPAGEOFF]
Lloh10:
	ldr	x12, [x12]
	cmp	x10, x12
	b.ne	LBB0_12
; %bb.10:
Lloh11:
	adrp	x12, _MIN_REFRESH_RANGE_IN_US@GOTPAGE
Lloh12:
	ldr	x12, [x12, _MIN_REFRESH_RANGE_IN_US@GOTPAGEOFF]
Lloh13:
	ldr	w12, [x12]
	sub	w13, w8, w1
	cmp	w13, w12
	b.lo	LBB0_12
; %bb.11:
	mov	x0, x20
	mov	x1, x8
	bl	_calc_v_total_from_refresh
	str	x0, [x19, #40]
	ldr	w1, [x19, #12]
	mov	x0, x20
	bl	_calc_v_total_from_refresh
	str	x0, [x19, #32]
	b	LBB0_8
LBB0_12:
Lloh14:
	adrp	x8, _VRR_STATE_ACTIVE_FIXED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VRR_STATE_ACTIVE_FIXED@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x10, x8
	b.ne	LBB0_16
; %bb.13:
	str	w1, [x19, #48]
	cbz	x9, LBB0_17
; %bb.14:
	ldr	w8, [x19, #52]
	cbz	w8, LBB0_17
; %bb.15:
	mov	w8, #1
	str	w8, [x19, #52]
	b	LBB0_8
LBB0_16:
	str	x11, [x19]
	b	LBB0_7
LBB0_17:
	mov	w8, #1
	str	w8, [x19, #52]
	mov	x0, x20
	bl	_calc_v_total_from_refresh
	stp	x0, x0, [x19, #32]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_VRR_STATE_UNSUPPORTED,8,3      ; @VRR_STATE_UNSUPPORTED
	.comm	_VRR_STATE_DISABLED,8,3         ; @VRR_STATE_DISABLED
	.comm	_VRR_STATE_INACTIVE,8,3         ; @VRR_STATE_INACTIVE
	.comm	_VRR_STATE_ACTIVE_VARIABLE,8,3  ; @VRR_STATE_ACTIVE_VARIABLE
	.comm	_MIN_REFRESH_RANGE_IN_US,4,2    ; @MIN_REFRESH_RANGE_IN_US
	.comm	_VRR_STATE_ACTIVE_FIXED,8,3     ; @VRR_STATE_ACTIVE_FIXED
.subsections_via_symbols
