	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kmx61_setup_any_motion_interrupt
_kmx61_setup_any_motion_interrupt:      ## @kmx61_setup_any_motion_interrupt
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_KMX61_ACC@GOTPCREL(%rip), %r12
	movq	_KMX61_MAG@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	orl	(%r12), %edx
	leaq	-44(%rbp), %rsi
	callq	_kmx61_get_mode
	testl	%eax, %eax
	js	LBB0_18
## %bb.1:
	movq	_KMX61_ALL_STBY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	orl	(%r12), %edx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_kmx61_set_mode
	testl	%eax, %eax
	js	LBB0_18
## %bb.2:
	movq	%r14, %rdi
	callq	_kmx61_chip_update_thresholds
	testl	%eax, %eax
	js	LBB0_18
## %bb.3:
	movq	(%r14), %rdi
	movq	_KMX61_REG_INC1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_KMX61_REG_INC1_BIT_IEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_KMX61_REG_INC1_BIT_WUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	orl	%ebx, %edx
	orl	%eax, %edx
	jmp	LBB0_8
LBB0_4:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_19
LBB0_7:
	orl	%edx, %eax
	notl	%eax
	andl	%eax, %ebx
	movl	%ebx, %edx
LBB0_8:
	movq	(%r14), %rdi
	movq	_KMX61_REG_INC1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_write_byte_data
	movq	(%r14), %rdi
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movq	_KMX61_REG_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movq	_KMX61_REG_CTRL1_BIT_WUFE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_KMX61_REG_CTRL1_BIT_BTSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.13:
	orl	%ebx, %edx
	orl	%eax, %edx
	jmp	LBB0_15
