	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ingenic_gpio_get_direction
_ingenic_gpio_get_direction:            ## @ingenic_gpio_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_gpiochip_get_data
	movq	(%rax), %r14
	addl	(%rbx), %r15d
	movq	(%r14), %rax
	movq	_ID_JZ4760@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_4
## %bb.1:
	movq	_JZ4740_GPIO_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_ingenic_get_pin_config
	movl	%eax, %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	jne	LBB0_3
## %bb.2:
	movq	_JZ4740_GPIO_DIR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_ingenic_get_pin_config
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	sete	%al
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_JZ4760_GPIO_PAT1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ingenic_get_pin_config         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ID_JZ4760,8,3                  ## @ID_JZ4760
	.comm	_JZ4760_GPIO_PAT1,4,2           ## @JZ4760_GPIO_PAT1
	.comm	_JZ4740_GPIO_SELECT,4,2         ## @JZ4740_GPIO_SELECT
	.comm	_JZ4740_GPIO_DIR,4,2            ## @JZ4740_GPIO_DIR
	.no_dead_strip	_ingenic_gpio_get_direction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ingenic_gpio_get_direction
_ingenic_gpio_get_direction:            ; @ingenic_gpio_get_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	x20, x1
	mov	x21, x0
	bl	_gpiochip_get_data
	ldr	x19, [x0]
	ldr	w8, [x21]
	add	w20, w8, w20
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _ID_JZ4760@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ID_JZ4760@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _JZ4740_GPIO_SELECT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _JZ4740_GPIO_SELECT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ingenic_get_pin_config
	cbz	w0, LBB0_4
; %bb.2:
	mov	w0, #1
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _JZ4760_GPIO_PAT1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _JZ4760_GPIO_PAT1@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	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
	b	_ingenic_get_pin_config
LBB0_4:
Lloh9:
	adrp	x8, _JZ4740_GPIO_DIR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _JZ4740_GPIO_DIR@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ingenic_get_pin_config
	cmp	w0, #0
	cset	w0, eq
LBB0_5:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ID_JZ4760,8,3                  ; @ID_JZ4760
	.comm	_JZ4760_GPIO_PAT1,4,2           ; @JZ4760_GPIO_PAT1
	.comm	_JZ4740_GPIO_SELECT,4,2         ; @JZ4740_GPIO_SELECT
	.comm	_JZ4740_GPIO_DIR,4,2            ; @JZ4740_GPIO_DIR
	.no_dead_strip	_ingenic_gpio_get_direction
.subsections_via_symbols
