	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmci_doorbell_create           ## -- Begin function vmci_doorbell_create
	.p2align	4, 0x90
_vmci_doorbell_create:                  ## @vmci_doorbell_create
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	%rcx, %rbx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.2:
	movq	%rsi, %r14
	movq	_VMCI_FLAG_DELAYED_CB@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	testq	%rsi, %rax
	jne	LBB0_4
## %bb.3:
	movq	%rdx, %r15
	movq	_VMCI_PRIVILEGE_ALL_FLAGS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	testq	%rdx, %rax
	je	LBB0_7
LBB0_4:
	movq	_VMCI_ERROR_INVALID_ARGS@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r8, %r12
	movq	%rdi, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rdi
	movq	8(%r13), %rsi
	callq	_vmci_handle_is_invalid
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	xorl	%eax, %eax
	callq	_vmci_get_context_id
	movq	_VMCI_INVALID_ID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	cmpq	%rsi, %rax
	jne	LBB0_16
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_warn
	movq	_VMCI_ERROR_NO_RESOURCES@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_11:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_warn
	movq	_VMCI_ERROR_NO_MEM@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_12:
	movq	(%r13), %rax
	movq	_VMCI_HOST_CONTEXT_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_15
## %bb.13:
	xorl	%eax, %eax
	callq	_vmci_guest_code_active
	testq	%rax, %rax
	je	LBB0_23
## %bb.14:
	xorl	%eax, %eax
	callq	_vmci_get_context_id
	movq	(%r13), %rsi
	cmpq	%rsi, %rax
	jne	LBB0_24
LBB0_15:
	movq	8(%r13), %rdx
	movq	_VMCI_INVALID_ID@GOTPCREL(%rip), %rcx
	movq	%rax, %rsi
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	cmpq	(%rcx), %rdx
	jne	LBB0_17
	jmp	LBB0_24
LBB0_16:
	movq	%rax, %rdi
	callq	_vmci_make_handle
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
LBB0_17:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	$0, 8(%rax)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	56(%rax), %rdi
	callq	_INIT_HLIST_NODE
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, 48(%rax)
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	leaq	40(%r15), %rdi
	movq	_dbell_delayed_dispatch@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	_VMCI_FLAG_DELAYED_CB@GOTPCREL(%rip), %rax
	andq	(%rax), %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, 32(%rax)
	movq	%rax, %r14
	movq	%rbx, 24(%rax)
	movq	%r12, 16(%rax)
	movq	%r15, %rdi
	addq	$4, %rdi
	movq	%rdi, %r12
	xorl	%esi, %esi
	callq	_atomic_set
	movq	_VMCI_RESOURCE_TYPE_DOORBELL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, %r15
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_vmci_resource_add
	movl	%eax, %ebx
	movq	_VMCI_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_22
## %bb.18:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_vmci_resource_handle
	movq	%rax, %r12
	movq	%rdx, %r15
	xorl	%eax, %eax
	callq	_vmci_guest_code_active
	testq	%rax, %rax
	je	LBB0_21
## %bb.19:
	movq	%r14, %rdi
	callq	_dbell_index_table_add
	movq	8(%r14), %rdx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_dbell_link
	movl	%eax, %ebx
	movq	_VMCI_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_27
## %bb.20:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %esi
	callq	_atomic_set
LBB0_21:
	movq	%r12, (%r13)
	movq	%r15, 8(%r13)
	jmp	LBB0_6
LBB0_22:
	leaq	L_.str.3(%rip), %rdi
	movq	%r15, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_pr_warn
	jmp	LBB0_26
LBB0_23:
	movq	(%r13), %rsi
LBB0_24:
	movq	8(%r13), %rdx
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_devel
	movq	_VMCI_ERROR_INVALID_ARGS@GOTPCREL(%rip), %rax
