	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grgpio_remove
_grgpio_remove:                         ## @grgpio_remove
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	callq	_platform_get_drvdata
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 8(%rbx)
	je	LBB0_6
## %bb.1:
	movq	_GRGPIO_MAX_NGPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.2:
	movq	16(%rbx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rdx,8)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_4
LBB0_6:
	movq	%rbx, %rdi
	callq	_gpiochip_remove
	movq	8(%rbx), %rdi
	xorl	%r14d, %r14d
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_irq_domain_remove
	jmp	LBB0_8
LBB0_5:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRGPIO_MAX_NGPIO,4,2           ## @GRGPIO_MAX_NGPIO
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_grgpio_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grgpio_remove
_grgpio_remove:                         ; @grgpio_remove
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_platform_get_drvdata
	mov	x19, x0
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _GRGPIO_MAX_NGPIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRGPIO_MAX_NGPIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	ldr	x9, [x19, #16]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9]
	cbnz	x10, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.ne	LBB0_3
LBB0_5:
	mov	x0, x19
	bl	_gpiochip_remove
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_irq_domain_remove
LBB0_7:
	mov	w20, #0
LBB0_8:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GRGPIO_MAX_NGPIO,4,2           ; @GRGPIO_MAX_NGPIO
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_grgpio_remove
.subsections_via_symbols
