	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_saradc_read_raw
_rockchip_saradc_read_raw:              ## @rockchip_saradc_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, %r13
	callq	_iio_priv
	movq	%rax, %r15
	cmpq	$128, %rbx
	je	LBB0_5
## %bb.1:
	cmpq	$129, %rbx
	jne	LBB0_8
## %bb.2:
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r15, %rbx
	addq	$32, %rbx
	movq	%rbx, %rdi
	callq	_reinit_completion
	movq	_SARADC_DLY_PU_SOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%r15), %rsi
	movl	$8, %edi
	callq	_writel_relaxed
	movq	_SARADC_CTRL_POWER_CTRL@GOTPCREL(%rip), %rax
	movq	_SARADC_CTRL_CHN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	andl	(%r12), %edi
	orl	(%rax), %edi
	movq	_SARADC_CTRL_IRQ_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_SARADC_CTRL@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	24(%r15), %rsi
	callq	_writel
	movq	_SARADC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	(%r15), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_5:
	movl	16(%r15), %edi
	callq	_regulator_get_voltage
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	%ebx, %eax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	shrq	$38, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	8(%r15), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_IIO_VAL_FRACTIONAL_LOG2@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_3:
	movq	(%r14), %rsi
	addq	24(%r15), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_writel_relaxed
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SARADC_DLY_PU_SOC,8,3          ## @SARADC_DLY_PU_SOC
	.comm	_SARADC_CTRL_POWER_CTRL,4,2     ## @SARADC_CTRL_POWER_CTRL
	.comm	_SARADC_CTRL_CHN_MASK,4,2       ## @SARADC_CTRL_CHN_MASK
	.comm	_SARADC_CTRL_IRQ_ENABLE,4,2     ## @SARADC_CTRL_IRQ_ENABLE
	.comm	_SARADC_CTRL,8,3                ## @SARADC_CTRL
	.comm	_SARADC_TIMEOUT,4,2             ## @SARADC_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get voltage\n"

	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ## @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rockchip_saradc_read_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_saradc_read_raw
_rockchip_saradc_read_raw:              ; @rockchip_saradc_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	x21, x4
	mov	x23, x3
	mov	x19, x2
	mov	x22, x1
	mov	x24, x0
	bl	_iio_priv
	mov	x20, x0
	cmp	x21, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	x21, #129
	b.ne	LBB0_6
; %bb.2:
	add	x21, x24, #4
	mov	x0, x21
	bl	_mutex_lock
	add	x23, x20, #32
	mov	x0, x23
	bl	_reinit_completion
	ldr	x8, [x20, #24]
Lloh0:
	adrp	x9, _SARADC_DLY_PU_SOC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SARADC_DLY_PU_SOC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #8
	bl	_writel_relaxed
Lloh3:
	adrp	x8, _SARADC_CTRL_POWER_CTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SARADC_CTRL_POWER_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x22]
Lloh6:
	adrp	x10, _SARADC_CTRL_CHN_MASK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SARADC_CTRL_CHN_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	and	w9, w10, w9
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _SARADC_CTRL_IRQ_ENABLE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SARADC_CTRL_IRQ_ENABLE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x20, #24]
Lloh12:
	adrp	x22, _SARADC_CTRL@GOTPAGE
Lloh13:
	ldr	x22, [x22, _SARADC_CTRL@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
Lloh14:
	adrp	x8, _SARADC_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SARADC_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_7
; %bb.3:
	ldr	w8, [x20]
	str	w8, [x19]
	mov	x0, x21
	bl	_mutex_unlock
Lloh17:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x8]
	b	LBB0_10
LBB0_4:
	ldr	w0, [x20, #16]
	bl	_regulator_get_voltage
	mov	x21, x0
	tbnz	w0, #31, LBB0_9
; %bb.5:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	umull	x8, w21, w8
	lsr	x8, x8, #38
	str	w8, [x19]
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	str	w8, [x23]
Lloh20:
	adrp	x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	b	LBB0_10
LBB0_6:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	ldr	x8, [x20, #24]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel_relaxed
	mov	x0, x21
	bl	_mutex_unlock
Lloh25:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_9:
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	bl	_dev_err
LBB0_10:
	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 AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SARADC_DLY_PU_SOC,8,3          ; @SARADC_DLY_PU_SOC
	.comm	_SARADC_CTRL_POWER_CTRL,4,2     ; @SARADC_CTRL_POWER_CTRL
	.comm	_SARADC_CTRL_CHN_MASK,4,2       ; @SARADC_CTRL_CHN_MASK
	.comm	_SARADC_CTRL_IRQ_ENABLE,4,2     ; @SARADC_CTRL_IRQ_ENABLE
	.comm	_SARADC_CTRL,8,3                ; @SARADC_CTRL
	.comm	_SARADC_TIMEOUT,4,2             ; @SARADC_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get voltage\n"

	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ; @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rockchip_saradc_read_raw
.subsections_via_symbols
