	.file	"extr_netvsc.c_netvsc_send_pkt.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Unable to send packet pages %u len %u, ret %d\n"
	.text
	.p2align 4
	.type	netvsc_send_pkt, @function
netvsc_send_pkt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, r8
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 104
	.cfi_def_cfa_offset 160
	mov	rbp, QWORD PTR [rsi]
	mov	QWORD PTR 32[rsp], rdx
	mov	QWORD PTR 8[rsp], rcx
	sal	rbp, 4
	add	rbp, QWORD PTR 8[rdx]
	mov	r14, QWORD PTR 8[rbp]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 88[rsp], rax
	xor	eax, eax
	call	hv_get_drvdata@PLT
	mov	rdi, rax
	mov	r12, rax
	call	netdev_priv@PLT
	mov	rsi, QWORD PTR [rbx]
	mov	rdi, r12
	mov	QWORD PTR 16[rsp], rax
	call	netdev_get_tx_queue@PLT
	lea	rdi, 8[r14]
	mov	r15, rax
	call	hv_get_avail_to_write_percent@PLT
	mov	QWORD PTR 24[rsp], rax
	mov	eax, DWORD PTR NVSP_MSG1_TYPE_SEND_RNDIS_PKT[rip]
	mov	DWORD PTR 48[rsp], eax
	xor	eax, eax
	test	r13, r13
	sete	al
	xor	edx, edx
	mov	DWORD PTR 56[rsp], eax
	mov	rax, QWORD PTR 8[rbx]
	cmp	rax, QWORD PTR NETVSC_INVALID_INDEX[rip]
	mov	QWORD PTR 64[rsp], rax
	je	.L2
	mov	rdx, QWORD PTR 16[rbx]
.L2:
	cmp	QWORD PTR [r14], 0
	mov	QWORD PTR 72[rsp], rdx
	je	.L3
	mov	r13d, DWORD PTR ENODEV[rip]
	neg	r13d
