	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hv_pci_protocol_negotiation
_hv_pci_protocol_negotiation:           ## @hv_pci_protocol_negotiation
	.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	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_init_completion
	movq	_hv_pci_generic_compl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movq	%rbx, 8(%r15)
	movq	_PCI_QUERY_PROTOCOL_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_pci_protocol_versions@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_12
## %bb.3:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r12
	movq	(%rbx), %rax
	movq	(%rax,%r13,8), %rax
	movq	%rax, (%r15)
	movl	4(%r14), %edi
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r15, %rsi
	movl	$16, %edx
	movq	%r15, %rcx
	callq	_vmbus_sendpacket
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	leaq	-48(%rbp), %rsi
	callq	_wait_for_response
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %edx
	testl	%edx, %edx
	jns	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_STATUS_REVISION_MISMATCH@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	leaq	-48(%rbp), %rdi
	callq	_reinit_completion
	incq	%r13
	movq	%r12, %rbx
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r13
	jl	LBB0_4
LBB0_12:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movq	_EPROTO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_6:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_8:
	movq	(%r12), %rax
	movq	(%rax,%r13,8), %rdx
	movq	_pci_protocol_version@GOTPCREL(%rip), %rax
	movq	%rdx, (%rax)
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	xorl	%ebx, %ebx
LBB0_14:
	movq	%r15, %rdi
	callq	_kfree
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_hv_pci_generic_compl,4,2       ## @hv_pci_generic_compl
	.comm	_PCI_QUERY_PROTOCOL_VERSION,4,2 ## @PCI_QUERY_PROTOCOL_VERSION
	.comm	_pci_protocol_versions,8,3      ## @pci_protocol_versions
	.comm	_VM_PKT_DATA_INBAND,4,2         ## @VM_PKT_DATA_INBAND
	.comm	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,2 ## @VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PCI Pass-through VSP failed to request version: %d"

	.comm	_pci_protocol_version,8,3       ## @pci_protocol_version
L_.str.1:                               ## @.str.1
	.asciz	"PCI VMBus probing: Using version %#x\n"

	.comm	_STATUS_REVISION_MISMATCH,4,2   ## @STATUS_REVISION_MISMATCH
L_.str.2:                               ## @.str.2
	.asciz	"PCI Pass-through VSP failed version request: %#x"

	.comm	_EPROTO,4,2                     ## @EPROTO
L_.str.3:                               ## @.str.3
	.asciz	"PCI pass-through VSP failed to find supported version"

	.no_dead_strip	_hv_pci_protocol_negotiation
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hv_pci_protocol_negotiation
_hv_pci_protocol_negotiation:           ; @hv_pci_protocol_negotiation
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	add	x21, sp, #8
	add	x0, sp, #8
	bl	_init_completion
Lloh3:
	adrp	x8, _hv_pci_generic_compl@GOTPAGE
Lloh4:
	ldr	x8, [x8, _hv_pci_generic_compl@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh6:
	adrp	x8, _PCI_QUERY_PROTOCOL_VERSION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCI_QUERY_PROTOCOL_VERSION@GOTPAGEOFF]
	str	x21, [x19, #8]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #8]
Lloh9:
	adrp	x22, _pci_protocol_versions@GOTPAGE
Lloh10:
	ldr	x22, [x22, _pci_protocol_versions@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.2:
	mov	x23, #0
Lloh11:
	adrp	x24, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh12:
	ldr	x24, [x24, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh13:
	adrp	x25, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGE
Lloh14:
	ldr	x25, [x25, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGEOFF]
Lloh15:
	adrp	x26, _STATUS_REVISION_MISMATCH@GOTPAGE
Lloh16:
	ldr	x26, [x26, _STATUS_REVISION_MISMATCH@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x8, [x8, x23, lsl #3]
	str	x8, [x19]
	ldr	w0, [x20, #4]
	ldr	w4, [x24]
	ldr	w5, [x25]
	mov	x1, x19
	mov	w2, #16
	mov	x3, x19
	bl	_vmbus_sendpacket
	cbnz	w0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #8
	mov	x0, x20
	bl	_wait_for_response
	cbnz	w0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #12]
	tbz	w8, #31, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #8
	bl	_reinit_completion
	add	x23, x23, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	b.lt	LBB0_3
LBB0_8:
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_9:
	mov	x0, x20
	bl	_dev_err
Lloh19:
	adrp	x8, _EPROTO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_10:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_11:
	mov	x21, x0
	str	x21, [sp]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_13
LBB0_12:
	ldr	x8, [x22]
	ldr	x2, [x8, x23, lsl #3]
Lloh27:
	adrp	x8, _pci_protocol_version@GOTPAGE
Lloh28:
	ldr	x8, [x8, _pci_protocol_version@GOTPAGEOFF]
Lloh29:
	str	x2, [x8]
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_info
	mov	w21, #0
LBB0_13:
	mov	x0, x19
	bl	_kfree
LBB0_14:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
LBB0_15:
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.2@PAGE
Lloh33:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_hv_pci_generic_compl,4,2       ; @hv_pci_generic_compl
	.comm	_PCI_QUERY_PROTOCOL_VERSION,4,2 ; @PCI_QUERY_PROTOCOL_VERSION
	.comm	_pci_protocol_versions,8,3      ; @pci_protocol_versions
	.comm	_VM_PKT_DATA_INBAND,4,2         ; @VM_PKT_DATA_INBAND
	.comm	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,2 ; @VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PCI Pass-through VSP failed to request version: %d"

	.comm	_pci_protocol_version,8,3       ; @pci_protocol_version
l_.str.1:                               ; @.str.1
	.asciz	"PCI VMBus probing: Using version %#x\n"

	.comm	_STATUS_REVISION_MISMATCH,4,2   ; @STATUS_REVISION_MISMATCH
l_.str.2:                               ; @.str.2
	.asciz	"PCI Pass-through VSP failed version request: %#x"

	.comm	_EPROTO,4,2                     ; @EPROTO
l_.str.3:                               ; @.str.3
	.asciz	"PCI pass-through VSP failed to find supported version"

	.no_dead_strip	_hv_pci_protocol_negotiation
.subsections_via_symbols
