	.file	"extr_net.c_vhost_net_set_backend.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	vhost_net_set_backend, @function
vhost_net_set_backend:
.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
	mov	r14d, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	mutex_lock@PLT
	mov	rdi, r13
	call	vhost_dev_check_owner@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L2
	cmp	DWORD PTR VHOST_NET_VQ_MAX[rip], r14d
	ja	.L3
	mov	ebp, DWORD PTR ENOBUFS[rip]
	neg	ebp
.L2:
	mov	rdi, r13
	movsx	r12, ebp
	call	mutex_unlock@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	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
	mov	eax, r14d
	lea	rdx, [rax+rax*2]
	mov	rax, QWORD PTR 8[r13]
	lea	r15, [rax+rdx*8]
	mov	rdi, r15
	call	mutex_lock@PLT
	mov	rdi, r15
	call	vhost_vq_access_ok@PLT
	test	eax, eax
	jne	.L4
	mov	ebp, DWORD PTR EFAULT[rip]
	neg	ebp
.L5:
	mov	rdi, r15
	call	mutex_unlock@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, r12d
	call	get_socket@PLT
	mov	rdi, rax
	mov	rbx, rax
	call	IS_ERR@PLT
	mov	r12, rax
	test	rax, rax
	jne	.L25
	mov	rax, QWORD PTR 8[r15]
	mov	QWORD PTR [rsp], rax
	cmp	rbx, rax
	je	.L23
	test	rbx, rbx
	je	.L9
	mov	rdi, rbx
	xor	ebp, ebp
	call	vhost_sock_zcopy@PLT
	test	rax, rax
	setne	bpl
.L9:
	mov	esi, ebp
	mov	rdi, r15
	call	vhost_ubuf_alloc@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L26
	mov	rax, QWORD PTR 16[r15]
	mov	QWORD PTR 16[r15], rbp
	mov	rsi, r15
	mov	rdi, r13
	mov	QWORD PTR 8[rsp], rax
	call	vhost_net_disable_vq@PLT
	mov	rdi, QWORD PTR 8[r15]
	mov	rsi, rbx
	call	rcu_assign_pointer@PLT
	mov	rsi, r15
	mov	rdi, r13
	call	vhost_net_enable_vq@PLT
	mov	rdi, r15
	call	vhost_init_used@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L5
	mov	rdi, r15
	call	mutex_unlock@PLT
	mov	rax, QWORD PTR 8[rsp]
	test	rax, rax
	je	.L8
	mov	rdi, rax
	call	vhost_ubuf_put_and_wait@PLT
	mov	rdi, r15
	call	mutex_lock@PLT
	mov	rdi, r15
	call	vhost_zerocopy_signal_used@PLT
.L23:
	mov	rdi, r15
	call	mutex_unlock@PLT
.L8:
	mov	rbx, QWORD PTR [rsp]
	test	rbx, rbx
	je	.L11
	mov	rdi, r13
	mov	esi, r14d
	call	vhost_net_flush_vq@PLT
	mov	edi, DWORD PTR [rbx]
	call	fput@PLT
.L11:
	mov	rdi, r13
	call	mutex_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rdi, rbp
	call	PTR_ERR@PLT
	mov	edi, DWORD PTR [rbx]
	mov	ebp, eax
	call	fput@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	mov	rdi, rbx
	call	PTR_ERR@PLT
	mov	ebp, eax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	vhost_net_set_backend, .-vhost_net_set_backend
	.comm	VHOST_NET_VQ_MAX,4,4
	.comm	ENOBUFS,4,4
	.comm	EFAULT,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_net.c_vhost_net_set_backend.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vhost_net_set_backend, %function
vhost_net_set_backend:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	mov	r6, r1
	mov	r7, r2
	bl	mutex_lock
	mov	r0, r5
	bl	vhost_dev_check_owner
	subs	r4, r0, #0
	bne	.L2
	ldr	r3, .L26
	ldr	r3, [r3]
	cmp	r3, r6
	bhi	.L3
	ldr	r3, .L26+4
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L2:
	mov	r0, r5
	bl	mutex_unlock
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	ldr	r3, [r5, #4]
	add	r0, r6, r6, lsl #1
	add	r8, r3, r0, lsl #2
	mov	r0, r8
	bl	mutex_lock
	mov	r0, r8
	bl	vhost_vq_access_ok
	cmp	r0, #0
	bne	.L4
	ldr	r3, .L26+8
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L5:
	mov	r0, r8
	bl	mutex_unlock
	b	.L2
.L4:
	mov	r0, r7
	bl	get_socket
	mov	r9, r0
	bl	IS_ERR
	subs	r4, r0, #0
	bne	.L24
	ldr	r10, [r8, #4]
	cmp	r9, r10
	beq	.L22
	cmp	r9, #0
	moveq	r1, r9
	beq	.L9
	mov	r0, r9
	bl	vhost_sock_zcopy
	subs	r1, r0, #0
	movne	r1, #1
.L9:
	mov	r0, r8
	bl	vhost_ubuf_alloc
	mov	r7, r0
	bl	IS_ERR
	cmp	r0, #0
	bne	.L25
	mov	r1, r8
	ldr	fp, [r8, #8]
	mov	r0, r5
	str	r7, [r8, #8]
	bl	vhost_net_disable_vq
	mov	r1, r9
	ldr	r0, [r8, #4]
	bl	rcu_assign_pointer
	mov	r1, r8
	mov	r0, r5
	bl	vhost_net_enable_vq
	mov	r0, r8
	bl	vhost_init_used
	cmp	r0, #0
	bne	.L14
	mov	r0, r8
	bl	mutex_unlock
	cmp	fp, #0
	beq	.L8
	mov	r0, fp
	bl	vhost_ubuf_put_and_wait
	mov	r0, r8
	bl	mutex_lock
	mov	r0, r8
	bl	vhost_zerocopy_signal_used
.L22:
	mov	r0, r8
	bl	mutex_unlock
.L8:
	cmp	r10, #0
	beq	.L2
	mov	r1, r6
	mov	r0, r5
	bl	vhost_net_flush_vq
	ldr	r0, [r10]
	bl	fput
	b	.L2
.L14:
	mov	r4, r0
	b	.L5
.L25:
	mov	r0, r7
	bl	PTR_ERR
	mov	r4, r0
	ldr	r0, [r9]
	bl	fput
	b	.L5
.L24:
	mov	r0, r9
	bl	PTR_ERR
	mov	r4, r0
	b	.L5
.L27:
	.align	2
.L26:
	.word	VHOST_NET_VQ_MAX
	.word	ENOBUFS
	.word	EFAULT
	.size	vhost_net_set_backend, .-vhost_net_set_backend
	.comm	VHOST_NET_VQ_MAX,4,4
	.comm	ENOBUFS,4,4
	.comm	EFAULT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
