	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stk8312_set_mode
_stk8312_set_mode:                      ## @stk8312_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r15d, %r15d
	cmpl	%esi, (%rdi)
	je	LBB0_4
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	movq	_STK8312_REG_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movl	%ebx, (%r14)
	movq	_STK8312_MODE_ACTIVE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_4
## %bb.5:
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$5000, %esi                     ## imm = 0x1388
	callq	_usleep_range
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_stk8312_otp_init               ## TAILCALL
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
LBB0_4:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STK8312_REG_MODE,4,2           ## @STK8312_REG_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to change sensor mode\n"

	.comm	_STK8312_MODE_ACTIVE,4,2        ## @STK8312_MODE_ACTIVE
	.no_dead_strip	_stk8312_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stk8312_set_mode
_stk8312_set_mode:                      ; @stk8312_set_mode
	.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
	ldr	w8, [x0]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_6
LBB0_2:
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
Lloh0:
	adrp	x8, _STK8312_REG_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STK8312_REG_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
	mov	x2, x21
	bl	_i2c_smbus_write_byte_data
	mov	x20, x0
	tbnz	w0, #31, LBB0_5
; %bb.3:
	str	w21, [x19]
Lloh3:
	adrp	x8, _STK8312_MODE_ACTIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STK8312_MODE_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.4:
	mov	w0, #1000
	mov	w1, #5000
	bl	_usleep_range
	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	_stk8312_otp_init
LBB0_5:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
LBB0_6:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_STK8312_REG_MODE,4,2           ; @STK8312_REG_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to change sensor mode\n"

	.comm	_STK8312_MODE_ACTIVE,4,2        ; @STK8312_MODE_ACTIVE
	.no_dead_strip	_stk8312_set_mode
.subsections_via_symbols
