	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apply_below_the_range
_apply_below_the_range:                 ## @apply_below_the_range
	.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
	movq	%rcx, %r12
	movl	%edx, %r14d
	movq	%rsi, %r15
	movl	(%rcx), %ebx
	movl	48(%rcx), %esi
	movabsq	$1000000000000000, %rdi         ## imm = 0x38D7EA4C68000
	callq	_div64_u64
	movq	_BTR_EXIT_MARGIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	cmpl	%ebx, %eax
	jae	LBB0_3
## %bb.1:
	cmpl	$0, 8(%r12)
	je	LBB0_17
## %bb.2:
	movl	$0, 8(%r12)
	jmp	LBB0_17
LBB0_3:
	cmpl	%r14d, %ebx
	jae	LBB0_16
## %bb.4:
	movl	$1, 8(%r12)
	jmp	LBB0_5
LBB0_16:
	cmpl	$0, 8(%r12)
	je	LBB0_17
LBB0_5:
	movl	24(%r12), %esi
	leal	-1(%r14), %ecx
	leal	(%rcx,%rsi), %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r8d
	movl	$-1, %r9d
	movl	$-1, %edi
	addl	%esi, %ecx
	jb	LBB0_7
## %bb.6:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r8d
	movl	%eax, %edi
	subl	%esi, %eax
	negl	%eax
	subl	%esi, %edi
	cmovbl	%eax, %edi
LBB0_7:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %ecx
	cmpl	%r14d, %esi
	ja	LBB0_9
## %bb.8:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r9d
	subl	%esi, %eax
	negl	%eax
	subl	%esi, %r9d
	cmovbl	%eax, %r9d
LBB0_9:
	movl	%edi, %eax
	subl	%r9d, %eax
	negl	%eax
	subl	%r9d, %edi
	cmovbl	%r8d, %ecx
	cmovbl	%eax, %edi
	movl	20(%r12), %esi
	testl	%esi, %esi
	je	LBB0_13
## %bb.10:
	movq	_BTR_DRIFT_MARGIN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jae	LBB0_13
## %bb.11:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%esi
	cmpl	(%r12), %eax
	jae	LBB0_13
## %bb.12:
	cmpl	4(%r12), %eax
	cmoval	%esi, %ecx
LBB0_13:
	xorl	%esi, %esi
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	4(%r12), %edi
	cmpl	%edi, %eax
	setb	%al
	cmpl	$2, %ecx
	setae	%dl
	andb	%al, %dl
	movzbl	%dl, %eax
	subl	%eax, %ecx
	je	LBB0_15
## %bb.14:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %esi
LBB0_15:
	cmpl	%edi, %esi
	cmoval	%esi, %edi
	movl	%edi, 16(%r12)
	movl	%ecx, 20(%r12)
	movl	%ecx, 12(%r12)
	jmp	LBB0_18
LBB0_17:
	movl	$0, 20(%r12)
	movq	$0, 12(%r12)
	movl	48(%r12), %esi
	movq	%r15, %rdi
	callq	_calc_v_total_from_refresh
	movq	%rax, 40(%r12)
	movl	28(%r12), %esi
	movq	%r15, %rdi
	callq	_calc_v_total_from_refresh
	movq	%rax, 32(%r12)
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BTR_EXIT_MARGIN,4,2            ## @BTR_EXIT_MARGIN
	.comm	_BTR_DRIFT_MARGIN,4,2           ## @BTR_DRIFT_MARGIN
	.no_dead_strip	_apply_below_the_range
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apply_below_the_range
_apply_below_the_range:                 ; @apply_below_the_range
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x3
	mov	x20, x2
	mov	x21, x1
	ldr	w22, [x3]
	ldr	w1, [x3, #48]
	mov	x0, #1125899906809856
	movk	x0, #42182, lsl #16
	movk	x0, #36222, lsl #32
	bl	_div64_u64
Lloh0:
	adrp	x8, _BTR_EXIT_MARGIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BTR_EXIT_MARGIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w8, w8, w20
	cmp	w8, w22
	b.hs	LBB0_3
; %bb.1:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_8
; %bb.2:
	str	wzr, [x19, #8]
	b	LBB0_8
LBB0_3:
	cmp	w22, w20
	b.hs	LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_6
LBB0_5:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_8
LBB0_6:
	ldr	w10, [x19, #24]
	sub	w8, w20, #1
	adds	w8, w8, w10
	udiv	w8, w8, w10
	b.lo	LBB0_9
; %bb.7:
	mov	w9, #-1
	b	LBB0_10
LBB0_8:
	str	xzr, [x19, #16]
	str	wzr, [x19, #12]
	ldr	w1, [x19, #48]
	mov	x0, x21
	bl	_calc_v_total_from_refresh
	str	x0, [x19, #40]
	ldr	w1, [x19, #28]
	mov	x0, x21
	bl	_calc_v_total_from_refresh
	str	x0, [x19, #32]
	b	LBB0_21
LBB0_9:
	udiv	w9, w20, w8
	sub	w11, w9, w10
	subs	w9, w10, w9
	csel	w9, w9, w11, hi
LBB0_10:
	udiv	w11, w20, w10
	cmp	w10, w20
	b.ls	LBB0_12
; %bb.11:
	mov	w10, #-1
	b	LBB0_13
LBB0_12:
	udiv	w12, w20, w11
	sub	w13, w12, w10
	subs	w10, w10, w12
	csel	w10, w10, w13, hi
LBB0_13:
	sub	w12, w10, w9
	subs	w9, w9, w10
	csel	w8, w8, w11, lo
	csel	w10, w12, w9, lo
	ldr	w9, [x19, #20]
	cbz	w9, LBB0_17
; %bb.14:
Lloh3:
	adrp	x11, _BTR_DRIFT_MARGIN@GOTPAGE
Lloh4:
	ldr	x11, [x11, _BTR_DRIFT_MARGIN@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	cmp	w10, w11
	b.hs	LBB0_17
; %bb.15:
	udiv	w10, w20, w9
	ldr	w11, [x19]
	cmp	w10, w11
	b.hs	LBB0_17
; %bb.16:
	ldr	w11, [x19, #4]
	cmp	w10, w11
	csel	w8, w9, w8, hi
LBB0_17:
	udiv	w10, w20, w8
	ldr	w9, [x19, #4]
	cmp	w8, #1
	ccmp	w10, w9, #2, hi
	cset	w10, lo
	subs	w8, w8, w10
	b.eq	LBB0_19
; %bb.18:
	udiv	w10, w20, w8
	b	LBB0_20
LBB0_19:
	mov	w10, #0
LBB0_20:
	cmp	w10, w9
	csel	w9, w10, w9, hi
	stp	w9, w8, [x19, #16]
	str	w8, [x19, #12]
LBB0_21:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BTR_EXIT_MARGIN,4,2            ; @BTR_EXIT_MARGIN
	.comm	_BTR_DRIFT_MARGIN,4,2           ; @BTR_DRIFT_MARGIN
	.no_dead_strip	_apply_below_the_range
.subsections_via_symbols
