	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rpi_exp_gpio_dir_in
_rpi_exp_gpio_dir_in:                   ## @rpi_exp_gpio_dir_in
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	callq	_gpiochip_get_data
	movq	%rax, %rbx
	movq	_RPI_EXP_GPIO_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	movl	%eax, -64(%rbp)
	movq	_RPI_EXP_GPIO_DIR_IN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -56(%rbp)
	movq	$0, -40(%rbp)
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_rpi_exp_gpio_get_polarity
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movl	%eax, -60(%rbp)
	movl	(%rbx), %edi
	movq	_RPI_FIRMWARE_SET_GPIO_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movl	$40, %ecx
	callq	_rpi_firmware_property
	movl	%eax, %ebx
	movl	-64(%rbp), %r8d
	xorl	%eax, %eax
	movl	%ebx, %ecx
	orl	%r8d, %ecx
	je	LBB0_3
## %bb.2:
	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
LBB0_3:
	addq	$40, %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_EXP_GPIO_DIR_IN,4,2        ## @RPI_EXP_GPIO_DIR_IN
	.comm	_RPI_FIRMWARE_SET_GPIO_CONFIG,4,2 ## @RPI_FIRMWARE_SET_GPIO_CONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set GPIO %u to input (%d %x)\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_rpi_exp_gpio_dir_in
.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_dir_in
_rpi_exp_gpio_dir_in:                   ; @rpi_exp_gpio_dir_in
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x0
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
Lloh3:
	adrp	x9, _RPI_EXP_GPIO_DIR_IN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RPI_EXP_GPIO_DIR_IN@GOTPAGEOFF]
	str	w8, [sp, #8]
Lloh5:
	ldr	w8, [x9]
	str	w8, [sp, #40]
	stp	xzr, xzr, [sp, #24]
	str	xzr, [sp, #16]
	mov	x0, x20
	mov	x1, x19
	bl	_rpi_exp_gpio_get_polarity
	tbnz	w0, #31, LBB0_4
; %bb.1:
	str	w0, [sp, #12]
	ldr	w0, [x21]
Lloh6:
	adrp	x8, _RPI_FIRMWARE_SET_GPIO_CONFIG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RPI_FIRMWARE_SET_GPIO_CONFIG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	w3, #40
	bl	_rpi_firmware_property
	ldr	w4, [sp, #8]
	orr	w8, w0, w4
	cbz	w8, LBB0_3
; %bb.2:
	mov	x21, x0
	ldr	w0, [x20]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x21
	bl	_dev_err
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w0, w21, w8, ne
	b	LBB0_4
LBB0_3:
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RPI_EXP_GPIO_BASE,4,2          ; @RPI_EXP_GPIO_BASE
	.comm	_RPI_EXP_GPIO_DIR_IN,4,2        ; @RPI_EXP_GPIO_DIR_IN
	.comm	_RPI_FIRMWARE_SET_GPIO_CONFIG,4,2 ; @RPI_FIRMWARE_SET_GPIO_CONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set GPIO %u to input (%d %x)\n"

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