LBB0_9:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_19
LBB0_11:
	movq	(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_19
LBB0_14:
	orl	%edx, %eax
	notl	%eax
	andl	%eax, %ebx
	movl	%ebx, %edx
LBB0_15:
	movq	(%r14), %rdi
	movq	_KMX61_REG_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_16
## %bb.17:
	movq	_KMX61_ACT_STBY_BIT@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %esi
	orl	(%rax), %esi
	movl	%esi, -44(%rbp)
	movl	(%r13), %edx
	orl	(%r12), %edx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_kmx61_set_mode
LBB0_18:
	movl	%eax, %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_KMX61_ACC,4,2                  ## @KMX61_ACC
	.comm	_KMX61_MAG,4,2                  ## @KMX61_MAG
	.comm	_KMX61_ALL_STBY,4,2             ## @KMX61_ALL_STBY
	.comm	_KMX61_REG_INC1,4,2             ## @KMX61_REG_INC1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading reg_inc1\n"

	.comm	_KMX61_REG_INC1_BIT_IEN,4,2     ## @KMX61_REG_INC1_BIT_IEN
	.comm	_KMX61_REG_INC1_BIT_WUFS,4,2    ## @KMX61_REG_INC1_BIT_WUFS
L_.str.1:                               ## @.str.1
	.asciz	"Error writing reg_inc1\n"

	.comm	_KMX61_REG_CTRL1,4,2            ## @KMX61_REG_CTRL1
L_.str.2:                               ## @.str.2
	.asciz	"Error reading reg_ctrl1\n"

	.comm	_KMX61_REG_CTRL1_BIT_WUFE,4,2   ## @KMX61_REG_CTRL1_BIT_WUFE
	.comm	_KMX61_REG_CTRL1_BIT_BTSE,4,2   ## @KMX61_REG_CTRL1_BIT_BTSE
L_.str.3:                               ## @.str.3
	.asciz	"Error writing reg_ctrl1\n"

	.comm	_KMX61_ACT_STBY_BIT,4,2         ## @KMX61_ACT_STBY_BIT
	.no_dead_strip	_kmx61_setup_any_motion_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kmx61_setup_any_motion_interrupt
_kmx61_setup_any_motion_interrupt:      ; @kmx61_setup_any_motion_interrupt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _KMX61_ACC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _KMX61_ACC@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x23, _KMX61_MAG@GOTPAGE
Lloh3:
	ldr	x23, [x23, _KMX61_MAG@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w2, w9, w8
	add	x1, sp, #12
	bl	_kmx61_get_mode
	tbnz	w0, #31, LBB0_8
; %bb.1:
Lloh4:
	adrp	x8, _KMX61_ALL_STBY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _KMX61_ALL_STBY@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w2, w9, w8
	mov	x0, x19
	mov	w3, #1
	bl	_kmx61_set_mode
	tbnz	w0, #31, LBB0_8
; %bb.2:
	mov	x0, x19
	bl	_kmx61_chip_update_thresholds
	tbnz	w0, #31, LBB0_8
; %bb.3:
	ldr	x0, [x19]
Lloh7:
	adrp	x24, _KMX61_REG_INC1@GOTPAGE
Lloh8:
	ldr	x24, [x24, _KMX61_REG_INC1@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_i2c_smbus_read_byte_data
	mov	x21, x0
	tbnz	w0, #31, LBB0_10
; %bb.4:
Lloh9:
	adrp	x8, _KMX61_REG_INC1_BIT_IEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KMX61_REG_INC1_BIT_IEN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _KMX61_REG_INC1_BIT_WUFS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _KMX61_REG_INC1_BIT_WUFS@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w10, w9, w8
	bic	w10, w21, w10
	orr	w8, w8, w21
	orr	w8, w8, w9
	cmp	w20, #0
	csel	w2, w10, w8, eq
	ldr	x0, [x19]
	ldr	w1, [x24]
	bl	_i2c_smbus_write_byte_data
	mov	x21, x0
	ldr	x0, [x19]
	tbnz	w21, #31, LBB0_11
; %bb.5:
Lloh15:
	adrp	x24, _KMX61_REG_CTRL1@GOTPAGE
Lloh16:
	ldr	x24, [x24, _KMX61_REG_CTRL1@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_i2c_smbus_read_byte_data
	mov	x21, x0
	tbnz	w0, #31, LBB0_12
; %bb.6:
Lloh17:
	adrp	x8, _KMX61_REG_CTRL1_BIT_WUFE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _KMX61_REG_CTRL1_BIT_WUFE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _KMX61_REG_CTRL1_BIT_BTSE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _KMX61_REG_CTRL1_BIT_BTSE@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w10, w9, w8
	bic	w10, w21, w10
	orr	w8, w8, w21
	orr	w8, w8, w9
	cmp	w20, #0
	csel	w2, w10, w8, eq
	ldr	x0, [x19]
	ldr	w1, [x24]
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_13
; %bb.7:
Lloh23:
	adrp	x8, _KMX61_ACT_STBY_BIT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _KMX61_ACT_STBY_BIT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w1, w9, w8
	str	w1, [sp, #12]
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w2, w9, w8
	mov	x0, x19
	mov	w3, #1
	bl	_kmx61_set_mode
LBB0_8:
	mov	x21, x0
LBB0_9:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
LBB0_10:
	ldr	x0, [x19]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_11:
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_12:
	ldr	x0, [x19]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_13:
	mov	x21, x0
	ldr	x0, [x19]
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_KMX61_ACC,4,2                  ; @KMX61_ACC
	.comm	_KMX61_MAG,4,2                  ; @KMX61_MAG
	.comm	_KMX61_ALL_STBY,4,2             ; @KMX61_ALL_STBY
	.comm	_KMX61_REG_INC1,4,2             ; @KMX61_REG_INC1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading reg_inc1\n"

	.comm	_KMX61_REG_INC1_BIT_IEN,4,2     ; @KMX61_REG_INC1_BIT_IEN
	.comm	_KMX61_REG_INC1_BIT_WUFS,4,2    ; @KMX61_REG_INC1_BIT_WUFS
l_.str.1:                               ; @.str.1
	.asciz	"Error writing reg_inc1\n"

	.comm	_KMX61_REG_CTRL1,4,2            ; @KMX61_REG_CTRL1
l_.str.2:                               ; @.str.2
	.asciz	"Error reading reg_ctrl1\n"

	.comm	_KMX61_REG_CTRL1_BIT_WUFE,4,2   ; @KMX61_REG_CTRL1_BIT_WUFE
	.comm	_KMX61_REG_CTRL1_BIT_BTSE,4,2   ; @KMX61_REG_CTRL1_BIT_BTSE
l_.str.3:                               ; @.str.3
	.asciz	"Error writing reg_ctrl1\n"

	.comm	_KMX61_ACT_STBY_BIT,4,2         ; @KMX61_ACT_STBY_BIT
	.no_dead_strip	_kmx61_setup_any_motion_interrupt
.subsections_via_symbols
