	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9150_gpadc_read_adc
_da9150_gpadc_read_adc:                 ## @da9150_gpadc_read_adc
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	leaq	4(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	8(%r12), %edi
	movq	_DA9150_GPADC_MAN@GOTPCREL(%rip), %rax
	movq	_DA9150_GPADC_MUX_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r14d, %edx
	shll	%cl, %edx
	movl	(%rax), %esi
	movq	_DA9150_GPADC_EN_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	callq	_da9150_reg_write
	leaq	12(%r12), %rbx
	movq	%rbx, %rdi
	callq	_try_wait_for_completion
	movl	$5, %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	movl	8(%r12), %edi
	movq	_DA9150_GPADC_RES_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rcx
	movl	$2, %edx
	callq	_da9150_bulk_read
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	-44(%rbp), %edx
	movq	_DA9150_GPADC_RUN_MASK@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_2
## %bb.1:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	movq	_DA9150_GPADC_RES_L_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	movq	_DA9150_GPADC_RES_L_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %edx
	movl	-48(%rbp), %eax
	movq	_DA9150_GPADC_RES_L_BITS@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%edx, %eax
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_5
## %bb.4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9150_GPADC_MAN,4,2           ## @DA9150_GPADC_MAN
	.comm	_DA9150_GPADC_EN_MASK,4,2       ## @DA9150_GPADC_EN_MASK
	.comm	_DA9150_GPADC_MUX_SHIFT,4,2     ## @DA9150_GPADC_MUX_SHIFT
	.comm	_DA9150_GPADC_RES_A,4,2         ## @DA9150_GPADC_RES_A
	.comm	_DA9150_GPADC_RUN_MASK,4,2      ## @DA9150_GPADC_RUN_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout on channel %d of GPADC\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_DA9150_GPADC_RES_L_MASK,4,2    ## @DA9150_GPADC_RES_L_MASK
	.comm	_DA9150_GPADC_RES_L_SHIFT,4,2   ## @DA9150_GPADC_RES_L_SHIFT
	.comm	_DA9150_GPADC_RES_L_BITS,4,2    ## @DA9150_GPADC_RES_L_BITS
	.no_dead_strip	_da9150_gpadc_read_adc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9150_gpadc_read_adc
_da9150_gpadc_read_adc:                 ; @da9150_gpadc_read_adc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w0, [x20, #8]
Lloh3:
	adrp	x8, _DA9150_GPADC_MAN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DA9150_GPADC_MAN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _DA9150_GPADC_EN_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DA9150_GPADC_EN_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _DA9150_GPADC_MUX_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DA9150_GPADC_MUX_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w9, w19, w9
	orr	w2, w9, w8
	bl	_da9150_reg_write
	add	x22, x20, #12
	mov	x0, x22
	bl	_try_wait_for_completion
	mov	w0, #5
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	ldr	w0, [x20, #8]
Lloh12:
	adrp	x8, _DA9150_GPADC_RES_A@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DA9150_GPADC_RES_A@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x3, sp
	mov	w2, #2
	bl	_da9150_bulk_read
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w8, [sp, #4]
Lloh15:
	adrp	x9, _DA9150_GPADC_RUN_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DA9150_GPADC_RUN_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x20]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
Lloh20:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
Lloh23:
	adrp	x9, _DA9150_GPADC_RES_L_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DA9150_GPADC_RES_L_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh26:
	adrp	x9, _DA9150_GPADC_RES_L_SHIFT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _DA9150_GPADC_RES_L_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	asr	w8, w8, w9
	ldr	w9, [sp]
Lloh29:
	adrp	x10, _DA9150_GPADC_RES_L_BITS@GOTPAGE
Lloh30:
	ldr	x10, [x10, _DA9150_GPADC_RES_L_BITS@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w0, w9, w8
LBB0_3:
	ldr	x8, [sp, #8]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	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
	add	sp, sp, #64
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9150_GPADC_MAN,4,2           ; @DA9150_GPADC_MAN
	.comm	_DA9150_GPADC_EN_MASK,4,2       ; @DA9150_GPADC_EN_MASK
	.comm	_DA9150_GPADC_MUX_SHIFT,4,2     ; @DA9150_GPADC_MUX_SHIFT
	.comm	_DA9150_GPADC_RES_A,4,2         ; @DA9150_GPADC_RES_A
	.comm	_DA9150_GPADC_RUN_MASK,4,2      ; @DA9150_GPADC_RUN_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout on channel %d of GPADC\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_DA9150_GPADC_RES_L_MASK,4,2    ; @DA9150_GPADC_RES_L_MASK
	.comm	_DA9150_GPADC_RES_L_SHIFT,4,2   ; @DA9150_GPADC_RES_L_SHIFT
	.comm	_DA9150_GPADC_RES_L_BITS,4,2    ; @DA9150_GPADC_RES_L_BITS
	.no_dead_strip	_da9150_gpadc_read_adc
.subsections_via_symbols
