	.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
	movl	(%rax), %eax
	movq	_vmbus_connection@GOTPCREL(%rip), %r12
	movl	%eax, 24(%r12)
	leaq	L_.str(%rip), %rdi
	callq	_create_workqueue
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	60(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	56(%r12), %rdi
	callq	_spin_lock_init
	leaq	52(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	48(%r12), %rdi
	callq	_spin_lock_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, 8(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.12:
	movq	%rax, 40(%r12)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	addq	%rax, %rcx
	movq	%rcx, 32(%r12)
	movl	(%rbx), %edi
	orl	(%r15), %edi
	movl	$1, %esi
	callq	___get_free_pages
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.13:
	movl	(%r15), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.14:
	movq	%rax, %r14
	movq	_VERSION_CURRENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_VERSION_INVAL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vmbus_negotiate_version
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	%eax, %r15d
	movl	%ebx, %edi
	callq	_vmbus_get_next_version
	movl	%eax, %ebx
	cmpl	(%r13), %eax
	jne	LBB0_15
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	movq	_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_destroy_workqueue
LBB0_7:
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	xorl	%esi, %esi
	callq	_free_pages
	movq	$0, 8(%r12)
LBB0_9:
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	movl	$1, %esi
	callq	_free_pages
	movq	$0, (%r12)
LBB0_11:
	movq	%r14, %rdi
	callq	_kfree
LBB0_19:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	xorl	%r15d, %r15d
	cmpl	(%r13), %ebx
	je	LBB0_5
## %bb.18:
	movq	_vmbus_proto_version@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_host_info_eax@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_host_info_ebx@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movzwl	%dx, %ecx
	sarl	$16, %edx
	movq	_host_info_ecx@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_host_info_edx@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %r9d
	sarl	$24, %r9d
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	movl	%ebx, %r10d
	sarl	$16, %r10d
	movzwl	%bx, %ebx
	subq	$8, %rsp
	leaq	L_.str.1(%rip), %rdi
	pushq	%rbx
	pushq	%r10
	pushq	%rax
	callq	_pr_info
	addq	$32, %rsp
	movq	%r14, %rdi
	callq	_kfree
	xorl	%r15d, %r15d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_CONNECTING,4,2                 ## @CONNECTING
	.comm	_vmbus_connection,64,3          ## @vmbus_connection
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hv_vmbus_con"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.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	_VERSION_INVAL,4,2              ## @VERSION_INVAL
	.comm	_vmbus_proto_version,4,2        ## @vmbus_proto_version
L_.str.1:                               ## @.str.1
	.asciz	"Hyper-V Host Build:%d-%d.%d-%d-%d.%d; Vmbus version:%d.%d\n"

	.comm	_host_info_eax,4,2              ## @host_info_eax
	.comm	_host_info_ebx,4,2              ## @host_info_ebx
	.comm	_host_info_ecx,4,2              ## @host_info_ecx
	.comm	_host_info_edx,4,2              ## @host_info_edx
L_.str.2:                               ## @.str.2
	.asciz	"Unable to connect to host\n"

	.comm	_DISCONNECTED,4,2               ## @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:
	sub	sp, sp, #80
	.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
Lloh0:
	adrp	x8, _CONNECTING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONNECTING@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x22, _vmbus_connection@GOTPAGE
Lloh4:
	ldr	x22, [x22, _vmbus_connection@GOTPAGEOFF]
	str	w8, [x22, #24]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_create_workqueue
	str	x0, [x22, #16]
	cbz	x0, LBB0_7
; %bb.1:
	add	x0, x22, #60
	bl	_INIT_LIST_HEAD
	add	x0, x22, #56
	bl	_spin_lock_init
	add	x0, x22, #52
	bl	_INIT_LIST_HEAD
	add	x0, x22, #48
	bl	_spin_lock_init
Lloh7:
	adrp	x19, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x19, [x19, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh9:
	adrp	x20, ___GFP_ZERO@GOTPAGE
Lloh10:
	ldr	x20, [x20, ___GFP_ZERO@GOTPAGEOFF]
	ldr	w9, [x20]
	orr	w0, w9, w8
	mov	w1, #0
	bl	___get_free_pages
	str	x0, [x22, #8]
	cbz	x0, LBB0_7
; %bb.2:
Lloh11:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	asr	w8, w8, #1
	add	x8, x0, w8, sxtw
	stp	x8, x0, [x22, #32]
	ldr	w8, [x19]
	ldr	w9, [x20]
	orr	w0, w9, w8
	mov	w1, #1
	bl	___get_free_pages
	str	x0, [x22]
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w1, [x19]
	mov	w0, #8
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_8
; %bb.4:
Lloh14:
	adrp	x8, _VERSION_CURRENT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VERSION_CURRENT@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
Lloh17:
	adrp	x23, _VERSION_INVAL@GOTPAGE
Lloh18:
	ldr	x23, [x23, _VERSION_INVAL@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_vmbus_negotiate_version
	cbz	w0, LBB0_17
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x20, x0
	mov	x0, x21
	bl	_vmbus_get_next_version
	mov	x21, x0
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_5
	b	LBB0_9
LBB0_7:
	mov	x19, #0
LBB0_8:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
Lloh24:
	adrp	x8, _DISCONNECTED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DISCONNECTED@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x22, #24]
	ldr	x0, [x22, #16]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_destroy_workqueue
LBB0_11:
	ldr	x0, [x22, #8]
	cbz	x0, LBB0_13
; %bb.12:
	mov	w1, #0
	bl	_free_pages
	str	xzr, [x22, #8]
LBB0_13:
	ldr	x0, [x22]
	cbz	x0, LBB0_15
; %bb.14:
	mov	w1, #1
	bl	_free_pages
	str	xzr, [x22]
LBB0_15:
	mov	x0, x19
	bl	_kfree
LBB0_16:
	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
	add	sp, sp, #80
	ret
LBB0_17:
	ldr	w8, [x23]
	cmp	w21, w8
	b.ne	LBB0_19
; %bb.18:
	mov	w20, #0
	b	LBB0_9
LBB0_19:
Lloh27:
	adrp	x8, _vmbus_proto_version@GOTPAGE
Lloh28:
	ldr	x8, [x8, _vmbus_proto_version@GOTPAGEOFF]
Lloh29:
	str	w21, [x8]
Lloh30:
	adrp	x8, _host_info_eax@GOTPAGE
Lloh31:
	ldr	x8, [x8, _host_info_eax@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x8, _host_info_ebx@GOTPAGE
Lloh34:
	ldr	x8, [x8, _host_info_ebx@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	asr	w2, w8, #16
	and	w3, w8, #0xffff
Lloh36:
	adrp	x8, _host_info_ecx@GOTPAGE
Lloh37:
	ldr	x8, [x8, _host_info_ecx@GOTPAGEOFF]
Lloh38:
	adrp	x9, _host_info_edx@GOTPAGE
Lloh39:
	ldr	x9, [x9, _host_info_edx@GOTPAGEOFF]
Lloh40:
	ldr	w4, [x8]
Lloh41:
	ldr	w8, [x9]
	asr	w5, w8, #24
	and	w6, w8, #0xffffff
	asr	w7, w21, #16
	and	w8, w21, #0xffff
	str	w8, [sp]
Lloh42:
	adrp	x0, l_.str.1@PAGE
Lloh43:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	mov	x0, x19
	bl	_kfree
	mov	w20, #0
	b	LBB0_16
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh40
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_CONNECTING,4,2                 ; @CONNECTING
	.comm	_vmbus_connection,64,3          ; @vmbus_connection
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hv_vmbus_con"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.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	_VERSION_INVAL,4,2              ; @VERSION_INVAL
	.comm	_vmbus_proto_version,4,2        ; @vmbus_proto_version
l_.str.1:                               ; @.str.1
	.asciz	"Hyper-V Host Build:%d-%d.%d-%d-%d.%d; Vmbus version:%d.%d\n"

	.comm	_host_info_eax,4,2              ; @host_info_eax
	.comm	_host_info_ebx,4,2              ; @host_info_ebx
	.comm	_host_info_ecx,4,2              ; @host_info_ecx
	.comm	_host_info_edx,4,2              ; @host_info_edx
l_.str.2:                               ; @.str.2
	.asciz	"Unable to connect to host\n"

	.comm	_DISCONNECTED,4,2               ; @DISCONNECTED
.subsections_via_symbols
