	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qp_detatch_guest_work
_qp_detatch_guest_work:                 ## @qp_detatch_guest_work
	.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
	movl	%edi, %r14d
	movq	_qp_guest_endpoints@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	%r14d, %edi
	callq	_qp_guest_handle_to_entry
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_VMCI_QPFLAG_LOCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.3:
	cmpl	$2, 4(%r15)
	jl	LBB0_4
## %bb.7:
	xorl	%edi, %edi
	movl	%r14d, %esi
	callq	_qp_notify_peer_local
	movl	%eax, %r14d
	jmp	LBB0_8
LBB0_1:
	movq	_qp_guest_endpoints@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_VMCI_ERROR_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_12
LBB0_5:
	movl	%r14d, %edi
	callq	_qp_detatch_hypercall
	movl	%eax, %r14d
	movq	_VMCI_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jge	LBB0_8
## %bb.6:
	movq	_qp_guest_endpoints@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_12
LBB0_4:
	movq	_VMCI_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_8:
	movl	4(%r15), %ebx
	decl	%ebx
	movl	%ebx, 4(%r15)
	jne	LBB0_10
## %bb.9:
	movq	_qp_guest_endpoints@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_qp_list_remove_entry
	movl	4(%r15), %ebx
LBB0_10:
	movq	_qp_guest_endpoints@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	jne	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	_qp_guest_endpoint_destroy
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_qp_guest_endpoints,4,2         ## @qp_guest_endpoints
	.comm	_VMCI_ERROR_NOT_FOUND,4,2       ## @VMCI_ERROR_NOT_FOUND
	.comm	_VMCI_QPFLAG_LOCAL,4,2          ## @VMCI_QPFLAG_LOCAL
	.comm	_VMCI_SUCCESS,4,2               ## @VMCI_SUCCESS
	.no_dead_strip	_qp_detatch_guest_work
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qp_detatch_guest_work
_qp_detatch_guest_work:                 ; @qp_detatch_guest_work
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, _qp_guest_endpoints@GOTPAGE
Lloh1:
	ldr	x0, [x0, _qp_guest_endpoints@GOTPAGEOFF]
	bl	_mutex_lock
	and	x20, x19, #0xffffffff
	mov	x0, x20
	bl	_qp_guest_handle_to_entry
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
Lloh2:
	adrp	x9, _VMCI_QPFLAG_LOCAL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VMCI_QPFLAG_LOCAL@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
	ldr	w8, [x19, #4]
	cmp	w8, #2
	b.lt	LBB0_7
; %bb.3:
	mov	w0, #0
	mov	x1, x20
	bl	_qp_notify_peer_local
	mov	x20, x0
	b	LBB0_8
LBB0_4:
Lloh5:
	adrp	x0, _qp_guest_endpoints@GOTPAGE
Lloh6:
	ldr	x0, [x0, _qp_guest_endpoints@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh7:
	adrp	x8, _VMCI_ERROR_NOT_FOUND@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VMCI_ERROR_NOT_FOUND@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
	b	LBB0_12
LBB0_5:
	mov	x0, x20
	bl	_qp_detatch_hypercall
	mov	x20, x0
Lloh10:
	adrp	x8, _VMCI_SUCCESS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VMCI_SUCCESS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_8
; %bb.6:
Lloh13:
	adrp	x0, _qp_guest_endpoints@GOTPAGE
Lloh14:
	ldr	x0, [x0, _qp_guest_endpoints@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_12
LBB0_7:
Lloh15:
	adrp	x8, _VMCI_SUCCESS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VMCI_SUCCESS@GOTPAGEOFF]
Lloh17:
	ldr	w20, [x8]
LBB0_8:
	ldr	w8, [x19, #4]
	subs	w21, w8, #1
	str	w21, [x19, #4]
	b.ne	LBB0_10
; %bb.9:
Lloh18:
	adrp	x0, _qp_guest_endpoints@GOTPAGE
Lloh19:
	ldr	x0, [x0, _qp_guest_endpoints@GOTPAGEOFF]
	mov	x1, x19
	bl	_qp_list_remove_entry
	ldr	w21, [x19, #4]
LBB0_10:
Lloh20:
	adrp	x0, _qp_guest_endpoints@GOTPAGE
Lloh21:
	ldr	x0, [x0, _qp_guest_endpoints@GOTPAGEOFF]
	bl	_mutex_unlock
	cbnz	w21, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_qp_guest_endpoint_destroy
LBB0_12:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_qp_guest_endpoints,4,2         ; @qp_guest_endpoints
	.comm	_VMCI_ERROR_NOT_FOUND,4,2       ; @VMCI_ERROR_NOT_FOUND
	.comm	_VMCI_QPFLAG_LOCAL,4,2          ; @VMCI_QPFLAG_LOCAL
	.comm	_VMCI_SUCCESS,4,2               ; @VMCI_SUCCESS
	.no_dead_strip	_qp_detatch_guest_work
.subsections_via_symbols
