	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pmx_gpio_set_direction
_mtk_pmx_gpio_set_direction:            ## @mtk_pmx_gpio_set_direction
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r14d
	callq	_pinctrl_dev_get_drvdata
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_mtk_get_port
	movq	(%rbx), %rcx
	addl	(%rcx), %eax
	movl	%eax, -36(%rbp)
	movl	%r14d, %edi
	andl	$15, %edi
	callq	_BIT
	movl	%eax, %r15d
	movq	(%rbx), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	-36(%rbp), %rdi
	movl	%r14d, %esi
	callq	*%rax
LBB0_2:
	movl	-36(%rbp), %edi
	movq	%rbx, %rsi
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.3:
	callq	_CLR_ADDR
	jmp	LBB0_5
LBB0_4:
	callq	_SET_ADDR
LBB0_5:
	movl	%eax, -36(%rbp)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mtk_get_regmap
	movl	-36(%rbp), %esi
	movl	%eax, %edi
	movl	%r15d, %edx
	callq	_regmap_write
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mtk_pmx_gpio_set_direction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pmx_gpio_set_direction
_mtk_pmx_gpio_set_direction:            ; @mtk_pmx_gpio_set_direction
	.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	x22, x3
	mov	x19, x2
	bl	_pinctrl_dev_get_drvdata
	mov	x20, x0
	mov	x1, x19
	bl	_mtk_get_port
	ldr	x8, [x20]
	ldr	w8, [x8]
	add	w8, w8, w0
	str	w8, [sp, #12]
	and	w0, w19, #0xf
	bl	_BIT
	mov	x21, x0
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, sp, #12
	mov	x1, x19
	blr	x8
LBB0_2:
	ldr	w0, [sp, #12]
	mov	x1, x20
	cbz	w22, LBB0_4
; %bb.3:
	bl	_CLR_ADDR
	b	LBB0_5
LBB0_4:
	bl	_SET_ADDR
LBB0_5:
	str	w0, [sp, #12]
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_get_regmap
	ldr	w1, [sp, #12]
	mov	x2, x21
	bl	_regmap_write
	mov	w0, #0
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_mtk_pmx_gpio_set_direction
.subsections_via_symbols
