	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stmfx_function_enable          ## -- Begin function stmfx_function_enable
	.p2align	4, 0x90
_stmfx_function_enable:                 ## @stmfx_function_enable
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	movq	_STMFX_REG_SYS_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_13
## %bb.1:
	movq	_STMFX_FUNC_IDD@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_STMFX_FUNC_TS@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_6
LBB0_3:
	movq	_STMFX_REG_SYS_CTRL_ALTGPIO_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_6
## %bb.4:
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_6:
	movq	_STMFX_FUNC_ALTGPIO_LOW@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_9
## %bb.7:
	movq	_STMFX_REG_SYS_CTRL_TS_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_9
## %bb.8:
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_9:
	movq	_STMFX_FUNC_ALTGPIO_HIGH@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_12
## %bb.10:
	movq	_STMFX_REG_SYS_CTRL_IDD_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_12
## %bb.11:
	movl	4(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_5:
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%r14d, %edi
	callq	_stmfx_func_to_mask
	movl	(%rbx), %edi
	movl	(%r15), %esi
	movl	%eax, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_STMFX_REG_SYS_CTRL,4,2         ## @STMFX_REG_SYS_CTRL
	.comm	_STMFX_FUNC_IDD,4,2             ## @STMFX_FUNC_IDD
	.comm	_STMFX_FUNC_TS,4,2              ## @STMFX_FUNC_TS
	.comm	_STMFX_REG_SYS_CTRL_ALTGPIO_EN,4,2 ## @STMFX_REG_SYS_CTRL_ALTGPIO_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ALTGPIO function already enabled\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_STMFX_FUNC_ALTGPIO_LOW,4,2     ## @STMFX_FUNC_ALTGPIO_LOW
	.comm	_STMFX_REG_SYS_CTRL_TS_EN,4,2   ## @STMFX_REG_SYS_CTRL_TS_EN
L_.str.1:                               ## @.str.1
	.asciz	"TS in use, aGPIO[3:0] unavailable\n"

	.comm	_STMFX_FUNC_ALTGPIO_HIGH,4,2    ## @STMFX_FUNC_ALTGPIO_HIGH
	.comm	_STMFX_REG_SYS_CTRL_IDD_EN,4,2  ## @STMFX_REG_SYS_CTRL_IDD_EN
L_.str.2:                               ## @.str.2
	.asciz	"IDD in use, aGPIO[7:4] unavailable\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stmfx_function_enable          ; -- Begin function stmfx_function_enable
	.p2align	2
_stmfx_function_enable:                 ; @stmfx_function_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x21, _STMFX_REG_SYS_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _STMFX_REG_SYS_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	cbnz	w0, LBB0_12
; %bb.1:
Lloh2:
	adrp	x8, _STMFX_FUNC_IDD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _STMFX_FUNC_IDD@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _STMFX_FUNC_TS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _STMFX_FUNC_TS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_5
LBB0_3:
	ldr	w8, [sp, #12]
Lloh8:
	adrp	x9, _STMFX_REG_SYS_CTRL_ALTGPIO_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _STMFX_REG_SYS_CTRL_ALTGPIO_EN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	w0, [x19, #4]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_11
LBB0_5:
Lloh13:
	adrp	x8, _STMFX_FUNC_ALTGPIO_LOW@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STMFX_FUNC_ALTGPIO_LOW@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.6:
	ldr	w8, [sp, #12]
Lloh16:
	adrp	x9, _STMFX_REG_SYS_CTRL_TS_EN@GOTPAGE
Lloh17:
	ldr	x9, [x9, _STMFX_REG_SYS_CTRL_TS_EN@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	w0, [x19, #4]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_8:
Lloh21:
	adrp	x8, _STMFX_FUNC_ALTGPIO_HIGH@GOTPAGE
Lloh22:
	ldr	x8, [x8, _STMFX_FUNC_ALTGPIO_HIGH@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_13
; %bb.9:
	ldr	w8, [sp, #12]
Lloh24:
	adrp	x9, _STMFX_REG_SYS_CTRL_IDD_EN@GOTPAGE
Lloh25:
	ldr	x9, [x9, _STMFX_REG_SYS_CTRL_IDD_EN@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.10:
	ldr	w0, [x19, #4]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_11:
	bl	_dev_err
Lloh29:
	adrp	x8, _EBUSY@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	add	sp, sp, #64
	ret
LBB0_13:
	mov	x0, x20
	bl	_stmfx_func_to_mask
	mov	x2, x0
	ldr	w0, [x19]
	ldr	w1, [x21]
	mov	x3, x2
	bl	_regmap_update_bits
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_STMFX_REG_SYS_CTRL,4,2         ; @STMFX_REG_SYS_CTRL
	.comm	_STMFX_FUNC_IDD,4,2             ; @STMFX_FUNC_IDD
	.comm	_STMFX_FUNC_TS,4,2              ; @STMFX_FUNC_TS
	.comm	_STMFX_REG_SYS_CTRL_ALTGPIO_EN,4,2 ; @STMFX_REG_SYS_CTRL_ALTGPIO_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ALTGPIO function already enabled\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_STMFX_FUNC_ALTGPIO_LOW,4,2     ; @STMFX_FUNC_ALTGPIO_LOW
	.comm	_STMFX_REG_SYS_CTRL_TS_EN,4,2   ; @STMFX_REG_SYS_CTRL_TS_EN
l_.str.1:                               ; @.str.1
	.asciz	"TS in use, aGPIO[3:0] unavailable\n"

	.comm	_STMFX_FUNC_ALTGPIO_HIGH,4,2    ; @STMFX_FUNC_ALTGPIO_HIGH
	.comm	_STMFX_REG_SYS_CTRL_IDD_EN,4,2  ; @STMFX_REG_SYS_CTRL_IDD_EN
l_.str.2:                               ; @.str.2
	.asciz	"IDD in use, aGPIO[7:4] unavailable\n"

.subsections_via_symbols
