	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmci_dispatch_dgs
_vmci_dispatch_dgs:                     ## @vmci_dispatch_dgs
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %r13
	movq	_VMCI_MAX_DG_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	movq	(%r14), %r15
	xorl	%edi, %edi
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpq	%r15, %rax
	setb	%dil
	callq	_BUILD_BUG_ON
	movq	_VMCI_DATA_IN_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rsi
	movq	%r15, %rdx
	callq	_ioread8_rep
	movq	(%r13), %rax
	movq	_VMCI_INVALID_ID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%r14), %rsi
	cmpq	%rcx, %rax
	jne	LBB0_2
## %bb.1:
	cmpq	%rsi, %r15
	jbe	LBB0_24
LBB0_2:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	(,%rdi,4), %rdx
	addq	%r13, %rdx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	leaq	(,%rdi,4), %rdi
	negq	%rdi
	movq	%r13, %r14
	movq	%r15, %r12
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_18 Depth 2
	cmpq	%rcx, %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	movq	%r14, %rdi
	callq	_roundup
	movq	%rax, %r14
	leaq	(,%r12,4), %r15
	addq	%r13, %r15
	subq	%rax, %r15
	sarq	$2, %r15
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_VMCI_DG_SIZE_ALIGNED
	movl	%eax, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rbx, %rax
	jae	LBB0_6
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	16(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	movq	%rax, %r12
	xorl	%eax, %eax
	callq	_dev_dbg
	leaq	(%r12,%rbx), %r13
	subq	%r15, %rbx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rbx,4), %r14
	subq	%r15, %r13
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r12, %rbx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addq	%r12, %r14
	movq	_VMCI_DATA_IN_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	movq	(%r15), %rsi
	movq	%rbx, %rdx
	callq	_ioread8_rep
	subq	%rbx, %r13
	cmpq	%rbx, %r13
	ja	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %r12
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rbx, %r15
	jae	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%r12, %r15
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(,%r12,4), %rsi
	addq	%r13, %rsi
	leaq	(,%r15,4), %rax
	subq	%rax, %rsi
	movq	%r13, %rdi
	movq	%r15, %rdx
	callq	_memmove
	movq	%r13, %r14
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_VMCI_DATA_IN_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %rdi
	leaq	(,%r15,4), %rsi
	addq	(%rax), %rsi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	subq	%r15, %rdx
	callq	_ioread8_rep
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movq	_VMCI_HYPERVISOR_CONTEXT_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rax
	movq	_VMCI_EVENT_HANDLER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_vmci_event_dispatch
	jmp	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_vmci_datagram_invoke_guest_handler
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_VMCI_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	16(%rcx), %edi
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r14,%rbx,4), %r14
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	leaq	(,%r12,4), %r15
	addq	%r13, %r15
	subq	%r14, %r15
	sarq	$2, %r15
	movq	_VMCI_DG_HEADERSIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jae	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_VMCI_DATA_IN_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %rdi
	movq	(%rax), %rsi
	movq	%r12, %rdx
	movq	%r12, %rbx
	callq	_ioread8_rep
	movq	%r12, %r15
	movq	%r13, %r14
LBB0_22:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rax
	movq	_VMCI_INVALID_ID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	cmpq	%rcx, %rax
	jne	LBB0_3
## %bb.23:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rsi, %r15
	ja	LBB0_3
LBB0_24:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VMCI_MAX_DG_SIZE,8,3           ## @VMCI_MAX_DG_SIZE
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_VMCI_DATA_IN_ADDR,8,3          ## @VMCI_DATA_IN_ADDR
	.comm	_VMCI_INVALID_ID,8,3            ## @VMCI_INVALID_ID
	.comm	_VMCI_HYPERVISOR_CONTEXT_ID,8,3 ## @VMCI_HYPERVISOR_CONTEXT_ID
	.comm	_VMCI_EVENT_HANDLER,8,3         ## @VMCI_EVENT_HANDLER
	.comm	_VMCI_SUCCESS,4,2               ## @VMCI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Datagram with resource (ID=0x%x) failed (err=%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to receive datagram (size=%u bytes)\n"

	.comm	_VMCI_DG_HEADERSIZE,8,3         ## @VMCI_DG_HEADERSIZE
	.no_dead_strip	_vmci_dispatch_dgs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmci_dispatch_dgs
_vmci_dispatch_dgs:                     ; @vmci_dispatch_dgs
	.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
	mov	x19, x0
	ldr	x27, [x0]
Lloh0:
	adrp	x8, _VMCI_MAX_DG_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VMCI_MAX_DG_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
Lloh3:
	adrp	x22, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x26, [x22]
	cmp	x21, x26
	cset	w0, lo
	bl	_BUILD_BUG_ON
Lloh5:
	adrp	x23, _VMCI_DATA_IN_ADDR@GOTPAGE
