	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scmi_remove
_scmi_remove:                           ## @scmi_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_platform_get_drvdata
	movq	%rax, %r14
	movq	_scmi_list_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	cmpq	$0, 16(%r14)
	je	LBB0_1
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_scmi_list_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.4:
	negl	%ebx
	jmp	LBB0_5
LBB0_1:
	leaq	8(%r14), %rdi
	callq	_list_del
	movq	_scmi_list_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_3:
	movq	%r14, %rbx
	addq	$4, %rbx
	movq	_scmi_mbox_free_channel@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movq	%rbx, %rdx
	callq	_idr_for_each
	movq	%rbx, %rdi
	callq	_idr_destroy
	movl	(%r15), %esi
	movq	%r14, %rdi
	movq	%r14, %rdx
	callq	_idr_for_each
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_idr_destroy
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_scmi_list_mutex,4,2            ## @scmi_list_mutex
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_scmi_mbox_free_channel,4,2     ## @scmi_mbox_free_channel
	.no_dead_strip	_scmi_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scmi_remove
_scmi_remove:                           ; @scmi_remove
	.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
	bl	_platform_get_drvdata
	mov	x19, x0
Lloh0:
	adrp	x0, _scmi_list_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _scmi_list_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
Lloh5:
	adrp	x0, _scmi_list_mutex@GOTPAGE
Lloh6:
	ldr	x0, [x0, _scmi_list_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	cbz	w20, LBB0_4
; %bb.2:
	neg	w0, w20
	b	LBB0_5
LBB0_3:
	add	x0, x19, #8
	bl	_list_del
Lloh7:
	adrp	x0, _scmi_list_mutex@GOTPAGE
Lloh8:
	ldr	x0, [x0, _scmi_list_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_4:
	add	x20, x19, #4
Lloh9:
	adrp	x21, _scmi_mbox_free_channel@GOTPAGE
Lloh10:
	ldr	x21, [x21, _scmi_mbox_free_channel@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	mov	x2, x20
	bl	_idr_for_each
	mov	x0, x20
	bl	_idr_destroy
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x19
	bl	_idr_for_each
	mov	x20, x0
	mov	x0, x19
	bl	_idr_destroy
	mov	x0, x20
LBB0_5:
	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	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_scmi_list_mutex,4,2            ; @scmi_list_mutex
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_scmi_mbox_free_channel,4,2     ; @scmi_mbox_free_channel
	.no_dead_strip	_scmi_remove
.subsections_via_symbols
