	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __vmbus_open
___vmbus_open:                          ## @__vmbus_open
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MAX_USER_DEFINED_BYTES@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jb	LBB0_1
## %bb.2:
	movq	%rcx, %r15
	movq	%rdi, %rbx
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	64(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	80(%rdi), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	16(%rbx), %r14
	movq	_CHANNEL_OPEN_STATE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	%r13, %r14
	jne	LBB0_1
## %bb.3:
	movq	_CHANNEL_OPENING_STATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movq	%r15, 24(%rbx)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 72(%rbx)
	leaq	36(%rbx), %r12
	movq	%r12, %rdi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_hv_ringbuffer_init
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.4:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	subq	%r13, %rdx
	leaq	32(%rbx), %rdi
	leaq	(%r14,%r13,4), %rsi
	callq	_hv_ringbuffer_init
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.5:
	leaq	40(%rbx), %r14
	movq	$0, 40(%rbx)
	movq	64(%rbx), %rdi
	callq	_page_address
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	shlq	%cl, %rdx
	movq	%rbx, %rdi
	movl	%eax, %esi
	movq	%r14, %rcx
	callq	_vmbus_establish_gpadl
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$80, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r13
	movq	%rax, %rdi
	addq	$16, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_init_completion
	movq	%rbx, 32(%r13)
	movq	24(%r13), %r14
	movq	_CHANNELMSG_OPENCHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	movl	60(%rbx), %eax
	movl	%eax, 28(%r14)
	movl	%eax, 24(%r14)
	movq	40(%rbx), %rax
	movq	%rax, 16(%r14)
	movq	(%rbx), %rax
	movq	%rax, (%r14)
	movl	56(%rbx), %eax
	movl	%eax, 12(%r14)
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.9:
	movl	8(%r14), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
LBB0_10:
	movq	_vmbus_connection@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	leaq	4(%r15), %rsi
	movq	%r13, %rdi
	callq	_list_add_tail
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	$0, 48(%rbx)
	je	LBB0_13
LBB0_11:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_12:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_19
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_22
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_20
LBB0_13:
	movq	%r14, %rdi
	movl	$40, %esi
	movl	$1, %edx
	callq	_vmbus_post_msg
	movl	%eax, %r15d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_trace_vmbus_open
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.18:
	movq	_vmbus_connection@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r13, %rdi
	callq	_list_del
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_19:
	movq	%r13, %rdi
	callq	_kfree
LBB0_20:
	movq	40(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_vmbus_teardown_gpadl
	movq	$0, 40(%rbx)
LBB0_21:
	movq	%r12, %rdi
	callq	_hv_ringbuffer_cleanup
	leaq	32(%rbx), %rdi
	callq	_hv_ringbuffer_cleanup
	movq	_CHANNEL_OPEN_STATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
LBB0_22:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_wait_for_completion
	movq	_vmbus_connection@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r13, %rdi
	callq	_list_del
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	$0, 48(%rbx)
	jne	LBB0_11
## %bb.15:
	cmpq	$0, 8(%r13)
	je	LBB0_17
## %bb.16:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_17:
	movq	_CHANNEL_OPENED_STATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movq	%r13, %rdi
	callq	_kfree
	xorl	%r15d, %r15d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_USER_DEFINED_BYTES,8,3     ## @MAX_USER_DEFINED_BYTES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CHANNEL_OPEN_STATE,8,3         ## @CHANNEL_OPEN_STATE
	.comm	_CHANNEL_OPENING_STATE,8,3      ## @CHANNEL_OPENING_STATE
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CHANNELMSG_OPENCHANNEL,4,2     ## @CHANNELMSG_OPENCHANNEL
	.comm	_vmbus_connection,8,2           ## @vmbus_connection
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_CHANNEL_OPENED_STATE,8,3       ## @CHANNEL_OPENED_STATE
	.no_dead_strip	___vmbus_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __vmbus_open
___vmbus_open:                          ; @__vmbus_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, _MAX_USER_DEFINED_BYTES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_USER_DEFINED_BYTES@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x2
	b.lo	LBB0_11
; %bb.1:
	mov	x20, x4
	mov	x24, x3
	mov	x22, x2
	mov	x19, x0
	str	x1, [sp, #8]                    ; 8-byte Folded Spill
	ldr	x21, [x0, #64]
	add	x26, x0, #80
	ldp	x25, x28, [x0]
	mov	x0, x26
	bl	_spin_lock_irqsave
	ldr	x27, [x19, #16]
Lloh3:
	adrp	x8, _CHANNEL_OPEN_STATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHANNEL_OPEN_STATE@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	mov	x0, x26
	bl	_spin_unlock_irqrestore
	cmp	x27, x23
	b.ne	LBB0_11
; %bb.2:
Lloh6:
	adrp	x8, _CHANNEL_OPENING_STATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CHANNEL_OPENING_STATE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	stp	x8, x24, [x19, #16]
	str	x20, [x19, #72]
	add	x20, x19, #36
	mov	x0, x20
	mov	x1, x21
	mov	x2, x25
	bl	_hv_ringbuffer_init
	mov	x24, x0
	cbnz	w0, LBB0_17
; %bb.3:
	sub	x2, x28, x25
	add	x0, x19, #32
	add	x1, x21, x25, lsl #2
	bl	_hv_ringbuffer_init
	mov	x24, x0
	cbnz	w0, LBB0_17
; %bb.4:
	mov	x21, x19
	str	xzr, [x21, #40]!
	ldr	x0, [x19, #64]
	bl	_page_address
	mov	x1, x0
Lloh9:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	lsl	x2, x28, x8
	mov	x0, x19
	mov	x3, x21
	bl	_vmbus_establish_gpadl
	mov	x24, x0
	cbnz	w0, LBB0_17
; %bb.5:
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w0, #80
	bl	_kmalloc
	cbz	x0, LBB0_12
; %bb.6:
	mov	x21, x0
	add	x25, x0, #16
	mov	x0, x25
	bl	_init_completion
	str	x19, [x21, #32]
Lloh15:
	adrp	x8, _CHANNELMSG_OPENCHANNEL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CHANNELMSG_OPENCHANNEL@GOTPAGEOFF]
	ldr	x26, [x21, #24]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x26, #32]
	ldp	w9, w8, [x19, #56]
	stp	w8, w8, [x26, #24]
	ldr	x8, [x19, #40]
	str	x8, [x26, #16]
	ldr	x8, [x19]
	str	x8, [x26]
	str	w9, [x26, #12]
	cbz	x22, LBB0_8
; %bb.7:
	ldr	w0, [x26, #8]
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x22
	bl	_memcpy
LBB0_8:
Lloh18:
	adrp	x22, _vmbus_connection@GOTPAGE
Lloh19:
	ldr	x22, [x22, _vmbus_connection@GOTPAGEOFF]
	mov	x0, x22
	bl	_spin_lock_irqsave
	add	x1, x22, #4
	mov	x0, x21
	bl	_list_add_tail
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_13
LBB0_9:
Lloh20:
	adrp	x8, _ENODEV@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_15
LBB0_11:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_18
LBB0_12:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_16
LBB0_13:
	mov	x0, x26
	mov	w1, #40
	mov	w2, #1
	bl	_vmbus_post_msg
	mov	x24, x0
	mov	x0, x26
	mov	x1, x24
	bl	_trace_vmbus_open
	cbz	w24, LBB0_19
; %bb.14:
Lloh28:
	adrp	x22, _vmbus_connection@GOTPAGE
Lloh29:
	ldr	x22, [x22, _vmbus_connection@GOTPAGEOFF]
	mov	x0, x22
	bl	_spin_lock_irqsave
	mov	x0, x21
	bl	_list_del
	mov	x0, x22
	bl	_spin_unlock_irqrestore
LBB0_15:
	mov	x0, x21
	bl	_kfree
LBB0_16:
	ldr	x1, [x19, #40]
	mov	x0, x19
	bl	_vmbus_teardown_gpadl
	str	xzr, [x19, #40]
LBB0_17:
	mov	x0, x20
	bl	_hv_ringbuffer_cleanup
	add	x0, x19, #32
	bl	_hv_ringbuffer_cleanup
Lloh30:
	adrp	x8, _CHANNEL_OPEN_STATE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CHANNEL_OPEN_STATE@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	str	x8, [x19, #16]
LBB0_18:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_19:
	mov	x0, x25
	bl	_wait_for_completion
Lloh33:
	adrp	x22, _vmbus_connection@GOTPAGE
Lloh34:
	ldr	x22, [x22, _vmbus_connection@GOTPAGEOFF]
	mov	x0, x22
	bl	_spin_lock_irqsave
	mov	x0, x21
	bl	_list_del
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_9
; %bb.20:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_22
; %bb.21:
Lloh35:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_10
LBB0_22:
Lloh37:
	adrp	x8, _CHANNEL_OPENED_STATE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _CHANNEL_OPENED_STATE@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
	str	x8, [x19, #16]
	mov	x0, x21
	bl	_kfree
	mov	w24, #0
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_USER_DEFINED_BYTES,8,3     ; @MAX_USER_DEFINED_BYTES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CHANNEL_OPEN_STATE,8,3         ; @CHANNEL_OPEN_STATE
	.comm	_CHANNEL_OPENING_STATE,8,3      ; @CHANNEL_OPENING_STATE
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CHANNELMSG_OPENCHANNEL,4,2     ; @CHANNELMSG_OPENCHANNEL
	.comm	_vmbus_connection,8,2           ; @vmbus_connection
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_CHANNEL_OPENED_STATE,8,3       ; @CHANNEL_OPENED_STATE
	.no_dead_strip	___vmbus_open
.subsections_via_symbols
