	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pctrl_dt_subnode_to_map
_mtk_pctrl_dt_subnode_to_map:           ## @mtk_pctrl_dt_subnode_to_map
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r12
	callq	_pinctrl_dev_get_drvdata
	movq	%rax, %r14
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_of_find_property
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	movq	%r14, -120(%rbp)                ## 8-byte Spill
	leaq	-104(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_pinconf_generic_parse_dt_config
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_19
## %bb.2:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ebx
	cmpl	$7, %ebx
	jbe	LBB0_16
## %bb.3:
	movl	-44(%rbp), %eax
	movl	%ebx, %r14d
	sarl	$3, %r14d
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	setne	%al
	cmpl	$8, %ebx
	setge	%cl
	andb	%al, %cl
	movzbl	%cl, %r8d
	incl	%r8d
	imull	%r14d, %r8d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_pinctrl_utils_reserve_map
	xorl	%r15d, %r15d
	testl	%eax, %eax
	cmovsl	%eax, %r15d
	js	LBB0_18
## %bb.4:
	cmpl	$8, %ebx
	jl	LBB0_18
## %bb.5:
	cmpl	$2, %r14d
	movl	$1, %eax
	cmovgel	%r14d, %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	xorl	%r12d, %r12d
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	jmp	LBB0_8
LBB0_6:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	incl	%r12d
	cmpl	%r12d, -68(%rbp)                ## 4-byte Folded Reload
	movq	-112(%rbp), %r13                ## 8-byte Reload
	je	LBB0_25
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	leaq	-96(%rbp), %rcx
	callq	_of_property_read_u32_index
	testl	%eax, %eax
	jne	LBB0_21
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	-96(%rbp), %rdi
	callq	_MTK_GET_PIN_NO
	movq	%rax, %r14
	movq	-96(%rbp), %rdi
	callq	_MTK_GET_PIN_FUNC
	movq	%rax, %r15
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	movq	8(%rbx), %rax
	cmpq	(%rax), %r14
	jge	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_mtk_gpio_functions@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARRAY_SIZE
	cmpq	%rax, %r15
	jge	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_mtk_pctrl_find_group_by_pin
	testq	%rax, %rax
	je	LBB0_22
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %r13
	subq	$8, %rsp
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%rax, %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r9
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_mtk_pctrl_dt_node_to_map_func
	addq	$16, %rsp
	testl	%eax, %eax
	js	LBB0_21
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_7
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r13), %r8d
	movq	-104(%rbp), %r9
	movl	-44(%rbp), %r10d
	movq	_PIN_MAP_TYPE_CONFIGS_GROUP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	pushq	%rax
	pushq	%r10
	callq	_pinctrl_utils_add_map_configs
	addq	$16, %rsp
	testl	%eax, %eax
	jns	LBB0_7
LBB0_21:
	movl	%eax, %r15d
	jmp	LBB0_18
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_17:
	subl	(%rax), %r15d
LBB0_18:
	movq	-104(%rbp), %rdi
	callq	_kfree
LBB0_19:
	movl	%r15d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_23
LBB0_22:
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_23:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_25:
	xorl	%r15d, %r15d
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pinmux"

L_.str.1:                               ## @.str.1
	.asciz	"missing pins property in node %pOFn .\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mtk_gpio_functions,4,2         ## @mtk_gpio_functions
L_.str.2:                               ## @.str.2
	.asciz	"invalid pins value.\n"

L_.str.3:                               ## @.str.3
	.asciz	"unable to match pin %d to group\n"

	.comm	_PIN_MAP_TYPE_CONFIGS_GROUP,4,2 ## @PIN_MAP_TYPE_CONFIGS_GROUP
	.no_dead_strip	_mtk_pctrl_dt_subnode_to_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pctrl_dt_subnode_to_map
_mtk_pctrl_dt_subnode_to_map:           ; @mtk_pctrl_dt_subnode_to_map
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x23, x0
	bl	_pinctrl_dev_get_drvdata
	mov	x24, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, #0
	bl	_of_find_property
	cbz	x0, LBB0_6
