	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_pfc_gpio_set_direction
_sh_pfc_gpio_set_direction:             ## @sh_pfc_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	%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	%ecx, %r15d
	movl	%edx, %r12d
	callq	_pinctrl_dev_get_drvdata
	movq	(%rax), %rbx
	testl	%r15d, %r15d
	jne	LBB0_1
## %bb.2:
	movq	_PINMUX_TYPE_OUTPUT@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_PINMUX_TYPE_INPUT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_sh_pfc_get_pin_index
	movq	8(%rbx), %rcx
	movq	(%rcx), %r12
	movslq	%eax, %r13
	movl	(%r12,%r13,8), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:
	testl	%r15d, %r15d
	jne	LBB0_5
## %bb.6:
	movq	_SH_PFC_PIN_CFG_OUTPUT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
LBB0_10:
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movl	4(%r12,%r13,8), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_sh_pfc_config_mux
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r14d, %eax
	jmp	LBB0_9
LBB0_5:
	movq	_SH_PFC_PIN_CFG_INPUT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PINMUX_TYPE_INPUT,4,2          ## @PINMUX_TYPE_INPUT
	.comm	_PINMUX_TYPE_OUTPUT,4,2         ## @PINMUX_TYPE_OUTPUT
	.comm	_SH_PFC_PIN_CFG_INPUT,4,2       ## @SH_PFC_PIN_CFG_INPUT
	.comm	_SH_PFC_PIN_CFG_OUTPUT,4,2      ## @SH_PFC_PIN_CFG_OUTPUT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sh_pfc_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 sh_pfc_gpio_set_direction
_sh_pfc_gpio_set_direction:             ; @sh_pfc_gpio_set_direction
	.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	x21, x3
	mov	x22, x2
	bl	_pinctrl_dev_get_drvdata
Lloh0:
	adrp	x8, _PINMUX_TYPE_INPUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PINMUX_TYPE_INPUT@GOTPAGEOFF]
	ldr	x19, [x0]
Lloh2:
	adrp	x9, _PINMUX_TYPE_OUTPUT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PINMUX_TYPE_OUTPUT@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x9, x8, eq
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_sh_pfc_get_pin_index
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x19, #8]
	ldr	x22, [x8]
	sbfiz	x8, x0, #3, #32
	ldr	w8, [x22, x8]
	cbz	w8, LBB0_2
; %bb.1:
Lloh4:
	adrp	x9, _SH_PFC_PIN_CFG_INPUT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SH_PFC_PIN_CFG_INPUT@GOTPAGEOFF]
Lloh6:
	adrp	x10, _SH_PFC_PIN_CFG_OUTPUT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SH_PFC_PIN_CFG_OUTPUT@GOTPAGEOFF]
	cmp	w21, #0
	csel	x9, x10, x9, eq
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_2:
	sxtw	x21, w0
	mov	x0, x19
	bl	_spin_lock_irqsave
	add	x8, x22, x21, lsl #3
	ldr	w1, [x8, #4]
	mov	x0, x19
	mov	x2, x20
	bl	_sh_pfc_config_mux
	mov	x20, x0
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PINMUX_TYPE_INPUT,4,2          ; @PINMUX_TYPE_INPUT
	.comm	_PINMUX_TYPE_OUTPUT,4,2         ; @PINMUX_TYPE_OUTPUT
	.comm	_SH_PFC_PIN_CFG_INPUT,4,2       ; @SH_PFC_PIN_CFG_INPUT
	.comm	_SH_PFC_PIN_CFG_OUTPUT,4,2      ; @SH_PFC_PIN_CFG_OUTPUT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sh_pfc_gpio_set_direction
.subsections_via_symbols
