	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gpiochip_remove                ## -- Begin function gpiochip_remove
	.p2align	4, 0x90
_gpiochip_remove:                       ## @gpiochip_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	%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, %r14
	movq	(%rdi), %r15
	movq	%r15, %rdi
	callq	_gpiochip_sysfs_unregister
	movq	%r14, %rdi
	callq	_gpiochip_free_hogs
	movq	$0, 32(%r15)
	movq	%r14, %rdi
	callq	_gpiochip_irqchip_remove
	movq	%r14, %rdi
	callq	_acpi_gpiochip_remove
	movq	%r14, %rdi
	callq	_gpiochip_remove_pin_ranges
	movq	%r14, %rdi
	callq	_of_gpiochip_remove
	movq	%r14, %rdi
	callq	_gpiochip_free_valid_mask
	movq	$0, 24(%r15)
	movq	_gpio_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	cmpl	$0, (%r15)
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	movl	$1, %r13d
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_FLAG_REQUESTED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%r15), %rsi
	addq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	cmovnel	%r13d, %r14d
	incq	%r12
	movl	(%r15), %eax
	addq	$4, %rbx
	cmpq	%rax, %r12
	jb	LBB0_3
## %bb.4:
	movq	_gpio_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.5:
	leaq	4(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_crit
	jmp	LBB0_6
LBB0_1:
	movq	_gpio_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
LBB0_6:
	leaq	8(%r15), %rdi
	addq	$4, %r15
	movq	%r15, %rsi
	callq	_cdev_device_del
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_put_device                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_gpio_lock,4,2                  ## @gpio_lock
	.comm	_FLAG_REQUESTED,4,2             ## @FLAG_REQUESTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gpiochip_remove                ; -- Begin function gpiochip_remove
	.p2align	2
_gpiochip_remove:                       ; @gpiochip_remove
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	ldr	x19, [x0]
	mov	x0, x19
	bl	_gpiochip_sysfs_unregister
	mov	x0, x20
	bl	_gpiochip_free_hogs
	str	xzr, [x19, #32]
	mov	x0, x20
	bl	_gpiochip_irqchip_remove
	mov	x0, x20
	bl	_acpi_gpiochip_remove
	mov	x0, x20
	bl	_gpiochip_remove_pin_ranges
	mov	x0, x20
	bl	_of_gpiochip_remove
	mov	x0, x20
	bl	_gpiochip_free_valid_mask
	str	xzr, [x19, #24]
Lloh0:
	adrp	x0, _gpio_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _gpio_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x21, #0
	mov	x22, #0
	mov	w20, #0
Lloh2:
	adrp	x23, _FLAG_REQUESTED@GOTPAGE
Lloh3:
	ldr	x23, [x23, _FLAG_REQUESTED@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x23]
	add	x1, x8, x21
	bl	_test_bit
	cmp	x0, #0
	csinc	w20, w20, wzr, eq
	add	x22, x22, #1
	ldr	w8, [x19]
	add	x21, x21, #4
	cmp	x22, x8
	b.lo	LBB0_2
; %bb.3:
Lloh4:
	adrp	x0, _gpio_lock@GOTPAGE
Lloh5:
	ldr	x0, [x0, _gpio_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	cbz	w20, LBB0_6
; %bb.4:
	add	x0, x19, #4
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_crit
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x0, _gpio_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _gpio_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
LBB0_6:
	add	x0, x19, #8
	add	x19, x19, #4
	mov	x1, x19
	bl	_cdev_device_del
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_put_device
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_gpio_lock,4,2                  ; @gpio_lock
	.comm	_FLAG_REQUESTED,4,2             ; @FLAG_REQUESTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"

.subsections_via_symbols
