	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx25821_set_gpiopin_direction  ## -- Begin function cx25821_set_gpiopin_direction
	.p2align	4, 0x90
_cx25821_set_gpiopin_direction:         ## @cx25821_set_gpiopin_direction
	.cfi_startproc
## %bb.0:
                                        ## kill: def $esi killed $esi def $rsi
	cmpl	$46, %esi
	jle	LBB0_1
## %bb.5:
	retq
LBB0_1:
	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
	movl	%edx, %r15d
	leal	-31(%rsi), %ebx
	cmpl	$32, %esi
	cmovll	%esi, %ebx
	movq	_GPIO_LO_OE@GOTPCREL(%rip), %rax
	cmovgeq	_GPIO_HI_OE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r14d, %edi
	callq	_cx_read
	movl	%eax, %r12d
	movl	%ebx, %edi
	cmpl	$1, %r15d
	jne	LBB0_3
## %bb.2:
	callq	_Set_GPIO_Bit
	orl	%r12d, %eax
	jmp	LBB0_4
LBB0_3:
	callq	_Clear_GPIO_Bit
	andl	%r12d, %eax
LBB0_4:
	movl	%r14d, %edi
	movl	%eax, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cx_write                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GPIO_LO_OE,4,2                 ## @GPIO_LO_OE
	.comm	_GPIO_HI_OE,4,2                 ## @GPIO_HI_OE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx25821_set_gpiopin_direction  ; -- Begin function cx25821_set_gpiopin_direction
	.p2align	2
_cx25821_set_gpiopin_direction:         ; @cx25821_set_gpiopin_direction
	.cfi_startproc
; %bb.0:
	cmp	w1, #46
	b.le	LBB0_2
; %bb.1:
	ret
LBB0_2:
	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	x21, x2
	subs	w8, w1, #31
	csel	w20, w8, w1, gt
Lloh0:
	adrp	x8, _GPIO_HI_OE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GPIO_HI_OE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _GPIO_LO_OE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GPIO_LO_OE@GOTPAGEOFF]
	csel	x8, x8, x9, gt
	ldr	w19, [x8]
	mov	x0, x19
	bl	_cx_read
	mov	x22, x0
	mov	x0, x20
	cmp	w21, #1
	b.ne	LBB0_4
; %bb.3:
	bl	_Set_GPIO_Bit
	orr	w1, w0, w22
	b	LBB0_5
LBB0_4:
	bl	_Clear_GPIO_Bit
	and	w1, w0, w22
LBB0_5:
	mov	x0, x19
	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	_cx_write
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_GPIO_LO_OE,4,2                 ; @GPIO_LO_OE
	.comm	_GPIO_HI_OE,4,2                 ; @GPIO_HI_OE
.subsections_via_symbols
