	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sca3000_read_event_config
_sca3000_read_event_config:             ## @sca3000_read_event_config
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_iio_priv
	movq	%rax, %r12
	leaq	8(%rax), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_SCA3000_REG_MODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_sca3000_read_data_short
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_9:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	(%r14), %eax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_5
## %bb.2:
	cmpl	$131, %eax
	je	LBB0_5
## %bb.3:
	cmpl	$130, %eax
	jne	LBB0_8
## %bb.4:
	movq	(%r12), %rax
	movq	_SCA3000_REG_MODE_FREE_FALL_DETECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, (%rax)
	setne	%bl
	jmp	LBB0_9
LBB0_5:
	movq	(%r12), %rax
	movq	_SCA3000_REG_MODE_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	movq	_SCA3000_REG_MODE_MEAS_MODE_MOT_DET@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	(%rax), %ecx
	jne	LBB0_9
## %bb.6:
	movq	_SCA3000_REG_CTRL_SEL_MD_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sca3000_read_ctrl_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:
	movq	_sca3000_addresses@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r14), %rcx
	movq	(%rax,%rcx,8), %rax
	xorl	%ecx, %ecx
	testl	%ebx, 8(%rax)
	setne	%cl
	movl	%ecx, %ebx
	jmp	LBB0_9
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_SCA3000_REG_MODE_ADDR,4,2      ## @SCA3000_REG_MODE_ADDR
	.comm	_SCA3000_REG_MODE_FREE_FALL_DETECT,4,2 ## @SCA3000_REG_MODE_FREE_FALL_DETECT
	.comm	_SCA3000_REG_MODE_MODE_MASK,4,2 ## @SCA3000_REG_MODE_MODE_MASK
	.comm	_SCA3000_REG_MODE_MEAS_MODE_MOT_DET,4,2 ## @SCA3000_REG_MODE_MEAS_MODE_MOT_DET
	.comm	_SCA3000_REG_CTRL_SEL_MD_CTRL,4,2 ## @SCA3000_REG_CTRL_SEL_MD_CTRL
	.comm	_sca3000_addresses,8,3          ## @sca3000_addresses
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sca3000_read_event_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sca3000_read_event_config
_sca3000_read_event_config:             ; @sca3000_read_event_config
	.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
	mov	x20, x1
	bl	_iio_priv
	mov	x21, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x8, _SCA3000_REG_MODE_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCA3000_REG_MODE_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #1
	bl	_sca3000_read_data_short
	mov	x22, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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
LBB0_2:
	ldr	w8, [x20]
	sub	w9, w8, #128
	cmp	w9, #2
	b.lo	LBB0_6
; %bb.3:
	cmp	w8, #131
	b.eq	LBB0_6
; %bb.4:
	cmp	w8, #130
	b.ne	LBB0_10
; %bb.5:
	ldr	x8, [x21]
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SCA3000_REG_MODE_FREE_FALL_DETECT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SCA3000_REG_MODE_FREE_FALL_DETECT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w22, ne
	b	LBB0_1
LBB0_6:
	ldr	x8, [x21]
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _SCA3000_REG_MODE_MODE_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SCA3000_REG_MODE_MODE_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh9:
	adrp	x9, _SCA3000_REG_MODE_MEAS_MODE_MOT_DET@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SCA3000_REG_MODE_MEAS_MODE_MOT_DET@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.7:
Lloh12:
	adrp	x8, _SCA3000_REG_CTRL_SEL_MD_CTRL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SCA3000_REG_CTRL_SEL_MD_CTRL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_sca3000_read_ctrl_reg
	mov	x22, x0
	tbnz	w0, #31, LBB0_1
; %bb.8:
Lloh15:
	adrp	x8, _sca3000_addresses@GOTPAGE
Lloh16:
	ldr	x8, [x8, _sca3000_addresses@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w8, [x8, #8]
	tst	w8, w22
	cset	w22, ne
	b	LBB0_1
LBB0_9:
	mov	w22, #0
	b	LBB0_1
LBB0_10:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SCA3000_REG_MODE_ADDR,4,2      ; @SCA3000_REG_MODE_ADDR
	.comm	_SCA3000_REG_MODE_FREE_FALL_DETECT,4,2 ; @SCA3000_REG_MODE_FREE_FALL_DETECT
	.comm	_SCA3000_REG_MODE_MODE_MASK,4,2 ; @SCA3000_REG_MODE_MODE_MASK
	.comm	_SCA3000_REG_MODE_MEAS_MODE_MOT_DET,4,2 ; @SCA3000_REG_MODE_MEAS_MODE_MOT_DET
	.comm	_SCA3000_REG_CTRL_SEL_MD_CTRL,4,2 ; @SCA3000_REG_CTRL_SEL_MD_CTRL
	.comm	_sca3000_addresses,8,3          ; @sca3000_addresses
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sca3000_read_event_config
.subsections_via_symbols
