	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmci_qp_broker_unmap           ## -- Begin function vmci_qp_broker_unmap
	.p2align	4, 0x90
_vmci_qp_broker_unmap:                  ## @vmci_qp_broker_unmap
	.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	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_vmci_ctx_get_id
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_vmci_handle_is_invalid
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	_VMCI_INVALID_ID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_3
## %bb.4:
	movq	%r15, %r14
	shrq	$32, %r14
	movq	_qp_broker_list@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_vmci_ctx_qp_exists
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_qp_broker_handle_to_entry
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r13
	cmpq	(%rax), %r12
	je	LBB0_12
## %bb.10:
	cmpq	8(%r13), %r12
	jne	LBB0_11
LBB0_12:
	movq	_VMCI_HOST_CONTEXT_ID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_14
## %bb.13:
	movq	_VMCI_SUCCESS@GOTPCREL(%rip), %rbx
	jmp	LBB0_17
LBB0_3:
	movq	_VMCI_ERROR_INVALID_ARGS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_18
LBB0_5:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_6
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
LBB0_6:
	movq	%r12, %rsi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_pr_devel
	movq	_VMCI_ERROR_NOT_FOUND@GOTPCREL(%rip), %rbx
LBB0_17:
	movl	(%rbx), %ebx
	movq	_qp_broker_list@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	16(%r13), %edi
	callq	_qp_acquire_queue_mutex
	movq	%r13, %rdi
	callq	_qp_save_headers
	movq	_VMCI_SUCCESS@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	jge	LBB0_16
## %bb.15:
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_pr_warn
LBB0_16:
	movl	16(%r13), %esi
	movl	24(%r13), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_qp_host_unmap_queues
	movl	16(%r13), %edi
	movl	24(%r13), %esi
	callq	_qp_host_unregister_user_memory
	decl	20(%r13)
	movl	16(%r13), %edi
	callq	_qp_release_queue_mutex
	jmp	LBB0_17
LBB0_11:
	movq	_VMCI_ERROR_QUEUEPAIR_NOTATTACHED@GOTPCREL(%rip), %rbx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_VMCI_INVALID_ID,8,3            ## @VMCI_INVALID_ID
	.comm	_VMCI_ERROR_INVALID_ARGS,4,2    ## @VMCI_ERROR_INVALID_ARGS
	.comm	_qp_broker_list,4,2             ## @qp_broker_list
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Context (ID=0x%x) not attached to queue pair (handle=0x%x:0x%x)\n"

	.comm	_VMCI_ERROR_NOT_FOUND,4,2       ## @VMCI_ERROR_NOT_FOUND
L_.str.1:                               ## @.str.1
	.asciz	"Context (ID=0x%x) reports being attached to queue pair (handle=0x%x:0x%x) that isn't present in broker\n"

	.comm	_VMCI_ERROR_QUEUEPAIR_NOTATTACHED,4,2 ## @VMCI_ERROR_QUEUEPAIR_NOTATTACHED
	.comm	_VMCI_HOST_CONTEXT_ID,8,3       ## @VMCI_HOST_CONTEXT_ID
	.comm	_VMCI_SUCCESS,4,2               ## @VMCI_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"Failed to save queue headers for queue pair (handle=0x%x:0x%x,result=%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmci_qp_broker_unmap           ; -- Begin function vmci_qp_broker_unmap
	.p2align	2
_vmci_qp_broker_unmap:                  ; @vmci_qp_broker_unmap
	.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, x2
	mov	x23, x1
	mov	x19, x0
	mov	x0, x1
	bl	_vmci_ctx_get_id
	mov	x22, x0
	mov	x0, x19
	bl	_vmci_handle_is_invalid
	cbz	x23, LBB0_11
; %bb.1:
	cbnz	x0, LBB0_11
; %bb.2:
Lloh0:
	adrp	x8, _VMCI_INVALID_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VMCI_INVALID_ID@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x22, x8
	b.eq	LBB0_11
; %bb.3:
	lsr	x21, x19, #32
Lloh3:
	adrp	x0, _qp_broker_list@GOTPAGE
