	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_hpts_insert_locked
_tcp_hpts_insert_locked:                ## @tcp_hpts_insert_locked
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r13
	movq	%r8, %rbx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_HPTS_MTX_ASSERT
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$88, %edx
	callq	_memset
	movq	(%r15), %rax
	movq	%rax, (%rbx)
	movl	32(%r15), %eax
	movl	%eax, 84(%rbx)
	movl	64(%r15), %eax
	movl	%eax, 80(%rbx)
	movups	48(%r15), %xmm0
	movups	%xmm0, 64(%rbx)
	movl	%r14d, 8(%rbx)
	movq	8(%r15), %rax
	movq	%rax, 16(%rbx)
	movl	16(%r15), %eax
	movl	%eax, 24(%rbx)
LBB0_2:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	cmpq	$0, (%r12)
	je	LBB0_3
LBB0_34:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_35
## %bb.4:
	movq	%r13, %rdi
	callq	_tcp_tv_to_hptstick
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_tick_to_wheel
	movl	%eax, %r13d
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_max_ticks_available
	movl	%r13d, %edi
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.5:
	movl	%edi, 28(%rbx)
	movl	%eax, 32(%rbx)
	movl	%r14d, 36(%rbx)
LBB0_6:
	testl	%eax, %eax
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	je	LBB0_7
## %bb.8:
	cmpl	%esi, %eax
	jge	LBB0_9
## %bb.10:
	movl	%edi, %r13d
	movl	%esi, %ecx
	subl	%eax, %ecx
	movl	%ecx, 12(%r12)
	movl	-52(%rbp), %eax
	jmp	LBB0_11
LBB0_35:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tcp_queue_to_hpts_immediate_locked ## TAILCALL
LBB0_7:
	movl	%edi, %r13d
	xorl	%eax, %eax
	cmpl	$2, %esi
	setge	%al
	subl	%eax, %esi
	movl	-52(%rbp), %eax
	movl	%eax, 8(%r12)
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, 12(%r12)
	jmp	LBB0_12
LBB0_9:
	movl	$0, 12(%r12)
	movl	%edi, %r13d
	callq	_hpts_tick
LBB0_11:
	movl	%eax, 8(%r12)
LBB0_12:
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.13:
	movl	12(%r12), %edx
	movl	%edx, 40(%rbx)
	movl	%eax, 44(%rbx)
LBB0_14:
	movslq	%eax, %rdx
	shlq	$2, %rdx
	addq	40(%r15), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	xorl	%r8d, %r8d
	callq	_hpts_sane_pace_insert
	cmpq	$0, (%r15)
	jne	LBB0_34
## %bb.15:
	cmpl	$0, 12(%r12)
	jne	LBB0_34
## %bb.16:
	cmpq	$0, 8(%r15)
	jne	LBB0_34
## %bb.17:
	movl	32(%r15), %edi
	movl	%r13d, %esi
	callq	_hpts_ticks_diff
	movl	16(%r15), %ecx
	xorl	%esi, %esi
	movl	%ecx, %edx
	subl	%eax, %edx
	cmovlel	%esi, %edx
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.18:
	movl	%eax, 48(%rbx)
	movl	%edx, 52(%rbx)
LBB0_19:
	testl	%edx, %edx
	je	LBB0_28
## %bb.20:
	cmpl	-44(%rbp), %edx                 ## 4-byte Folded Reload
	jle	LBB0_28
## %bb.21:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, 16(%r15)
	cmpl	%eax, %ecx
	jle	LBB0_29
## %bb.22:
	movq	_HPTS_TICKS_PER_USEC@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	imull	(%rax), %r14d
	testl	%r14d, %r14d
	je	LBB0_34
## %bb.23:
	movl	%r14d, %edi
	movq	_HPTS_USEC_IN_SEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%esi, %esi
	cmpl	%eax, %edi
	jle	LBB0_26
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	incq	%rsi
	subl	%eax, %edi
	cmpl	%eax, %edi
	jg	LBB0_24
LBB0_26:
	movl	%edi, %r14d
	callq	_tvtosbt
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_tcp_hpts_callout_skip_swi@GOTPCREL(%rip), %rax
	leaq	28(%r15), %r13
	cmpq	$0, (%rax)
	je	LBB0_27
## %bb.31:
	movq	_hpts_timeout_dir@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	24(%r15), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_tcp_hpts_precision@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_C_PREL
	movl	%eax, (%rsp)
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movl	%r12d, %ecx
	jmp	LBB0_32
