	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tfrc_calc_x                    ## -- Begin function tfrc_calc_x
	.p2align	4, 0x90
_tfrc_calc_x:                           ## @tfrc_calc_x
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r14
	xorl	%edi, %edi
	cmpl	$1000001, %edx                  ## imm = 0xF4241
	setge	%dil
	callq	_BUG_ON
	xorl	%edi, %edi
	testl	%ebx, %ebx
	sete	%dil
	callq	_BUG_ON
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.1:
	movq	_TFRC_CALC_X_SPLIT@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jge	LBB0_2
## %bb.6:
	movq	_TFRC_CALC_X_ARRSIZE@GOTPCREL(%rip), %rcx
	movl	$1000000, %eax                  ## imm = 0xF4240
	xorl	%edx, %edx
	idivl	(%rcx)
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	cltq
	movq	_tfrc_calc_x_lookup@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	-8(%rcx,%rax,8), %rax
	jmp	LBB0_7
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_DCCP_CRIT
	movl	$-1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_TFRC_SMALLEST_P@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ebx, %ecx
	jle	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%ecx, %edx
	callq	_DCCP_WARN
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	decl	%eax
	cltq
LBB0_5:
	movq	_tfrc_calc_x_lookup@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rax,8), %rax
	addq	$4, %rax
LBB0_7:
	movl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_scaled_div
	movl	%eax, %edi
	movl	%ebx, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_scaled_div32                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WARNING: RTT is 0, returning maximum X_calc."

	.comm	_TFRC_CALC_X_SPLIT,4,2          ## @TFRC_CALC_X_SPLIT
	.comm	_TFRC_SMALLEST_P,4,2            ## @TFRC_SMALLEST_P
L_.str.1:                               ## @.str.1
	.asciz	"Value of p (%d) below resolution. Substituting %d\n"

	.comm	_tfrc_calc_x_lookup,8,3         ## @tfrc_calc_x_lookup
	.comm	_TFRC_CALC_X_ARRSIZE,4,2        ## @TFRC_CALC_X_ARRSIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tfrc_calc_x                    ; -- Begin function tfrc_calc_x
	.p2align	2
_tfrc_calc_x:                           ; @tfrc_calc_x
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	w22, #16960
	movk	w22, #15, lsl #16
	cmp	w2, w22
	cset	w0, gt
	bl	_BUG_ON
	cmp	w21, #0
	cset	w0, eq
	bl	_BUG_ON
	cbz	w19, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _TFRC_CALC_X_SPLIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TFRC_CALC_X_SPLIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ge	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _TFRC_CALC_X_ARRSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TFRC_CALC_X_ARRSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sdiv	w8, w22, w8
	sdiv	w8, w21, w8
	sub	w8, w8, #1
Lloh6:
	adrp	x9, _tfrc_calc_x_lookup@GOTPAGE
Lloh7:
	ldr	x9, [x9, _tfrc_calc_x_lookup@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_8
LBB0_3:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DCCP_CRIT
	mov	w0, #-1
	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
LBB0_4:
Lloh11:
	adrp	x8, _TFRC_SMALLEST_P@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TFRC_SMALLEST_P@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	cmp	w2, w21
	b.le	LBB0_6
; %bb.5:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_DCCP_WARN
	mov	x8, #0
	b	LBB0_7
LBB0_6:
	sdiv	w8, w21, w2
	sub	w8, w8, #1
	sxtw	x8, w8
LBB0_7:
Lloh16:
	adrp	x9, _tfrc_calc_x_lookup@GOTPAGE
Lloh17:
	ldr	x9, [x9, _tfrc_calc_x_lookup@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	ldr	x8, [x9, x8, lsl #3]
	add	x8, x8, #4
LBB0_8:
	ldr	w21, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_scaled_div
	mov	x1, x21
	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
	b	_scaled_div32
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WARNING: RTT is 0, returning maximum X_calc."

	.comm	_TFRC_CALC_X_SPLIT,4,2          ; @TFRC_CALC_X_SPLIT
	.comm	_TFRC_SMALLEST_P,4,2            ; @TFRC_SMALLEST_P
l_.str.1:                               ; @.str.1
	.asciz	"Value of p (%d) below resolution. Substituting %d\n"

	.comm	_tfrc_calc_x_lookup,8,3         ; @tfrc_calc_x_lookup
	.comm	_TFRC_CALC_X_ARRSIZE,4,2        ; @TFRC_CALC_X_ARRSIZE
.subsections_via_symbols