LBB0_25:
	movl	(%rax), %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_26:
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_6
LBB0_27:
	movq	%r14, %rdi
	callq	_dbell_index_table_remove
	movq	%r14, %rdi
	callq	_vmci_resource_remove
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_VMCI_FLAG_DELAYED_CB,8,3       ## @VMCI_FLAG_DELAYED_CB
	.comm	_VMCI_PRIVILEGE_ALL_FLAGS,8,3   ## @VMCI_PRIVILEGE_ALL_FLAGS
	.comm	_VMCI_ERROR_INVALID_ARGS,4,2    ## @VMCI_ERROR_INVALID_ARGS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed allocating memory for datagram entry\n"

	.comm	_VMCI_ERROR_NO_MEM,4,2          ## @VMCI_ERROR_NO_MEM
	.comm	_VMCI_INVALID_ID,8,3            ## @VMCI_INVALID_ID
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get context ID\n"

	.comm	_VMCI_ERROR_NO_RESOURCES,4,2    ## @VMCI_ERROR_NO_RESOURCES
	.comm	_VMCI_HOST_CONTEXT_ID,8,3       ## @VMCI_HOST_CONTEXT_ID
L_.str.2:                               ## @.str.2
	.asciz	"Invalid argument (handle=0x%x:0x%x)\n"

	.comm	_dbell_delayed_dispatch,4,2     ## @dbell_delayed_dispatch
	.comm	_VMCI_RESOURCE_TYPE_DOORBELL,4,2 ## @VMCI_RESOURCE_TYPE_DOORBELL
	.comm	_VMCI_SUCCESS,4,2               ## @VMCI_SUCCESS
L_.str.3:                               ## @.str.3
	.asciz	"Failed to add new resource (handle=0x%x:0x%x), error: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmci_doorbell_create           ; -- Begin function vmci_doorbell_create
	.p2align	2
_vmci_doorbell_create:                  ; @vmci_doorbell_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	x0, LBB0_4
; %bb.1:
	mov	x22, x3
	cbz	x3, LBB0_4
; %bb.2:
	mov	x23, x1
Lloh0:
	adrp	x27, _VMCI_FLAG_DELAYED_CB@GOTPAGE
Lloh1:
	ldr	x27, [x27, _VMCI_FLAG_DELAYED_CB@GOTPAGEOFF]
	ldr	x8, [x27]
	bics	xzr, x1, x8
	b.ne	LBB0_4
; %bb.3:
	mov	x24, x2
Lloh2:
	adrp	x8, _VMCI_PRIVILEGE_ALL_FLAGS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VMCI_PRIVILEGE_ALL_FLAGS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	bics	xzr, x2, x8
	b.eq	LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _VMCI_ERROR_INVALID_ARGS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VMCI_ERROR_INVALID_ARGS@GOTPAGEOFF]
LBB0_5:
	ldr	w21, [x8]
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_7:
	mov	x21, x4
	mov	x20, x0
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kmalloc
	cbz	x0, LBB0_11
; %bb.8:
	mov	x19, x0
	ldp	x0, x1, [x20]
	bl	_vmci_handle_is_invalid
	cbz	x0, LBB0_12
; %bb.9:
	bl	_vmci_get_context_id
Lloh10:
	adrp	x8, _VMCI_INVALID_ID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VMCI_INVALID_ID@GOTPAGEOFF]
Lloh12:
	ldr	x1, [x8]
	cmp	x0, x1
	b.ne	LBB0_16
; %bb.10:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_warn
Lloh15:
	adrp	x8, _VMCI_ERROR_NO_RESOURCES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VMCI_ERROR_NO_RESOURCES@GOTPAGEOFF]
Lloh17:
	ldr	w21, [x8]
	b	LBB0_26
LBB0_11:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
Lloh20:
	adrp	x8, _VMCI_ERROR_NO_MEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _VMCI_ERROR_NO_MEM@GOTPAGEOFF]
	b	LBB0_5
LBB0_12:
	ldr	x25, [x20]
Lloh22:
	adrp	x8, _VMCI_HOST_CONTEXT_ID@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VMCI_HOST_CONTEXT_ID@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x25, x8
	b.eq	LBB0_15
; %bb.13:
	bl	_vmci_guest_code_active
	cbz	x0, LBB0_23
; %bb.14:
	bl	_vmci_get_context_id
	mov	x25, x0
	ldr	x1, [x20]
	cmp	x0, x1
	b.ne	LBB0_24
