	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_device_context_remove          ## -- Begin function device_context_remove
	.p2align	4, 0x90
_device_context_remove:                 ## @device_context_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
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	movq	(%r14), %rdx
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	8(%r14), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, (%rax,%rcx,8)
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rcx
	cmpq	%rcx, %rdx
	jne	LBB0_3
## %bb.6:
	movq	%rdx, %rcx
	testl	%r15d, %r15d
	jne	LBB0_8
	jmp	LBB0_13
LBB0_1:
	xorl	%ecx, %ecx
	testl	%r15d, %r15d
	je	LBB0_13
LBB0_8:
	decq	%rdx
	movq	%rdx, (%r14)
	movq	8(%r14), %rdi
	je	LBB0_9
## %bb.10:
	leaq	(%rdi,%rcx,8), %rax
	leaq	(%rdi,%rcx,8), %rsi
	addq	$8, %rsi
	subq	%rcx, %rdx
	shlq	$3, %rdx
	movq	%rax, %rdi
	callq	_memmove
	movq	8(%r14), %rdi
	movl	(%r14), %esi
	shll	$3, %esi
	callq	_heap_realloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.11:
	movq	%rax, 8(%r14)
	jmp	LBB0_12
LBB0_4:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	jne	LBB0_8
LBB0_13:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR                            ## TAILCALL
LBB0_9:
	callq	_heap_free
	movq	$0, 8(%r14)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Removing context %p.\n"

	.comm	_TRUE,4,2                       ## @TRUE
L_.str.1:                               ## @.str.1
	.asciz	"Context %p doesn't exist in context array.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to shrink context array. Oh well.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_device_context_remove          ; -- Begin function device_context_remove
	.p2align	2
_device_context_remove:                 ; @device_context_remove
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _FALSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x8, [x19]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x9, #0
	ldr	x10, [x19, #8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x9, lsl #3]
	cmp	x11, x20
	b.eq	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.4:
	mov	x9, x8
	cbnz	w21, LBB0_6
	b	LBB0_10
LBB0_5:
	mov	x9, #0
	cbz	w21, LBB0_10
LBB0_6:
	ldr	x0, [x19, #8]
	subs	x8, x8, #1
	str	x8, [x19]
	b.eq	LBB0_11
; %bb.7:
	add	x0, x0, x9, lsl #3
	add	x1, x0, #8
	sub	x8, x8, x9
	lsl	x2, x8, #3
	bl	_memmove
	ldr	x0, [x19, #8]
	ldr	w8, [x19]
	lsl	w1, w8, #3
	bl	_heap_realloc
	cbz	x0, LBB0_13
; %bb.8:
	str	x0, [x19, #8]
	b	LBB0_12
LBB0_9:
Lloh5:
	adrp	x10, _TRUE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _TRUE@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x10]
	cbnz	w21, LBB0_6
LBB0_10:
	str	x20, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
	b	LBB0_12
LBB0_11:
	bl	_heap_free
	str	xzr, [x19, #8]
LBB0_12:
	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
	add	sp, sp, #64
	ret
LBB0_13:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	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
	add	sp, sp, #64
	b	_ERR
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Removing context %p.\n"

	.comm	_TRUE,4,2                       ; @TRUE
l_.str.1:                               ; @.str.1
	.asciz	"Context %p doesn't exist in context array.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to shrink context array. Oh well.\n"

.subsections_via_symbols
