	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ltc294x_get_voltage
_ltc294x_get_voltage:                   ## @ltc294x_get_voltage
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movl	4(%rdi), %edi
	movq	_LTC294X_REG_VOLTAGE_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movl	$2, %ecx
	callq	_ltc294x_read_regs
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %esi
	movl	(%rbx), %ecx
	cmpl	$129, %ecx
	je	LBB0_1
## %bb.2:
	cmpl	$128, %ecx
	jne	LBB0_4
## %bb.3:
	movl	$1250, %ecx                     ## imm = 0x4E2
	movl	$56640, %edi                    ## imm = 0xDD40
	jmp	LBB0_5
LBB0_1:
	movl	$500, %ecx                      ## imm = 0x1F4
	movl	$47200, %edi                    ## imm = 0xB860
	jmp	LBB0_5
LBB0_4:
	movl	$100, %ecx
	movl	$60000, %edi                    ## imm = 0xEA60
LBB0_5:
	shll	$8, %edx
	orl	%esi, %edx
	imull	%edi, %edx
	movslq	%edx, %rdx
	imulq	$-2147450879, %rdx, %rsi        ## imm = 0x80008001
	shrq	$32, %rsi
	addl	%esi, %edx
	movl	%edx, %esi
	shrl	$31, %esi
	sarl	$15, %edx
	addl	%esi, %edx
	imull	%ecx, %edx
	movl	%edx, (%r14)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_7
## %bb.6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_LTC294X_REG_VOLTAGE_MSB,4,2    ## @LTC294X_REG_VOLTAGE_MSB
	.no_dead_strip	_ltc294x_get_voltage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ltc294x_get_voltage
_ltc294x_get_voltage:                   ; @ltc294x_get_voltage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	w0, [x0, #4]
Lloh3:
	adrp	x8, _LTC294X_REG_VOLTAGE_MSB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LTC294X_REG_VOLTAGE_MSB@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, sp
	mov	w3, #2
	bl	_ltc294x_read_regs
	ldp	w8, w9, [sp]
	ldr	w10, [x20]
	mov	w11, #500
	mov	w12, #47200
	mov	w13, #100
	mov	w14, #60000
	mov	w15, #1250
	mov	w16, #56640
	cmp	w10, #128
	csel	w14, w14, w16, ne
	csel	w13, w13, w15, ne
	cmp	w10, #129
	csel	w10, w12, w14, eq
	csel	w11, w11, w13, eq
	orr	w8, w9, w8, lsl #8
	mul	w8, w8, w10
	mov	w9, #32769
	movk	w9, #32768, lsl #16
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #15
	add	w8, w9, w8, lsr #31
	mul	w8, w8, w11
	str	w8, [x19]
	ldr	x8, [sp, #8]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_LTC294X_REG_VOLTAGE_MSB,4,2    ; @LTC294X_REG_VOLTAGE_MSB
	.no_dead_strip	_ltc294x_get_voltage
.subsections_via_symbols
