	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ds2782_get_current
_ds2782_get_current:                    ## @ds2782_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_DS2782_REG_RSNSP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	callq	_ds278x_read_reg
	testl	%eax, %eax
	je	LBB0_1
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	-32(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.3:
	movl	$1000, %eax                     ## imm = 0x3E8
	xorl	%edx, %edx
	idivl	%ecx
	movl	%eax, %r15d
	movq	(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_dbg
	movq	_DS278x_REG_CURRENT_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ds278x_read_reg16
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_DS2782_CURRENT_UNITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%r15d
	imull	-28(%rbp), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_2:
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_DS2782_REG_RSNSP,4,2           ## @DS2782_REG_RSNSP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sense resistor value is 0\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"sense resistor = %d milli-ohms\n"

	.comm	_DS278x_REG_CURRENT_MSB,4,2     ## @DS278x_REG_CURRENT_MSB
	.comm	_DS2782_CURRENT_UNITS,4,2       ## @DS2782_CURRENT_UNITS
	.no_dead_strip	_ds2782_get_current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ds2782_get_current
_ds2782_get_current:                    ; @ds2782_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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DS2782_REG_RSNSP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DS2782_REG_RSNSP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_ds278x_read_reg
	cbz	w0, LBB0_2
LBB0_1:
	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
LBB0_2:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_5
; %bb.3:
	mov	w9, #1000
	ldr	x0, [x20]
	sdiv	w21, w9, w8
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
Lloh5:
	adrp	x8, _DS278x_REG_CURRENT_MSB@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DS278x_REG_CURRENT_MSB@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	bl	_ds278x_read_reg16
	cbnz	w0, LBB0_1
; %bb.4:
	ldr	w8, [sp, #8]
Lloh8:
	adrp	x9, _DS2782_CURRENT_UNITS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DS2782_CURRENT_UNITS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	sdiv	w9, w9, w21
	mul	w8, w9, w8
	str	w8, [x19]
	b	LBB0_1
LBB0_5:
	ldr	x0, [x20]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh13:
	adrp	x8, _ENXIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_DS2782_REG_RSNSP,4,2           ; @DS2782_REG_RSNSP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sense resistor value is 0\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"sense resistor = %d milli-ohms\n"

	.comm	_DS278x_REG_CURRENT_MSB,4,2     ; @DS278x_REG_CURRENT_MSB
	.comm	_DS2782_CURRENT_UNITS,4,2       ; @DS2782_CURRENT_UNITS
	.no_dead_strip	_ds2782_get_current
.subsections_via_symbols
