	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_aspeed_gpio_copro_release_gpio ## -- Begin function aspeed_gpio_copro_release_gpio
	.p2align	4, 0x90
_aspeed_gpio_copro_release_gpio:        ## @aspeed_gpio_copro_release_gpio
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_gpiod_to_chip
	movq	%rax, %rdi
	callq	_gpiochip_get_data
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_gpio_chip_hwgpio
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_to_bank
	cmpq	$0, (%r14)
	je	LBB0_1
## %bb.3:
	testl	%r15d, %r15d
	js	LBB0_5
## %bb.4:
	cmpl	12(%r14), %r15d
	jle	LBB0_6
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%rax, %r13
	shrl	$3, %r15d
	movq	%r14, %r12
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	(%r14), %rax
	movq	(%rax,%r15,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.8:
	xorl	%ebx, %ebx
	decq	%rcx
	movq	%rcx, (%rax,%r15,8)
	jne	LBB0_10
## %bb.9:
	movq	_GPIO_CMDSRC_ARM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_aspeed_gpio_change_cmd_source
	jmp	LBB0_10
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GPIO_CMDSRC_ARM,4,2            ## @GPIO_CMDSRC_ARM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_aspeed_gpio_copro_release_gpio ; -- Begin function aspeed_gpio_copro_release_gpio
	.p2align	2
_aspeed_gpio_copro_release_gpio:        ; @aspeed_gpio_copro_release_gpio
	.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	x20, x0
	bl	_gpiod_to_chip
	bl	_gpiochip_get_data
	mov	x19, x0
	mov	x0, x20
	bl	_gpio_chip_hwgpio
	mov	x20, x0
	bl	_to_bank
	ldr	x8, [x19]
	cbz	x8, LBB0_4
; %bb.1:
	tbnz	w20, #31, LBB0_3
; %bb.2:
	ldr	w8, [x19, #12]
	cmp	w20, w8
	b.le	LBB0_7
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _ENXIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_6:
	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
	ret
LBB0_7:
	mov	x21, x0
	lsr	w22, w20, #3
	add	x20, x19, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x19]
	ldr	x9, [x8, w22, uxtw #3]
	cbz	x9, LBB0_11
; %bb.8:
	subs	x9, x9, #1
	str	x9, [x8, x22, lsl #3]
	b.ne	LBB0_10
; %bb.9:
Lloh4:
	adrp	x8, _GPIO_CMDSRC_ARM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GPIO_CMDSRC_ARM@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_aspeed_gpio_change_cmd_source
LBB0_10:
	mov	w19, #0
	b	LBB0_12
LBB0_11:
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_12:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GPIO_CMDSRC_ARM,4,2            ; @GPIO_CMDSRC_ARM
.subsections_via_symbols