LBB0_28:
	cmpl	%eax, %ecx
	jg	LBB0_34
LBB0_29:
	movl	$1, 20(%r15)
	movq	%r15, %rdi
	callq	_tcp_wakehpts
	testq	%rbx, %rbx
	je	LBB0_34
## %bb.30:
	movabsq	$-281474976710656, %rax         ## imm = 0xFFFF000000000000
	movq	%rax, 56(%rbx)
	jmp	LBB0_34
LBB0_27:
	movq	_hpts_timeout_swi@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	24(%r15), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_C_DIRECT_EXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_tcp_hpts_precision@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_C_PREL
	orl	%r12d, %eax
	movl	%eax, (%rsp)
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
LBB0_32:
	movq	%r15, %r8
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	callq	_callout_reset_sbt_on
	testq	%rbx, %rbx
	je	LBB0_34
## %bb.33:
	movl	%r14d, 56(%rbx)
	movl	%eax, 60(%rbx)
	jmp	LBB0_34
	.cfi_endproc
                                        ## -- End function
	.comm	_HPTS_TICKS_PER_USEC,4,2        ## @HPTS_TICKS_PER_USEC
	.comm	_HPTS_USEC_IN_SEC,4,2           ## @HPTS_USEC_IN_SEC
	.comm	_tcp_hpts_callout_skip_swi,8,3  ## @tcp_hpts_callout_skip_swi
	.comm	_hpts_timeout_swi,4,2           ## @hpts_timeout_swi
	.comm	_C_DIRECT_EXEC,4,2              ## @C_DIRECT_EXEC
	.comm	_tcp_hpts_precision,4,2         ## @tcp_hpts_precision
	.comm	_hpts_timeout_dir,4,2           ## @hpts_timeout_dir
	.no_dead_strip	_tcp_hpts_insert_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_hpts_insert_locked
