	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function negotiate_nvsp_ver
_negotiate_nvsp_ver:                    ## @negotiate_nvsp_ver
	.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	%rcx, %r15
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_hv_get_drvdata
	movq	%rax, %r12
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	_NVSP_MSG_TYPE_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	%r15, 40(%rbx)
	movq	%r15, 32(%rbx)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_trace_nvsp_send
	movl	(%r14), %edi
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%rbx, %rsi
	movl	$56, %edx
	movq	%rbx, %rcx
	callq	_vmbus_sendpacket
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	%r13, %rdi
	callq	_wait_for_completion
	movq	24(%rbx), %rax
	movq	_NVSP_STAT_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.4:
	movq	_NVSP_PROTOCOL_VERSION_1@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpq	%r15, (%rcx)
	je	LBB0_3
## %bb.5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	_NVSP_MSG2_TYPE_SEND_NDIS_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	_ETH_HLEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	(%r12), %rax
	movq	%rax, 16(%rbx)
	movl	$1, (%rbx)
	movq	_NVSP_PROTOCOL_VERSION_5@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jg	LBB0_7
## %bb.6:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 4(%rbx)
LBB0_7:
	movq	_NVSP_PROTOCOL_VERSION_61@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jg	LBB0_9
## %bb.8:
	movl	$1, 12(%rbx)
LBB0_9:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_trace_nvsp_send
	movl	(%r14), %edi
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rsi
	movl	$56, %edx
	movq	%rbx, %rcx
	xorl	%r9d, %r9d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vmbus_sendpacket               ## TAILCALL
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVSP_MSG_TYPE_INIT,4,2         ## @NVSP_MSG_TYPE_INIT
	.comm	_VM_PKT_DATA_INBAND,4,2         ## @VM_PKT_DATA_INBAND
	.comm	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,2 ## @VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
	.comm	_NVSP_STAT_SUCCESS,8,3          ## @NVSP_STAT_SUCCESS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NVSP_PROTOCOL_VERSION_1,8,3    ## @NVSP_PROTOCOL_VERSION_1
	.comm	_NVSP_MSG2_TYPE_SEND_NDIS_CONFIG,4,2 ## @NVSP_MSG2_TYPE_SEND_NDIS_CONFIG
	.comm	_ETH_HLEN,8,3                   ## @ETH_HLEN
	.comm	_NVSP_PROTOCOL_VERSION_5,8,3    ## @NVSP_PROTOCOL_VERSION_5
	.comm	_NVSP_PROTOCOL_VERSION_61,8,3   ## @NVSP_PROTOCOL_VERSION_61
	.no_dead_strip	_negotiate_nvsp_ver
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function negotiate_nvsp_ver
_negotiate_nvsp_ver:                    ; @negotiate_nvsp_ver
	.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	x21, x3
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
	bl	_hv_get_drvdata
	mov	x22, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #56
	bl	_memset
Lloh0:
	adrp	x8, _NVSP_MSG_TYPE_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVSP_MSG_TYPE_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	stp	x21, x21, [x19, #32]
	mov	x0, x22
	mov	x1, x19
	bl	_trace_nvsp_send
	ldr	w0, [x20]
Lloh3:
	adrp	x24, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh4:
	ldr	x24, [x24, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
	ldr	w4, [x24]
Lloh5:
	adrp	x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGEOFF]
Lloh7:
	ldr	w5, [x8]
	mov	x1, x19
	mov	w2, #56
	mov	x3, x19
	bl	_vmbus_sendpacket
	cbnz	w0, LBB0_5
; %bb.1:
	mov	x0, x23
	bl	_wait_for_completion
	ldr	x8, [x19, #24]
Lloh8:
	adrp	x9, _NVSP_STAT_SUCCESS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NVSP_STAT_SUCCESS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
Lloh11:
	adrp	x8, _NVSP_PROTOCOL_VERSION_1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NVSP_PROTOCOL_VERSION_1@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ne	LBB0_6
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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_6:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #56
	bl	_memset
Lloh17:
	adrp	x8, _NVSP_MSG2_TYPE_SEND_NDIS_CONFIG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NVSP_MSG2_TYPE_SEND_NDIS_CONFIG@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	ldr	x8, [x22]
Lloh20:
	adrp	x9, _ETH_HLEN@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ETH_HLEN@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x8, x9, x8
	str	x8, [x19, #16]
	mov	w8, #1
	str	w8, [x19]
Lloh23:
	adrp	x8, _NVSP_PROTOCOL_VERSION_5@GOTPAGE
Lloh24:
	ldr	x8, [x8, _NVSP_PROTOCOL_VERSION_5@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cmp	x8, x21
	b.gt	LBB0_8
; %bb.7:
	movi.2s	v0, #1
	stur	d0, [x19, #4]
LBB0_8:
Lloh26:
	adrp	x8, _NVSP_PROTOCOL_VERSION_61@GOTPAGE
Lloh27:
	ldr	x8, [x8, _NVSP_PROTOCOL_VERSION_61@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cmp	x8, x21
	b.gt	LBB0_10
; %bb.9:
	mov	w8, #1
	str	w8, [x19, #12]
LBB0_10:
	mov	x0, x22
	mov	x1, x19
	bl	_trace_nvsp_send
	ldr	w0, [x20]
	ldr	w4, [x24]
	mov	x1, x19
	mov	w2, #56
	mov	x3, x19
	mov	w5, #0
	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
	b	_vmbus_sendpacket
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_NVSP_MSG_TYPE_INIT,4,2         ; @NVSP_MSG_TYPE_INIT
	.comm	_VM_PKT_DATA_INBAND,4,2         ; @VM_PKT_DATA_INBAND
	.comm	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,2 ; @VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
	.comm	_NVSP_STAT_SUCCESS,8,3          ; @NVSP_STAT_SUCCESS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NVSP_PROTOCOL_VERSION_1,8,3    ; @NVSP_PROTOCOL_VERSION_1
	.comm	_NVSP_MSG2_TYPE_SEND_NDIS_CONFIG,4,2 ; @NVSP_MSG2_TYPE_SEND_NDIS_CONFIG
	.comm	_ETH_HLEN,8,3                   ; @ETH_HLEN
	.comm	_NVSP_PROTOCOL_VERSION_5,8,3    ; @NVSP_PROTOCOL_VERSION_5
	.comm	_NVSP_PROTOCOL_VERSION_61,8,3   ; @NVSP_PROTOCOL_VERSION_61
	.no_dead_strip	_negotiate_nvsp_ver
.subsections_via_symbols
