	.file	"extr_blkfront.c_xbd_int.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	xbd_int, @function
xbd_int:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	rax, 8[rdi]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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, rdi
	mov	rdi, rax
	lea	r14, 24[rbx]
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rax
	call	mtx_lock@PLT
	mov	rax, QWORD PTR XBD_STATE_DISCONNECTED[rip]
	xor	edi, edi
	cmp	QWORD PTR [rbx], rax
	sete	dil
	call	__predict_false@PLT
	test	rax, rax
	jne	.L14
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rax, QWORD PTR 40[rbx]
	mov	r13, QWORD PTR [rax]
	xor	eax, eax
	call	rmb@PLT
	mov	r12, QWORD PTR 24[rbx]
.L26:
	cmp	r13, r12
	je	.L3
.L29:
	mov	rsi, r12
	mov	rdi, r14
	add	r12, 1
	call	RING_GET_RESPONSE@PLT
	mov	rsi, QWORD PTR XBD_Q_BUSY[rip]
	mov	r15, rax
	mov	rax, QWORD PTR [rax]
	lea	rdx, [rax+rax*4]
	mov	rax, QWORD PTR 56[rbx]
	lea	rbp, [rax+rdx*8]
	mov	rdi, rbp
	call	xbd_remove_cm@PLT
	mov	esi, DWORD PTR 32[rbp]
	mov	edi, DWORD PTR 36[rbp]
	call	gnttab_end_foreign_access_references@PLT
	mov	rax, QWORD PTR 0[rbp]
	cmp	rax, QWORD PTR BLKIF_OP_READ[rip]
	mov	edx, DWORD PTR BUS_DMASYNC_POSTREAD[rip]
	je	.L5
	cmp	rax, QWORD PTR BLKIF_OP_WRITE[rip]
	je	.L6
	xor	edx, edx
	cmp	rax, QWORD PTR BLKIF_OP_WRITE_BARRIER[rip]
	je	.L6
.L5:
	mov	esi, DWORD PTR 28[rbp]
	mov	edi, DWORD PTR 48[rbx]
	call	bus_dmamap_sync@PLT
	mov	esi, DWORD PTR 28[rbp]
	mov	edi, DWORD PTR 48[rbx]
	call	bus_dmamap_unload@PLT
	mov	rsi, rbp
	mov	rdi, rbx
	call	xbd_cm_thaw@PLT
	mov	eax, DWORD PTR 8[r15]
	cmp	QWORD PTR 16[rbp], 0
	mov	DWORD PTR 24[rbp], eax
	jne	.L28
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, rbp
	test	rax, rax
	je	.L9
	call	rax
	cmp	r13, r12
	jne	.L29
.L3:
	mov	QWORD PTR 24[rbx], r13
	cmp	QWORD PTR 32[rbx], r13
	je	.L11
	xor	ebp, ebp
	mov	rdi, r14
	mov	esi, ebp
	call	RING_FINAL_CHECK_FOR_RESPONSES@PLT
	test	ebp, ebp
	jne	.L2
.L12:
	mov	rsi, QWORD PTR XBD_Q_BUSY[rip]
	mov	rdi, rbx
	call	xbd_queue_length@PLT
	test	rax, rax
	je	.L30
.L13:
	mov	rdi, rbx
	call	xbd_startio@PLT
	xor	edi, edi
	mov	rax, QWORD PTR XBD_STATE_SUSPENDED[rip]
	cmp	QWORD PTR [rbx], rax
	sete	dil
	call	__predict_false@PLT
	test	rax, rax
	jne	.L31
