	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adnp_gpio_direction_output
_adnp_gpio_direction_output:            ## @adnp_gpio_direction_output
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	%esi, %ebx
	callq	_gpiochip_get_data
	movq	%rax, %r13
	movb	(%rax), %cl
	movl	%ebx, %r12d
	movl	%ebx, %r14d
	shrq	%cl, %r14
	leaq	4(%rax), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_GPIO_DDR
	leaq	(%rax,%r14), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_adnp_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, %ebx
	andl	$7, %r12d
	movl	%r12d, %edi
	callq	_BIT
	orl	%eax, -44(%rbp)
	movq	%r13, %rdi
	callq	_GPIO_DDR
	leaq	(%rax,%r14), %rsi
	movl	-44(%rbp), %edx
	movq	%r13, %rdi
	callq	_adnp_write
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r13, %rdi
	callq	_GPIO_DDR
	addq	%rax, %r14
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_adnp_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movl	%ebx, %r14d
	movl	-44(%rbp), %ebx
	movl	%r12d, %edi
	callq	_BIT
	testl	%ebx, %eax
	je	LBB0_6
## %bb.7:
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	___adnp_gpio_set
	xorl	%r15d, %r15d
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %r15d
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %r15d
	jmp	LBB0_9
LBB0_6:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_9:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EPERM,4,2                      ## @EPERM
	.no_dead_strip	_adnp_gpio_direction_output
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adnp_gpio_direction_output
_adnp_gpio_direction_output:            ; @adnp_gpio_direction_output
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	bl	_gpiochip_get_data
	mov	x22, x0
	mov	x19, x0
	ldr	w8, [x19], #4
	mov	w9, w21
	lsr	x25, x9, x8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x22
	bl	_GPIO_DDR
	add	x1, x0, x25
	add	x2, sp, #12
	mov	x0, x22
	bl	_adnp_read
	tbnz	w0, #31, LBB0_5
; %bb.1:
	and	w23, w21, #0x7
	mov	x0, x23
	bl	_BIT
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
	mov	x0, x22
	bl	_GPIO_DDR
	add	x1, x0, x25
	ldr	w2, [sp, #12]
	mov	x0, x22
	bl	_adnp_write
	tbnz	w0, #31, LBB0_5
; %bb.2:
	mov	x0, x22
	bl	_GPIO_DDR
	add	x1, x0, x25
	add	x2, sp, #12
	mov	x0, x22
	bl	_adnp_read
	tbnz	w0, #31, LBB0_5
; %bb.3:
	ldr	w24, [sp, #12]
	mov	x0, x23
	bl	_BIT
	tst	w0, w24
	b.eq	LBB0_7
; %bb.4:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	___adnp_gpio_set
	mov	w24, #0
	b	LBB0_6
LBB0_5:
	mov	x24, x0
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x24
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
Lloh0:
	adrp	x8, _EPERM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EPERM,4,2                      ; @EPERM
	.no_dead_strip	_adnp_gpio_direction_output
.subsections_via_symbols
