	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_sar_adc_get_sample
_meson_sar_adc_get_sample:              ## @meson_sar_adc_get_sample
	.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
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_iio_priv
	movq	(%r14), %rcx
	movq	_IIO_TEMP@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_3
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_2
LBB0_3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_meson_sar_adc_lock
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	%r12, %rdi
	callq	_meson_sar_adc_clear_fifo
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	movl	%r13d, %ecx
	callq	_meson_sar_adc_set_averaging
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_meson_sar_adc_enable_channel
	movq	%r12, %rdi
	callq	_meson_sar_adc_start_sample_engine
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_meson_sar_adc_read_raw_sample
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_meson_sar_adc_stop_sample_engine
	movq	%r12, %rdi
	callq	_meson_sar_adc_unlock
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.5:
	movl	(%r12), %edi
	movl	8(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_warn
	jmp	LBB0_7
LBB0_2:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_6:
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_TEMP,8,3                   ## @IIO_TEMP
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read sample for channel %lu: %d\n"

	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.no_dead_strip	_meson_sar_adc_get_sample
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_sar_adc_get_sample
_meson_sar_adc_get_sample:              ; @meson_sar_adc_get_sample
	.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	x22, x3
	mov	x24, x2
	mov	x19, x1
	mov	x20, x0
	bl	_iio_priv
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _IIO_TEMP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IIO_TEMP@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x0]
	cbz	w8, LBB0_5
LBB0_2:
	mov	x0, x20
	bl	_meson_sar_adc_lock
	mov	x23, x0
	cbnz	w0, LBB0_7
; %bb.3:
	mov	x0, x20
	bl	_meson_sar_adc_clear_fifo
	mov	x0, x20
	mov	x1, x19
	mov	x2, x24
	mov	x3, x22
	bl	_meson_sar_adc_set_averaging
	mov	x0, x20
	mov	x1, x19
	bl	_meson_sar_adc_enable_channel
	mov	x0, x20
	bl	_meson_sar_adc_start_sample_engine
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_meson_sar_adc_read_raw_sample
	mov	x23, x0
	mov	x0, x20
	bl	_meson_sar_adc_stop_sample_engine
	mov	x0, x20
	bl	_meson_sar_adc_unlock
	cbz	w23, LBB0_6
; %bb.4:
	ldr	w0, [x20]
	ldr	w2, [x19, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x23
	bl	_dev_warn
	b	LBB0_7
LBB0_5:
Lloh5:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_7
LBB0_6:
Lloh8:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh10:
	ldr	w23, [x8]
LBB0_7:
	mov	x0, x23
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_TEMP,8,3                   ; @IIO_TEMP
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read sample for channel %lu: %d\n"

	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.no_dead_strip	_meson_sar_adc_get_sample
.subsections_via_symbols