_tcp_hpts_insert_locked:                ; @tcp_hpts_insert_locked
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x24, x5
	mov	x19, x4
	mov	x23, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	bl	_HPTS_MTX_ASSERT
	cbz	x19, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #88
	bl	_memset
	ldp	x8, x9, [x20]
	str	x8, [x19]
	ldr	w8, [x20, #32]
	ldr	w10, [x20, #64]
	stp	w10, w8, [x19, #80]
	ldr	q0, [x20, #48]
	str	q0, [x19, #64]
	str	w21, [x19, #8]
	str	x9, [x19, #16]
	ldr	w8, [x20, #16]
	str	w8, [x19, #24]
LBB0_2:
	ldr	x8, [x22]
	cbz	x8, LBB0_4
LBB0_3:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_4:
	cbz	w21, LBB0_10
; %bb.5:
	mov	x0, x24
	bl	_tcp_tv_to_hptstick
	mov	x25, x0
	bl	_tick_to_wheel
	mov	x24, x0
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x24
	bl	_max_ticks_available
	cbz	x19, LBB0_7
; %bb.6:
	stp	w24, w0, [x19, #28]
	str	w25, [x19, #36]
LBB0_7:
	cbz	w0, LBB0_11
; %bb.8:
	cmp	w0, w21
	b.ge	LBB0_12
; %bb.9:
	sub	w8, w21, w0
	ldr	w0, [sp, #12]
	str	w8, [x22, #12]
	b	LBB0_13
LBB0_10:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x23
	mov	w3, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_tcp_queue_to_hpts_immediate_locked
LBB0_11:
	cmp	w21, #1
	cset	w8, gt
	ldr	w0, [sp, #12]
	sub	w21, w21, w8
	stp	w0, w21, [x22, #8]
	cbnz	x19, LBB0_14
	b	LBB0_15
LBB0_12:
	str	wzr, [x22, #12]
	mov	x0, x24
	mov	x1, x21
	bl	_hpts_tick
LBB0_13:
	str	w0, [x22, #8]
	cbz	x19, LBB0_15
LBB0_14:
	ldr	w8, [x22, #12]
	stp	w8, w0, [x19, #40]
LBB0_15:
	ldr	x8, [x20, #40]
	add	x2, x8, w0, sxtw #2
	mov	x0, x20
	mov	x1, x22
	mov	x3, x23
	mov	w4, #0
	bl	_hpts_sane_pace_insert
	ldr	x8, [x20]
	cbnz	x8, LBB0_3
; %bb.16:
	ldr	w8, [x22, #12]
	cbnz	w8, LBB0_3
; %bb.17:
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_3
; %bb.18:
	ldr	w0, [x20, #32]
	mov	x1, x24
	bl	_hpts_ticks_diff
	ldr	w8, [x20, #16]
	subs	w9, w8, w0
	csel	w9, w9, wzr, gt
	cbz	x19, LBB0_20
; %bb.19:
	stp	w0, w9, [x19, #48]
LBB0_20:
	cbz	w9, LBB0_27
; %bb.21:
	cmp	w9, w21
	b.le	LBB0_27
; %bb.22:
	str	w21, [x20, #16]
	cmp	w8, w0
	b.le	LBB0_28
; %bb.23:
Lloh0:
	adrp	x8, _HPTS_TICKS_PER_USEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HPTS_TICKS_PER_USEC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w25, w8, w21
	cbz	w25, LBB0_3
; %bb.24:
Lloh3:
	adrp	x8, _HPTS_USEC_IN_SEC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HPTS_USEC_IN_SEC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w25, w8
	b.le	LBB0_30
; %bb.25:
	mov	x1, #0
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	add	x1, x1, #1
	sub	w25, w25, w8
	cmp	w25, w8
	b.gt	LBB0_26
	b	LBB0_31
LBB0_27:
	cmp	w8, w0
	b.gt	LBB0_3
LBB0_28:
	mov	w8, #1
	str	w8, [x20, #20]
	mov	x0, x20
	bl	_tcp_wakehpts
	cbz	x19, LBB0_3
; %bb.29:
	movi	d0, #0xffff000000000000
	str	d0, [x19, #56]
	b	LBB0_3
LBB0_30:
	mov	x1, #0
LBB0_31:
	mov	w0, w25
	bl	_tvtosbt
	mov	x21, x0
Lloh6:
	adrp	x8, _tcp_hpts_callout_skip_swi@GOTPAGE
Lloh7:
	ldr	x8, [x8, _tcp_hpts_callout_skip_swi@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	add	x22, x20, #28
	cbz	x8, LBB0_33
; %bb.32:
Lloh9:
	adrp	x8, _hpts_timeout_dir@GOTPAGE
Lloh10:
	ldr	x8, [x8, _hpts_timeout_dir@GOTPAGEOFF]
Lloh11:
	ldr	w23, [x8]
	ldr	w24, [x20, #24]
Lloh12:
	adrp	x8, _tcp_hpts_precision@GOTPAGE
Lloh13:
	ldr	x8, [x8, _tcp_hpts_precision@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_C_PREL
	mov	x6, x0
	b	LBB0_34
LBB0_33:
Lloh15:
	adrp	x8, _hpts_timeout_swi@GOTPAGE
Lloh16:
	ldr	x8, [x8, _hpts_timeout_swi@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
	ldr	w24, [x20, #24]
Lloh18:
	adrp	x8, _C_DIRECT_EXEC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _C_DIRECT_EXEC@GOTPAGEOFF]
Lloh20:
	ldr	w26, [x8]
Lloh21:
	adrp	x8, _tcp_hpts_precision@GOTPAGE
Lloh22:
	ldr	x8, [x8, _tcp_hpts_precision@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_C_PREL
	orr	w6, w0, w26
LBB0_34:
	mov	x0, x22
	mov	x1, x21
	mov	w2, #0
	mov	x3, x23
	mov	x4, x20
	mov	x5, x24
	bl	_callout_reset_sbt_on
	cbz	x19, LBB0_3
; %bb.35:
	stp	w25, w0, [x19, #56]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_HPTS_TICKS_PER_USEC,4,2        ; @HPTS_TICKS_PER_USEC
	.comm	_HPTS_USEC_IN_SEC,4,2           ; @HPTS_USEC_IN_SEC
	.comm	_tcp_hpts_callout_skip_swi,8,3  ; @tcp_hpts_callout_skip_swi
	.comm	_hpts_timeout_swi,4,2           ; @hpts_timeout_swi
	.comm	_C_DIRECT_EXEC,4,2              ; @C_DIRECT_EXEC
	.comm	_tcp_hpts_precision,4,2         ; @tcp_hpts_precision
	.comm	_hpts_timeout_dir,4,2           ; @hpts_timeout_dir
	.no_dead_strip	_tcp_hpts_insert_locked
.subsections_via_symbols
