	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netvsc_send_pkt
_netvsc_send_pkt:                       ## @netvsc_send_pkt
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	8(%rdx), %rax
	movq	(%rsi), %r13
	shlq	$4, %r13
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rax,%r13), %r14
	callq	_hv_get_drvdata
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_netdev_priv
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rsi
	movq	%r15, %rdi
	callq	_netdev_get_tx_queue
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	8(%r14), %rdi
	callq	_hv_get_avail_to_write_percent
	movq	_NVSP_MSG1_TYPE_SEND_RNDIS_PKT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -120(%rbp)
	xorl	%ecx, %ecx
	testq	%r12, %r12
	sete	%cl
	movl	%ecx, -112(%rbp)
	movq	8(%rbx), %rdx
	movq	%rdx, -104(%rbp)
	movq	_NETVSC_INVALID_INDEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_2
## %bb.1:
	xorl	%ecx, %ecx
	jmp	LBB0_3
LBB0_2:
	movq	16(%rbx), %rcx
LBB0_3:
	movq	%rcx, -96(%rbp)
	cmpq	$0, (%r14)
	je	LBB0_5
## %bb.4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_22:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_23:
	movl	%r12d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	-112(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_trace_nvsp_send_pkt
	movl	24(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_10
## %bb.6:
	cmpq	$0, 32(%rbx)
	je	LBB0_7
## %bb.8:
	movslq	28(%rbx), %rax
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	leaq	(%rsi,%rax,4), %rsi
	jmp	LBB0_9
LBB0_10:
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-120(%rbp), %rsi
	movq	%r14, %rdi
	movl	$32, %edx
	movq	%r12, %rcx
	callq	_vmbus_sendpacket
	jmp	LBB0_11
LBB0_7:
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
LBB0_9:
	leaq	-120(%rbp), %rcx
	movq	%r14, %rdi
	movl	$32, %r8d
	movq	%r12, %r9
	callq	_vmbus_sendpacket_pagebuffer
LBB0_11:
	movl	%eax, %r12d
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	addq	%r13, %r14
	testl	%eax, %eax
	je	LBB0_12
## %bb.14:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_16
## %bb.15:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_12:
	movq	%r14, %rdi
	callq	_atomic_inc_return
	movq	_RING_AVAIL_PERCENT_LOWATER@GOTPCREL(%rip), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax), %rcx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jge	LBB0_17
LBB0_13:
	movq	%rbx, %rdi
	callq	_netif_tx_stop_queue
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	4(%rax)
	jmp	LBB0_17
LBB0_16:
	movl	24(%rbx), %edx
	movq	16(%rbx), %rcx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %r8d
	callq	_netdev_err
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_17:
	movq	%rbx, %rdi
	callq	_netif_tx_queue_stopped
	testq	%rax, %rax
	je	LBB0_23
## %bb.18:
	movq	%r14, %rdi
	callq	_atomic_read
	testl	%eax, %eax
	jg	LBB0_23
## %bb.19:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, (%rax)
	jne	LBB0_23
## %bb.20:
	movq	%rbx, %rdi
	callq	_netif_tx_wake_queue
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_23
## %bb.21:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_NVSP_MSG1_TYPE_SEND_RNDIS_PKT,4,2 ## @NVSP_MSG1_TYPE_SEND_RNDIS_PKT
	.comm	_NETVSC_INVALID_INDEX,8,3       ## @NETVSC_INVALID_INDEX
	.comm	_ENODEV,4,2                     ## @ENODEV
	.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
	.comm	_RING_AVAIL_PERCENT_LOWATER,8,3 ## @RING_AVAIL_PERCENT_LOWATER
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to send packet pages %u len %u, ret %d\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_netvsc_send_pkt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netvsc_send_pkt
_netvsc_send_pkt:                       ; @netvsc_send_pkt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x25, x4
	mov	x28, x3
	mov	x19, x2
	mov	x23, x1
	ldr	x8, [x2, #8]
	ldr	x9, [x1]
	add	x21, x8, x9, lsl #4
	ldr	x27, [x21, #8]
	bl	_hv_get_drvdata
	mov	x24, x0
	bl	_netdev_priv
	mov	x20, x0
	ldr	x1, [x23]
	mov	x0, x24
	bl	_netdev_get_tx_queue
	mov	x22, x0
	add	x0, x27, #8
	bl	_hv_get_avail_to_write_percent
	mov	x26, x0
Lloh0:
	adrp	x8, _NVSP_MSG1_TYPE_SEND_RNDIS_PKT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVSP_MSG1_TYPE_SEND_RNDIS_PKT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	x25, #0
	cset	w9, eq
	str	w8, [sp]
	str	w9, [sp, #8]
	ldr	x8, [x23, #8]
	str	x8, [sp, #16]
Lloh3:
	adrp	x9, _NETVSC_INVALID_INDEX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NETVSC_INVALID_INDEX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x8, #0
	b	LBB0_3
LBB0_2:
	ldr	x8, [x23, #16]
LBB0_3:
	str	x8, [sp, #24]
	ldr	x8, [x27]
	cbz	x8, LBB0_7
; %bb.4:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_6:
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_7:
	mov	x8, sp
	add	x2, x8, #8
	mov	x0, x24
	mov	x1, x27
	bl	_trace_nvsp_send_pkt
	ldr	w2, [x23, #24]
	cbz	w2, LBB0_13
; %bb.8:
	ldr	x8, [x23, #32]
	cbz	x8, LBB0_10
; %bb.9:
	ldrsw	x8, [x23, #28]
	add	x28, x28, x8, lsl #2
LBB0_10:
	mov	x3, sp
	mov	x0, x27
	mov	x1, x28
	mov	w4, #32
	mov	x5, x25
	bl	_vmbus_sendpacket_pagebuffer
	mov	x25, x0
	cbz	w0, LBB0_14
LBB0_11:
Lloh8:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w25, w8
	b.eq	LBB0_15
; %bb.12:
	ldr	w2, [x23, #24]
	ldr	x3, [x23, #16]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x4, x25
	bl	_netdev_err
	b	LBB0_16
LBB0_13:
Lloh13:
	adrp	x8, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh15:
	ldr	w4, [x8]
Lloh16:
	adrp	x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGEOFF]
Lloh18:
	ldr	w5, [x8]
	mov	x1, sp
	mov	x0, x27
	mov	w2, #32
	mov	x3, x25
	bl	_vmbus_sendpacket
	mov	x25, x0
	cbnz	w0, LBB0_11
LBB0_14:
	mov	x0, x21
	bl	_atomic_inc_return
Lloh19:
	adrp	x8, _RING_AVAIL_PERCENT_LOWATER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RING_AVAIL_PERCENT_LOWATER@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cmp	x26, x8
	b.ge	LBB0_16
LBB0_15:
	mov	x0, x22
	bl	_netif_tx_stop_queue
	ldr	w8, [x20, #4]
	add	w8, w8, #1
	str	w8, [x20, #4]
LBB0_16:
	mov	x0, x22
	bl	_netif_tx_queue_stopped
	cbz	x0, LBB0_6
; %bb.17:
	mov	x0, x21
	bl	_atomic_read
	cmp	w0, #0
	b.gt	LBB0_6
; %bb.18:
	ldr	w8, [x19]
	cbnz	w8, LBB0_6
; %bb.19:
	mov	x0, x22
	bl	_netif_tx_wake_queue
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
Lloh22:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	cmn	w25, w8
	b.ne	LBB0_6
; %bb.20:
Lloh25:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_NVSP_MSG1_TYPE_SEND_RNDIS_PKT,4,2 ; @NVSP_MSG1_TYPE_SEND_RNDIS_PKT
	.comm	_NETVSC_INVALID_INDEX,8,3       ; @NETVSC_INVALID_INDEX
	.comm	_ENODEV,4,2                     ; @ENODEV
	.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
	.comm	_RING_AVAIL_PERCENT_LOWATER,8,3 ; @RING_AVAIL_PERCENT_LOWATER
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to send packet pages %u len %u, ret %d\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_netvsc_send_pkt
.subsections_via_symbols
