	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ingenic_adc_read_raw
_ingenic_adc_read_raw:                  ## @ingenic_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, %r15
	movq	%rdx, %r14
	movq	%rsi, %r13
	callq	_iio_priv
	movq	%rax, %r12
	cmpq	$130, %rbx
	je	LBB0_4
## %bb.1:
	cmpq	$131, %rbx
	jne	LBB0_7
## %bb.2:
	movl	12(%r12), %edi
	callq	_clk_enable
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_ingenic_adc_capture
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	movl	%eax, %ebx
	movl	12(%r12), %edi
	callq	_clk_disable
	jmp	LBB0_20
LBB0_4:
	movl	(%r13), %eax
	cmpl	$128, %eax
	je	LBB0_11
## %bb.5:
	cmpl	$129, %eax
	jne	LBB0_18
## %bb.6:
	movq	_JZ_ADC_AUX_VREF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_JZ_ADC_AUX_VREF_BITS@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_8:
	movl	(%r13), %eax
	cmpl	$129, %eax
	je	LBB0_13
## %bb.9:
	cmpl	$128, %eax
	jne	LBB0_15
## %bb.10:
	movq	_JZ_ADC_REG_ADBDAT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_11:
	cmpl	$0, 8(%r12)
	je	LBB0_16
## %bb.12:
	movq	_JZ_ADC_BATTERY_LOW_VREF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_JZ_ADC_BATTERY_LOW_VREF_BITS@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_13:
	movq	_JZ_ADC_REG_ADSDAT@GOTPCREL(%rip), %rax
LBB0_14:
	movq	(%rax), %rdi
	addq	16(%r12), %rdi
	callq	_readw
	movl	%eax, (%r14)
LBB0_15:
	movl	12(%r12), %edi
	callq	_clk_disable
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_16:
	movq	(%r12), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r14)
	addq	$4, %rax
LBB0_17:
	movl	(%rax), %eax
	movl	%eax, (%r15)
LBB0_18:
	movq	_IIO_VAL_FRACTIONAL_LOG2@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JZ_ADC_REG_ADSDAT,8,3          ## @JZ_ADC_REG_ADSDAT
	.comm	_JZ_ADC_REG_ADBDAT,8,3          ## @JZ_ADC_REG_ADBDAT
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_JZ_ADC_AUX_VREF,4,2            ## @JZ_ADC_AUX_VREF
	.comm	_JZ_ADC_AUX_VREF_BITS,4,2       ## @JZ_ADC_AUX_VREF_BITS
	.comm	_JZ_ADC_BATTERY_LOW_VREF,4,2    ## @JZ_ADC_BATTERY_LOW_VREF
	.comm	_JZ_ADC_BATTERY_LOW_VREF_BITS,4,2 ## @JZ_ADC_BATTERY_LOW_VREF_BITS
	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ## @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ingenic_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 ingenic_adc_read_raw
_ingenic_adc_read_raw:                  ; @ingenic_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	x21, x3
	mov	x19, x2
	mov	x22, x1
	bl	_iio_priv
	mov	x20, x0
	cmp	x23, #130
	b.eq	LBB0_4
; %bb.1:
	cmp	x23, #131
	b.ne	LBB0_7
; %bb.2:
	ldr	w0, [x20, #12]
	bl	_clk_enable
	ldr	w1, [x22]
	mov	x0, x20
	bl	_ingenic_adc_capture
	cbz	w0, LBB0_8
; %bb.3:
	mov	x21, x0
	ldr	w0, [x20, #12]
	bl	_clk_disable
	b	LBB0_20
LBB0_4:
	ldr	w8, [x22]
	cmp	w8, #128
	b.eq	LBB0_11
; %bb.5:
	cmp	w8, #129
	b.ne	LBB0_18
; %bb.6:
Lloh0:
	adrp	x8, _JZ_ADC_AUX_VREF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JZ_ADC_AUX_VREF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19]
Lloh3:
	adrp	x8, _JZ_ADC_AUX_VREF_BITS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _JZ_ADC_AUX_VREF_BITS@GOTPAGEOFF]
	b	LBB0_17
LBB0_7:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_20
LBB0_8:
	ldr	w8, [x22]
	cmp	w8, #129
	b.eq	LBB0_13
; %bb.9:
	cmp	w8, #128
	b.ne	LBB0_15
; %bb.10:
Lloh8:
	adrp	x8, _JZ_ADC_REG_ADBDAT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _JZ_ADC_REG_ADBDAT@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_16
; %bb.12:
Lloh10:
	adrp	x8, _JZ_ADC_BATTERY_LOW_VREF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _JZ_ADC_BATTERY_LOW_VREF@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x19]
Lloh13:
	adrp	x8, _JZ_ADC_BATTERY_LOW_VREF_BITS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _JZ_ADC_BATTERY_LOW_VREF_BITS@GOTPAGEOFF]
	b	LBB0_17
LBB0_13:
Lloh15:
	adrp	x8, _JZ_ADC_REG_ADSDAT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _JZ_ADC_REG_ADSDAT@GOTPAGEOFF]
LBB0_14:
	ldr	x9, [x20, #16]
	ldr	x8, [x8]
	add	x0, x8, x9
	bl	_readw
	str	w0, [x19]
LBB0_15:
	ldr	w0, [x20, #12]
	bl	_clk_disable
Lloh17:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
	b	LBB0_19
LBB0_16:
	ldr	x8, [x20]
	ldr	w9, [x8], #4
	str	w9, [x19]
LBB0_17:
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_18:
Lloh19:
	adrp	x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGEOFF]
LBB0_19:
	ldr	w21, [x8]
LBB0_20:
	mov	x0, x21
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_JZ_ADC_REG_ADSDAT,8,3          ; @JZ_ADC_REG_ADSDAT
	.comm	_JZ_ADC_REG_ADBDAT,8,3          ; @JZ_ADC_REG_ADBDAT
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_JZ_ADC_AUX_VREF,4,2            ; @JZ_ADC_AUX_VREF
	.comm	_JZ_ADC_AUX_VREF_BITS,4,2       ; @JZ_ADC_AUX_VREF_BITS
	.comm	_JZ_ADC_BATTERY_LOW_VREF,4,2    ; @JZ_ADC_BATTERY_LOW_VREF
	.comm	_JZ_ADC_BATTERY_LOW_VREF_BITS,4,2 ; @JZ_ADC_BATTERY_LOW_VREF_BITS
	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ; @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ingenic_adc_read_raw
.subsections_via_symbols
