	.file	"extr_blkback.c_xbb_get_resources.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	xbb_get_resources, @function
xbb_get_resources:
.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
	lea	r14, 16[rdi]
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	mov	rdi, r14
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	DWORD PTR 4[rsp], ecx
	call	mtx_lock@PLT
	mov	eax, DWORD PTR 0[rbp]
	and	eax, DWORD PTR XBBF_SHUTDOWN[rip]
	jne	.L10
	cmp	QWORD PTR [rbx], 0
	mov	r15d, eax
	mov	rdi, rbp
	je	.L17
	call	xbb_get_req@PLT
	mov	r12, rax
	test	rax, rax
	je	.L5
	xor	esi, esi
.L12:
	mov	rdi, r14
	mov	QWORD PTR 8[rsp], rsi
	call	mtx_unlock@PLT
	mov	rax, QWORD PTR [rbx]
	mov	rsi, QWORD PTR 8[rsp]
	test	rax, rax
	je	.L18
.L7:
	mov	QWORD PTR 64[r12], rax
	mov	eax, DWORD PTR 4[rsp]
	mov	DWORD PTR 56[r12], eax
	mov	eax, DWORD PTR 12[r13]
	mov	DWORD PTR 52[r12], eax
	mov	eax, DWORD PTR 8[r13]
	mov	DWORD PTR 48[r12], eax
	mov	rax, QWORD PTR BLKIF_PROTOCOL_NATIVE[rip]
	cmp	QWORD PTR 8[rbp], rax
	je	.L8
	lea	r14, 24[r12]
	mov	edx, 24
	mov	rdi, r13
	mov	rsi, r14
	call	bcopy@PLT
	mov	QWORD PTR 16[r12], r14
.L9:
	lea	r14, 12[r12]
	mov	rdi, r14
	call	binuptime@PLT
	mov	edi, DWORD PTR 24[rbp]
	mov	rsi, r14
	call	devstat_start_transaction@PLT
	mov	rax, QWORD PTR [rbx]
	mov	edx, DWORD PTR links[rip]
	mov	rsi, r12
	lea	rdi, 8[rax]
	call	STAILQ_INSERT_TAIL@PLT
	mov	rax, QWORD PTR [rbx]
	mov	rdx, QWORD PTR 0[r13]
	add	DWORD PTR 4[rax], 1
	add	DWORD PTR [rax], edx
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L17:
	.cfi_restore_state
	call	xbb_get_reqlist@PLT
	test	rax, rax
	je	.L5
	mov	rdi, rbp
	mov	QWORD PTR 8[rsp], rax
	call	xbb_get_req@PLT
	mov	rsi, QWORD PTR 8[rsp]
	test	rax, rax
	mov	r12, rax
	jne	.L12
	mov	eax, DWORD PTR XBBF_RESOURCE_SHORTAGE[rip]
	add	DWORD PTR 20[rbp], 1
	xor	edx, edx
	mov	rdi, rbp
	or	DWORD PTR 0[rbp], eax
	call	xbb_release_reqlist@PLT
.L10:
	mov	rdi, r14
	mov	r15d, 1
	call	mtx_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	QWORD PTR 16[r12], r13
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	mov	eax, DWORD PTR XBBF_RESOURCE_SHORTAGE[rip]
	add	DWORD PTR 20[rbp], 1
	mov	rdi, r14
	mov	r15d, 1
	or	DWORD PTR 0[rbp], eax
	call	mtx_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	eax, DWORD PTR 8[r13]
	mov	QWORD PTR [rbx], rsi
	lea	rdi, 28[rbp]
	mov	edx, DWORD PTR links[rip]
	mov	DWORD PTR 48[rsi], eax
	mov	eax, DWORD PTR 16[r13]
	mov	DWORD PTR 72[rsi], eax
	call	STAILQ_INSERT_TAIL@PLT
	mov	rax, QWORD PTR [rbx]
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	xbb_get_resources, .-xbb_get_resources
	.comm	links,4,4
	.comm	XBBF_SHUTDOWN,4,4
	.comm	XBBF_RESOURCE_SHORTAGE,4,4
	.comm	BLKIF_PROTOCOL_NATIVE,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_blkback.c_xbb_get_resources.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	xbb_get_resources, %function
