	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function balloon_connect_vsp
_balloon_connect_vsp:                   ## @balloon_connect_vsp
	.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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	(%rdi), %edi
	movq	_dm_ring_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_balloon_onchannelcallback@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r15, (%rsp)
	movl	%edx, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_vmbus_open
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	leaq	-184(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$72, %edx
	callq	_memset
	movq	_DM_VERSION_REQUEST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -136(%rbp)
	movl	$72, -152(%rbp)
	movq	_trans_id@GOTPCREL(%rip), %rdi
	callq	_atomic_inc_return
	movq	%rax, -144(%rbp)
	movq	_DYNMEM_PROTOCOL_VERSION_WIN10@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	_dm_device@GOTPCREL(%rip), %r12
	movl	%eax, 12(%r12)
	movl	(%r15), %edi
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	movq	%rbx, %rsi
	movl	$72, %edx
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_vmbus_sendpacket
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.2:
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,4), %esi
	leaq	8(%r12), %r14
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	(%r12), %rax
	movq	_DM_INIT_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
LBB0_8:
	movq	_EPROTO@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	movl	12(%r12), %edi
	callq	_DYNMEM_MAJOR_VERSION
	movl	%eax, %ebx
	movl	12(%r12), %edi
	callq	_DYNMEM_MINOR_VERSION
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_pr_info
	leaq	-112(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$72, %edx
	callq	_memset
	movq	_DM_CAPABILITIES_REPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	$72, -80(%rbp)
	movq	_trans_id@GOTPCREL(%rip), %rdi
	callq	_atomic_inc_return
	movq	%rax, -72(%rbp)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, -96(%rbp)
	movl	$7, -88(%rbp)
	movq	$0, -104(%rbp)
	movl	$-1, -112(%rbp)
	movl	(%r15), %edi
	movl	(%r13), %r8d
	movq	%rbx, %rsi
	movl	$72, %edx
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_vmbus_sendpacket
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,4), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_3
## %bb.7:
	movq	(%r12), %rax
	xorl	%ebx, %ebx
	movq	_DM_INIT_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
	jmp	LBB0_11
LBB0_3:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	(%r15), %edi
	callq	_vmbus_close
LBB0_11:
	movl	%ebx, %eax
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dm_ring_size,4,2               ## @dm_ring_size
	.comm	_balloon_onchannelcallback,4,2  ## @balloon_onchannelcallback
	.comm	_DM_VERSION_REQUEST,4,2         ## @DM_VERSION_REQUEST
	.comm	_trans_id,4,2                   ## @trans_id
	.comm	_DYNMEM_PROTOCOL_VERSION_WIN10,4,2 ## @DYNMEM_PROTOCOL_VERSION_WIN10
	.comm	_dm_device,16,3                 ## @dm_device
	.comm	_VM_PKT_DATA_INBAND,4,2         ## @VM_PKT_DATA_INBAND
	.comm	_HZ,4,2                         ## @HZ
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_DM_INIT_ERROR,8,3              ## @DM_INIT_ERROR
	.comm	_EPROTO,4,2                     ## @EPROTO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Using Dynamic Memory protocol version %u.%u\n"

	.comm	_DM_CAPABILITIES_REPORT,4,2     ## @DM_CAPABILITIES_REPORT
	.no_dead_strip	_balloon_connect_vsp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function balloon_connect_vsp
