	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stmfx_chip_init
_stmfx_chip_init:                       ## @stmfx_chip_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_i2c_get_clientdata
	movq	%rax, %r15
	leaq	4(%r12), %r14
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_devm_regulator_get_optional
	movq	%rax, (%r15)
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	movl	%eax, %ebx
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_4
## %bb.1:
	movq	$0, (%r15)
LBB0_2:
	movl	8(%r15), %edi
	movq	_STMFX_REG_CHIP_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-60(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_11
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
LBB0_18:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_19:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.20:
	callq	_regulator_disable
	movl	%eax, %ebx
	jmp	LBB0_21
LBB0_4:
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_21
## %bb.5:
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_21:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_23
## %bb.22:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_STMFX_REG_CHIP_ID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-60(%rbp), %esi
	notl	%esi
	callq	_FIELD_GET
	movl	(%r12), %ecx
	addl	%ecx, %ecx
	cmpl	%ecx, %eax
	jne	LBB0_12
## %bb.13:
	movl	8(%r15), %r12d
	movq	_STMFX_REG_FW_VERSION_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	-56(%rbp), %r13
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	movl	%r12d, %edi
	movl	%ebx, %esi
	movq	%r13, %rdx
	movl	%eax, %ecx
	callq	_regmap_bulk_read
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_18
LBB0_12:
	movl	-60(%rbp), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_8:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.9:
	callq	_regulator_enable
	testl	%eax, %eax
	je	LBB0_2
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_7
LBB0_15:
	movl	-60(%rbp), %edx
	movl	-56(%rbp), %ecx
	movl	-52(%rbp), %r8d
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	movq	%r15, %rdi
	callq	_stmfx_chip_reset
	testl	%eax, %eax
	je	LBB0_16
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_18
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_23:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vdd"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EPROBE_DEFER,4,2               ## @EPROBE_DEFER
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get VDD regulator: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"VDD enable failed: %d\n"

	.comm	_STMFX_REG_CHIP_ID,4,2          ## @STMFX_REG_CHIP_ID
L_.str.3:                               ## @.str.3
	.asciz	"Error reading chip ID: %d\n"

	.comm	_STMFX_REG_CHIP_ID_MASK,4,2     ## @STMFX_REG_CHIP_ID_MASK
L_.str.4:                               ## @.str.4
	.asciz	"Unknown chip ID: %#x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_STMFX_REG_FW_VERSION_MSB,4,2   ## @STMFX_REG_FW_VERSION_MSB
L_.str.5:                               ## @.str.5
	.asciz	"Error reading FW version: %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"STMFX id: %#x, fw version: %x.%02x\n"

L_.str.7:                               ## @.str.7
	.asciz	"Failed to reset chip: %d\n"

	.no_dead_strip	_stmfx_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stmfx_chip_init
_stmfx_chip_init:                       ; @stmfx_chip_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_i2c_get_clientdata
	mov	x19, x0
	add	x20, x22, #4
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_devm_regulator_get_optional
	str	x0, [x19]
	bl	_PTR_ERR_OR_ZERO
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.1:
	str	xzr, [x19]
LBB0_2:
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x8, _STMFX_REG_CHIP_ID@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STMFX_REG_CHIP_ID@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_12
; %bb.3:
	mov	x21, x0
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_4:
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
	ldr	x0, [x19]
	cbz	x0, LBB0_10
LBB0_5:
	bl	_regulator_disable
	mov	x21, x0
	b	LBB0_10
LBB0_6:
	mov	x21, x0
Lloh13:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_10
; %bb.7:
	cbz	w21, LBB0_16
; %bb.8:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_9:
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
LBB0_10:
	ldr	x8, [sp, #24]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.11:
	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
	add	sp, sp, #80
	ret
LBB0_12:
Lloh21:
	adrp	x8, _STMFX_REG_CHIP_ID_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _STMFX_REG_CHIP_ID_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w8, [sp, #12]
	mvn	w1, w8
	bl	_FIELD_GET
	ldr	w8, [x22]
	cmp	w0, w8, lsl #1
	b.ne	LBB0_15
; %bb.13:
	ldr	w21, [x19, #8]
Lloh24:
	adrp	x8, _STMFX_REG_FW_VERSION_MSB@GOTPAGE
Lloh25:
	ldr	x8, [x8, _STMFX_REG_FW_VERSION_MSB@GOTPAGEOFF]
Lloh26:
	ldr	w22, [x8]
	add	x0, sp, #16
	bl	_ARRAY_SIZE
	mov	x3, x0
	add	x2, sp, #16
	mov	x0, x21
	mov	x1, x22
	bl	_regmap_bulk_read
	cbz	w0, LBB0_19
; %bb.14:
	mov	x21, x0
Lloh27:
	adrp	x1, l_.str.5@PAGE
Lloh28:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_4
LBB0_15:
	ldr	w2, [sp, #12]
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x0, [x19]
	cbnz	x0, LBB0_5
	b	LBB0_10
LBB0_16:
	ldr	x0, [x19]
	cbz	x0, LBB0_2
; %bb.17:
	bl	_regulator_enable
	cbz	w0, LBB0_2
; %bb.18:
	mov	x21, x0
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_19:
	ldp	w2, w3, [sp, #12]
	ldr	w4, [sp, #20]
Lloh36:
	adrp	x1, l_.str.6@PAGE
Lloh37:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_dev_info
	mov	x0, x19
	bl	_stmfx_chip_reset
	mov	x21, x0
	cbz	w0, LBB0_10
; %bb.20:
Lloh38:
	adrp	x1, l_.str.7@PAGE
Lloh39:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_4
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vdd"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EPROBE_DEFER,4,2               ; @EPROBE_DEFER
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get VDD regulator: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"VDD enable failed: %d\n"

	.comm	_STMFX_REG_CHIP_ID,4,2          ; @STMFX_REG_CHIP_ID
l_.str.3:                               ; @.str.3
	.asciz	"Error reading chip ID: %d\n"

	.comm	_STMFX_REG_CHIP_ID_MASK,4,2     ; @STMFX_REG_CHIP_ID_MASK
l_.str.4:                               ; @.str.4
	.asciz	"Unknown chip ID: %#x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STMFX_REG_FW_VERSION_MSB,4,2   ; @STMFX_REG_FW_VERSION_MSB
l_.str.5:                               ; @.str.5
	.asciz	"Error reading FW version: %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"STMFX id: %#x, fw version: %x.%02x\n"

l_.str.7:                               ; @.str.7
	.asciz	"Failed to reset chip: %d\n"

	.no_dead_strip	_stmfx_chip_init
.subsections_via_symbols
