	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iadc_rsense_read
_iadc_rsense_read:                      ## @iadc_rsense_read
	.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, %rax
	movq	%rdi, %rbx
	movq	_IADC_EXT_RSENSE@GOTPCREL(%rip), %r14
	movq	(%r14), %rdx
	shlq	$2, %rdx
	addq	(%rdi), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_of_property_read_u32
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movq	(%rbx), %rax
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %eax
	testl	%eax, %eax
	je	LBB0_4
LBB0_5:
	movq	_IADC_NOMINAL_RSENSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_iadc_read
	testl	%eax, %eax
	js	LBB0_7
## %bb.6:
	movl	-20(%rbp), %eax
	movq	_IADC_NOMINAL_RSENSE_SIGN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	movq	_IADC_INT_RSENSE_IDEAL_VALUE@GOTPCREL(%rip), %rsi
	imull	$1000, (%rsi), %esi             ## imm = 0x3E8
	movl	%edx, %edi
	negl	%edi
	testl	%eax, %ecx
	cmovel	%edx, %edi
	movq	_IADC_INT_RSENSE_DEVIATION@GOTPCREL(%rip), %rax
	imull	(%rax), %edi
	addl	%esi, %edi
	movslq	%edi, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	movq	(%rbx), %rcx
	movq	_IADC_INT_RSENSE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_2:
	movq	_IADC_INT_RSENSE_IDEAL_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rcx
	movq	(%r14), %rdx
	movl	%eax, (%rcx,%rdx,4)
	testl	%eax, %eax
	jne	LBB0_5
LBB0_4:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qcom,external-resistor-micro-ohms"

	.comm	_IADC_EXT_RSENSE,8,3            ## @IADC_EXT_RSENSE
	.comm	_IADC_INT_RSENSE_IDEAL_VALUE,4,2 ## @IADC_INT_RSENSE_IDEAL_VALUE
L_.str.1:                               ## @.str.1
	.asciz	"external resistor can't be zero Ohms"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IADC_NOMINAL_RSENSE,4,2        ## @IADC_NOMINAL_RSENSE
	.comm	_IADC_NOMINAL_RSENSE_SIGN_MASK,4,2 ## @IADC_NOMINAL_RSENSE_SIGN_MASK
	.comm	_IADC_INT_RSENSE_DEVIATION,4,2  ## @IADC_INT_RSENSE_DEVIATION
	.comm	_IADC_INT_RSENSE,8,3            ## @IADC_INT_RSENSE
	.no_dead_strip	_iadc_rsense_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iadc_rsense_read
_iadc_rsense_read:                      ; @iadc_rsense_read
	.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	x8, x1
	mov	x19, x0
	ldr	x9, [x0]
Lloh0:
	adrp	x20, _IADC_EXT_RSENSE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _IADC_EXT_RSENSE@GOTPAGEOFF]
	ldr	x10, [x20]
	add	x2, x9, x10, lsl #2
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_of_property_read_u32
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	x8, [x19]
	ldr	x9, [x20]
	ldr	w8, [x8, x9, lsl #2]
	cbz	w8, LBB0_5
LBB0_2:
Lloh4:
	adrp	x8, _IADC_NOMINAL_RSENSE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IADC_NOMINAL_RSENSE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_iadc_read
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	w0, #0
	ldr	w8, [sp, #12]
Lloh7:
	adrp	x9, _IADC_NOMINAL_RSENSE_SIGN_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IADC_NOMINAL_RSENSE_SIGN_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _IADC_INT_RSENSE_IDEAL_VALUE@GOTPAGE
Lloh11:
	ldr	x10, [x10, _IADC_INT_RSENSE_IDEAL_VALUE@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	mov	w11, #1000
	mul	w10, w10, w11
	bic	w11, w8, w9
	tst	w9, w8
	cneg	w8, w11, ne
Lloh13:
	adrp	x9, _IADC_INT_RSENSE_DEVIATION@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IADC_INT_RSENSE_DEVIATION@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	madd	w8, w8, w9, w10
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	ldr	x9, [x19]
Lloh16:
	adrp	x10, _IADC_INT_RSENSE@GOTPAGE
Lloh17:
	ldr	x10, [x10, _IADC_INT_RSENSE@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	str	w8, [x9, x10, lsl #2]
	b	LBB0_6
LBB0_4:
Lloh19:
	adrp	x8, _IADC_INT_RSENSE_IDEAL_VALUE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IADC_INT_RSENSE_IDEAL_VALUE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	x9, [x19]
	ldr	x10, [x20]
	str	w8, [x9, x10, lsl #2]
	cbnz	w8, LBB0_2
LBB0_5:
	ldr	w0, [x19, #8]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qcom,external-resistor-micro-ohms"

	.comm	_IADC_EXT_RSENSE,8,3            ; @IADC_EXT_RSENSE
	.comm	_IADC_INT_RSENSE_IDEAL_VALUE,4,2 ; @IADC_INT_RSENSE_IDEAL_VALUE
l_.str.1:                               ; @.str.1
	.asciz	"external resistor can't be zero Ohms"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IADC_NOMINAL_RSENSE,4,2        ; @IADC_NOMINAL_RSENSE
	.comm	_IADC_NOMINAL_RSENSE_SIGN_MASK,4,2 ; @IADC_NOMINAL_RSENSE_SIGN_MASK
	.comm	_IADC_INT_RSENSE_DEVIATION,4,2  ; @IADC_INT_RSENSE_DEVIATION
	.comm	_IADC_INT_RSENSE,8,3            ; @IADC_INT_RSENSE
	.no_dead_strip	_iadc_rsense_read
.subsections_via_symbols
