	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmbus_connect                  ## -- Begin function vmbus_connect
	.p2align	4, 0x90
_vmbus_connect:                         ## @vmbus_connect
	.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	_CONNECTING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_vmbus_connection@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	leaq	L_.str(%rip), %rdi
	callq	_create_workqueue
	movq	%rax, 72(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_create_workqueue
	movq	%rax, 64(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	callq	_create_workqueue
	movq	%rax, 56(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	leaq	52(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	48(%r12), %rdi
	callq	_spin_lock_init
	leaq	44(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	40(%r12), %rdi
	callq	_mutex_init
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movq	___GFP_ZERO@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	orl	(%r15), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	___get_free_pages
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	movq	%rax, 32(%r12)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	addq	%rax, %rcx
	movq	%rcx, 24(%r12)
	movl	(%rbx), %edi
	orl	(%r15), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	___get_free_pages
	movq	8(%r12), %rcx
	movq	%rax, (%rcx)
	movl	(%rbx), %edi
	orl	(%r15), %edi
	xorl	%esi, %esi
	callq	___get_free_pages
	movq	8(%r12), %rcx
	movq	%rax, 8(%rcx)
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.9:
	cmpq	$0, 8(%rax)
	je	LBB0_5
## %bb.10:
	movl	(%r15), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.11:
	movq	%rax, %r14
	movq	_VERSION_CURRENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_ETIMEDOUT@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_vmbus_negotiate_version
	movl	%eax, %ebx
	addl	(%r13), %eax
	je	LBB0_7
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	(%r12), %rax
	movq	_CONNECTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%r15d, %edi
	callq	_vmbus_get_next_version
	movl	%eax, %r15d
	movq	_VERSION_INVAL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_12
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_err
	movq	_DISCONNECTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	xorl	%eax, %eax
	callq	_vmbus_disconnect
	movq	%r14, %rdi
	callq	_kfree
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_15:
	movq	_VERSION_INVAL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	je	LBB0_7
## %bb.16:
	movq	_vmbus_proto_version@GOTPCREL(%rip), %rax
	movl	%r15d, (%rax)
	movl	%r15d, %esi
	sarl	$16, %esi
	movzwl	%r15w, %edx
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_info
	movq	%r14, %rdi
	callq	_kfree
	xorl	%ebx, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_CONNECTING,8,3                 ## @CONNECTING
	.comm	_vmbus_connection,80,3          ## @vmbus_connection
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hv_vmbus_con"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"hv_pri_chan"

L_.str.2:                               ## @.str.2
	.asciz	"hv_sub_chan"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_VERSION_CURRENT,4,2            ## @VERSION_CURRENT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_CONNECTED,8,3                  ## @CONNECTED
	.comm	_VERSION_INVAL,4,2              ## @VERSION_INVAL
	.comm	_vmbus_proto_version,4,2        ## @vmbus_proto_version
L_.str.3:                               ## @.str.3
	.asciz	"Vmbus version:%d.%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Unable to connect to host\n"

	.comm	_DISCONNECTED,8,3               ## @DISCONNECTED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmbus_connect                  ; -- Begin function vmbus_connect
	.p2align	2
_vmbus_connect:                         ; @vmbus_connect
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _CONNECTING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONNECTING@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x22, _vmbus_connection@GOTPAGE
Lloh4:
	ldr	x22, [x22, _vmbus_connection@GOTPAGEOFF]
	str	x8, [x22]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_create_workqueue
	str	x0, [x22, #72]
	cbz	x0, LBB0_11
; %bb.1:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_create_workqueue
	str	x0, [x22, #64]
	cbz	x0, LBB0_11
; %bb.2:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_create_workqueue
	str	x0, [x22, #56]
	cbz	x0, LBB0_11
; %bb.3:
	add	x0, x22, #52
	bl	_INIT_LIST_HEAD
	add	x0, x22, #48
	bl	_spin_lock_init
	add	x0, x22, #44
	bl	_INIT_LIST_HEAD
	add	x0, x22, #40
	bl	_mutex_init
Lloh11:
	adrp	x19, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x19, [x19, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh13:
	adrp	x20, ___GFP_ZERO@GOTPAGE
Lloh14:
	ldr	x20, [x20, ___GFP_ZERO@GOTPAGEOFF]
	ldr	w9, [x20]
	orr	w0, w9, w8
	mov	w1, #0
	bl	___get_free_pages
	str	x0, [x22, #16]
	cbz	x0, LBB0_11
; %bb.4:
Lloh15:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	asr	w8, w8, #1
	add	x8, x0, w8, sxtw
	stp	x8, x0, [x22, #24]
	ldr	w8, [x19]
	ldr	w9, [x20]
	orr	w0, w9, w8
	mov	w1, #0
	bl	___get_free_pages
	ldr	x8, [x22, #8]
	str	x0, [x8]
	ldr	w8, [x19]
	ldr	w9, [x20]
	orr	w0, w9, w8
	mov	w1, #0
	bl	___get_free_pages
	ldr	x8, [x22, #8]
	str	x0, [x8, #8]
	ldr	x8, [x22, #8]
	ldr	x9, [x8]
	cbz	x9, LBB0_11
; %bb.5:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_11
; %bb.6:
	ldr	w1, [x19]
	mov	w0, #8
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_12
; %bb.7:
Lloh18:
	adrp	x8, _VERSION_CURRENT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VERSION_CURRENT@GOTPAGEOFF]
Lloh20:
	ldr	w21, [x8]
Lloh21:
	adrp	x23, _ETIMEDOUT@GOTPAGE
Lloh22:
	ldr	x23, [x23, _ETIMEDOUT@GOTPAGEOFF]
Lloh23:
	adrp	x25, _CONNECTED@GOTPAGE
Lloh24:
	ldr	x25, [x25, _CONNECTED@GOTPAGEOFF]
Lloh25:
	adrp	x24, _VERSION_INVAL@GOTPAGE
Lloh26:
	ldr	x24, [x24, _VERSION_INVAL@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_vmbus_negotiate_version
	mov	x20, x0
	ldr	w8, [x23]
	cmn	w0, w8
	b.eq	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x22]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	bl	_vmbus_get_next_version
	mov	x21, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_8
	b	LBB0_13
LBB0_11:
	mov	x19, #0
LBB0_12:
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_13:
Lloh30:
	adrp	x0, l_.str.4@PAGE
Lloh31:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
Lloh32:
	adrp	x8, _DISCONNECTED@GOTPAGE
Lloh33:
	ldr	x8, [x8, _DISCONNECTED@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	str	x8, [x22]
	bl	_vmbus_disconnect
	mov	x0, x19
	bl	_kfree
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_15:
	ldr	w8, [x24]
	cmp	w21, w8
	b.eq	LBB0_13
; %bb.16:
Lloh35:
	adrp	x8, _vmbus_proto_version@GOTPAGE
Lloh36:
	ldr	x8, [x8, _vmbus_proto_version@GOTPAGEOFF]
Lloh37:
	str	w21, [x8]
	asr	w1, w21, #16
	and	w2, w21, #0xffff
Lloh38:
	adrp	x0, l_.str.3@PAGE
Lloh39:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_info
	mov	x0, x19
	bl	_kfree
	mov	w20, #0
	b	LBB0_14
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_CONNECTING,8,3                 ; @CONNECTING
	.comm	_vmbus_connection,80,3          ; @vmbus_connection
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hv_vmbus_con"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"hv_pri_chan"

l_.str.2:                               ; @.str.2
	.asciz	"hv_sub_chan"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_VERSION_CURRENT,4,2            ; @VERSION_CURRENT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_CONNECTED,8,3                  ; @CONNECTED
	.comm	_VERSION_INVAL,4,2              ; @VERSION_INVAL
	.comm	_vmbus_proto_version,4,2        ; @vmbus_proto_version
l_.str.3:                               ; @.str.3
	.asciz	"Vmbus version:%d.%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Unable to connect to host\n"

	.comm	_DISCONNECTED,8,3               ; @DISCONNECTED
.subsections_via_symbols
