	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function htcp_alpha_update
_htcp_alpha_update:                     ## @htcp_alpha_update
	.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
	movq	%rdi, %r14
	movl	(%rdi), %r15d
	callq	_htcp_cong_time
                                        ## kill: def $eax killed $eax def $rax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$1, %ebx
	subl	%ecx, %eax
	jle	LBB0_2
## %bb.1:
	leal	(%rax,%rax,4), %esi
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	imull	%edx, %edx
	movl	%edx, %eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rsi,2), %eax
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	incl	%ebx
LBB0_2:
	movq	_use_rtt_scaling@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.3:
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	shll	$3, %ecx
	addl	%r15d, %r15d
	leal	(%r15,%r15,4), %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, %edi
	movl	$4, %esi
	callq	_max
	movl	%eax, %edi
	movl	$80, %esi
	callq	_min
	movl	%eax, %ecx
	shll	$3, %ebx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%eax, %eax
	movl	$1, %ebx
	cmovnel	%eax, %ebx
LBB0_5:
	movl	$128, %eax
	subl	8(%r14), %eax
	imull	%ebx, %eax
	addl	%eax, %eax
	movl	%eax, 4(%r14)
	jne	LBB0_7
## %bb.6:
	movq	_ALPHA_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_use_rtt_scaling,8,3            ## @use_rtt_scaling
	.comm	_ALPHA_BASE,4,2                 ## @ALPHA_BASE
	.no_dead_strip	_htcp_alpha_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function htcp_alpha_update
_htcp_alpha_update:                     ; @htcp_alpha_update
	.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, x0
	ldr	w21, [x0]
	bl	_htcp_cong_time
Lloh0:
	adrp	x8, _HZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	subs	w9, w0, w8
	b.le	LBB0_2
; %bb.1:
	mov	w10, #10
	cmp	w9, #0
	cinc	w11, w9, lt
	asr	w11, w11, #1
	mul	w11, w11, w11
	sdiv	w11, w11, w8
	madd	w9, w9, w10, w11
	sdiv	w9, w9, w8
	add	w20, w9, #1
	b	LBB0_3
LBB0_2:
	mov	w20, #1
LBB0_3:
Lloh3:
	adrp	x9, _use_rtt_scaling@GOTPAGE
Lloh4:
	ldr	x9, [x9, _use_rtt_scaling@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, #0
	ccmp	w21, #0, #4, ne
	b.eq	LBB0_5
; %bb.4:
	lsl	w8, w8, #3
	add	w9, w21, w21, lsl #2
	lsl	w9, w9, #1
	sdiv	w0, w8, w9
	mov	w1, #4
	bl	_max
	mov	w1, #80
	bl	_min
	lsl	w8, w20, #3
	sdiv	w8, w8, w0
	cmp	w8, #0
	csinc	w20, w8, wzr, ne
LBB0_5:
	ldr	w8, [x19, #8]
	mov	w9, #128
	sub	w8, w9, w8
	mul	w8, w20, w8
	lsl	w8, w8, #1
	str	w8, [x19, #4]
	cbnz	w8, LBB0_7
; %bb.6:
Lloh6:
	adrp	x8, _ALPHA_BASE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ALPHA_BASE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #4]
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_use_rtt_scaling,8,3            ; @use_rtt_scaling
	.comm	_ALPHA_BASE,4,2                 ; @ALPHA_BASE
	.no_dead_strip	_htcp_alpha_update
.subsections_via_symbols