Lloh4:
	ldr	x0, [x0, _qp_broker_list@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x23
	mov	x1, x19
	bl	_vmci_ctx_qp_exists
	cbz	w0, LBB0_12
; %bb.4:
	mov	x0, x19
	bl	_qp_broker_handle_to_entry
	cbz	x0, LBB0_13
; %bb.5:
	mov	x23, x0
	ldr	x8, [x0]
	cmp	x22, x8
	b.eq	LBB0_7
; %bb.6:
	ldr	x8, [x23, #8]
	cmp	x22, x8
	b.ne	LBB0_17
LBB0_7:
Lloh5:
	adrp	x8, _VMCI_HOST_CONTEXT_ID@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VMCI_HOST_CONTEXT_ID@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
Lloh8:
	adrp	x24, _VMCI_SUCCESS@GOTPAGE
Lloh9:
	ldr	x24, [x24, _VMCI_SUCCESS@GOTPAGEOFF]
	cmp	x22, x8
	b.eq	LBB0_15
; %bb.8:
	ldr	w0, [x23, #16]
	bl	_qp_acquire_queue_mutex
	mov	x0, x23
	bl	_qp_save_headers
	ldr	w8, [x24]
	cmp	w0, w8
	b.ge	LBB0_10
; %bb.9:
	mov	x3, x0
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	bl	_pr_warn
LBB0_10:
	ldr	w1, [x23, #16]
	ldr	w2, [x23, #24]
	mov	x0, x20
	bl	_qp_host_unmap_queues
	ldr	w0, [x23, #16]
	ldr	w1, [x23, #24]
	bl	_qp_host_unregister_user_memory
	ldp	w0, w8, [x23, #16]
	sub	w8, w8, #1
	str	w8, [x23, #20]
	bl	_qp_release_queue_mutex
Lloh12:
	adrp	x24, _VMCI_SUCCESS@GOTPAGE
Lloh13:
	ldr	x24, [x24, _VMCI_SUCCESS@GOTPAGEOFF]
	b	LBB0_15
LBB0_11:
Lloh14:
	adrp	x8, _VMCI_ERROR_INVALID_ARGS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VMCI_ERROR_INVALID_ARGS@GOTPAGEOFF]
Lloh16:
	ldr	w19, [x8]
	b	LBB0_16
LBB0_12:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_14:
	mov	x1, x22
	mov	x2, x21
	mov	x3, x19
	bl	_pr_devel
Lloh21:
	adrp	x24, _VMCI_ERROR_NOT_FOUND@GOTPAGE
Lloh22:
	ldr	x24, [x24, _VMCI_ERROR_NOT_FOUND@GOTPAGEOFF]
LBB0_15:
	ldr	w19, [x24]
Lloh23:
	adrp	x0, _qp_broker_list@GOTPAGE
Lloh24:
	ldr	x0, [x0, _qp_broker_list@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_16:
	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
	ret
LBB0_17:
Lloh25:
	adrp	x24, _VMCI_ERROR_QUEUEPAIR_NOTATTACHED@GOTPAGE
Lloh26:
	ldr	x24, [x24, _VMCI_ERROR_QUEUEPAIR_NOTATTACHED@GOTPAGEOFF]
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_VMCI_INVALID_ID,8,3            ; @VMCI_INVALID_ID
	.comm	_VMCI_ERROR_INVALID_ARGS,4,2    ; @VMCI_ERROR_INVALID_ARGS
	.comm	_qp_broker_list,4,2             ; @qp_broker_list
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Context (ID=0x%x) not attached to queue pair (handle=0x%x:0x%x)\n"

	.comm	_VMCI_ERROR_NOT_FOUND,4,2       ; @VMCI_ERROR_NOT_FOUND
l_.str.1:                               ; @.str.1
	.asciz	"Context (ID=0x%x) reports being attached to queue pair (handle=0x%x:0x%x) that isn't present in broker\n"

	.comm	_VMCI_ERROR_QUEUEPAIR_NOTATTACHED,4,2 ; @VMCI_ERROR_QUEUEPAIR_NOTATTACHED
	.comm	_VMCI_HOST_CONTEXT_ID,8,3       ; @VMCI_HOST_CONTEXT_ID
	.comm	_VMCI_SUCCESS,4,2               ; @VMCI_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"Failed to save queue headers for queue pair (handle=0x%x:0x%x,result=%d)\n"

.subsections_via_symbols