_balloon_connect_vsp:                   ; @balloon_connect_vsp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _dm_ring_size@GOTPAGE
Lloh1:
	ldr	x8, [x8, _dm_ring_size@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _balloon_onchannelcallback@GOTPAGE
Lloh4:
	ldr	x8, [x8, _balloon_onchannelcallback@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	mov	x2, x1
	mov	x3, #0
	mov	w4, #0
	mov	x6, x19
	bl	_vmbus_open
	mov	x20, x0
	cbnz	w0, LBB0_12
; %bb.1:
	mov	w20, #72
	add	x0, sp, #72
	mov	w1, #0
	mov	w2, #72
	bl	_memset
Lloh6:
	adrp	x8, _DM_VERSION_REQUEST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DM_VERSION_REQUEST@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #120]
	str	w20, [sp, #104]
Lloh9:
	adrp	x0, _trans_id@GOTPAGE
Lloh10:
	ldr	x0, [x0, _trans_id@GOTPAGEOFF]
	bl	_atomic_inc_return
	str	x0, [sp, #112]
Lloh11:
	adrp	x8, _DYNMEM_PROTOCOL_VERSION_WIN10@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DYNMEM_PROTOCOL_VERSION_WIN10@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [sp, #128]
Lloh14:
	adrp	x21, _dm_device@GOTPAGE
Lloh15:
	ldr	x21, [x21, _dm_device@GOTPAGEOFF]
	str	xzr, [sp, #136]
	str	w8, [x21, #12]
	ldr	w0, [x19]
Lloh16:
	adrp	x22, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh17:
	ldr	x22, [x22, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
	ldr	w4, [x22]
	add	x1, sp, #72
	mov	w2, #72
	mov	x3, #0
	mov	w5, #0
	bl	_vmbus_sendpacket
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.2:
Lloh18:
	adrp	x23, _HZ@GOTPAGE
Lloh19:
	ldr	x23, [x23, _HZ@GOTPAGEOFF]
	ldr	w8, [x23]
	add	w1, w8, w8, lsl #2
	add	x0, x21, #8
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_9
; %bb.3:
	ldr	x8, [x21]
Lloh20:
	adrp	x24, _DM_INIT_ERROR@GOTPAGE
Lloh21:
	ldr	x24, [x24, _DM_INIT_ERROR@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_4:
Lloh22:
	adrp	x8, _EPROTO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
	b	LBB0_10
LBB0_5:
	ldr	w0, [x21, #12]
	bl	_DYNMEM_MAJOR_VERSION
	mov	x20, x0
	ldr	w0, [x21, #12]
	bl	_DYNMEM_MINOR_VERSION
	mov	x2, x0
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_pr_info
	mov	w20, #72
	mov	x0, sp
	mov	w1, #0
	mov	w2, #72
	bl	_memset
Lloh26:
	adrp	x8, _DM_CAPABILITIES_REPORT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DM_CAPABILITIES_REPORT@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [sp, #48]
	str	w20, [sp, #32]
Lloh29:
	adrp	x0, _trans_id@GOTPAGE
Lloh30:
	ldr	x0, [x0, _trans_id@GOTPAGEOFF]
	bl	_atomic_inc_return
	str	x0, [sp, #40]
	movi.2s	v0, #1
	str	d0, [sp, #16]
	mov	w8, #7
	str	w8, [sp, #24]
	str	xzr, [sp, #8]
	mov	w8, #-1
	str	w8, [sp]
	ldr	w0, [x19]
	ldr	w4, [x22]
	mov	x1, sp
	mov	w2, #72
	mov	x3, #0
	mov	w5, #0
	bl	_vmbus_sendpacket
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.6:
	ldr	w8, [x23]
	add	w1, w8, w8, lsl #2
	add	x0, x21, #8
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_9
; %bb.7:
	ldr	x8, [x21]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.8:
	mov	w20, #0
	b	LBB0_12
LBB0_9:
Lloh31:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_11:
	ldr	w0, [x19]
	bl	_vmbus_close
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_dm_ring_size,4,2               ; @dm_ring_size
	.comm	_balloon_onchannelcallback,4,2  ; @balloon_onchannelcallback
	.comm	_DM_VERSION_REQUEST,4,2         ; @DM_VERSION_REQUEST
	.comm	_trans_id,4,2                   ; @trans_id
	.comm	_DYNMEM_PROTOCOL_VERSION_WIN10,4,2 ; @DYNMEM_PROTOCOL_VERSION_WIN10
	.comm	_dm_device,16,3                 ; @dm_device
	.comm	_VM_PKT_DATA_INBAND,4,2         ; @VM_PKT_DATA_INBAND
	.comm	_HZ,4,2                         ; @HZ
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_DM_INIT_ERROR,8,3              ; @DM_INIT_ERROR
	.comm	_EPROTO,4,2                     ; @EPROTO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Using Dynamic Memory protocol version %u.%u\n"

	.comm	_DM_CAPABILITIES_REPORT,4,2     ; @DM_CAPABILITIES_REPORT
	.no_dead_strip	_balloon_connect_vsp
.subsections_via_symbols
