	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function direction_store
_direction_store:                       ## @direction_store
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %rbx
	callq	_dev_get_drvdata
	movq	%rax, %r12
	movq	8(%rax), %r15
	movq	%rax, %rdi
	callq	_mutex_lock
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_sysfs_streq
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movl	$1, %esi
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_sysfs_streq
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_sysfs_streq
	testq	%rax, %rax
	je	LBB0_8
LBB0_4:
	movq	%r15, %rdi
	xorl	%esi, %esi
LBB0_5:
	callq	_gpiod_direction_output_raw
LBB0_6:
	movl	%eax, %ebx
LBB0_7:
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	cmovnel	%ebx, %r14d
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_sysfs_streq
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_gpiod_direction_input
	jmp	LBB0_6
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"high"

L_.str.1:                               ## @.str.1
	.asciz	"out"

L_.str.2:                               ## @.str.2
	.asciz	"low"

L_.str.3:                               ## @.str.3
	.asciz	"in"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_direction_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function direction_store
_direction_store:                       ; @direction_store
	.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	x19, x3
	mov	x22, x2
	bl	_dev_get_drvdata
	mov	x20, x0
	ldr	x21, [x0, #8]
	bl	_mutex_lock
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_sysfs_streq
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	mov	w1, #1
	b	LBB0_5
LBB0_2:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_sysfs_streq
	cbnz	x0, LBB0_4
; %bb.3:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_sysfs_streq
	cbz	x0, LBB0_8
LBB0_4:
	mov	x0, x21
	mov	w1, #0
LBB0_5:
	bl	_gpiod_direction_output_raw
LBB0_6:
	mov	x21, x0
LBB0_7:
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w21, #0
	csel	w0, w19, w21, eq
	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
LBB0_8:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	bl	_sysfs_streq
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x21
	bl	_gpiod_direction_input
	b	LBB0_6
LBB0_10:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"high"

l_.str.1:                               ; @.str.1
	.asciz	"out"

l_.str.2:                               ; @.str.2
	.asciz	"low"

l_.str.3:                               ; @.str.3
	.asciz	"in"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_direction_store
.subsections_via_symbols