Lloh6:
	ldr	x23, [x23, _VMCI_DATA_IN_ADDR@GOTPAGEOFF]
	ldr	x8, [x23]
	ldp	x1, x9, [x19]
	add	x0, x8, x9
	mov	x2, x26
	bl	_ioread8_rep
	ldr	x8, [x27]
Lloh7:
	adrp	x20, _VMCI_INVALID_ID@GOTPAGE
Lloh8:
	ldr	x20, [x20, _VMCI_INVALID_ID@GOTPAGEOFF]
	ldr	x9, [x20]
	ldr	x1, [x22]
	cmp	x8, x9
	ccmp	x26, x1, #2, eq
	b.ls	LBB0_22
; %bb.1:
	lsl	x10, x21, #2
	add	x11, x27, x10
	stp	x11, x27, [sp, #16]             ; 16-byte Folded Spill
	neg	x28, x10
	mov	x24, x27
	mov	x25, x26
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x0, x24, #1
	bl	_roundup
	mov	x24, x0
	add	x8, x27, x25, lsl #2
	sub	x8, x8, x0
	asr	x26, x8, #2
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24]
	ldr	x9, [x20]
	ldr	x1, [x22]
	cmp	x8, x9
	ccmp	x26, x1, #2, eq
	b.ls	LBB0_22
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_VMCI_DG_SIZE_ALIGNED
	mov	w27, w0
	cmp	x21, x27
	b.hs	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #16]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x27
	bl	_dev_dbg
	sub	x8, x27, x26
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	add	x24, x9, x8, lsl #2
	add	x8, x21, x27
	sub	x25, x8, x26
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x23]
	ldp	x1, x9, [x19]
	add	x0, x8, x9
	mov	x2, x21
	bl	_ioread8_rep
	add	x24, x24, x28
	sub	x25, x25, x21
	cmp	x25, x21
	b.hi	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x21
	b	LBB0_20
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	x26, x27
	b.hs	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	x26, x25
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x24, [sp, #24]                  ; 8-byte Folded Reload
	add	x8, x24, x25, lsl #2
	sub	x1, x8, x26, lsl #2
	mov	x0, x24
	mov	x2, x26
	bl	_memmove
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23]
	ldp	x10, x9, [x19]
	add	x0, x8, x9
	add	x1, x10, x26, lsl #2
	sub	x2, x21, x26
	bl	_ioread8_rep
	mov	x25, x21
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24, #8]
Lloh11:
	adrp	x9, _VMCI_HYPERVISOR_CONTEXT_ID@GOTPAGE
Lloh12:
	ldr	x9, [x9, _VMCI_HYPERVISOR_CONTEXT_ID@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24]
Lloh14:
	adrp	x9, _VMCI_EVENT_HANDLER@GOTPAGE
Lloh15:
	ldr	x9, [x9, _VMCI_EVENT_HANDLER@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_vmci_event_dispatch
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_vmci_datagram_invoke_guest_handler
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
                                        ; kill: def $w0 killed $w0 def $x0
Lloh17:
	adrp	x8, _VMCI_SUCCESS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _VMCI_SUCCESS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19, #16]
	ldr	w2, [x24]
	str	x0, [sp]
	mov	x0, x8
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, x27, lsl #2
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x27, [sp, #24]                  ; 8-byte Folded Reload
	add	x8, x27, x25, lsl #2
	sub	x8, x8, x24
	asr	x26, x8, #2
Lloh22:
	adrp	x8, _VMCI_DG_HEADERSIZE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VMCI_DG_HEADERSIZE@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x26, x8
	b.hs	LBB0_3
; %bb.21:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23]
	ldp	x1, x9, [x19]
	add	x0, x8, x9
	mov	x2, x25
	bl	_ioread8_rep
	mov	x26, x25
	mov	x24, x27
	b	LBB0_3
LBB0_22:
	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
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_VMCI_MAX_DG_SIZE,8,3           ; @VMCI_MAX_DG_SIZE
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_VMCI_DATA_IN_ADDR,8,3          ; @VMCI_DATA_IN_ADDR
	.comm	_VMCI_INVALID_ID,8,3            ; @VMCI_INVALID_ID
	.comm	_VMCI_HYPERVISOR_CONTEXT_ID,8,3 ; @VMCI_HYPERVISOR_CONTEXT_ID
	.comm	_VMCI_EVENT_HANDLER,8,3         ; @VMCI_EVENT_HANDLER
	.comm	_VMCI_SUCCESS,4,2               ; @VMCI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Datagram with resource (ID=0x%x) failed (err=%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to receive datagram (size=%u bytes)\n"

	.comm	_VMCI_DG_HEADERSIZE,8,3         ; @VMCI_DG_HEADERSIZE
	.no_dead_strip	_vmci_dispatch_dgs
.subsections_via_symbols
