	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rza2_chip_get_direction
_rza2_chip_get_direction:               ## @rza2_chip_get_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	%esi, %r15d
	callq	_gpiochip_get_data
	movq	%rax, %r14
	movl	%r15d, %edi
	callq	_RZA2_PIN_ID_TO_PORT
	movl	%eax, %r12d
	movl	%r15d, %edi
	callq	_RZA2_PIN_ID_TO_PIN
	movl	%eax, %r13d
	movq	(%r14), %rbx
	movl	%r12d, %edi
	callq	_RZA2_PDR
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_readw
	addl	%r13d, %r13d
	movl	%r13d, %ecx
	sarl	%cl, %eax
	movq	_RZA2_PDR_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_RZA2_PDR_OUTPUT@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.1:
	movq	_RZA2_PDR_INPUT@GOTPCREL(%rip), %rcx
	movl	$1, %ebx
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.2:
	movq	(%r14), %rdi
	movl	$1, %ebx
	movl	%r15d, %esi
	movl	$1, %edx
	callq	_rza2_pin_to_gpio
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RZA2_PDR_MASK,4,2              ## @RZA2_PDR_MASK
	.comm	_RZA2_PDR_OUTPUT,4,2            ## @RZA2_PDR_OUTPUT
	.comm	_RZA2_PDR_INPUT,4,2             ## @RZA2_PDR_INPUT
	.no_dead_strip	_rza2_chip_get_direction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rza2_chip_get_direction
_rza2_chip_get_direction:               ; @rza2_chip_get_direction
	.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	x19, x1
	bl	_gpiochip_get_data
	mov	x20, x0
	mov	x0, x19
	bl	_RZA2_PIN_ID_TO_PORT
	mov	x21, x0
	mov	x0, x19
	bl	_RZA2_PIN_ID_TO_PIN
	mov	x22, x0
	ldr	x23, [x20]
	mov	x0, x21
	bl	_RZA2_PDR
	add	x0, x0, x23
	bl	_readw
	lsl	w8, w22, #1
	asr	w8, w0, w8
Lloh0:
	adrp	x9, _RZA2_PDR_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RZA2_PDR_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w8, w9
Lloh3:
	adrp	x9, _RZA2_PDR_OUTPUT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RZA2_PDR_OUTPUT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x9, _RZA2_PDR_INPUT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RZA2_PDR_INPUT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	mov	w20, #1
	b	LBB0_5
LBB0_4:
	ldr	x0, [x20]
	mov	w20, #1
	mov	x1, x19
	mov	w2, #1
	bl	_rza2_pin_to_gpio
LBB0_5:
	mov	x0, x20
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_RZA2_PDR_MASK,4,2              ; @RZA2_PDR_MASK
	.comm	_RZA2_PDR_OUTPUT,4,2            ; @RZA2_PDR_OUTPUT
	.comm	_RZA2_PDR_INPUT,4,2             ; @RZA2_PDR_INPUT
	.no_dead_strip	_rza2_chip_get_direction
.subsections_via_symbols
