	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_vbatt_threshold
_set_vbatt_threshold:                   ## @set_vbatt_threshold
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	%rdi, %r15
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	movl	%r12d, %eax
	shll	$5, %eax
	movslq	%eax, %rbx
	imulq	$-1037155065, %rbx, %rax        ## imm = 0xC22E4507
	shrq	$32, %rax
	addl	%eax, %ebx
	movl	%ebx, %eax
	shrl	$31, %eax
	sarl	$9, %ebx
	addl	%eax, %ebx
	jmp	LBB0_3
LBB0_1:
	xorl	%ebx, %ebx
LBB0_3:
	movl	4(%r15), %edi
	movq	_PM8607_VBAT_LOWTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_pm860x_reg_write
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	callq	_dev_dbg
	testl	%r14d, %r14d
	jle	LBB0_4
## %bb.5:
	movl	%r14d, %eax
	shll	$5, %eax
	movslq	%eax, %rbx
	imulq	$-1037155065, %rbx, %rax        ## imm = 0xC22E4507
	shrq	$32, %rax
	addl	%eax, %ebx
	movl	%ebx, %eax
	shrl	$31, %eax
	sarl	$9, %ebx
	addl	%eax, %ebx
	jmp	LBB0_6
LBB0_4:
	movl	$255, %ebx
LBB0_6:
	movl	4(%r15), %edi
	movq	_PM8607_VBAT_HIGHTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_pm860x_reg_write
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PM8607_VBAT_LOWTH,4,2          ## @PM8607_VBAT_LOWTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VBAT Min:%dmv, LOWTH:0x%x\n"

	.comm	_PM8607_VBAT_HIGHTH,4,2         ## @PM8607_VBAT_HIGHTH
L_.str.1:                               ## @.str.1
	.asciz	"VBAT Max:%dmv, HIGHTH:0x%x\n"

	.no_dead_strip	_set_vbatt_threshold
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_vbatt_threshold
_set_vbatt_threshold:                   ; @set_vbatt_threshold
	.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, x2
	mov	x20, x1
	mov	x21, x0
	lsl	w8, w1, #5
	mov	w23, #17671
	movk	w23, #49710, lsl #16
	smull	x9, w8, w23
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #9
	add	w8, w9, w8, lsr #31
	cmp	w1, #1
	csel	w22, wzr, w8, lt
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x8, _PM8607_VBAT_LOWTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PM8607_VBAT_LOWTH@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_pm860x_reg_write
	ldr	w0, [x21]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x22
	bl	_dev_dbg
	mov	w8, #255
	lsl	w9, w19, #5
	smull	x10, w9, w23
	lsr	x10, x10, #32
	add	w9, w10, w9
	asr	w10, w9, #9
	add	w9, w10, w9, lsr #31
	cmp	w19, #1
	csel	w20, w8, w9, lt
	ldr	w0, [x21, #4]
Lloh5:
	adrp	x8, _PM8607_VBAT_HIGHTH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PM8607_VBAT_HIGHTH@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_pm860x_reg_write
	ldr	w0, [x21]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	mov	x3, x20
	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
	b	_dev_dbg
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PM8607_VBAT_LOWTH,4,2          ; @PM8607_VBAT_LOWTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VBAT Min:%dmv, LOWTH:0x%x\n"

	.comm	_PM8607_VBAT_HIGHTH,4,2         ; @PM8607_VBAT_HIGHTH
l_.str.1:                               ; @.str.1
	.asciz	"VBAT Max:%dmv, HIGHTH:0x%x\n"

	.no_dead_strip	_set_vbatt_threshold
.subsections_via_symbols
