	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ds2780_get_accumulated_current
_ds2780_get_accumulated_current:        ## @ds2780_get_accumulated_current
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	_DS2780_RSNSP_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rsi
	callq	_ds2780_read8
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movl	-28(%rbp), %r15d
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.2:
	movq	_DS2780_ACR_MSB_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-32(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ds2780_read16
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	xorl	%ecx, %ecx
	movl	$1000, %eax                     ## imm = 0x3E8
	xorl	%edx, %edx
	idivl	%r15d
	movl	%eax, %esi
	movq	_DS2780_CHARGE_UNITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%esi
	imull	-32(%rbp), %eax
	movl	%eax, (%r14)
	jmp	LBB0_7
LBB0_6:
	movl	%eax, %ecx
	jmp	LBB0_7
LBB0_5:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
LBB0_7:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DS2780_RSNSP_REG,4,2           ## @DS2780_RSNSP_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sense resistor value is 0\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_DS2780_ACR_MSB_REG,4,2         ## @DS2780_ACR_MSB_REG
	.comm	_DS2780_CHARGE_UNITS,4,2        ## @DS2780_CHARGE_UNITS
	.no_dead_strip	_ds2780_get_accumulated_current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ds2780_get_accumulated_current
_ds2780_get_accumulated_current:        ; @ds2780_get_accumulated_current
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DS2780_RSNSP_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DS2780_RSNSP_REG@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x1, sp, #8
	bl	_ds2780_read8
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	w21, [sp, #8]
	cbz	w21, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _DS2780_ACR_MSB_REG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DS2780_ACR_MSB_REG@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x1, sp, #12
	mov	x0, x20
	bl	_ds2780_read16
	tbnz	w0, #31, LBB0_5
; %bb.3:
	mov	w0, #0
	mov	w8, #1000
	sdiv	w8, w8, w21
	ldr	w9, [sp, #12]
Lloh6:
	adrp	x10, _DS2780_CHARGE_UNITS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DS2780_CHARGE_UNITS@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	sdiv	w8, w10, w8
	mul	w8, w8, w9
	str	w8, [x19]
	b	LBB0_5
LBB0_4:
	ldr	w0, [x20]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh11:
	adrp	x8, _ENXIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DS2780_RSNSP_REG,4,2           ; @DS2780_RSNSP_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sense resistor value is 0\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_DS2780_ACR_MSB_REG,4,2         ; @DS2780_ACR_MSB_REG
	.comm	_DS2780_CHARGE_UNITS,4,2        ; @DS2780_CHARGE_UNITS
	.no_dead_strip	_ds2780_get_accumulated_current
.subsections_via_symbols
