	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sc27xx_adc_read
_sc27xx_adc_read:                       ## @sc27xx_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	%rcx, %r14
	movl	%edx, %r13d
	movl	%esi, %r12d
	movq	%rdi, %r15
	movl	(%rdi), %edi
	movq	_SC27XX_ADC_HWLOCK_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hwspin_lock_timeout_raw
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	20(%r15), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_2:
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movq	_SC27XX_ADC_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movl	(%r15), %edi
	callq	_hwspin_unlock_raw
	jmp	LBB0_14
LBB0_4:
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_INT_CLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movq	_SC27XX_ADC_IRQ_CLR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.5:
	movq	_SC27XX_ADC_SCALE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r13d
	movq	_SC27XX_ADC_SCALE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, %r13d
	movq	_SC27XX_ADC_CHN_ID_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%edx, %r12d
	orl	%r13d, %r12d
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_CH_CFG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	8(%r15), %rsi
	orl	%eax, %edx
	movl	%r12d, %ecx
	callq	_regmap_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.6:
	movq	_SC27XX_ADC_12BIT_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SC27XX_ADC_RUN_NUM_MASK@GOTPCREL(%rip), %rax
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_CTL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	addq	8(%r15), %rsi
	movl	(%rax), %edx
	orl	%ecx, %edx
	callq	_regmap_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.7:
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movq	_SC27XX_ADC_CHN_RUN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_INT_RAW@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movq	_SC27XX_ADC_POLL_RAW_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_SC27XX_ADC_RDY_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%ecx, %ecx
	callq	_regmap_read_poll_timeout
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	movl	20(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_10:
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	_SC27XX_ADC_DATA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, -44(%rbp)
	xorl	%ebx, %ebx
LBB0_12:
	movl	16(%r15), %edi
	movq	_SC27XX_ADC_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movq	_SC27XX_ADC_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	movl	(%r15), %edi
	callq	_hwspin_unlock_raw
	testl	%ebx, %ebx
	jne	LBB0_14
## %bb.13:
	movl	-44(%rbp), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SC27XX_ADC_HWLOCK_TIMEOUT,4,2  ## @SC27XX_ADC_HWLOCK_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout to get the hwspinlock\n"

	.comm	_SC27XX_ADC_CTL,8,3             ## @SC27XX_ADC_CTL
	.comm	_SC27XX_ADC_EN,4,2              ## @SC27XX_ADC_EN
	.comm	_SC27XX_ADC_INT_CLR,8,3         ## @SC27XX_ADC_INT_CLR
	.comm	_SC27XX_ADC_IRQ_CLR,4,2         ## @SC27XX_ADC_IRQ_CLR
	.comm	_SC27XX_ADC_SCALE_SHIFT,4,2     ## @SC27XX_ADC_SCALE_SHIFT
	.comm	_SC27XX_ADC_SCALE_MASK,4,2      ## @SC27XX_ADC_SCALE_MASK
	.comm	_SC27XX_ADC_CHN_ID_MASK,4,2     ## @SC27XX_ADC_CHN_ID_MASK
	.comm	_SC27XX_ADC_CH_CFG,8,3          ## @SC27XX_ADC_CH_CFG
	.comm	_SC27XX_ADC_12BIT_MODE,4,2      ## @SC27XX_ADC_12BIT_MODE
	.comm	_SC27XX_ADC_RUN_NUM_SHIFT,4,2   ## @SC27XX_ADC_RUN_NUM_SHIFT
	.comm	_SC27XX_ADC_RUN_NUM_MASK,4,2    ## @SC27XX_ADC_RUN_NUM_MASK
	.comm	_SC27XX_ADC_CHN_RUN,4,2         ## @SC27XX_ADC_CHN_RUN
	.comm	_SC27XX_ADC_INT_RAW,8,3         ## @SC27XX_ADC_INT_RAW
	.comm	_SC27XX_ADC_IRQ_RAW,4,2         ## @SC27XX_ADC_IRQ_RAW
	.comm	_SC27XX_ADC_POLL_RAW_STATUS,4,2 ## @SC27XX_ADC_POLL_RAW_STATUS
	.comm	_SC27XX_ADC_RDY_TIMEOUT,4,2     ## @SC27XX_ADC_RDY_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"read adc timeout, status = 0x%x\n"

	.comm	_SC27XX_ADC_DATA,8,3            ## @SC27XX_ADC_DATA
	.comm	_SC27XX_ADC_DATA_MASK,4,2       ## @SC27XX_ADC_DATA_MASK
	.no_dead_strip	_sc27xx_adc_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sc27xx_adc_read
_sc27xx_adc_read:                       ; @sc27xx_adc_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _SC27XX_ADC_HWLOCK_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SC27XX_ADC_HWLOCK_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_hwspin_lock_timeout_raw
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	w0, [x20, #20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_14
LBB0_2:
	ldr	w0, [x20, #16]
Lloh5:
	adrp	x24, _SC27XX_ADC_CTL@GOTPAGE
Lloh6:
	ldr	x24, [x24, _SC27XX_ADC_CTL@GOTPAGEOFF]
	ldr	x8, [x20, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
Lloh7:
	adrp	x25, _SC27XX_ADC_EN@GOTPAGE
Lloh8:
	ldr	x25, [x25, _SC27XX_ADC_EN@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x3, x2
	bl	_regmap_update_bits
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	ldr	w0, [x20]
	bl	_hwspin_unlock_raw
	b	LBB0_14
LBB0_4:
	ldr	w0, [x20, #16]
Lloh9:
	adrp	x8, _SC27XX_ADC_INT_CLR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SC27XX_ADC_INT_CLR@GOTPAGEOFF]
	ldr	x9, [x20, #8]
Lloh11:
	ldr	x8, [x8]
	add	x1, x8, x9
Lloh12:
	adrp	x8, _SC27XX_ADC_IRQ_CLR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SC27XX_ADC_IRQ_CLR@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.5:
Lloh15:
	adrp	x8, _SC27XX_ADC_SCALE_SHIFT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SC27XX_ADC_SCALE_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	lsl	w8, w23, w8
Lloh18:
	adrp	x9, _SC27XX_ADC_SCALE_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SC27XX_ADC_SCALE_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	and	w8, w8, w9
Lloh21:
	adrp	x10, _SC27XX_ADC_CHN_ID_MASK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _SC27XX_ADC_CHN_ID_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	and	w11, w10, w22
	orr	w3, w11, w8
	ldr	w0, [x20, #16]
	ldr	x8, [x20, #8]
Lloh24:
	adrp	x11, _SC27XX_ADC_CH_CFG@GOTPAGE
Lloh25:
	ldr	x11, [x11, _SC27XX_ADC_CH_CFG@GOTPAGEOFF]
Lloh26:
	ldr	x11, [x11]
	add	x1, x11, x8
	orr	w2, w10, w9
	bl	_regmap_update_bits
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.6:
Lloh27:
	adrp	x8, _SC27XX_ADC_12BIT_MODE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SC27XX_ADC_12BIT_MODE@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
Lloh30:
	adrp	x8, _SC27XX_ADC_RUN_NUM_MASK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SC27XX_ADC_RUN_NUM_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w0, [x20, #16]
	ldr	x9, [x20, #8]
	ldr	x10, [x24]
	add	x1, x10, x9
	orr	w2, w8, w3
	bl	_regmap_update_bits
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.7:
	ldr	w0, [x20, #16]
	ldr	x8, [x20, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
Lloh33:
	adrp	x8, _SC27XX_ADC_CHN_RUN@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SC27XX_ADC_CHN_RUN@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.8:
	ldr	w0, [x20, #16]
	ldr	x8, [x20, #8]
Lloh36:
	adrp	x9, _SC27XX_ADC_INT_RAW@GOTPAGE
Lloh37:
	ldr	x9, [x9, _SC27XX_ADC_INT_RAW@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	add	x1, x9, x8
Lloh39:
	adrp	x8, _SC27XX_ADC_POLL_RAW_STATUS@GOTPAGE
Lloh40:
	ldr	x8, [x8, _SC27XX_ADC_POLL_RAW_STATUS@GOTPAGEOFF]
Lloh41:
	ldr	w4, [x8]
Lloh42:
	adrp	x8, _SC27XX_ADC_RDY_TIMEOUT@GOTPAGE
Lloh43:
	ldr	x8, [x8, _SC27XX_ADC_RDY_TIMEOUT@GOTPAGEOFF]
Lloh44:
	ldr	w5, [x8]
	mov	w3, #0
	bl	_regmap_read_poll_timeout
	cbz	w0, LBB0_10
; %bb.9:
	mov	x21, x0
	ldr	w0, [x20, #20]
Lloh45:
	adrp	x1, l_.str.1@PAGE
Lloh46:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_10:
	ldr	w0, [x20, #16]
	ldr	x8, [x20, #8]
Lloh47:
	adrp	x9, _SC27XX_ADC_DATA@GOTPAGE
Lloh48:
	ldr	x9, [x9, _SC27XX_ADC_DATA@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	add	x1, x9, x8
	add	x2, sp, #12
	bl	_regmap_read
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.11:
Lloh50:
	adrp	x8, _SC27XX_ADC_DATA_MASK@GOTPAGE
Lloh51:
	ldr	x8, [x8, _SC27XX_ADC_DATA_MASK@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	and	w8, w9, w8
	str	w8, [sp, #12]
LBB0_12:
	ldr	w0, [x20, #16]
	ldr	x8, [x20, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
	ldr	w2, [x25]
	mov	w3, #0
	bl	_regmap_update_bits
	ldr	w0, [x20]
	bl	_hwspin_unlock_raw
	cbnz	w21, LBB0_14
; %bb.13:
	ldr	w8, [sp, #12]
	str	w8, [x19]
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_SC27XX_ADC_HWLOCK_TIMEOUT,4,2  ; @SC27XX_ADC_HWLOCK_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout to get the hwspinlock\n"

	.comm	_SC27XX_ADC_CTL,8,3             ; @SC27XX_ADC_CTL
	.comm	_SC27XX_ADC_EN,4,2              ; @SC27XX_ADC_EN
	.comm	_SC27XX_ADC_INT_CLR,8,3         ; @SC27XX_ADC_INT_CLR
	.comm	_SC27XX_ADC_IRQ_CLR,4,2         ; @SC27XX_ADC_IRQ_CLR
	.comm	_SC27XX_ADC_SCALE_SHIFT,4,2     ; @SC27XX_ADC_SCALE_SHIFT
	.comm	_SC27XX_ADC_SCALE_MASK,4,2      ; @SC27XX_ADC_SCALE_MASK
	.comm	_SC27XX_ADC_CHN_ID_MASK,4,2     ; @SC27XX_ADC_CHN_ID_MASK
	.comm	_SC27XX_ADC_CH_CFG,8,3          ; @SC27XX_ADC_CH_CFG
	.comm	_SC27XX_ADC_12BIT_MODE,4,2      ; @SC27XX_ADC_12BIT_MODE
	.comm	_SC27XX_ADC_RUN_NUM_SHIFT,4,2   ; @SC27XX_ADC_RUN_NUM_SHIFT
	.comm	_SC27XX_ADC_RUN_NUM_MASK,4,2    ; @SC27XX_ADC_RUN_NUM_MASK
	.comm	_SC27XX_ADC_CHN_RUN,4,2         ; @SC27XX_ADC_CHN_RUN
	.comm	_SC27XX_ADC_INT_RAW,8,3         ; @SC27XX_ADC_INT_RAW
	.comm	_SC27XX_ADC_IRQ_RAW,4,2         ; @SC27XX_ADC_IRQ_RAW
	.comm	_SC27XX_ADC_POLL_RAW_STATUS,4,2 ; @SC27XX_ADC_POLL_RAW_STATUS
	.comm	_SC27XX_ADC_RDY_TIMEOUT,4,2     ; @SC27XX_ADC_RDY_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"read adc timeout, status = 0x%x\n"

	.comm	_SC27XX_ADC_DATA,8,3            ; @SC27XX_ADC_DATA
	.comm	_SC27XX_ADC_DATA_MASK,4,2       ; @SC27XX_ADC_DATA_MASK
	.no_dead_strip	_sc27xx_adc_read
.subsections_via_symbols
