	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcap_adc_convert
_cpcap_adc_convert:                     ## @cpcap_adc_convert
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rcx
	movl	(%rdi), %eax
	cmpl	$129, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %edx
	cmpl	$128, %eax
	jne	LBB0_5
## %bb.2:
	movq	_CPCAP_ADC_BATTP@GOTPCREL(%rip), %rdx
	jmp	LBB0_4
LBB0_3:
	movq	_CPCAP_ADC_BATTI@GOTPCREL(%rip), %rdx
LBB0_4:
	movl	(%rdx), %edx
LBB0_5:
	movslq	%edx, %rdx
	leaq	(%rdx,%rdx,2), %rsi
	movq	(%rcx,%rsi,8), %rdx
	movq	_IIO_CHAN_INFO_RAW@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rdx
	je	LBB0_12
## %bb.6:
	movq	_CPCAP_ADC_AD0@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	je	LBB0_8
## %bb.7:
	movq	_CPCAP_ADC_AD3@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	je	LBB0_8
## %bb.9:
	movl	4(%rbx), %eax
	imull	20(%rcx,%rsi,8), %eax
	movl	%eax, 4(%rbx)
	movl	16(%rcx,%rsi,8), %edi
	testl	%edi, %edi
	je	LBB0_12
## %bb.10:
	cltd
	idivl	%edi
	addl	8(%rcx,%rsi,8), %eax
	jmp	LBB0_11
LBB0_8:
	movl	4(%rbx), %edi
	callq	_cpcap_adc_table_to_millicelcius
LBB0_11:
	movl	%eax, 4(%rbx)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CPCAP_ADC_BATTP,4,2            ## @CPCAP_ADC_BATTP
	.comm	_CPCAP_ADC_BATTI,4,2            ## @CPCAP_ADC_BATTI
	.comm	_IIO_CHAN_INFO_RAW,8,3          ## @IIO_CHAN_INFO_RAW
	.comm	_CPCAP_ADC_AD0,4,2              ## @CPCAP_ADC_AD0
	.comm	_CPCAP_ADC_AD3,4,2              ## @CPCAP_ADC_AD3
	.no_dead_strip	_cpcap_adc_convert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcap_adc_convert
_cpcap_adc_convert:                     ; @cpcap_adc_convert
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w9, [x0]
	cmp	w9, #129
	b.eq	LBB0_3
; %bb.1:
	mov	x10, x9
	cmp	w9, #128
	b.ne	LBB0_5
; %bb.2:
Lloh0:
	adrp	x10, _CPCAP_ADC_BATTP@GOTPAGE
Lloh1:
	ldr	x10, [x10, _CPCAP_ADC_BATTP@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x10, _CPCAP_ADC_BATTI@GOTPAGE
Lloh3:
	ldr	x10, [x10, _CPCAP_ADC_BATTI@GOTPAGEOFF]
LBB0_4:
	ldr	w10, [x10]
LBB0_5:
	mov	w11, #24
	smull	x11, w10, w11
	ldr	x11, [x8, x11]
Lloh4:
	adrp	x12, _IIO_CHAN_INFO_RAW@GOTPAGE
Lloh5:
	ldr	x12, [x12, _IIO_CHAN_INFO_RAW@GOTPAGEOFF]
Lloh6:
	ldr	x12, [x12]
	cmp	x11, x12
	b.eq	LBB0_10
; %bb.6:
Lloh7:
	adrp	x11, _CPCAP_ADC_AD0@GOTPAGE
Lloh8:
	ldr	x11, [x11, _CPCAP_ADC_AD0@GOTPAGEOFF]
Lloh9:
	ldr	w11, [x11]
Lloh10:
	adrp	x12, _CPCAP_ADC_AD3@GOTPAGE
Lloh11:
	ldr	x12, [x12, _CPCAP_ADC_AD3@GOTPAGEOFF]
Lloh12:
	ldr	w12, [x12]
	cmp	w9, w11
	ccmp	w9, w12, #4, ne
	b.ne	LBB0_8
; %bb.7:
	ldr	w0, [x19, #4]
	bl	_cpcap_adc_table_to_millicelcius
	str	w0, [x19, #4]
	b	LBB0_10
LBB0_8:
	sxtw	x9, w10
	mov	w10, #24
	madd	x10, x9, x10, x8
	ldr	w11, [x19, #4]
	ldp	w10, w12, [x10, #16]
	mul	w11, w11, w12
	str	w11, [x19, #4]
	cbz	w10, LBB0_10
; %bb.9:
	sdiv	w10, w11, w10
	mov	w11, #24
	madd	x8, x9, x11, x8
	ldr	w8, [x8, #8]
	add	w8, w10, w8
	str	w8, [x19, #4]
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CPCAP_ADC_BATTP,4,2            ; @CPCAP_ADC_BATTP
	.comm	_CPCAP_ADC_BATTI,4,2            ; @CPCAP_ADC_BATTI
	.comm	_IIO_CHAN_INFO_RAW,8,3          ; @IIO_CHAN_INFO_RAW
	.comm	_CPCAP_ADC_AD0,4,2              ; @CPCAP_ADC_AD0
	.comm	_CPCAP_ADC_AD3,4,2              ; @CPCAP_ADC_AD3
	.no_dead_strip	_cpcap_adc_convert
.subsections_via_symbols