.L14:
	mov	rdi, QWORD PTR 8[rsp]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	jmp	mtx_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	edx, DWORD PTR BUS_DMASYNC_POSTWRITE[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rsi, rbp
	mov	rdi, rbx
	call	xbd_bio_complete@PLT
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L9:
	call	xbd_free_command@PLT
	jmp	.L26
.L11:
	mov	rax, QWORD PTR 40[rbx]
	add	r13, 1
	mov	QWORD PTR 8[rax], r13
	jmp	.L12
.L31:
	mov	rax, QWORD PTR 16[rbx]
	mov	rdx, QWORD PTR XBD_Q_BUSY[rip]
	lea	rdi, [rax+rdx*4]
	call	wakeup@PLT
	jmp	.L14
.L30:
	mov	esi, DWORD PTR XBDF_WAIT_IDLE[rip]
	mov	rdi, rbx
	call	xbd_thaw@PLT
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	xbd_int, .-xbd_int
	.comm	XBD_STATE_SUSPENDED,8,8
	.comm	XBD_STATE_DISCONNECTED,8,8
	.comm	XBD_Q_BUSY,8,8
	.comm	XBDF_WAIT_IDLE,4,4
	.comm	BUS_DMASYNC_POSTWRITE,4,4
	.comm	BUS_DMASYNC_POSTREAD,4,4
	.comm	BLKIF_OP_WRITE_BARRIER,8,8
	.comm	BLKIF_OP_WRITE,8,8
	.comm	BLKIF_OP_READ,8,8
	.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_blkfront.c_xbd_int.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	xbd_int, %function
xbd_int:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r0
	add	r3, r0, #4
	sub	sp, sp, #12
	mov	r0, r3
	str	r3, [sp, #4]
	bl	mtx_lock
	ldr	r3, .L29
	ldr	r0, [r6]
	ldr	r3, [r3]
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	__predict_false
	cmp	r0, #0
	bne	.L14
	ldr	r10, .L29+4
.L2:
	ldr	r3, [r6, #20]
	ldr	r3, [r3]
	mov	r4, r3
	str	r3, [sp]
	bl	rmb
	ldr	r7, [r6, #12]
	cmp	r4, r7
	beq	.L3
	add	r9, r6, #12
	b	.L10
.L4:
	ldr	r2, .L29+8
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L6
	ldr	r2, .L29+12
	ldr	r2, [r2]
	cmp	r3, r2
	movne	r2, #0
	beq	.L6
.L5:
	ldr	r1, [r4, #16]
	ldr	r0, [r6, #24]
	bl	bus_dmamap_sync
	ldr	r1, [r4, #16]
	ldr	r0, [r6, #24]
	bl	bus_dmamap_unload
	mov	r1, r4
	mov	r0, r6
	bl	xbd_cm_thaw
	ldr	r2, [r4, #8]
	ldr	r3, [fp, #4]
	cmp	r2, #0
	str	r3, [r4, #12]
	bne	.L26
	ldr	r3, [r4, #4]
	mov	r0, r4
	cmp	r3, #0
	beq	.L9
	blx	r3
.L8:
	ldr	r3, [sp]
	cmp	r3, r7
	beq	.L3
.L10:
	mov	r1, r7
	mov	r0, r9
	bl	RING_GET_RESPONSE
	ldr	r5, [r0]
	ldr	r8, [r6, #28]
	ldr	r3, .L29+16
	rsb	r5, r5, r5, lsl #3
	add	r4, r8, r5, lsl #2
	ldr	r1, [r3]
	mov	fp, r0
	mov	r0, r4
	bl	xbd_remove_cm
	ldr	r1, [r4, #20]
	ldr	r0, [r4, #24]
	bl	gnttab_end_foreign_access_references
	ldr	r3, [r8, r5, lsl #2]
	ldr	r2, [r10]
	add	r7, r7, #1
	cmp	r3, r2
	bne	.L4
	ldr	r3, .L29+20
	ldr	r2, [r3]
	b	.L5
.L6:
	ldr	r3, .L29+24
	ldr	r2, [r3]
	b	.L5
.L26:
	mov	r1, r4
	mov	r0, r6
	bl	xbd_bio_complete
	ldr	r3, [sp]
	cmp	r3, r7
	bne	.L10
.L3:
	ldr	r2, [sp]
	ldr	r3, [r6, #16]
	str	r2, [r6, #12]
	cmp	r3, r2
	beq	.L11
	mov	r4, #0
	add	r0, r6, #12
	mov	r1, r4
	bl	RING_FINAL_CHECK_FOR_RESPONSES
	cmp	r4, r4
	bne	.L2
.L12:
	ldr	r3, .L29+16
	mov	r0, r6
	ldr	r1, [r3]
	bl	xbd_queue_length
	cmp	r0, #0
	beq	.L27
.L13:
	mov	r0, r6
	bl	xbd_startio
	ldr	r3, .L29+28
	ldr	r0, [r6]
	ldr	r3, [r3]
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	__predict_false
	cmp	r0, #0
	bne	.L28
.L14:
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mtx_unlock
.L9:
	bl	xbd_free_command
	b	.L8
.L11:
	ldr	r2, [sp]
	ldr	r3, [r6, #20]
	add	r8, r2, #1
	str	r8, [r3, #4]
	b	.L12
.L28:
	ldr	r3, .L29+16
	ldr	r0, [r3]
	ldr	r3, [r6, #8]
	add	r0, r3, r0, lsl #2
	bl	wakeup
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mtx_unlock
.L27:
	ldr	r3, .L29+32
	mov	r0, r6
	ldr	r1, [r3]
	bl	xbd_thaw
	b	.L13
.L30:
	.align	2
.L29:
	.word	XBD_STATE_DISCONNECTED
	.word	BLKIF_OP_READ
	.word	BLKIF_OP_WRITE
	.word	BLKIF_OP_WRITE_BARRIER
	.word	XBD_Q_BUSY
	.word	BUS_DMASYNC_POSTREAD
	.word	BUS_DMASYNC_POSTWRITE
	.word	XBD_STATE_SUSPENDED
	.word	XBDF_WAIT_IDLE
	.size	xbd_int, .-xbd_int
	.comm	XBD_STATE_SUSPENDED,4,4
	.comm	XBD_STATE_DISCONNECTED,4,4
	.comm	XBD_Q_BUSY,4,4
	.comm	XBDF_WAIT_IDLE,4,4
	.comm	BUS_DMASYNC_POSTWRITE,4,4
	.comm	BUS_DMASYNC_POSTREAD,4,4
	.comm	BLKIF_OP_WRITE_BARRIER,4,4
	.comm	BLKIF_OP_WRITE,4,4
	.comm	BLKIF_OP_READ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
