	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmbus_negotiate_version        ## -- Begin function vmbus_negotiate_version
	.p2align	4, 0x90
_vmbus_negotiate_version:               ## @vmbus_negotiate_version
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	addq	$20, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_init_completion
	movq	24(%r15), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	_CHANNELMSG_INITIATE_CONTACT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	%r14, 40(%rbx)
	movq	_VERSION_WIN10_V5@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	_vmbus_connection@GOTPCREL(%rip), %rax
	movl	32(%rax), %edi
	callq	_virt_to_phys
	movq	%rax, 24(%rbx)
	movq	_VMBUS_MESSAGE_CONNECTION_ID@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_VMBUS_MESSAGE_SINT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_VMBUS_MESSAGE_CONNECTION_ID_4@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movq	_vmbus_connection@GOTPCREL(%rip), %r12
	movl	%eax, 4(%r12)
	movq	24(%r12), %rax
	movl	(%rax), %edi
	callq	_virt_to_phys
	movq	%rax, 16(%rbx)
	movq	24(%r12), %rax
	movl	4(%rax), %edi
	callq	_virt_to_phys
	movq	%rax, 8(%rbx)
	movq	_VERSION_WIN8_1@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_4
## %bb.5:
	movq	$0, (%rbx)
	movl	$0, (%r12)
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	callq	_get_cpu
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_hv_cpu_number_to_vp_number
	movq	%rax, (%rbx)
	movl	%r14d, (%r12)
	xorl	%eax, %eax
	callq	_put_cpu
LBB0_6:
	movq	%r12, %r14
	leaq	12(%r12), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %r12
	addq	$16, %r15
	leaq	16(%r14), %rsi
	movq	%r15, %rdi
	callq	_list_add_tail
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	movl	$56, %esi
	movl	$1, %edx
	callq	_vmbus_post_msg
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_trace_vmbus_negotiate_version
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.7:
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_list_del
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
LBB0_12:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_vmbus_connection@GOTPCREL(%rip), %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_wait_for_completion
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_list_del
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	$0, 8(%r12)
	je	LBB0_11
## %bb.9:
	movq	_CONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	xorl	%r14d, %r14d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	_VERSION_WIN10_V5@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jg	LBB0_12
## %bb.10:
	movl	(%r12), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_12
LBB0_11:
	movq	_ECONNREFUSED@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_CHANNELMSG_INITIATE_CONTACT,4,2 ## @CHANNELMSG_INITIATE_CONTACT
	.comm	_VERSION_WIN10_V5,8,3           ## @VERSION_WIN10_V5
	.comm	_VMBUS_MESSAGE_SINT,4,2         ## @VMBUS_MESSAGE_SINT
	.comm	_VMBUS_MESSAGE_CONNECTION_ID_4,4,2 ## @VMBUS_MESSAGE_CONNECTION_ID_4
	.comm	_vmbus_connection,40,3          ## @vmbus_connection
	.comm	_VMBUS_MESSAGE_CONNECTION_ID,4,2 ## @VMBUS_MESSAGE_CONNECTION_ID
	.comm	_VERSION_WIN8_1,8,3             ## @VERSION_WIN8_1
	.comm	_CONNECTED,4,2                  ## @CONNECTED
	.comm	_ECONNREFUSED,4,2               ## @ECONNREFUSED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmbus_negotiate_version        ; -- Begin function vmbus_negotiate_version
	.p2align	2
