	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcap_adc_read
_cpcap_adc_read:                        ## @cpcap_adc_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r13
	movq	%rdx, %r14
	movq	%rsi, %r12
	callq	_iio_priv
	movq	%rax, %r15
	movl	4(%r12), %esi
	leaq	-48(%rbp), %rdi
	callq	_cpcap_adc_init_request
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.1:
	cmpq	$129, %r13
	je	LBB0_7
## %bb.2:
	cmpq	$128, %r13
	jne	LBB0_18
## %bb.3:
	leaq	4(%r15), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_cpcap_adc_start_bank
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.4:
	movl	12(%r15), %edi
	movl	(%r12), %esi
	movq	%r14, %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.5:
	movq	%r15, %rdi
	callq	_cpcap_adc_stop_bank
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.6:
	movq	%r13, %rdi
	callq	_mutex_unlock
	jmp	LBB0_15
LBB0_7:
	leaq	4(%r15), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_cpcap_adc_start_bank
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.8:
	movl	8(%r15), %eax
	movq	_CPCAP_VENDOR_ST@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.9:
	movl	4(%r12), %eax
	movq	_CPCAP_ADC_AD3@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.10:
	movl	(%r12), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_cpcap_adc_read_st_die_temp
	jmp	LBB0_12
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_11:
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_cpcap_adc_read_bank_scaled
LBB0_12:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.13:
	movq	%r15, %rdi
	callq	_cpcap_adc_stop_bank
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_14
LBB0_16:
	movq	%r15, %rdi
	addq	$4, %rdi
	callq	_mutex_unlock
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	-48(%rbp), %eax
	movl	%eax, (%r14)
LBB0_15:
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_CPCAP_VENDOR_ST,4,2            ## @CPCAP_VENDOR_ST
	.comm	_CPCAP_ADC_AD3,4,2              ## @CPCAP_ADC_AD3
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error reading ADC: %i\n"

	.no_dead_strip	_cpcap_adc_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcap_adc_read
_cpcap_adc_read:                        ; @cpcap_adc_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x4
	mov	x20, x2
	mov	x21, x1
	bl	_iio_priv
	mov	x19, x0
	ldr	w1, [x21, #4]
	add	x0, sp, #8
	bl	_cpcap_adc_init_request
	mov	x23, x0
	cbnz	w0, LBB0_16
; %bb.1:
	cmp	x22, #129
	b.eq	LBB0_7
; %bb.2:
	cmp	x22, #128
	b.ne	LBB0_11
; %bb.3:
	add	x22, x19, #4
	mov	x0, x22
	bl	_mutex_lock
	add	x1, sp, #8
	mov	x0, x19
	bl	_cpcap_adc_start_bank
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.4:
	ldr	w0, [x19, #12]
	ldr	w1, [x21]
	mov	x2, x20
	bl	_regmap_read
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.5:
	mov	x0, x19
	bl	_cpcap_adc_stop_bank
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.6:
	mov	x0, x22
	bl	_mutex_unlock
	b	LBB0_18
LBB0_7:
	add	x22, x19, #4
	mov	x0, x22
	bl	_mutex_lock
	add	x1, sp, #8
	mov	x0, x19
	bl	_cpcap_adc_start_bank
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.8:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _CPCAP_VENDOR_ST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CPCAP_VENDOR_ST@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.9:
	ldr	w8, [x21, #4]
Lloh3:
	adrp	x9, _CPCAP_ADC_AD3@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CPCAP_ADC_AD3@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.10:
	ldr	w1, [x21]
	add	x2, sp, #8
	mov	x0, x19
	bl	_cpcap_adc_read_st_die_temp
	b	LBB0_13
LBB0_11:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_12:
	add	x1, sp, #8
	mov	x0, x19
	bl	_cpcap_adc_read_bank_scaled
LBB0_13:
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_cpcap_adc_stop_bank
	mov	x23, x0
	cbz	w0, LBB0_17
LBB0_15:
	add	x0, x19, #4
	bl	_mutex_unlock
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_dev_err
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_17:
	mov	x0, x22
	bl	_mutex_unlock
	ldr	w8, [sp, #8]
	str	w8, [x20]
LBB0_18:
Lloh11:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh13:
	ldr	w23, [x8]
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CPCAP_VENDOR_ST,4,2            ; @CPCAP_VENDOR_ST
	.comm	_CPCAP_ADC_AD3,4,2              ; @CPCAP_ADC_AD3
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error reading ADC: %i\n"

	.no_dead_strip	_cpcap_adc_read
.subsections_via_symbols
