	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function giu_set_direction
_giu_set_direction:                     ## @giu_set_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	%esi, (%rdi)
	jbe	LBB0_1
## %bb.3:
	movl	%edx, %r14d
	cmpl	$15, %esi
	ja	LBB0_5
## %bb.4:
	movl	$1, %ebx
	movl	%esi, %ecx
	shll	%cl, %ebx
	movq	_GIUIOSELL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	cmpl	$31, %esi
	ja	LBB0_7
## %bb.6:
	addb	$-16, %sil
	movl	$1, %ebx
	movl	%esi, %ecx
	shll	%cl, %ebx
	movq	_GIUIOSELH@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_giu_flags@GOTPCREL(%rip), %rax
	movq	_GPIO_HAS_OUTPUT_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_10
## %bb.8:
	movl	$1, %ebx
	movl	%esi, %ecx
	shll	%cl, %ebx
	movq	_GIUPODATEN@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_10:
	cmpl	$49, %esi
	je	LBB0_14
## %bb.11:
	cmpl	$48, %esi
	jne	LBB0_1
## %bb.12:
	movq	_PIOEN0@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_2
LBB0_14:
	movq	_PIOEN1@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %ebx
	movq	_GIUPODATH@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %r15d
	movq	_giu_lock@GOTPCREL(%rip), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movl	%r15d, %edi
	callq	_giu_read
	movq	_GPIO_OUTPUT@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	orl	%ebx, %edx
	notl	%ebx
	andl	%eax, %ebx
	cmpl	%r14d, (%rcx)
	cmovel	%edx, %ebx
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_giu_write
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GIUIOSELL,4,2                  ## @GIUIOSELL
	.comm	_GIUIOSELH,4,2                  ## @GIUIOSELH
	.comm	_giu_flags,4,2                  ## @giu_flags
	.comm	_GPIO_HAS_OUTPUT_ENABLE,4,2     ## @GPIO_HAS_OUTPUT_ENABLE
	.comm	_GIUPODATEN,4,2                 ## @GIUPODATEN
	.comm	_GIUPODATH,4,2                  ## @GIUPODATH
	.comm	_PIOEN0,4,2                     ## @PIOEN0
	.comm	_PIOEN1,4,2                     ## @PIOEN1
	.comm	_giu_lock,4,2                   ## @giu_lock
	.comm	_GPIO_OUTPUT,4,2                ## @GPIO_OUTPUT
	.no_dead_strip	_giu_set_direction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function giu_set_direction
_giu_set_direction:                     ; @giu_set_direction
	.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
	ldr	w8, [x0]
	cmp	w8, w1
	b.ls	LBB0_10
; %bb.1:
	mov	x19, x2
	cmp	w1, #15
	b.hi	LBB0_3
; %bb.2:
	mov	w8, #1
	lsl	w22, w8, w1
Lloh0:
	adrp	x8, _GIUIOSELL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GIUIOSELL@GOTPAGEOFF]
	b	LBB0_13
LBB0_3:
	cmp	w1, #31
	b.hi	LBB0_5
; %bb.4:
	sub	w8, w1, #16
	mov	w9, #1
	lsl	w22, w9, w8
Lloh2:
	adrp	x8, _GIUIOSELH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GIUIOSELH@GOTPAGEOFF]
	b	LBB0_13
LBB0_5:
Lloh4:
	adrp	x8, _giu_flags@GOTPAGE
Lloh5:
	ldr	x8, [x8, _giu_flags@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _GPIO_HAS_OUTPUT_ENABLE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _GPIO_HAS_OUTPUT_ENABLE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	w8, #1
	lsl	w22, w8, w1
Lloh10:
	adrp	x8, _GIUPODATEN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GIUPODATEN@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
	cmp	w1, #49
	b.eq	LBB0_11
; %bb.8:
	cmp	w1, #48
	b.ne	LBB0_10
; %bb.9:
Lloh12:
	adrp	x8, _PIOEN0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PIOEN0@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_11:
Lloh17:
	adrp	x8, _PIOEN1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PIOEN1@GOTPAGEOFF]
LBB0_12:
	ldr	w22, [x8]
Lloh19:
	adrp	x8, _GIUPODATH@GOTPAGE
Lloh20:
	ldr	x8, [x8, _GIUPODATH@GOTPAGEOFF]
LBB0_13:
	ldr	w20, [x8]
Lloh21:
	adrp	x21, _giu_lock@GOTPAGE
Lloh22:
	ldr	x21, [x21, _giu_lock@GOTPAGEOFF]
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_giu_read
Lloh23:
	adrp	x8, _GPIO_OUTPUT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GPIO_OUTPUT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	orr	w9, w0, w22
	bic	w10, w0, w22
	cmp	w8, w19
	csel	w1, w9, w10, eq
	mov	x0, x20
	bl	_giu_write
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_14:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GIUIOSELL,4,2                  ; @GIUIOSELL
	.comm	_GIUIOSELH,4,2                  ; @GIUIOSELH
	.comm	_giu_flags,4,2                  ; @giu_flags
	.comm	_GPIO_HAS_OUTPUT_ENABLE,4,2     ; @GPIO_HAS_OUTPUT_ENABLE
	.comm	_GIUPODATEN,4,2                 ; @GIUPODATEN
	.comm	_GIUPODATH,4,2                  ; @GIUPODATH
	.comm	_PIOEN0,4,2                     ; @PIOEN0
	.comm	_PIOEN1,4,2                     ; @PIOEN1
	.comm	_giu_lock,4,2                   ; @giu_lock
	.comm	_GPIO_OUTPUT,4,2                ; @GPIO_OUTPUT
	.no_dead_strip	_giu_set_direction
.subsections_via_symbols
