	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ds2780_get_current
_ds2780_get_current:                    ## @ds2780_get_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	_DS2780_RSNSP_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-36(%rbp), %rsi
	callq	_ds2780_read8
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	movl	-36(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.4:
	movl	$1000, %eax                     ## imm = 0x3E8
	xorl	%edx, %edx
	idivl	%ecx
	movl	%eax, %r15d
	movq	_CURRENT_NOW@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_DS2780_CURRENT_MSB_REG@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_3
LBB0_6:
	movq	_CURRENT_AVG@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_3
## %bb.7:
	movq	_DS2780_IAVG_MSB_REG@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %edx
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ds2780_read16
	testl	%eax, %eax
	js	LBB0_10
## %bb.9:
	movq	_DS2780_CURRENT_UNITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%r15d
	imull	-40(%rbp), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	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	_EINVAL,4,2                     ## @EINVAL
	.comm	_CURRENT_NOW,4,2                ## @CURRENT_NOW
	.comm	_DS2780_CURRENT_MSB_REG,4,2     ## @DS2780_CURRENT_MSB_REG
	.comm	_CURRENT_AVG,4,2                ## @CURRENT_AVG
	.comm	_DS2780_IAVG_MSB_REG,4,2        ## @DS2780_IAVG_MSB_REG
	.comm	_DS2780_CURRENT_UNITS,4,2       ## @DS2780_CURRENT_UNITS
	.no_dead_strip	_ds2780_get_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_current
_ds2780_get_current:                    ; @ds2780_get_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, x2
	mov	x21, 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_10
; %bb.1:
	ldr	w22, [sp, #8]
	cbz	w22, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _CURRENT_NOW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CURRENT_NOW@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_5
; %bb.3:
Lloh6:
	adrp	x8, _DS2780_CURRENT_MSB_REG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DS2780_CURRENT_MSB_REG@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	ldr	w0, [x20]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_5:
Lloh10:
	adrp	x8, _CURRENT_AVG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CURRENT_AVG@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_9
; %bb.6:
Lloh13:
	adrp	x8, _DS2780_IAVG_MSB_REG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DS2780_IAVG_MSB_REG@GOTPAGEOFF]
LBB0_7:
	ldr	w2, [x8]
	add	x1, sp, #12
	mov	x0, x20
	bl	_ds2780_read16
	tbnz	w0, #31, LBB0_10
; %bb.8:
	mov	w0, #0
	mov	w8, #1000
	sdiv	w8, w8, w22
	ldr	w9, [sp, #12]
Lloh15:
	adrp	x10, _DS2780_CURRENT_UNITS@GOTPAGE
Lloh16:
	ldr	x10, [x10, _DS2780_CURRENT_UNITS@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	sdiv	w8, w10, w8
	mul	w8, w8, w9
	str	w8, [x19]
	b	LBB0_10
LBB0_9:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.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	_EINVAL,4,2                     ; @EINVAL
	.comm	_CURRENT_NOW,4,2                ; @CURRENT_NOW
	.comm	_DS2780_CURRENT_MSB_REG,4,2     ; @DS2780_CURRENT_MSB_REG
	.comm	_CURRENT_AVG,4,2                ; @CURRENT_AVG
	.comm	_DS2780_IAVG_MSB_REG,4,2        ; @DS2780_IAVG_MSB_REG
	.comm	_DS2780_CURRENT_UNITS,4,2       ; @DS2780_CURRENT_UNITS
	.no_dead_strip	_ds2780_get_current
.subsections_via_symbols
