	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tiadc_read_raw
_tiadc_read_raw:                        ## @tiadc_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_iio_priv
	movq	%rax, %r15
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rbx, %rdi
	callq	_iio_buffer_enabled
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_3:
	movq	%r15, %rdi
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	callq	_get_adc_chan_step_mask
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %r14d
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, %rdi
	addq	$16, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	_REG_FIFO1CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_tiadc_readl
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	movq	_REG_FIFO1@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_tiadc_readl
	decl	%ebx
	jne	LBB0_7
LBB0_8:
	movl	20(%r15), %edi
	movl	%r14d, %esi
	callq	_am335x_tsc_se_set_once
	movq	_jiffies@GOTPCREL(%rip), %r12
	movq	(%r12), %r14
	movq	_IDLE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%r15), %edi
	imull	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %r13
	addq	%r14, %r13
	movq	_REG_FIFO1CNT@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_tiadc_readl
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r12), %rdi
	movq	%r13, %rsi
	callq	_time_after
	testq	%rax, %rax
	je	LBB0_9
## %bb.11:
	movl	20(%r15), %edi
	callq	_am335x_tsc_se_adc_done
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_12:
	movl	%eax, %r14d
	movq	8(%r15), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %ebx
	xorl	%r13d, %r13d
	movq	_FIFOREAD_CHNLID_MASK@GOTPCREL(%rip), %r12
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	decl	%r14d
	je	LBB0_16
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	_REG_FIFO1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_tiadc_readl
	movl	(%r12), %ecx
	andl	%eax, %ecx
	shrl	$16, %ecx
	cmpl	%ebx, %ecx
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	_FIFOREAD_DATA_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	$1, %r13d
	jmp	LBB0_15
LBB0_16:
	movl	20(%r15), %edi
	callq	_am335x_tsc_se_adc_done
	testl	%r13d, %r13d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_18
## %bb.17:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	callq	_mutex_unlock
LBB0_19:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_REG_FIFO1CNT,4,2               ## @REG_FIFO1CNT
	.comm	_REG_FIFO1,4,2                  ## @REG_FIFO1
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_IDLE_TIMEOUT,4,2               ## @IDLE_TIMEOUT
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_FIFOREAD_CHNLID_MASK,4,2       ## @FIFOREAD_CHNLID_MASK
	.comm	_FIFOREAD_DATA_MASK,4,2         ## @FIFOREAD_DATA_MASK
	.no_dead_strip	_tiadc_read_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tiadc_read_raw
_tiadc_read_raw:                        ; @tiadc_read_raw
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x23, x1
	mov	x20, x0
	bl	_iio_priv
	mov	x22, x0
Lloh0:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	mov	x0, x20
	bl	_iio_buffer_enabled
	cbz	x0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_20
LBB0_3:
	mov	x0, x22
	mov	x1, x23
	bl	_get_adc_chan_step_mask
	cbz	w0, LBB0_11
; %bb.4:
	mov	x24, x0
	add	x20, x22, #16
	mov	x0, x20
	bl	_mutex_lock
Lloh5:
	adrp	x27, _REG_FIFO1CNT@GOTPAGE
Lloh6:
	ldr	x27, [x27, _REG_FIFO1CNT@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x22
	bl	_tiadc_readl
Lloh7:
	adrp	x26, _REG_FIFO1@GOTPAGE
Lloh8:
	ldr	x26, [x26, _REG_FIFO1@GOTPAGEOFF]
	cbz	w0, LBB0_7
; %bb.5:
	mov	x25, x0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sub	w25, w25, #1
	ldr	w1, [x26]
	mov	x0, x22
	bl	_tiadc_readl
	cbnz	w25, LBB0_6
LBB0_7:
	ldr	w0, [x22, #20]
	mov	x1, x24
	bl	_am335x_tsc_se_set_once
Lloh9:
	adrp	x28, _jiffies@GOTPAGE
Lloh10:
	ldr	x28, [x28, _jiffies@GOTPAGEOFF]
	ldr	x24, [x28]
Lloh11:
	adrp	x8, _IDLE_TIMEOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IDLE_TIMEOUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [x22]
	mul	w0, w9, w8
	bl	_msecs_to_jiffies
	add	x25, x0, x24
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	x0, x22
	bl	_tiadc_readl
	cbnz	w0, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x28]
	mov	x1, x25
	bl	_time_after
	cbz	x0, LBB0_8
; %bb.10:
	ldr	w0, [x22, #20]
	bl	_am335x_tsc_se_adc_done
Lloh14:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_18
LBB0_11:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
	mov	x24, x0
	mov	w25, #0
	ldr	x8, [x22, #8]
	ldr	x9, [x23]
	ldr	w23, [x8, x9, lsl #2]
Lloh18:
	adrp	x27, _FIFOREAD_CHNLID_MASK@GOTPAGE
Lloh19:
	ldr	x27, [x27, _FIFOREAD_CHNLID_MASK@GOTPAGEOFF]
Lloh20:
	adrp	x28, _FIFOREAD_DATA_MASK@GOTPAGE
Lloh21:
	ldr	x28, [x28, _FIFOREAD_DATA_MASK@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	subs	w24, w24, #1
	b.eq	LBB0_16
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x22
	bl	_tiadc_readl
	ldr	w8, [x27]
	and	w8, w8, w0
	cmp	w23, w8, lsr #16
	b.ne	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x28]
	and	w8, w8, w0
	str	w8, [x21]
	mov	w25, #1
	b	LBB0_13
LBB0_16:
	ldr	w0, [x22, #20]
	bl	_am335x_tsc_se_adc_done
	cbnz	w25, LBB0_19
; %bb.17:
Lloh22:
	adrp	x8, _EBUSY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_19:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_20:
	mov	x0, x19
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_REG_FIFO1CNT,4,2               ; @REG_FIFO1CNT
	.comm	_REG_FIFO1,4,2                  ; @REG_FIFO1
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_IDLE_TIMEOUT,4,2               ; @IDLE_TIMEOUT
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_FIFOREAD_CHNLID_MASK,4,2       ; @FIFOREAD_CHNLID_MASK
	.comm	_FIFOREAD_DATA_MASK,4,2         ; @FIFOREAD_DATA_MASK
	.no_dead_strip	_tiadc_read_raw
.subsections_via_symbols
