	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kv_set_valid_clock_range
_kv_set_valid_clock_range:              ## @kv_set_valid_clock_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_kv_get_ps
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_kv_get_pi
	testq	%r14, %r14
	je	LBB0_7
## %bb.1:
	cmpq	$0, 8(%r14)
	je	LBB0_7
## %bb.2:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_21
## %bb.3:
	movq	(%r14), %r8
	movq	8(%r15), %rdx
	movq	(%rdx), %rsi
	leaq	-1(%rcx), %rdx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, (%r8,%rdi,8)
	jge	LBB0_20
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%rdi, %rdx
	je	LBB0_20
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdi
	cmpq	%rdi, %rcx
	jne	LBB0_4
	jmp	LBB0_21
LBB0_7:
	movq	(%rax), %rcx
	movq	%rcx, %rdx
	shlq	$32, %rdx
	je	LBB0_13
## %bb.8:
	movq	%rdx, %rsi
	sarq	$32, %rsi
	movq	24(%rax), %r8
	movq	8(%r15), %rdi
	movq	(%rdi), %r9
	movabsq	$-4294967296, %rdi              ## imm = 0xFFFFFFFF00000000
	addq	%rdx, %rdi
	sarq	$32, %rdi
	cmpq	$2, %rsi
	movl	$1, %edx
	cmovaeq	%rsi, %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r9, (%r8,%rsi,8)
	jge	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	%rsi, %rdi
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	incq	%rsi
	cmpq	%rsi, %rdx
	jne	LBB0_9
	jmp	LBB0_13
LBB0_12:
	movq	%rsi, 8(%rax)
LBB0_13:
	decq	%rcx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rdx
	subq	$1, %rcx
	jb	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	24(%rax), %rsi
	movq	(%rsi,%rdx,8), %rsi
	movq	8(%r15), %rdi
	movslq	(%r15), %rbx
	cmpq	-8(%rdi,%rbx,8), %rsi
	jg	LBB0_14
LBB0_16:
	movq	%rdx, 16(%rax)
	movq	8(%rax), %rcx
	cmpq	%rdx, %rcx
	jbe	LBB0_27
## %bb.17:
	movq	8(%r15), %r8
	movq	(%r8), %rdi
	movq	24(%rax), %rbx
	jmp	LBB0_18
LBB0_20:
	movq	%rdi, 8(%rax)
LBB0_21:
	decq	%rcx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rdx
	subq	$1, %rcx
	jb	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	movq	(%r14), %rsi
	movq	(%rsi,%rdx,8), %rsi
	movq	8(%r15), %rdi
	movslq	(%r15), %rbx
	cmpq	-8(%rdi,%rbx,8), %rsi
	jg	LBB0_22
LBB0_24:
	movq	%rdx, 16(%rax)
	movq	8(%rax), %rcx
	cmpq	%rdx, %rcx
	jbe	LBB0_27
## %bb.25:
	movq	8(%r15), %r8
	movq	(%r8), %rdi
	movq	(%r14), %rbx
LBB0_18:
	subq	(%rbx,%rdx,8), %rdi
	movq	(%rbx,%rcx,8), %rbx
	movslq	(%r15), %rsi
	subq	-8(%r8,%rsi,8), %rbx
	cmpq	%rbx, %rdi
	jle	LBB0_19
## %bb.26:
	movq	%rcx, 16(%rax)
	jmp	LBB0_27
LBB0_19:
	movq	%rdx, 8(%rax)
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_kv_set_valid_clock_range
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kv_set_valid_clock_range
_kv_set_valid_clock_range:              ; @kv_set_valid_clock_range
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	mov	x0, x1
	bl	_kv_get_ps
	mov	x19, x0
	mov	x0, x20
	bl	_kv_get_pi
	cbz	x20, LBB0_6
; %bb.1:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	x8, [x0]
	cbz	x8, LBB0_17
; %bb.3:
	mov	x9, #0
	ldr	x10, [x20]
	ldr	x11, [x19, #8]
	ldr	x11, [x11]
	sub	x12, x8, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x10, x9, lsl #3]
	cmp	x13, x11
	ccmp	x12, x9, #4, lt
	b.eq	LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_4
	b	LBB0_17
LBB0_6:
	ldr	x8, [x0]
	lsl	x12, x8, #32
	cbz	x12, LBB0_11
; %bb.7:
	mov	x9, #0
	asr	x13, x12, #32
	ldr	x10, [x0, #24]
	ldr	x11, [x19, #8]
	ldr	x11, [x11]
	mov	x14, #-4294967296
	add	x12, x12, x14
	asr	x12, x12, #32
	cmp	x13, #1
	csinc	x13, x13, xzr, hi
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x10, x9, lsl #3]
	cmp	x14, x11
	ccmp	x12, x9, #4, lt
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x9, x9, #1
	cmp	x13, x9
	b.ne	LBB0_8
	b	LBB0_11
LBB0_10:
	str	x9, [x0, #8]
LBB0_11:
	sub	x9, x8, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x8, x9
	cbz	x9, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x9, [x0, #24]
	ldr	x10, [x9, x8, lsl #3]
	ldr	x9, [x19, #8]
	ldrsw	x11, [x19]
	add	x9, x9, x11, lsl #3
	ldur	x11, [x9, #-8]
	sub	x9, x8, #1
	cmp	x10, x11
	b.gt	LBB0_12
LBB0_14:
	str	x8, [x0, #16]
	ldr	x9, [x0, #8]
	cmp	x9, x8
	b.ls	LBB0_25
; %bb.15:
	ldr	x10, [x19, #8]
	ldr	x11, [x10]
	ldr	x12, [x0, #24]
	b	LBB0_22
LBB0_16:
	str	x9, [x0, #8]
LBB0_17:
	sub	x9, x8, #1
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x8, x9
	cbz	x9, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x9, [x20]
	ldr	x10, [x9, x8, lsl #3]
	ldr	x9, [x19, #8]
	ldrsw	x11, [x19]
	add	x9, x9, x11, lsl #3
	ldur	x11, [x9, #-8]
	sub	x9, x8, #1
	cmp	x10, x11
	b.gt	LBB0_18
LBB0_20:
	str	x8, [x0, #16]
	ldr	x9, [x0, #8]
	cmp	x9, x8
	b.ls	LBB0_25
; %bb.21:
	ldr	x10, [x19, #8]
	ldr	x11, [x10]
	ldr	x12, [x20]
LBB0_22:
	ldr	x13, [x12, x8, lsl #3]
	ldr	x12, [x12, x9, lsl #3]
	sub	x11, x11, x13
	ldrsw	x13, [x19]
	add	x10, x10, x13, lsl #3
	ldur	x10, [x10, #-8]
	sub	x10, x12, x10
	cmp	x11, x10
	b.le	LBB0_24
; %bb.23:
	str	x9, [x0, #16]
	b	LBB0_25
LBB0_24:
	str	x8, [x0, #8]
LBB0_25:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_kv_set_valid_clock_range
.subsections_via_symbols
