	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mgslpc_remove_device
_mgslpc_remove_device:                  ## @mgslpc_remove_device
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_mgslpc_device_list@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	cmpq	%rdi, %rcx
	je	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx), %rsi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rcx, %rdx
	movq	%rsi, %rcx
	cmpq	%rbx, %rsi
	jne	LBB0_7
	jmp	LBB0_4
LBB0_2:
	xorl	%edx, %edx
LBB0_4:
	movq	(%rbx), %rcx
	testq	%rdx, %rdx
	jne	LBB0_6
## %bb.5:
	movq	%rax, %rdx
LBB0_6:
	movq	%rcx, (%rdx)
	movq	%rbx, %rdi
	callq	_release_resources
	movq	%rbx, %rdi
	callq	_kfree
	movq	_mgslpc_device_count@GOTPCREL(%rip), %rax
	decl	(%rax)
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mgslpc_device_list,8,3         ## @mgslpc_device_list
	.comm	_mgslpc_device_count,4,2        ## @mgslpc_device_count
	.no_dead_strip	_mgslpc_remove_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mgslpc_remove_device
_mgslpc_remove_device:                  ; @mgslpc_remove_device
	.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
Lloh0:
	adrp	x8, _mgslpc_device_list@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mgslpc_device_list@GOTPAGEOFF]
	ldr	x9, [x8]
	cbz	x9, LBB0_6
; %bb.1:
	mov	x19, x0
	cmp	x9, x0
	b.eq	LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9]
	cbz	x11, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x10, x9
	mov	x9, x11
	cmp	x11, x19
	b.ne	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	x10, #0
LBB0_5:
	ldr	x9, [x19]
	cmp	x10, #0
	csel	x8, x8, x10, eq
	str	x9, [x8]
	mov	x0, x19
	bl	_release_resources
	mov	x0, x19
	bl	_kfree
Lloh2:
	adrp	x8, _mgslpc_device_count@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mgslpc_device_count@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_mgslpc_device_list,8,3         ; @mgslpc_device_list
	.comm	_mgslpc_device_count,4,2        ; @mgslpc_device_count
	.no_dead_strip	_mgslpc_remove_device
.subsections_via_symbols
