	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pmx_set_mode
_mtk_pmx_set_mode:                      ## @mtk_pmx_set_mode
	.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
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	_GPIO_MODE_BITS@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	callq	_pinctrl_dev_get_drvdata
	movq	%rax, %r15
	movq	(%rax), %rsi
	movq	16(%rsi), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mtk_get_regmap
	movl	%eax, %edi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	*%rbx
	movq	(%r15), %rsi
LBB0_2:
	movq	$-1, %rbx
	movl	%r13d, %ecx
	shlq	%cl, %rbx
	notl	%ebx
	movq	_MAX_GPIO_MODE_PER_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_3
## %bb.4:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r13
	jmp	LBB0_5
LBB0_3:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	movl	%eax, %r13d
LBB0_5:
	movb	(%rsi), %cl
	shlq	%cl, %r13
	addl	8(%rsi), %r13d
	movq	_GPIO_MODE_BITS@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	andl	%ebx, %r12d
	movl	%edx, %ecx
	shll	%cl, %ebx
	shlq	%cl, %r12
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mtk_get_regmap
	movl	%eax, %edi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_update_bits             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GPIO_MODE_BITS,8,3             ## @GPIO_MODE_BITS
	.comm	_MAX_GPIO_MODE_PER_REG,8,3      ## @MAX_GPIO_MODE_PER_REG
	.no_dead_strip	_mtk_pmx_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pmx_set_mode
_mtk_pmx_set_mode:                      ; @mtk_pmx_set_mode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x19, x1
Lloh0:
	adrp	x23, _GPIO_MODE_BITS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GPIO_MODE_BITS@GOTPAGEOFF]
	ldr	x22, [x23]
	bl	_pinctrl_dev_get_drvdata
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x24, [x8, #16]
	cbz	x24, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_get_regmap
	mov	x1, x19
	mov	x2, x21
	blr	x24
	ldr	x8, [x20]
LBB0_2:
	mov	x9, #-1
	lsl	x9, x9, x22
	mvn	w9, w9
Lloh2:
	adrp	x10, _MAX_GPIO_MODE_PER_REG@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MAX_GPIO_MODE_PER_REG@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	udiv	x11, x19, x10
	ldr	x12, [x8]
	lsl	x12, x11, x12
	ldr	w8, [x8, #8]
	add	w22, w12, w8
	and	x8, x9, x21
	msub	w10, w11, w10, w19
	ldr	x11, [x23]
	and	x10, x10, #0xff
	mul	x10, x11, x10
	lsl	w21, w9, w10
	lsl	x23, x8, x10
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_get_regmap
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_regmap_update_bits
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_GPIO_MODE_BITS,8,3             ; @GPIO_MODE_BITS
	.comm	_MAX_GPIO_MODE_PER_REG,8,3      ; @MAX_GPIO_MODE_PER_REG
	.no_dead_strip	_mtk_pmx_set_mode
.subsections_via_symbols