; %bb.1:
	mov	x25, x0
	add	x2, sp, #32
	add	x3, sp, #44
	mov	x0, x19
	mov	x1, x23
	bl	_pinconf_generic_parse_dt_config
	mov	x27, x0
	cbnz	w0, LBB0_21
; %bb.2:
	ldr	w25, [x25]
	cmp	w25, #7
	b.ls	LBB0_19
; %bb.3:
	ldr	w8, [sp, #44]
	asr	w26, w25, #3
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	ccmp	w8, #0, #4, gt
	mov	w8, #1
	cinc	w8, w8, ne
	mul	w4, w8, w26
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_pinctrl_utils_reserve_map
	cmp	w0, #0
	csel	w27, w0, wzr, lt
	tbnz	w0, #31, LBB0_20
; %bb.4:
	cmp	w25, #8
	b.lt	LBB0_20
; %bb.5:
	mov	w25, #0
	cmp	w26, #1
	csinc	w8, w26, wzr, gt
	str	w8, [sp, #16]                   ; 4-byte Folded Spill
	b	LBB0_8
LBB0_6:
	ldr	w0, [x24]
	str	x19, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_21
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w25, w25, #1
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	cmp	w8, w25
	b.eq	LBB0_22
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #24
	mov	x0, x19
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x25
	bl	_of_property_read_u32_index
	cbnz	w0, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [sp, #24]
	bl	_MTK_GET_PIN_NO
	mov	x27, x0
	ldr	x0, [sp, #24]
	bl	_MTK_GET_PIN_FUNC
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
	cmp	x27, x8
	b.ge	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x28, x0
Lloh9:
	adrp	x8, _mtk_gpio_functions@GOTPAGE
Lloh10:
	ldr	x8, [x8, _mtk_gpio_functions@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_ARRAY_SIZE
	cmp	x28, x0
	b.ge	LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x24
	mov	x1, x27
	bl	_mtk_pctrl_find_group_by_pin
	cbz	x0, LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x26, x0
	mov	x0, x24
	mov	x1, x27
	mov	x2, x28
	mov	x3, x26
	mov	x4, x22
	mov	x5, x21
	mov	x6, x20
	bl	_mtk_pctrl_dt_node_to_map_func
	tbnz	w0, #31, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_7
; %bb.14:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w4, [x26]
	ldr	x5, [sp, #32]
	ldr	w6, [sp, #44]
Lloh12:
	adrp	x8, _PIN_MAP_TYPE_CONFIGS_GROUP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PIN_MAP_TYPE_CONFIGS_GROUP@GOTPAGEOFF]
Lloh14:
	ldr	w7, [x8]
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_pinctrl_utils_add_map_configs
	tbz	w0, #31, LBB0_7
LBB0_15:
	mov	x27, x0
	b	LBB0_20
LBB0_16:
	ldr	w0, [x24]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_17:
	ldr	w0, [x24]
	str	x27, [sp]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_18:
	bl	_dev_err
LBB0_19:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_20:
	ldr	x0, [sp, #32]
	bl	_kfree
LBB0_21:
	mov	x0, x27
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_22:
	mov	w27, #0
	b	LBB0_20
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pinmux"

l_.str.1:                               ; @.str.1
	.asciz	"missing pins property in node %pOFn .\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mtk_gpio_functions,4,2         ; @mtk_gpio_functions
l_.str.2:                               ; @.str.2
	.asciz	"invalid pins value.\n"

l_.str.3:                               ; @.str.3
	.asciz	"unable to match pin %d to group\n"

	.comm	_PIN_MAP_TYPE_CONFIGS_GROUP,4,2 ; @PIN_MAP_TYPE_CONFIGS_GROUP
	.no_dead_strip	_mtk_pctrl_dt_subnode_to_map
.subsections_via_symbols
