	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stk8312_otp_init
_stk8312_otp_init:                      ## @stk8312_otp_init
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	_STK8312_REG_OTPADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$112, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	movq	_STK8312_REG_OTPCTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$2, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_10
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	$10, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$5000, %esi                     ## imm = 0x1388
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	-1(%rbx), %r14d
	movl	$7, %edi
	callq	_BIT
	testl	%r13d, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$1, %ebx
	movl	%r14d, %ebx
	ja	LBB0_3
LBB0_6:
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.8:
	movq	_STK8312_REG_OTPDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	subl	(%rcx), %r13d
	testl	%eax, %eax
	cmovnel	%eax, %r13d
	testl	%r13d, %r13d
	js	LBB0_11
## %bb.9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	_STK8312_REG_AFECTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_10
## %bb.13:
	movl	$150, %edi
	callq	_msleep
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_10:
	movl	%eax, %r13d
LBB0_11:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
LBB0_12:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_STK8312_REG_OTPADDR,4,2        ## @STK8312_REG_OTPADDR
	.comm	_STK8312_REG_OTPCTRL,4,2        ## @STK8312_REG_OTPCTRL
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_STK8312_REG_OTPDATA,4,2        ## @STK8312_REG_OTPDATA
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_STK8312_REG_AFECTRL,4,2        ## @STK8312_REG_AFECTRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to initialize sensor\n"

	.no_dead_strip	_stk8312_otp_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stk8312_otp_init
_stk8312_otp_init:                      ; @stk8312_otp_init
	.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
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _STK8312_REG_OTPADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STK8312_REG_OTPADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #112
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_9
; %bb.1:
Lloh3:
	adrp	x22, _STK8312_REG_OTPCTRL@GOTPAGE
Lloh4:
	ldr	x22, [x22, _STK8312_REG_OTPCTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #2
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_9
; %bb.2:
	mov	w23, #10
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1000
	mov	w1, #5000
	bl	_usleep_range
	ldr	w1, [x22]
	mov	x0, x19
	bl	_i2c_smbus_read_byte_data
	mov	x21, x0
	tbnz	w0, #31, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w24, w23, #1
	mov	w0, #7
	bl	_BIT
	and	w8, w0, w21
	cmp	w8, #0
	ccmp	w23, #1, #0, eq
	mov	x23, x24
	b.hi	LBB0_3
; %bb.5:
	cbz	w24, LBB0_12
; %bb.6:
Lloh5:
	adrp	x8, _STK8312_REG_OTPDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _STK8312_REG_OTPDATA@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_i2c_smbus_read_byte_data
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w21, w0, w8, ne
	tbnz	w21, #31, LBB0_10
; %bb.7:
	ldr	x0, [x20]
Lloh11:
	adrp	x8, _STK8312_REG_AFECTRL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _STK8312_REG_AFECTRL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_9
; %bb.8:
	mov	w0, #150
	bl	_msleep
	mov	w21, #0
	b	LBB0_11
LBB0_9:
	mov	x21, x0
LBB0_10:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_11:
	mov	x0, x21
	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
LBB0_12:
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_STK8312_REG_OTPADDR,4,2        ; @STK8312_REG_OTPADDR
	.comm	_STK8312_REG_OTPCTRL,4,2        ; @STK8312_REG_OTPCTRL
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_STK8312_REG_OTPDATA,4,2        ; @STK8312_REG_OTPDATA
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STK8312_REG_AFECTRL,4,2        ; @STK8312_REG_AFECTRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to initialize sensor\n"

	.no_dead_strip	_stk8312_otp_init
.subsections_via_symbols
