	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kv_get_high_voltage_limit
_kv_get_high_voltage_limit:             ## @kv_get_high_voltage_limit
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_kv_get_pi
	movq	%rax, %r12
	testq	%r15, %r15
	je	LBB0_8
## %bb.1:
	movl	(%r15), %r13d
	testq	%r13, %r13
	je	LBB0_8
## %bb.2:
	testl	%r13d, %r13d
	jle	LBB0_13
## %bb.3:
	movq	(%r12), %rcx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ecx, %ecx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rax
	incq	%rax
	movq	%rbx, %r13
	cmpq	$1, %rax
	jbe	LBB0_13
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-1(%r13), %rbx
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r15), %rax
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %esi
	movq	%r15, %rdi
	callq	_kv_convert_8bit_index_to_voltage
	movq	(%r12), %rcx
	cmpq	%rcx, %rax
	jg	LBB0_6
	jmp	LBB0_15
LBB0_8:
	movl	8(%r12), %r13d
	testl	%r13d, %r13d
	jle	LBB0_13
## %bb.9:
	movq	(%r12), %rcx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_10 Depth=1
	xorl	%ecx, %ecx
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%rbx, %rax
	incq	%rax
	movq	%rbx, %r13
	cmpq	$1, %rax
	jbe	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leaq	-1(%r13), %rbx
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	16(%r12), %rax
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %esi
	movq	%r15, %rdi
	callq	_kv_convert_2bit_index_to_voltage
	movq	(%r12), %rcx
	cmpq	%rcx, %rax
	jg	LBB0_12
LBB0_15:
	decl	%r13d
	jmp	LBB0_16
LBB0_13:
	xorl	%r13d, %r13d
LBB0_16:
	movl	%r13d, (%r14)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_kv_get_high_voltage_limit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kv_get_high_voltage_limit
_kv_get_high_voltage_limit:             ; @kv_get_high_voltage_limit
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_kv_get_pi
	mov	x21, x0
	cbz	x20, LBB0_7
; %bb.1:
	ldr	w22, [x20]
	cbz	w22, LBB0_7
; %bb.2:
	cmp	w22, #1
	b.lt	LBB0_13
; %bb.3:
	ldr	x8, [x21]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x23, #1
	mov	x22, x23
	cmp	x9, #1
	b.ls	LBB0_13
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	x23, x22, #1
	cbz	x8, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #8]
	ldr	w1, [x8, w23, uxtw #2]
	mov	x0, x20
	bl	_kv_convert_8bit_index_to_voltage
	ldr	x8, [x21]
	cmp	x0, x8
	b.gt	LBB0_4
	b	LBB0_12
LBB0_7:
	ldr	w22, [x21, #8]
	cmp	w22, #1
	b.lt	LBB0_13
; %bb.8:
	ldr	x8, [x21]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x9, x23, #1
	mov	x22, x23
	cmp	x9, #1
	b.ls	LBB0_13
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	sub	x23, x22, #1
	cbz	x8, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x21, #16]
	ldr	w1, [x8, w23, uxtw #2]
	mov	x0, x20
	bl	_kv_convert_2bit_index_to_voltage
	ldr	x8, [x21]
	cmp	x0, x8
	b.gt	LBB0_9
LBB0_12:
	sub	w8, w22, #1
	b	LBB0_14
LBB0_13:
	mov	w8, #0
LBB0_14:
	str	w8, [x19]
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_kv_get_high_voltage_limit
.subsections_via_symbols
