	.file	"extr_netfront.c_setup_rxqs.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"xnrx_%u"
.LC1:
	.string	"netfront receive lock"
.LC2:
	.string	"allocating rx gref"
.LC3:
	.string	"granting rx ring page"
	.text
	.p2align 4
	.type	setup_rxqs, @function
setup_rxqs:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	r15, .LC0[rip]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	edi, ebp
	xor	ebx, ebx
	sal	edi, 6
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	esi, DWORD PTR M_DEVBUF[rip]
	mov	QWORD PTR 8[rsp], rdx
	mov	edx, DWORD PTR M_WAITOK[rip]
	or	edx, DWORD PTR M_ZERO[rip]
	call	malloc@PLT
	mov	QWORD PTR [r12], rax
	mov	r8, rax
	test	rbp, rbp
	je	.L11
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, rbx
	mov	rax, QWORD PTR GRANT_REF_INVALID[rip]
	mov	ecx, ebx
	mov	rdx, r15
	sal	rdi, 6
	mov	esi, DWORD PTR XN_QUEUE_NAME_LEN[rip]
	mov	DWORD PTR 4[rsp], ebx
	lea	rbp, [r8+rdi]
	mov	DWORD PTR 0[rbp], ebx
	mov	edi, DWORD PTR 48[rbp]
	mov	QWORD PTR 56[rbp], r12
	mov	QWORD PTR 24[rbp], rax
	mov	QWORD PTR 8[rbp], 0
	call	snprintf@PLT
	mov	esi, DWORD PTR 48[rbp]
	lea	rdi, 52[rbp]
	mov	ecx, DWORD PTR MTX_DEF[rip]
	lea	rdx, .LC1[rip]
	call	mtx_init@PLT
	mov	edi, DWORD PTR NET_RX_RING_SIZE[rip]
	test	edi, edi
	js	.L8
	movsx	rax, edi
	lea	rsi, 8[0+rax*8]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdx, QWORD PTR 40[rbp]
	mov	QWORD PTR [rdx+rax], 0
	mov	rdx, QWORD PTR 32[rbp]
	mov	rcx, QWORD PTR GRANT_REF_INVALID[rip]
	mov	QWORD PTR [rdx+rax], rcx
	add	rax, 8
	cmp	rsi, rax
	jne	.L7
.L8:
	lea	rsi, 16[rbp]
	call	gnttab_alloc_grant_references@PLT
	test	rax, rax
	jne	.L23
	mov	esi, DWORD PTR M_DEVBUF[rip]
	mov	edi, DWORD PTR PAGE_SIZE[rip]
	mov	edx, DWORD PTR M_WAITOK[rip]
	or	edx, DWORD PTR M_ZERO[rip]
	call	malloc@PLT
	mov	rdi, rax
	mov	r13, rax
	call	SHARED_RING_INIT@PLT
	mov	edx, DWORD PTR PAGE_SIZE[rip]
	mov	rsi, r13
	lea	rdi, 8[rbp]
	call	FRONT_RING_INIT@PLT
	mov	rdi, r13
	call	virt_to_mfn@PLT
	lea	rdx, 24[rbp]
	mov	edi, r14d
	mov	esi, eax
	call	xenbus_grant_ring@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L24
	lea	rdi, 20[rbp]
	mov	esi, 1
	add	rbx, 1
	call	callout_init@PLT
	cmp	QWORD PTR 8[rsp], rbx
	je	.L11
	mov	r8, QWORD PTR [r12]
	jmp	.L2
.L11:
	xor	r13d, r13d
.L1:
	add	rsp, 24
	.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
.L23:
	.cfi_restore_state
	lea	rsi, .LC2[rip]
	mov	edi, r14d
	call	device_printf@PLT
	mov	r13d, DWORD PTR ENOMEM[rip]
.L9:
	movsx	rbp, DWORD PTR 4[rsp]
	xor	ebx, ebx
	sal	rbp, 6
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, QWORD PTR [r12]
	add	rdi, rbp
	call	disconnect_rxq@PLT
	mov	rdi, QWORD PTR [r12]
	add	rdi, rbp
	call	destroy_rxq@PLT
	mov	rax, rbp
	sub	rbp, 64
	cmp	rbx, rax
	jne	.L12
	mov	esi, DWORD PTR M_DEVBUF[rip]
	mov	rdi, QWORD PTR [r12]
	call	free@PLT
	jmp	.L1
.L24:
	lea	rsi, .LC3[rip]
	mov	edi, r14d
	call	device_printf@PLT
	mov	edi, DWORD PTR 16[rbp]
	call	gnttab_free_grant_references@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	esi, DWORD PTR M_DEVBUF[rip]
	call	free@PLT
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	setup_rxqs, .-setup_rxqs
	.comm	XN_QUEUE_NAME_LEN,4,4
	.comm	PAGE_SIZE,4,4
	.comm	NET_RX_RING_SIZE,4,4
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_DEVBUF,4,4
	.comm	MTX_DEF,4,4
	.comm	GRANT_REF_INVALID,8,8
	.comm	ENOMEM,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_netfront.c_setup_rxqs.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"xnrx_%u\000"
	.align	2
