	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rpi_exp_gpio_get_direction
_rpi_exp_gpio_get_direction:            ## @rpi_exp_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, %r14d
	movq	%rdi, %r15
	callq	_gpiochip_get_data
	movq	_RPI_EXP_GPIO_BASE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%r14d, %ecx
	movl	%ecx, -32(%rbp)
	movl	(%rax), %edi
	movq	_RPI_FIRMWARE_GET_GPIO_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movl	$8, %ecx
	callq	_rpi_firmware_property
	movl	%eax, %ebx
	movl	-32(%rbp), %r8d
	orl	%r8d, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	testl	%ebx, %ebx
	cmovnel	%ebx, %eax
	jmp	LBB0_3
LBB0_2:
	xorl	%eax, %eax
	cmpl	$0, -28(%rbp)
	sete	%al
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RPI_EXP_GPIO_BASE,4,2          ## @RPI_EXP_GPIO_BASE
	.comm	_RPI_FIRMWARE_GET_GPIO_CONFIG,4,2 ## @RPI_FIRMWARE_GET_GPIO_CONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get GPIO %u config (%d %x)\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_rpi_exp_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 rpi_exp_gpio_get_direction
_rpi_exp_gpio_get_direction:            ; @rpi_exp_gpio_get_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	x19, x1
	mov	x20, x0
	bl	_gpiochip_get_data
Lloh0:
	adrp	x8, _RPI_EXP_GPIO_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RPI_EXP_GPIO_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w8, w8, w19
	str	w8, [sp, #8]
	ldr	w0, [x0]
Lloh3:
	adrp	x8, _RPI_FIRMWARE_GET_GPIO_CONFIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RPI_FIRMWARE_GET_GPIO_CONFIG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	w3, #8
	bl	_rpi_firmware_property
	ldr	w4, [sp, #8]
	orr	w8, w0, w4
	cbz	w8, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	w0, [x20]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x21
	bl	_dev_err
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w0, w21, w8, ne
	b	LBB0_3
LBB0_2:
	ldr	w8, [sp, #12]
	cmp	w8, #0
	cset	w0, eq
LBB0_3:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_RPI_EXP_GPIO_BASE,4,2          ; @RPI_EXP_GPIO_BASE
	.comm	_RPI_FIRMWARE_GET_GPIO_CONFIG,4,2 ; @RPI_FIRMWARE_GET_GPIO_CONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get GPIO %u config (%d %x)\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_rpi_exp_gpio_get_direction
.subsections_via_symbols