LBB0_15:
	ldr	x26, [x20, #8]
Lloh25:
	adrp	x8, _VMCI_INVALID_ID@GOTPAGE
Lloh26:
	ldr	x8, [x8, _VMCI_INVALID_ID@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	mov	x1, x25
	cmp	x26, x8
	b.ne	LBB0_17
	b	LBB0_24
LBB0_16:
	bl	_vmci_make_handle
	mov	x25, x0
	mov	x26, x1
LBB0_17:
	str	xzr, [x19, #8]
	add	x0, x19, #56
	bl	_INIT_HLIST_NODE
	str	x24, [x19, #48]
	add	x0, x19, #40
Lloh28:
	adrp	x8, _dbell_delayed_dispatch@GOTPAGE
Lloh29:
	ldr	x8, [x8, _dbell_delayed_dispatch@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	bl	_INIT_WORK
	ldr	x8, [x27]
	and	x8, x8, x23
	stp	x22, x8, [x19, #24]
	str	x21, [x19, #16]
	add	x22, x19, #4
	mov	x0, x22
	mov	w1, #0
	bl	_atomic_set
Lloh31:
	adrp	x8, _VMCI_RESOURCE_TYPE_DOORBELL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _VMCI_RESOURCE_TYPE_DOORBELL@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x25
	mov	x3, x26
	bl	_vmci_resource_add
	mov	x21, x0
Lloh34:
	adrp	x27, _VMCI_SUCCESS@GOTPAGE
Lloh35:
	ldr	x27, [x27, _VMCI_SUCCESS@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w0, w8
	b.ne	LBB0_22
; %bb.18:
	mov	x0, x19
	bl	_vmci_resource_handle
	mov	x23, x0
	mov	x24, x1
	bl	_vmci_guest_code_active
	cbz	x0, LBB0_21
; %bb.19:
	mov	x0, x19
	bl	_dbell_index_table_add
	ldr	x2, [x19, #8]
	mov	x0, x23
	mov	x1, x24
	bl	_dbell_link
	mov	x21, x0
	ldr	w8, [x27]
	cmp	w8, w0
	b.ne	LBB0_25
; %bb.20:
	mov	x0, x22
	mov	w1, #1
	bl	_atomic_set
LBB0_21:
	stp	x23, x24, [x20]
	b	LBB0_6
LBB0_22:
	stp	x26, x21, [sp, #8]
	str	x25, [sp]
Lloh36:
	adrp	x0, l_.str.3@PAGE
Lloh37:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_warn
	b	LBB0_26
LBB0_23:
	ldr	x1, [x20]
LBB0_24:
	ldr	x2, [x20, #8]
Lloh38:
	adrp	x0, l_.str.2@PAGE
Lloh39:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_devel
Lloh40:
	adrp	x8, _VMCI_ERROR_INVALID_ARGS@GOTPAGE
Lloh41:
	ldr	x8, [x8, _VMCI_ERROR_INVALID_ARGS@GOTPAGEOFF]
Lloh42:
	ldr	w21, [x8]
	b	LBB0_26
LBB0_25:
	mov	x0, x19
	bl	_dbell_index_table_remove
	mov	x0, x19
	bl	_vmci_resource_remove
LBB0_26:
	mov	x0, x19
	bl	_kfree
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_VMCI_FLAG_DELAYED_CB,8,3       ; @VMCI_FLAG_DELAYED_CB
	.comm	_VMCI_PRIVILEGE_ALL_FLAGS,8,3   ; @VMCI_PRIVILEGE_ALL_FLAGS
	.comm	_VMCI_ERROR_INVALID_ARGS,4,2    ; @VMCI_ERROR_INVALID_ARGS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed allocating memory for datagram entry\n"

	.comm	_VMCI_ERROR_NO_MEM,4,2          ; @VMCI_ERROR_NO_MEM
	.comm	_VMCI_INVALID_ID,8,3            ; @VMCI_INVALID_ID
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get context ID\n"

	.comm	_VMCI_ERROR_NO_RESOURCES,4,2    ; @VMCI_ERROR_NO_RESOURCES
	.comm	_VMCI_HOST_CONTEXT_ID,8,3       ; @VMCI_HOST_CONTEXT_ID
l_.str.2:                               ; @.str.2
	.asciz	"Invalid argument (handle=0x%x:0x%x)\n"

	.comm	_dbell_delayed_dispatch,4,2     ; @dbell_delayed_dispatch
	.comm	_VMCI_RESOURCE_TYPE_DOORBELL,4,2 ; @VMCI_RESOURCE_TYPE_DOORBELL
	.comm	_VMCI_SUCCESS,4,2               ; @VMCI_SUCCESS
l_.str.3:                               ; @.str.3
	.asciz	"Failed to add new resource (handle=0x%x:0x%x), error: %d\n"

.subsections_via_symbols
