	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_da9052_adc_manual_read         ## -- Begin function da9052_adc_manual_read
	.p2align	4, 0x90
_da9052_adc_manual_read:                ## @da9052_adc_manual_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	_DA9052_ADC_VBBAT@GOTPCREL(%rip), %rax
	cmpb	%bl, (%rax)
	jae	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movq	%rdi, %r14
	callq	_mutex_lock
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_reinit_completion
	movq	_chan_mux@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movzbl	%bl, %ecx
	movq	_DA9052_ADC_MAN_MAN_CONV@GOTPCREL(%rip), %rdx
	movb	(%rdx), %dl
	orb	(%rax,%rcx), %dl
	movq	_DA9052_ADC_MAN_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%dl, %edx
	movq	%r14, %rdi
	callq	_da9052_reg_write
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msecs_to_jiffies
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movq	_DA9052_ADC_RES_H_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_da9052_reg_read
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movq	_DA9052_ADC_RES_L_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_da9052_reg_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.9:
	shll	$2, %r15d
	movq	_DA9052_ADC_RES_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	orl	%r15d, %eax
	movzwl	%ax, %ebx
	jmp	LBB0_10
LBB0_3:
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_5:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_7:
	movl	%r15d, %ebx
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9052_ADC_VBBAT,1,0           ## @DA9052_ADC_VBBAT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_chan_mux,8,3                   ## @chan_mux
	.comm	_DA9052_ADC_MAN_MAN_CONV,1,0    ## @DA9052_ADC_MAN_MAN_CONV
	.comm	_DA9052_ADC_MAN_REG,4,2         ## @DA9052_ADC_MAN_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for ADC conversion interrupt\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_DA9052_ADC_RES_H_REG,4,2       ## @DA9052_ADC_RES_H_REG
	.comm	_DA9052_ADC_RES_L_REG,4,2       ## @DA9052_ADC_RES_L_REG
	.comm	_DA9052_ADC_RES_LSB,4,2         ## @DA9052_ADC_RES_LSB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_da9052_adc_manual_read         ; -- Begin function da9052_adc_manual_read
	.p2align	2
_da9052_adc_manual_read:                ; @da9052_adc_manual_read
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _DA9052_ADC_VBBAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DA9052_ADC_VBBAT@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w8, w1
	b.hs	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
	add	x21, x19, #8
	mov	x0, x21
	bl	_reinit_completion
Lloh5:
	adrp	x8, _chan_mux@GOTPAGE
Lloh6:
	ldr	x8, [x8, _chan_mux@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldrb	w8, [x8, w20, uxtw]
Lloh8:
	adrp	x9, _DA9052_ADC_MAN_MAN_CONV@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DA9052_ADC_MAN_MAN_CONV@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w2, w9, w8
Lloh10:
	adrp	x8, _DA9052_ADC_MAN_REG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DA9052_ADC_MAN_REG@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_da9052_reg_write
	tbnz	w0, #31, LBB0_7
; %bb.3:
	mov	w0, #500
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_8
; %bb.4:
Lloh13:
	adrp	x8, _DA9052_ADC_RES_H_REG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DA9052_ADC_RES_H_REG@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_da9052_reg_read
	mov	x20, x0
	tbnz	w0, #31, LBB0_9
; %bb.5:
Lloh16:
	adrp	x8, _DA9052_ADC_RES_L_REG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DA9052_ADC_RES_L_REG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_da9052_reg_read
	tbnz	w0, #31, LBB0_7
; %bb.6:
Lloh19:
	adrp	x8, _DA9052_ADC_RES_LSB@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DA9052_ADC_RES_LSB@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	and	w8, w8, w0
	orr	w8, w8, w20, lsl #2
	and	w20, w8, #0xffff
	b	LBB0_9
LBB0_7:
	mov	x20, x0
	b	LBB0_9
LBB0_8:
	ldr	w0, [x19, #4]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh24:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9052_ADC_VBBAT,1,0           ; @DA9052_ADC_VBBAT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_chan_mux,8,3                   ; @chan_mux
	.comm	_DA9052_ADC_MAN_MAN_CONV,1,0    ; @DA9052_ADC_MAN_MAN_CONV
	.comm	_DA9052_ADC_MAN_REG,4,2         ; @DA9052_ADC_MAN_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for ADC conversion interrupt\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_DA9052_ADC_RES_H_REG,4,2       ; @DA9052_ADC_RES_H_REG
	.comm	_DA9052_ADC_RES_L_REG,4,2       ; @DA9052_ADC_RES_L_REG
	.comm	_DA9052_ADC_RES_LSB,4,2         ; @DA9052_ADC_RES_LSB
.subsections_via_symbols
