	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pistachio_pinmux_enable
_pistachio_pinmux_enable:               ## @pistachio_pinmux_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r12d
	callq	_pinctrl_dev_get_drvdata
	movq	%rax, %r14
	movq	16(%rax), %rbx
	movl	%r15d, %r13d
	shlq	$5, %r13
	cmpq	$0, (%rbx,%r13)
	jle	LBB0_16
## %bb.1:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%r13), %r14
	addq	$8, %r14
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx,%r13), %rdi
	callq	_ARRAY_SIZE
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	cmpl	%r12d, (%rdi,%rbx,4)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %rbx
	jb	LBB0_2
LBB0_4:
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jne	LBB0_6
## %bb.5:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	callq	_dev_err
	jmp	LBB0_14
LBB0_6:
	movl	%r12d, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r12,%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rsi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_pctl_readl
	movl	16(%r12,%r13), %edx
	movb	20(%r12,%r13), %cl
	shll	%cl, %edx
	shll	%cl, %ebx
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r12, %rbx
	callq	_pctl_writel
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	shlq	$5, %rdx
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12,%rdx), %rcx
	testq	%rcx, %rcx
	je	LBB0_16
## %bb.7:
	movl	8(%r12,%rdx), %eax
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%r15d, (%rcx,%rbx,4)
	je	LBB0_19
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_10
## %bb.12:
	movq	%rdx, %r15
	movl	%eax, %ebx
	jmp	LBB0_13
LBB0_8:
	movq	%rdx, %r15
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_19:
	movq	%rdx, %r15
LBB0_13:
	xorl	%edi, %edi
	cmpl	%eax, %ebx
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_15
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_15:
	movq	16(%r12,%r15), %rsi
	movq	%r14, %rdi
	callq	_pctl_readl
	movl	24(%r12,%r15), %edx
	movb	28(%r12,%r15), %cl
	shll	%cl, %edx
	shll	%cl, %ebx
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %ebx
	movq	16(%r12,%r15), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pctl_writel
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_16:
	movl	(%r14), %edi
	movq	24(%rbx,%r13), %rsi
	callq	_pinctrl_find_gpio_range_from_pin
	movq	%rax, %r14
	movq	%rbx, %rax
	xorl	%ebx, %ebx
	testq	%r14, %r14
	je	LBB0_18
## %bb.17:
	leaq	(%rax,%r13), %r15
	addq	$24, %r15
	movl	8(%r14), %edi
	callq	_gpiochip_get_data
	movq	(%r15), %rsi
	subq	(%r14), %rsi
	movl	%eax, %edi
	callq	_gpio_disable
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot mux pin %u to function %u\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_pistachio_pinmux_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pistachio_pinmux_enable
_pistachio_pinmux_enable:               ; @pistachio_pinmux_enable
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x21, x1
	bl	_pinctrl_dev_get_drvdata
	mov	x19, x0
	ldr	x24, [x0, #16]
	mov	w25, w20
	add	x22, x24, x25, lsl #5
	ldr	x8, [x22]
	cmp	x8, #1
	b.lt	LBB0_18
; %bb.1:
	ldr	x23, [x19, #8]
	mov	x27, x22
	ldr	x0, [x27, #8]!
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_5
; %bb.2:
	mov	x26, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x27]
	ldr	w8, [x0, x26, lsl #2]
	cmp	w8, w21
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x26, x26, #1
	bl	_ARRAY_SIZE
	cmp	x26, w0, uxtw
	b.lo	LBB0_3
	b	LBB0_6
LBB0_5:
	mov	w26, #0
LBB0_6:
	ldr	x0, [x27]
	bl	_ARRAY_SIZE
	cmp	w26, w0
	b.ne	LBB0_8
; %bb.7:
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	bl	_dev_err
	b	LBB0_16
LBB0_8:
	mov	w21, w21
	ldr	x1, [x22]
	mov	x0, x19
	bl	_pctl_readl
	add	x8, x24, x25, lsl #5
	ldp	w9, w8, [x8, #16]
	lsl	w9, w9, w8
	bic	w9, w0, w9
	lsl	w8, w26, w8
	orr	w1, w9, w8
	ldr	x2, [x22]
	mov	x0, x19
	bl	_pctl_writel
	lsl	x8, x21, #5
	ldr	x9, [x23, x8]
	cbz	x9, LBB0_18
; %bb.9:
	add	x8, x23, x21, lsl #5
	ldr	w8, [x8, #8]
	cbz	w8, LBB0_14
; %bb.10:
	mov	x24, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9, x24, lsl #2]
	cmp	w10, w20
	b.eq	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x24, x24, #1
	cmp	x8, x24
	b.ne	LBB0_11
; %bb.13:
	mov	x24, x8
	b	LBB0_15
LBB0_14:
	mov	w24, #0
LBB0_15:
	cmp	w24, w8
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_17
LBB0_16:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_20
LBB0_17:
	add	x20, x23, x21, lsl #5
	ldr	x1, [x20, #16]
	mov	x0, x19
	bl	_pctl_readl
	ldp	w8, w9, [x20, #24]
	lsl	w8, w8, w9
	bic	w8, w0, w8
	lsl	w9, w24, w9
	orr	w1, w8, w9
	ldr	x2, [x20, #16]
	mov	x0, x19
	bl	_pctl_writel
LBB0_18:
	ldr	w0, [x19]
	ldr	x1, [x22, #24]!
	bl	_pinctrl_find_gpio_range_from_pin
	cbz	x0, LBB0_20
; %bb.19:
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_gpiochip_get_data
	ldr	x8, [x22]
	ldr	x9, [x19]
	sub	x1, x8, x9
	bl	_gpio_disable
	mov	w0, #0
LBB0_20:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot mux pin %u to function %u\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_pistachio_pinmux_enable
.subsections_via_symbols