xbb_get_resources:
	@ 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	r4, r0
	add	r10, r0, #8
	mov	r0, r10
	mov	r9, r3
	mov	r7, r1
	mov	r8, r2
	bl	mtx_lock
	ldr	r3, .L21
	ldr	ip, [r4]
	ldr	r0, [r3]
	ands	r6, ip, r0
	bne	.L10
	ldr	r3, [r7]
	mov	r0, r4
	cmp	r3, #0
	beq	.L19
	bl	xbb_get_req
	subs	r5, r0, #0
	movne	fp, r6
	beq	.L5
.L12:
	mov	r0, r10
	bl	mtx_unlock
	ldr	r3, [r7]
	cmp	r3, #0
	beq	.L16
	ldr	r10, .L21+4
.L7:
	ldr	r2, .L21+8
	ldr	r1, [r4, #4]
	str	r3, [r5, #48]
	ldr	r3, [r2]
	ldr	r2, [r8, #8]
	cmp	r1, r3
	ldr	r3, [r8, #4]
	str	r9, [r5, #44]
	str	r2, [r5, #40]
	str	r3, [r5, #36]
	streq	r8, [r5, #16]
	beq	.L9
	add	r9, r5, #20
	mov	r1, r9
	mov	r2, #16
	mov	r0, r8
	bl	bcopy
	str	r9, [r5, #16]
.L9:
	add	r9, r5, #12
	mov	r0, r9
	bl	binuptime
	mov	r1, r9
	ldr	r0, [r4, #16]
	bl	devstat_start_transaction
	ldr	r0, [r7]
	mov	r1, r5
	ldr	r2, [r10]
	add	r0, r0, #8
	bl	STAILQ_INSERT_TAIL
	ldr	r0, [r8]
	ldr	r3, [r7]
	ldm	r3, {r1, r2}
	add	r1, r1, r0
	add	r2, r2, #1
	mov	r0, r6
	stm	r3, {r1, r2}
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	bl	xbb_get_reqlist
	subs	fp, r0, #0
	beq	.L5
	mov	r0, r4
	bl	xbb_get_req
	subs	r5, r0, #0
	bne	.L12
	ldr	r3, .L21+12
	ldr	r0, [r4]
	ldr	r2, [r3]
	ldr	r3, [r4, #12]
	orr	r0, r0, r2
	add	r3, r3, #1
	str	r0, [r4]
	mov	r2, r5
	mov	r1, fp
	mov	r0, r4
	str	r3, [r4, #12]
	bl	xbb_release_reqlist
.L10:
	mov	r0, r10
	bl	mtx_unlock
	mov	r6, #1
.L20:
	mov	r0, r6
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r2, [r8, #4]
	ldr	r3, [r8, #12]
	ldr	r10, .L21+4
	str	fp, [r7]
	mov	r1, fp
	str	r2, [fp, #36]
	str	r3, [fp, #52]
	ldr	r2, [r10]
	add	r0, r4, #20
	bl	STAILQ_INSERT_TAIL
	ldr	r3, [r7]
	b	.L7
.L5:
	ldr	r3, .L21+12
	ldr	r2, [r4]
	ldr	r1, [r3]
	ldr	r3, [r4, #12]
	orr	r2, r2, r1
	add	r3, r3, #1
	mov	r0, r10
	str	r2, [r4]
	str	r3, [r4, #12]
	bl	mtx_unlock
	mov	r6, #1
	b	.L20
.L22:
	.align	2
.L21:
	.word	XBBF_SHUTDOWN
	.word	links
	.word	BLKIF_PROTOCOL_NATIVE
	.word	XBBF_RESOURCE_SHORTAGE
	.size	xbb_get_resources, .-xbb_get_resources
	.comm	links,4,4
	.comm	XBBF_SHUTDOWN,4,4
	.comm	XBBF_RESOURCE_SHORTAGE,4,4
	.comm	BLKIF_PROTOCOL_NATIVE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