.L1:
	mov	rax, QWORD PTR 88[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L20
	add	rsp, 104
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	lea	r11, 48[rsp]
	lea	rdx, 56[rsp]
	mov	rsi, r14
	mov	rdi, r12
	mov	QWORD PTR 40[rsp], r11
	call	trace_nvsp_send_pkt@PLT
	mov	edx, DWORD PTR 24[rbx]
	mov	r11, QWORD PTR 40[rsp]
	test	edx, edx
	je	.L5
	cmp	QWORD PTR 32[rbx], 0
	jne	.L21
.L6:
	mov	rsi, QWORD PTR 8[rsp]
	mov	r9, r13
	mov	rcx, r11
	mov	rdi, r14
	mov	r8d, 32
	call	vmbus_sendpacket_pagebuffer@PLT
	mov	r13d, eax
.L7:
	test	r13d, r13d
	je	.L22
	mov	eax, r13d
	add	eax, DWORD PTR EAGAIN[rip]
	je	.L18
	mov	rcx, QWORD PTR 16[rbx]
	mov	edx, DWORD PTR 24[rbx]
	mov	r8d, r13d
	mov	rdi, r12
	lea	rsi, .LC0[rip]
	call	netdev_err@PLT
.L9:
	mov	rdi, r15
	call	netif_tx_queue_stopped@PLT
	test	rax, rax
	je	.L1
	mov	rdi, rbp
	call	atomic_read@PLT
	test	eax, eax
	jg	.L1
	mov	rax, QWORD PTR 32[rsp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L1
	mov	rdi, r15
	call	netif_tx_wake_queue@PLT
	mov	rax, QWORD PTR 16[rsp]
	add	DWORD PTR [rax], 1
	mov	eax, r13d
	add	eax, DWORD PTR EAGAIN[rip]
	jne	.L1
	mov	r13d, DWORD PTR ENOSPC[rip]
	neg	r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rcx, QWORD PTR 8[rsp]
	movsx	rax, DWORD PTR 28[rbx]
	lea	rax, [rcx+rax*4]
	mov	QWORD PTR 8[rsp], rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rdi, rbp
	call	atomic_inc_return@PLT
	mov	rax, QWORD PTR 24[rsp]
	cmp	QWORD PTR RING_AVAIL_PERCENT_LOWATER[rip], rax
	jle	.L9
.L18:
	mov	rdi, r15
	call	netif_tx_stop_queue@PLT
	mov	rax, QWORD PTR 16[rsp]
	add	DWORD PTR 4[rax], 1
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	mov	r9d, DWORD PTR VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED[rip]
	mov	rcx, r13
	mov	rsi, r11
	mov	rdi, r14
	mov	r8d, DWORD PTR VM_PKT_DATA_INBAND[rip]
	mov	edx, 32
	call	vmbus_sendpacket@PLT
	mov	r13d, eax
	jmp	.L7
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	netvsc_send_pkt, .-netvsc_send_pkt
	.comm	VM_PKT_DATA_INBAND,4,4
	.comm	VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,4
	.comm	RING_AVAIL_PERCENT_LOWATER,8,8
	.comm	NVSP_MSG1_TYPE_SEND_RNDIS_PKT,4,4
	.comm	NETVSC_INVALID_INDEX,8,8
	.comm	ENOSPC,4,4
	.comm	ENODEV,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_netvsc.c_netvsc_send_pkt.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Unable to send packet pages %u len %u, ret %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	netvsc_send_pkt, %function
netvsc_send_pkt:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r2
	ldr	r2, [r1]
	ldr	r6, [r7, #4]
	mov	r10, r3
	ldr	r3, .L24
	sub	sp, sp, #44
	add	r6, r6, r2, lsl #3
	mov	r4, r1
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	ldr	r8, [r6, #4]
	ldr	fp, [sp, #80]
	bl	hv_get_drvdata
	mov	r5, r0
	bl	netdev_priv
	mov	r3, r0
	ldr	r1, [r4]
	mov	r0, r5
	str	r3, [sp, #8]
	bl	netdev_get_tx_queue
	mov	r9, r0
	add	r0, r8, #4
	bl	hv_get_avail_to_write_percent
	ldr	r1, .L24+4
	clz	r3, fp
	ldr	r2, [r4, #4]
	ldr	ip, [r1]
	str	r2, [sp, #28]
	cmp	r2, ip
	moveq	r2, #0
	lsr	r3, r3, #5
	ldr	r1, .L24+8
	str	r3, [sp, #24]
	ldr	r3, [r8]
	ldrne	r2, [r4, #8]
	ldr	r1, [r1]
	cmp	r3, #0
	str	r0, [sp, #12]
	str	r1, [sp, #20]
	str	r2, [sp, #32]
	beq	.L3
	ldr	r3, .L24+12
	ldr	r8, [r3]
	rsb	r8, r8, #0
.L1:
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L22
	mov	r0, r8
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	add	r2, sp, #24
	mov	r1, r8
	mov	r0, r5
	bl	trace_nvsp_send_pkt
	ldr	r2, [r4, #12]
	cmp	r2, #0
	beq	.L5
	mov	ip, #16
	ldr	r3, [r4, #20]
	mov	r0, r8
	cmp	r3, #0
	ldrne	r3, [r4, #16]
	str	fp, [sp, #4]
	addne	r10, r10, r3, lsl #2
	mov	r1, r10
	add	r3, sp, #20
	str	ip, [sp]
	bl	vmbus_sendpacket_pagebuffer
	mov	r8, r0
.L7:
	cmp	r8, #0
	beq	.L23
	ldr	r3, .L24+16
	ldr	r3, [r3]
	cmn	r8, r3
	beq	.L20
	str	r8, [sp]
	mov	r0, r5
	ldr	r3, [r4, #8]
	ldr	r2, [r4, #12]
	ldr	r1, .L24+20
	bl	netdev_err
.L9:
	mov	r0, r9
	bl	netif_tx_queue_stopped
	cmp	r0, #0
	beq	.L1
	mov	r0, r6
	bl	atomic_read
	cmp	r0, #0
	bgt	.L1
	ldr	r3, [r7]
	cmp	r3, #0
	bne	.L1
	mov	r0, r9
	bl	netif_tx_wake_queue
	ldr	r1, [sp, #8]
	ldr	r2, .L24+16
	ldr	r3, [r1]
	ldr	r2, [r2]
	add	r3, r3, #1
	cmn	r8, r2
	str	r3, [r1]
	ldreq	r3, .L24+24
	ldreq	r8, [r3]
	rsbeq	r8, r8, #0
	b	.L1
.L23:
	mov	r0, r6
	bl	atomic_inc_return
	ldr	r3, .L24+28
	ldr	r2, [sp, #12]
	ldr	r3, [r3]
	cmp	r3, r2
	ble	.L9
.L20:
	mov	r0, r9
	bl	netif_tx_stop_queue
	ldr	r2, [sp, #8]
	ldr	r3, [r2, #4]
	add	r3, r3, #1
	str	r3, [r2, #4]
	b	.L9
.L5:
	ldr	r2, .L24+32
	ldr	r3, .L24+36
	ldr	ip, [r2]
	ldr	r2, [r3]
	mov	r0, r8
	stm	sp, {r2, ip}
	mov	r3, fp
	mov	r2, #16
	add	r1, sp, #20
	bl	vmbus_sendpacket
	mov	r8, r0
	b	.L7
.L22:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	.LC1
	.word	NETVSC_INVALID_INDEX
	.word	NVSP_MSG1_TYPE_SEND_RNDIS_PKT
	.word	ENODEV
	.word	EAGAIN
	.word	.LC0
	.word	ENOSPC
	.word	RING_AVAIL_PERCENT_LOWATER
	.word	VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
	.word	VM_PKT_DATA_INBAND
	.size	netvsc_send_pkt, .-netvsc_send_pkt
	.comm	VM_PKT_DATA_INBAND,4,4
	.comm	VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,4
	.comm	RING_AVAIL_PERCENT_LOWATER,4,4
	.comm	NVSP_MSG1_TYPE_SEND_RNDIS_PKT,4,4
	.comm	NETVSC_INVALID_INDEX,4,4
	.comm	ENOSPC,4,4
	.comm	ENODEV,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
