	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spear_adc_read_raw
_spear_adc_read_raw:                    ## @spear_adc_read_raw
	.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, %rbx
	movq	%rcx, %r14
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_iio_priv
	movq	%rax, %r13
	cmpq	$128, %rbx
	je	LBB0_6
## %bb.1:
	cmpq	$129, %rbx
	je	LBB0_7
## %bb.2:
	cmpq	$130, %rbx
	jne	LBB0_9
## %bb.3:
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	(%r12), %edi
	callq	_SPEAR_ADC_STATUS_CHANNEL_NUM
	movl	%eax, %ebx
	movl	16(%r13), %edi
	callq	_SPEAR_ADC_STATUS_AVG_SAMPLE
	orl	%ebx, %eax
	movq	_SPEAR_ADC_STATUS_START_CONVERSION@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_SPEAR_ADC_STATUS_ADC_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	xorl	%ecx, %ecx
	cmpl	$0, (%r13)
	jne	LBB0_5
## %bb.4:
	movq	_SPEAR_ADC_STATUS_VREF_INTERNAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_5:
	orl	%ecx, %eax
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_spear_adc_set_status
	movq	%r13, %rdi
	addq	$12, %rdi
	callq	_wait_for_completion
	movl	4(%r13), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_8
LBB0_6:
	movl	(%r13), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_SPEAR_ADC_DATA_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_IIO_VAL_FRACTIONAL_LOG2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_7:
	movl	8(%r13), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_8:
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPEAR_ADC_STATUS_START_CONVERSION,4,2 ## @SPEAR_ADC_STATUS_START_CONVERSION
	.comm	_SPEAR_ADC_STATUS_ADC_ENABLE,4,2 ## @SPEAR_ADC_STATUS_ADC_ENABLE
	.comm	_SPEAR_ADC_STATUS_VREF_INTERNAL,4,2 ## @SPEAR_ADC_STATUS_VREF_INTERNAL
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_SPEAR_ADC_DATA_BITS,4,2        ## @SPEAR_ADC_DATA_BITS
	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ## @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_spear_adc_read_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spear_adc_read_raw
_spear_adc_read_raw:                    ; @spear_adc_read_raw
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x23, x4
	mov	x24, x3
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	bl	_iio_priv
	mov	x21, x0
	cmp	x23, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	x23, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	x23, #130
	b.ne	LBB0_7
; %bb.3:
	mov	x0, x20
	bl	_mutex_lock
	ldr	w0, [x22]
	bl	_SPEAR_ADC_STATUS_CHANNEL_NUM
	mov	x22, x0
	ldr	w0, [x21, #16]
	bl	_SPEAR_ADC_STATUS_AVG_SAMPLE
	orr	w8, w0, w22
Lloh0:
	adrp	x9, _SPEAR_ADC_STATUS_START_CONVERSION@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SPEAR_ADC_STATUS_START_CONVERSION@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh3:
	adrp	x9, _SPEAR_ADC_STATUS_ADC_ENABLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SPEAR_ADC_STATUS_ADC_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x21]
Lloh6:
	adrp	x10, _SPEAR_ADC_STATUS_VREF_INTERNAL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SPEAR_ADC_STATUS_VREF_INTERNAL@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, w10, wzr, eq
	orr	w1, w8, w9
	mov	x0, x21
	bl	_spear_adc_set_status
	add	x0, x21, #12
	bl	_wait_for_completion
	ldr	w8, [x21, #4]
	str	w8, [x19]
	mov	x0, x20
	bl	_mutex_unlock
	b	LBB0_6
LBB0_4:
	ldr	w8, [x21]
Lloh9:
	adrp	x9, _SPEAR_ADC_DATA_BITS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SPEAR_ADC_DATA_BITS@GOTPAGEOFF]
	str	w8, [x19]
Lloh11:
	ldr	w8, [x9]
	str	w8, [x24]
Lloh12:
	adrp	x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_5:
	ldr	w8, [x21, #8]
	str	w8, [x19]
LBB0_6:
Lloh15:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_7:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SPEAR_ADC_STATUS_START_CONVERSION,4,2 ; @SPEAR_ADC_STATUS_START_CONVERSION
	.comm	_SPEAR_ADC_STATUS_ADC_ENABLE,4,2 ; @SPEAR_ADC_STATUS_ADC_ENABLE
	.comm	_SPEAR_ADC_STATUS_VREF_INTERNAL,4,2 ; @SPEAR_ADC_STATUS_VREF_INTERNAL
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_SPEAR_ADC_DATA_BITS,4,2        ; @SPEAR_ADC_DATA_BITS
	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ; @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_spear_adc_read_raw
.subsections_via_symbols
