	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kmx61_set_mode
_kmx61_set_mode:                        ## @kmx61_set_mode
	.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
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	8(%rdi), %rdi
	movq	_KMX61_REG_STBY@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movq	_KMX61_ACC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$-1, %ecx
	testl	%r13d, %eax
	je	LBB0_6
## %bb.2:
	movq	_KMX61_ACC_STBY_BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ebx, %ecx
	je	LBB0_5
## %bb.3:
	orl	%ecx, %r12d
	movl	$1, %ecx
	jmp	LBB0_6
LBB0_4:
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_17
LBB0_5:
	notl	%ecx
	andl	%ecx, %r12d
	xorl	%ecx, %ecx
LBB0_6:
	movq	%r14, %rdx
	testl	%r13d, %eax
	setne	%r14b
	movq	_KMX61_MAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r13d, %eax
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	je	LBB0_9
## %bb.7:
	movq	_KMX61_MAG_STBY_BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ebx, %ecx
	je	LBB0_10
## %bb.8:
	orl	%ecx, %r12d
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_11
LBB0_9:
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
	jmp	LBB0_11
LBB0_10:
	notl	%ecx
	andl	%ecx, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_11:
	testl	%r13d, %eax
	setne	%r13b
	movq	_KMX61_ACT_STBY_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, %ebx
	cmovnel	%eax, %ebx
	orl	%r12d, %ebx
	movq	8(%r15), %rdi
	movl	(%rdx), %esi
	movl	%ebx, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_16
## %bb.12:
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	sete	%al
	xorb	$1, %r14b
	orb	%al, %r14b
	jne	LBB0_14
## %bb.13:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r15)
LBB0_14:
	testl	%ecx, %ecx
	sete	%al
	xorb	$1, %r13b
	xorl	%r12d, %r12d
	orb	%al, %r13b
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	jne	LBB0_18
## %bb.15:
	movl	%eax, 4(%r15)
	jmp	LBB0_18
LBB0_16:
	movl	%eax, %r12d
	movq	8(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
LBB0_17:
	callq	_dev_err
LBB0_18:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KMX61_REG_STBY,4,2             ## @KMX61_REG_STBY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading reg_stby\n"

	.comm	_KMX61_ACC,4,2                  ## @KMX61_ACC
	.comm	_KMX61_ACC_STBY_BIT,4,2         ## @KMX61_ACC_STBY_BIT
	.comm	_KMX61_MAG,4,2                  ## @KMX61_MAG
	.comm	_KMX61_MAG_STBY_BIT,4,2         ## @KMX61_MAG_STBY_BIT
	.comm	_KMX61_ACT_STBY_BIT,4,2         ## @KMX61_ACT_STBY_BIT
L_.str.1:                               ## @.str.1
	.asciz	"Error writing reg_stby\n"

	.no_dead_strip	_kmx61_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kmx61_set_mode
_kmx61_set_mode:                        ; @kmx61_set_mode
	.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	x20, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x0, [x0, #8]
Lloh0:
	adrp	x24, _KMX61_REG_STBY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _KMX61_REG_STBY@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_i2c_smbus_read_byte_data
	mov	x21, x0
	tbnz	w0, #31, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _KMX61_ACC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _KMX61_ACC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ands	w8, w8, w23
	b.eq	LBB0_4
; %bb.2:
Lloh5:
	adrp	x9, _KMX61_ACC_STBY_BIT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _KMX61_ACC_STBY_BIT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w22
	bic	w10, w21, w9
	orr	w9, w9, w21
	mov	w11, #1
	csel	w21, w10, w9, eq
	csel	w25, wzr, w11, eq
	b	LBB0_5
LBB0_3:
	ldr	x0, [x19, #8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_4:
	mov	w25, #-1
LBB0_5:
	cmp	w8, #0
	cset	w26, ne
Lloh10:
	adrp	x8, _KMX61_MAG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _KMX61_MAG@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ands	w8, w8, w23
	b.eq	LBB0_7
; %bb.6:
Lloh13:
	adrp	x9, _KMX61_MAG_STBY_BIT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _KMX61_MAG_STBY_BIT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w22
	bic	w10, w21, w9
	orr	w9, w9, w21
	mov	w11, #1
	csel	w21, w10, w9, eq
	csel	w23, wzr, w11, eq
	b	LBB0_8
LBB0_7:
	mov	w23, #-1
LBB0_8:
	cmp	w8, #0
	cset	w27, ne
Lloh16:
	adrp	x8, _KMX61_ACT_STBY_BIT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _KMX61_ACT_STBY_BIT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w22
	csel	w8, wzr, w8, eq
	orr	w2, w8, w21
	ldr	x0, [x19, #8]
	ldr	w1, [x24]
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_13
; %bb.9:
	cmp	w20, #0
	cset	w8, eq
	eor	w9, w26, #0x1
	orr	w8, w8, w9
	tbnz	w8, #0, LBB0_11
; %bb.10:
	str	w25, [x19]
LBB0_11:
	cmp	w20, #0
	cset	w8, eq
	eor	w9, w27, #0x1
	mov	w21, #0
	orr	w8, w8, w9
	tbnz	w8, #0, LBB0_15
; %bb.12:
	str	w23, [x19, #4]
	b	LBB0_15
LBB0_13:
	mov	x21, x0
	ldr	x0, [x19, #8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_14:
	bl	_dev_err
LBB0_15:
	mov	x0, x21
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_KMX61_REG_STBY,4,2             ; @KMX61_REG_STBY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading reg_stby\n"

	.comm	_KMX61_ACC,4,2                  ; @KMX61_ACC
	.comm	_KMX61_ACC_STBY_BIT,4,2         ; @KMX61_ACC_STBY_BIT
	.comm	_KMX61_MAG,4,2                  ; @KMX61_MAG
	.comm	_KMX61_MAG_STBY_BIT,4,2         ; @KMX61_MAG_STBY_BIT
	.comm	_KMX61_ACT_STBY_BIT,4,2         ; @KMX61_ACT_STBY_BIT
l_.str.1:                               ; @.str.1
	.asciz	"Error writing reg_stby\n"

	.no_dead_strip	_kmx61_set_mode
.subsections_via_symbols