_vmbus_negotiate_version:               ; @vmbus_negotiate_version
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x19, x0
	add	x21, x0, #20
	mov	x0, x21
	bl	_init_completion
	ldr	x22, [x19, #24]
	mov	x0, x22
	mov	w1, #0
	mov	w2, #56
	bl	_memset
Lloh0:
	adrp	x8, _CHANNELMSG_INITIATE_CONTACT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHANNELMSG_INITIATE_CONTACT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x22, #48]
	str	x20, [x22, #40]
Lloh3:
	adrp	x27, _VERSION_WIN10_V5@GOTPAGE
Lloh4:
	ldr	x27, [x27, _VERSION_WIN10_V5@GOTPAGEOFF]
	ldr	x8, [x27]
Lloh5:
	adrp	x26, _vmbus_connection@GOTPAGE
Lloh6:
	ldr	x26, [x26, _vmbus_connection@GOTPAGEOFF]
	cmp	x8, x20
	b.le	LBB0_2
; %bb.1:
	ldr	w0, [x26, #32]
	bl	_virt_to_phys
	str	x0, [x22, #24]
Lloh7:
	adrp	x8, _VMBUS_MESSAGE_CONNECTION_ID@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VMBUS_MESSAGE_CONNECTION_ID@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh9:
	adrp	x8, _VMBUS_MESSAGE_SINT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VMBUS_MESSAGE_SINT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x22, #32]
Lloh12:
	adrp	x8, _VMBUS_MESSAGE_CONNECTION_ID_4@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VMBUS_MESSAGE_CONNECTION_ID_4@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	str	w8, [x26, #4]
	ldr	x8, [x26, #24]
	ldr	w0, [x8]
	bl	_virt_to_phys
	str	x0, [x22, #16]
	ldr	x8, [x26, #24]
	ldr	w0, [x8, #4]
	bl	_virt_to_phys
	str	x0, [x22, #8]
Lloh14:
	adrp	x8, _VERSION_WIN8_1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VERSION_WIN8_1@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x8, x20
	b.le	LBB0_5
; %bb.4:
	str	xzr, [x22]
	str	wzr, [x26]
	b	LBB0_6
LBB0_5:
	bl	_get_cpu
	mov	x23, x0
	bl	_hv_cpu_number_to_vp_number
	str	x0, [x22]
	str	w23, [x26]
	bl	_put_cpu
LBB0_6:
	add	x23, x26, #12
	mov	x0, x23
	bl	_spin_lock_irqsave
	add	x24, x19, #16
	add	x1, x26, #16
	mov	x0, x24
	bl	_list_add_tail
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	mov	w1, #56
	mov	w2, #1
	bl	_vmbus_post_msg
	mov	x25, x0
	mov	x0, x22
	mov	x1, x25
	bl	_trace_vmbus_negotiate_version
	cbz	w25, LBB0_9
; %bb.7:
	mov	x0, x23
	bl	_spin_lock_irqsave
	mov	x0, x24
	bl	_list_del
	mov	x0, x23
	bl	_spin_unlock_irqrestore
LBB0_8:
	mov	x0, x25
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x21
	bl	_wait_for_completion
	mov	x0, x23
	bl	_spin_lock_irqsave
	mov	x0, x24
	bl	_list_del
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_12
; %bb.10:
Lloh17:
	adrp	x8, _CONNECTED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CONNECTED@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x26, #8]
	ldr	x8, [x27]
	cmp	x8, x20
	b.le	LBB0_13
; %bb.11:
	mov	w25, #0
	b	LBB0_8
LBB0_12:
Lloh20:
	adrp	x8, _ECONNREFUSED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ECONNREFUSED@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_8
LBB0_13:
	mov	w25, #0
	ldr	w8, [x19]
	str	w8, [x26, #4]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_CHANNELMSG_INITIATE_CONTACT,4,2 ; @CHANNELMSG_INITIATE_CONTACT
	.comm	_VERSION_WIN10_V5,8,3           ; @VERSION_WIN10_V5
	.comm	_VMBUS_MESSAGE_SINT,4,2         ; @VMBUS_MESSAGE_SINT
	.comm	_VMBUS_MESSAGE_CONNECTION_ID_4,4,2 ; @VMBUS_MESSAGE_CONNECTION_ID_4
	.comm	_vmbus_connection,40,3          ; @vmbus_connection
	.comm	_VMBUS_MESSAGE_CONNECTION_ID,4,2 ; @VMBUS_MESSAGE_CONNECTION_ID
	.comm	_VERSION_WIN8_1,8,3             ; @VERSION_WIN8_1
	.comm	_CONNECTED,4,2                  ; @CONNECTED
	.comm	_ECONNREFUSED,4,2               ; @ECONNREFUSED
.subsections_via_symbols
