	.file	"extr_xen_msi.c_xen_msi_alloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	xen_msi_alloc
	.type	xen_msi_alloc, @function
xen_msi_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edi
	lea	rdi, msi_lock[rip]
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rcx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	mtx_lock@PLT
	mov	rax, QWORD PTR msi_last_irq[rip]
	movsx	rdx, r12d
	add	rdx, rax
	cmp	rdx, QWORD PTR num_msi_irqs[rip]
	jg	.L2
	test	r12d, r12d
	jle	.L18
	mov	rcx, rax
	lea	r13d, -1[r12]
	lea	rdx, 1[rax]
	neg	rcx
	lea	r8, [rdx+r13]
	lea	rdi, [rbx+rcx*4]
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ecx, DWORD PTR first_msi_irq[rip]
	add	ecx, eax
	mov	DWORD PTR [rdi+rax*4], ecx
	add	rax, 1
	cmp	rax, r8
	jne	.L6
	add	rdx, r13
	lea	rdi, msi_lock[rip]
	mov	QWORD PTR msi_last_irq[rip], rdx
	call	mtx_unlock@PLT
	mov	esi, DWORD PTR [rbx]
	mov	edi, ebp
	mov	edx, r12d
	lea	rbp, 4[rbx+r13*4]
	call	xen_register_msi@PLT
	test	eax, eax
	jne	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	edi, DWORD PTR [rbx]
	add	rbx, 4
	call	nexus_add_irq@PLT
	cmp	rbx, rbp
	jne	.L8
.L9:
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	lea	rdi, msi_lock[rip]
	call	mtx_unlock@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	lea	rdi, msi_lock[rip]
	call	mtx_unlock@PLT
	mov	esi, DWORD PTR [rbx]
	mov	edx, r12d
	mov	edi, ebp
	call	xen_register_msi@PLT
	test	eax, eax
	je	.L9
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	xen_msi_alloc, .-xen_msi_alloc
	.comm	num_msi_irqs,8,8
	.comm	msi_lock,4,4
	.comm	msi_last_irq,8,8
	.comm	first_msi_irq,4,4
	.comm	ENXIO,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_xen_msi.c_xen_msi_alloc.c"
	.text
	.align	2
	.global	xen_msi_alloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	xen_msi_alloc, %function
xen_msi_alloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	mov	r6, r0
	ldr	r9, .L19
	ldr	r0, .L19+4
	mov	r5, r3
	bl	mtx_lock
	ldr	r3, .L19+8
	ldr	r2, [r9]
	ldr	r1, [r3]
	add	r3, r2, r4
	cmp	r3, r1
	bgt	.L2
	cmp	r4, #0
	ble	.L18
	sub	r7, r5, #4
	mov	r8, r7
	mov	lr, r7
	ldr	r1, .L19+12
.L6:
	ldr	ip, [r1]
	add	ip, ip, r2
	add	r2, r2, #1
	cmp	r2, r3
	str	ip, [lr, #4]!
	bne	.L6
	ldr	r0, .L19+4
	str	r2, [r9]
	bl	mtx_unlock
	mov	r2, r4
	mov	r0, r6
	ldr	r1, [r5]
	bl	xen_register_msi
	cmp	r0, #0
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	add	r4, r7, r4, lsl #2
.L8:
	ldr	r0, [r8, #4]!
	bl	nexus_add_irq
	cmp	r8, r4
	bne	.L8
.L9:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r0, .L19+4
	bl	mtx_unlock
	ldr	r3, .L19+16
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	ldr	r0, .L19+4
	bl	mtx_unlock
	mov	r2, r4
	mov	r0, r6
	ldr	r1, [r5]
	bl	xen_register_msi
	cmp	r0, #0
	beq	.L9
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L20:
	.align	2
.L19:
	.word	msi_last_irq
	.word	msi_lock
	.word	num_msi_irqs
	.word	first_msi_irq
	.word	ENXIO
	.size	xen_msi_alloc, .-xen_msi_alloc
	.comm	num_msi_irqs,4,4
	.comm	msi_lock,4,4
	.comm	msi_last_irq,4,4
	.comm	first_msi_irq,4,4
	.comm	ENXIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
