	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sca3000_motion_detect_set_state
_sca3000_motion_detect_set_state:       ## @sca3000_motion_detect_set_state
	.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
	movl	%edx, %r15d
	movl	%esi, %ebx
	callq	_iio_priv
	movq	%rax, %r14
	movq	_SCA3000_REG_CTRL_SEL_MD_CTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rax, %rdi
	callq	_sca3000_read_ctrl_reg
	testl	%eax, %eax
	js	LBB0_16
## %bb.1:
	movq	_sca3000_addresses@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%ebx, %rdx
	movq	(%rcx,%rdx,8), %rcx
	movl	8(%rcx), %edx
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.2:
	testl	%eax, %edx
	jne	LBB0_9
## %bb.3:
	movl	(%r12), %esi
	orl	%eax, %edx
	movq	%r14, %rdi
	callq	_sca3000_write_ctrl_reg
	testl	%eax, %eax
	jne	LBB0_16
## %bb.4:
	movl	$1, %eax
	jmp	LBB0_8
LBB0_5:
	testl	%eax, %edx
	je	LBB0_9
## %bb.6:
	movl	(%r12), %esi
	notl	%edx
	andl	%edx, %eax
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_sca3000_write_ctrl_reg
	testl	%eax, %eax
	jne	LBB0_16
## %bb.7:
	movq	$-1, %rax
LBB0_8:
	addq	%rax, 8(%r14)
LBB0_9:
	movq	_SCA3000_REG_MODE_ADDR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_sca3000_read_data_short
	testl	%eax, %eax
	je	LBB0_10
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	(%r14), %rax
	movl	(%rax), %edx
	movq	_SCA3000_REG_MODE_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, %ecx
	andl	%edx, %ecx
	cmpq	$0, 8(%r14)
	movq	_SCA3000_REG_MODE_MEAS_MODE_MOT_DET@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	je	LBB0_13
## %bb.11:
	xorl	%eax, %eax
	cmpl	%ebx, %ecx
	je	LBB0_16
## %bb.12:
	movl	(%r15), %esi
	notl	%edi
	andl	%edi, %edx
	orl	%ebx, %edx
	movq	%r14, %rdi
	jmp	LBB0_15
LBB0_13:
	xorl	%eax, %eax
	cmpl	%ebx, %ecx
	jne	LBB0_16
## %bb.14:
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%ecx, %edx
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sca3000_write_reg              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SCA3000_REG_CTRL_SEL_MD_CTRL,4,2 ## @SCA3000_REG_CTRL_SEL_MD_CTRL
	.comm	_sca3000_addresses,8,3          ## @sca3000_addresses
	.comm	_SCA3000_REG_MODE_ADDR,4,2      ## @SCA3000_REG_MODE_ADDR
	.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
	.no_dead_strip	_sca3000_motion_detect_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sca3000_motion_detect_set_state
_sca3000_motion_detect_set_state:       ; @sca3000_motion_detect_set_state
	.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, x2
	mov	x21, x1
	bl	_iio_priv
	mov	x19, x0
Lloh0:
	adrp	x22, _SCA3000_REG_CTRL_SEL_MD_CTRL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SCA3000_REG_CTRL_SEL_MD_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_sca3000_read_ctrl_reg
	tbnz	w0, #31, LBB0_17
; %bb.1:
Lloh2:
	adrp	x8, _sca3000_addresses@GOTPAGE
Lloh3:
	ldr	x8, [x8, _sca3000_addresses@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	x8, [x8, w21, sxtw #3]
	ldr	w8, [x8, #8]
	and	w9, w8, w0
	cbz	w20, LBB0_5
; %bb.2:
	cbnz	w9, LBB0_9
; %bb.3:
	ldr	w1, [x22]
	orr	w2, w8, w0
	mov	x0, x19
	bl	_sca3000_write_ctrl_reg
	cbnz	w0, LBB0_17
; %bb.4:
	mov	w8, #1
	b	LBB0_8
LBB0_5:
	cbz	w9, LBB0_9
; %bb.6:
	ldr	w1, [x22]
	bic	w2, w0, w8
	mov	x0, x19
	bl	_sca3000_write_ctrl_reg
	cbnz	w0, LBB0_17
; %bb.7:
	mov	x8, #-1
LBB0_8:
	ldr	x9, [x19, #8]
	add	x8, x9, x8
	str	x8, [x19, #8]
LBB0_9:
Lloh5:
	adrp	x20, _SCA3000_REG_MODE_ADDR@GOTPAGE
Lloh6:
	ldr	x20, [x20, _SCA3000_REG_MODE_ADDR@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #1
	bl	_sca3000_read_data_short
	cbnz	w0, LBB0_17
; %bb.10:
	ldp	x8, x11, [x19]
Lloh7:
	adrp	x9, _SCA3000_REG_MODE_MODE_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SCA3000_REG_MODE_MODE_MASK@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh9:
	ldr	w9, [x9]
	and	w2, w9, w8
Lloh10:
	adrp	x10, _SCA3000_REG_MODE_MEAS_MODE_MOT_DET@GOTPAGE
Lloh11:
	ldr	x10, [x10, _SCA3000_REG_MODE_MEAS_MODE_MOT_DET@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	cbz	x11, LBB0_13
; %bb.11:
	cmp	w2, w10
	b.eq	LBB0_16
; %bb.12:
	ldr	w1, [x20]
	bic	w8, w8, w9
	orr	w2, w8, w10
	b	LBB0_15
LBB0_13:
	cmp	w2, w10
	b.ne	LBB0_16
; %bb.14:
	ldr	w1, [x20]
LBB0_15:
	mov	x0, x19
	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
	b	_sca3000_write_reg
LBB0_16:
	mov	w0, #0
LBB0_17:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SCA3000_REG_CTRL_SEL_MD_CTRL,4,2 ; @SCA3000_REG_CTRL_SEL_MD_CTRL
	.comm	_sca3000_addresses,8,3          ; @sca3000_addresses
	.comm	_SCA3000_REG_MODE_ADDR,4,2      ; @SCA3000_REG_MODE_ADDR
	.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
	.no_dead_strip	_sca3000_motion_detect_set_state
.subsections_via_symbols