.LC1:
	.ascii	"netfront receive lock\000"
	.align	2
.LC2:
	.ascii	"allocating rx gref\000"
	.align	2
.LC3:
	.ascii	"granting rx ring page\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup_rxqs, %function
setup_rxqs:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r2
	mov	r3, r0
	ldr	r10, .L24
	ldr	fp, .L24+4
	sub	sp, sp, #12
	mov	r9, r1
	str	r2, [sp, #4]
	ldr	r1, [r10]
	ldr	r2, [fp]
	add	r0, r4, r4, lsl #2
	orr	r2, r1, r2
	ldr	r1, .L24+8
	lsl	r0, r0, #3
	ldr	r1, [r1]
	str	r3, [sp]
	bl	malloc
	cmp	r4, #0
	str	r0, [r9]
	beq	.L2
	mov	r8, #0
	ldr	r7, .L24+12
.L3:
	mov	r4, #0
	ldr	r3, [r7]
	add	r6, r8, r8, lsl #2
	ldr	r1, .L24+16
	add	r5, r0, r6, lsl #3
	str	r8, [r0, r6, lsl #3]
	ldr	r2, .L24+20
	ldr	r1, [r1]
	str	r3, [r5, #16]
	ldr	r0, [r5, #28]
	mov	r3, r8
	str	r9, [r5, #36]
	str	r4, [r5, #4]
	bl	snprintf
	ldr	r3, .L24+24
	ldr	r1, [r5, #28]
	ldr	r3, [r3]
	ldr	r2, .L24+28
	add	r0, r5, #32
	bl	mtx_init
	ldr	r3, .L24+32
	lsl	r6, r6, #3
	ldr	r0, [r3]
	cmp	r0, r4
	movge	ip, r4
	addge	r1, r0, #1
	blt	.L9
.L8:
	ldr	r3, [r5, #24]
	str	ip, [r3, r4, lsl #2]
	ldr	r2, [r7]
	ldr	r3, [r5, #20]
	str	r2, [r3, r4, lsl #2]
	add	r4, r4, #1
	cmp	r1, r4
	bne	.L8
.L9:
	add	r1, r5, #8
	bl	gnttab_alloc_grant_references
	cmp	r0, #0
	bne	.L22
	ldr	r3, [fp]
	ldr	r2, [r10]
	ldr	r1, .L24+8
	orr	r2, r2, r3
	ldr	r3, .L24+36
	ldr	r1, [r1]
	ldr	r0, [r3]
	bl	malloc
	mov	r4, r0
	bl	SHARED_RING_INIT
	ldr	r3, .L24+36
	mov	r1, r4
	ldr	r2, [r3]
	add	r0, r5, #4
	bl	FRONT_RING_INIT
	mov	r0, r4
	bl	virt_to_mfn
	add	r2, r5, #16
	mov	r1, r0
	ldr	r0, [sp]
	bl	xenbus_grant_ring
	cmp	r0, #0
	bne	.L23
	mov	r1, #1
	add	r0, r5, #12
	bl	callout_init
	ldr	r3, [sp, #4]
	add	r8, r8, #1
	cmp	r8, r3
	ldrne	r0, [r9]
	bne	.L3
.L2:
	mov	r4, #0
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L22:
	ldr	r0, [sp]
	ldr	r1, .L24+40
	bl	device_printf
	ldr	r3, .L24+44
	ldr	r4, [r3]
.L12:
	ldr	r0, [r9]
	sub	r8, r8, #1
	add	r0, r0, r6
	bl	disconnect_rxq
	ldr	r0, [r9]
	add	r0, r0, r6
	bl	destroy_rxq
	cmn	r8, #1
	sub	r6, r6, #40
	bne	.L12
	ldr	r3, .L24+8
	ldr	r0, [r9]
	ldr	r1, [r3]
	bl	free
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
.L10:
	ldr	r1, .L24+48
	mov	r4, r0
	ldr	r0, [sp]
	bl	device_printf
	ldr	r0, [r5, #8]
	bl	gnttab_free_grant_references
	ldr	r3, .L24+8
	ldr	r0, [r5, #4]
	ldr	r1, [r3]
	bl	free
	b	.L12
.L25:
	.align	2
.L24:
	.word	M_WAITOK
	.word	M_ZERO
	.word	M_DEVBUF
	.word	GRANT_REF_INVALID
	.word	XN_QUEUE_NAME_LEN
	.word	.LC0
	.word	MTX_DEF
	.word	.LC1
	.word	NET_RX_RING_SIZE
	.word	PAGE_SIZE
	.word	.LC2
	.word	ENOMEM
	.word	.LC3
	.size	setup_rxqs, .-setup_rxqs
	.comm	XN_QUEUE_NAME_LEN,4,4
	.comm	PAGE_SIZE,4,4
	.comm	NET_RX_RING_SIZE,4,4
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_DEVBUF,4,4
	.comm	MTX_DEF,4,4
	.comm	GRANT_REF_INVALID,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
