	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ads1015_read_raw
_ads1015_read_raw:                      ## @ads1015_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r13
	callq	_iio_priv
	movq	%rax, %r12
	movq	%rax, %rbx
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	cmpq	$128, %r14
	je	LBB0_14
## %bb.1:
	cmpq	$129, %r14
	je	LBB0_15
## %bb.2:
	cmpq	$130, %r14
	jne	LBB0_16
## %bb.3:
	movq	%r15, %r14
	movl	8(%r15), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_iio_device_claim_direct_mode
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.4:
	movq	%r12, %rdi
	callq	_ads1015_event_channel_enabled
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movq	(%r12), %rax
	cmpq	(%r14), %rax
	jne	LBB0_6
LBB0_7:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_ads1015_set_power_state
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movq	(%r14), %rsi
	movq	%r12, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_ads1015_get_adc_result
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movl	(%r14), %edi
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	sarl	%cl, %edi
	movl	$15, %esi
	subl	%ecx, %esi
	callq	_sign_extend32
	movl	%eax, (%r14)
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ads1015_set_power_state
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_13
## %bb.12:
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_13
LBB0_14:
	movq	24(%r12), %rax
	movq	(%r15), %rcx
	movslq	(%rax,%rcx,8), %rax
	movq	_ads1015_fullscale_range@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	12(%r15), %eax
	decl	%eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_IIO_VAL_FRACTIONAL_LOG2@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_17
LBB0_15:
	movq	8(%r12), %rax
	movq	24(%r12), %rcx
	movq	(%r15), %rdx
	movslq	4(%rcx,%rdx,8), %rcx
	movl	(%rax,%rcx,4), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_17
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_17
LBB0_6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_8:
	movl	%eax, %r15d
	jmp	LBB0_13
LBB0_10:
	movl	%eax, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ads1015_set_power_state
LBB0_13:
	movq	%r13, %rdi
	callq	_iio_device_release_direct_mode
LBB0_17:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_ads1015_fullscale_range,8,3    ## @ads1015_fullscale_range
	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ## @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ads1015_read_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ads1015_read_raw
_ads1015_read_raw:                      ; @ads1015_read_raw
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x25, x4
	mov	x24, x3
	mov	x21, x2
	mov	x23, x1
	mov	x20, x0
	bl	_iio_priv
	mov	x22, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	cmp	x25, #128
	b.eq	LBB0_9
; %bb.1:
	cmp	x25, #129
	b.eq	LBB0_10
; %bb.2:
	cmp	x25, #130
	b.ne	LBB0_11
; %bb.3:
	ldr	w25, [x23, #8]
	mov	x0, x20
	bl	_iio_device_claim_direct_mode
	mov	x24, x0
	cbnz	w0, LBB0_16
; %bb.4:
	mov	x0, x22
	bl	_ads1015_event_channel_enabled
	cbz	w0, LBB0_6
; %bb.5:
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_12
LBB0_6:
	mov	x0, x22
	mov	w1, #1
	bl	_ads1015_set_power_state
	tbnz	w0, #31, LBB0_13
; %bb.7:
	ldr	x1, [x23]
	mov	x0, x22
	mov	x2, x21
	bl	_ads1015_get_adc_result
	tbnz	w0, #31, LBB0_14
; %bb.8:
	ldr	w8, [x21]
	asr	w0, w8, w25
	mov	w8, #15
	sub	w1, w8, w25
	bl	_sign_extend32
	str	w0, [x21]
	mov	x0, x22
	mov	w1, #0
	bl	_ads1015_set_power_state
Lloh0:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w24, w0, w8, lt
	b	LBB0_15
LBB0_9:
	ldr	x8, [x22, #24]
	ldr	x9, [x23]
	lsl	x9, x9, #3
	ldrsw	x8, [x8, x9]
Lloh3:
	adrp	x9, _ads1015_fullscale_range@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ads1015_fullscale_range@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	w8, [x9, x8, lsl #2]
	str	w8, [x21]
	ldr	w8, [x23, #12]
	sub	w8, w8, #1
	str	w8, [x24]
Lloh6:
	adrp	x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IIO_VAL_FRACTIONAL_LOG2@GOTPAGEOFF]
Lloh8:
	ldr	w24, [x8]
	b	LBB0_16
LBB0_10:
	ldr	x8, [x22, #24]
	ldr	x9, [x23]
	add	x8, x8, x9, lsl #3
	ldrsw	x8, [x8, #4]
	ldr	x9, [x22, #8]
	ldr	w8, [x9, x8, lsl #2]
	str	w8, [x21]
Lloh9:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh11:
	ldr	w24, [x8]
	b	LBB0_16
LBB0_11:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_16
LBB0_12:
Lloh15:
	adrp	x8, _EBUSY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_15
LBB0_13:
	mov	x24, x0
	b	LBB0_15
LBB0_14:
	mov	x24, x0
	mov	x0, x22
	mov	w1, #0
	bl	_ads1015_set_power_state
LBB0_15:
	mov	x0, x20
	bl	_iio_device_release_direct_mode
LBB0_16:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_ads1015_fullscale_range,8,3    ; @ads1015_fullscale_range
	.comm	_IIO_VAL_FRACTIONAL_LOG2,4,2    ; @IIO_VAL_FRACTIONAL_LOG2
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ads1015_read_raw
.subsections_via_symbols
