	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ingenic_pinmux_set_mux
_ingenic_pinmux_set_mux:                ## @ingenic_pinmux_set_mux
	.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
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_pinctrl_dev_get_drvdata
	movq	%rax, %r14
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_pinmux_generic_get_function
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_pinctrl_generic_get_group
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r13
	movl	(%r15), %edi
	movl	(%r12), %edx
	movl	24(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	cmpl	$0, (%r13)
	je	LBB0_4
## %bb.5:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movl	(%rcx,%rbx,4), %esi
	movl	(%rax,%rbx,4), %edx
	movq	%r14, %rdi
	callq	_ingenic_pinmux_set_pin_fn
	incq	%rbx
	movl	(%r13), %eax
	cmpq	%rax, %rbx
	jb	LBB0_6
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_7
LBB0_4:
	xorl	%r15d, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"enable function %s group %s\n"

	.no_dead_strip	_ingenic_pinmux_set_mux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ingenic_pinmux_set_mux
_ingenic_pinmux_set_mux:                ; @ingenic_pinmux_set_mux
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x2
	mov	x22, x1
	mov	x21, x0
	bl	_pinctrl_dev_get_drvdata
	mov	x19, x0
	mov	x0, x21
	mov	x1, x22
	bl	_pinmux_generic_get_function
	cbz	x0, LBB0_6
; %bb.1:
	mov	x22, x0
	mov	x0, x21
	mov	x1, x20
	bl	_pinctrl_generic_get_group
	cbz	x0, LBB0_6
; %bb.2:
	mov	x20, x0
	ldr	w0, [x21]
	ldr	w2, [x22]
	ldr	w3, [x20, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x20]
	cbz	w8, LBB0_5
; %bb.3:
	mov	x21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x8, x9, [x20, #8]
	lsl	x10, x21, #2
	ldr	w1, [x9, x10]
	ldr	w2, [x8, x10]
	mov	x0, x19
	bl	_ingenic_pinmux_set_pin_fn
	add	x21, x21, #1
	ldr	w8, [x20]
	cmp	x21, x8
	b.lo	LBB0_4
LBB0_5:
	mov	w0, #0
	b	LBB0_7
LBB0_6:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enable function %s group %s\n"

	.no_dead_strip	_ingenic_pinmux_set_mux
.subsections_via_symbols
