	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mma7660_set_mode
_mma7660_set_mode:                      ## @mma7660_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	cmpl	%esi, (%rdi)
	je	LBB0_10
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	_MMA7660_REG_MODE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:
	movq	_MMA7660_MODE_ACTIVE@GOTPCREL(%rip), %rcx
	movq	_MMA7660_REG_MODE_BIT_TON@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r14d, (%rcx)
	jne	LBB0_6
## %bb.5:
	notl	%eax
	andl	%eax, %ebx
	movq	_MMA7660_REG_MODE_BIT_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_7
LBB0_2:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_6:
	movq	_MMA7660_REG_MODE_BIT_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, %ebx
LBB0_7:
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movl	%r14d, (%r15)
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	movq	%r12, %rdi
	callq	_dev_err
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMA7660_REG_MODE,4,2           ## @MMA7660_REG_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read sensor mode\n"

	.comm	_MMA7660_MODE_ACTIVE,4,2        ## @MMA7660_MODE_ACTIVE
	.comm	_MMA7660_REG_MODE_BIT_TON,4,2   ## @MMA7660_REG_MODE_BIT_TON
	.comm	_MMA7660_REG_MODE_BIT_MODE,4,2  ## @MMA7660_REG_MODE_BIT_MODE
L_.str.1:                               ## @.str.1
	.asciz	"failed to change sensor mode\n"

	.no_dead_strip	_mma7660_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mma7660_set_mode
_mma7660_set_mode:                      ; @mma7660_set_mode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_11
LBB0_2:
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x23, _MMA7660_REG_MODE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MMA7660_REG_MODE@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_i2c_smbus_read_byte_data
	mov	x22, x0
	tbnz	w0, #31, LBB0_5
; %bb.3:
Lloh2:
	adrp	x8, _MMA7660_MODE_ACTIVE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MMA7660_MODE_ACTIVE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
Lloh5:
	adrp	x8, _MMA7660_REG_MODE_BIT_TON@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MMA7660_REG_MODE_BIT_TON@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w9, w20
	b.ne	LBB0_6
; %bb.4:
	bic	w8, w22, w8
Lloh8:
	adrp	x9, _MMA7660_REG_MODE_BIT_MODE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MMA7660_REG_MODE_BIT_MODE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w8, w9
	b	LBB0_7
LBB0_5:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_6:
Lloh13:
	adrp	x9, _MMA7660_REG_MODE_BIT_MODE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _MMA7660_REG_MODE_BIT_MODE@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w2, w22, w8
LBB0_7:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_i2c_smbus_write_byte_data
	mov	x22, x0
	tbnz	w0, #31, LBB0_9
; %bb.8:
	str	w20, [x21]
	b	LBB0_11
LBB0_9:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
	mov	x0, x19
	bl	_dev_err
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MMA7660_REG_MODE,4,2           ; @MMA7660_REG_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read sensor mode\n"

	.comm	_MMA7660_MODE_ACTIVE,4,2        ; @MMA7660_MODE_ACTIVE
	.comm	_MMA7660_REG_MODE_BIT_TON,4,2   ; @MMA7660_REG_MODE_BIT_TON
	.comm	_MMA7660_REG_MODE_BIT_MODE,4,2  ; @MMA7660_REG_MODE_BIT_MODE
l_.str.1:                               ; @.str.1
	.asciz	"failed to change sensor mode\n"

	.no_dead_strip	_mma7660_set_mode
.subsections_via_symbols
