	.file	"extr_vmm.c_vm_handle_suspend.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"All vcpus suspended"
.LC1:
	.string	"Sleeping during suspend"
.LC2:
	.string	"vmsusp"
.LC3:
	.string	"Rendezvous during suspend"
	.text
	.p2align 4
	.type	vm_handle_suspend, @function
vm_handle_suspend:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	r15, .LC3[rip]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	lea	r13, 4[rdi]
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	lea	r14, 16[rbx]
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR 24[rdi]
	mov	edi, ebp
	mov	QWORD PTR 8[rsp], rdx
	movsx	rdx, esi
	mov	rsi, r13
	lea	r12, [rax+rdx*4]
	call	CPU_SET_ATOMIC@PLT
	mov	rdi, r12
	call	vcpu_lock@PLT
.L2:
	mov	rsi, r14
	mov	rdi, r13
	call	CPU_CMP@PLT
	test	rax, rax
	je	.L18
.L3:
	cmp	QWORD PTR 8[rbx], 0
	je	.L19
	mov	rdx, r15
	mov	esi, ebp
	mov	rdi, rbx
	call	VCPU_CTR0@PLT
	mov	rdi, r12
	call	vcpu_unlock@PLT
	mov	esi, ebp
	mov	rdi, rbx
	call	vm_handle_rendezvous@PLT
	mov	rdi, r12
	call	vcpu_lock@PLT
	mov	rsi, r14
	mov	rdi, r13
	call	CPU_CMP@PLT
	test	rax, rax
	jne	.L3
.L18:
	mov	esi, ebp
	lea	rdx, .LC0[rip]
	mov	rdi, rbx
	xor	ebp, ebp
	call	VCPU_CTR0@PLT
	mov	rdi, r12
	call	vcpu_unlock@PLT
	mov	eax, DWORD PTR [rbx]
	test	eax, eax
	jg	.L4
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	add	ebp, 1
	cmp	DWORD PTR [rbx], ebp
	jle	.L8
.L4:
	mov	rsi, r13
	mov	edi, ebp
	call	CPU_ISSET@PLT
	test	rax, rax
	je	.L7
	mov	esi, ebp
	xor	edx, edx
	mov	rdi, rbx
	add	ebp, 1
	call	vcpu_notify_event@PLT
	cmp	DWORD PTR [rbx], ebp
	jg	.L4
.L8:
	mov	rax, QWORD PTR 8[rsp]
	mov	DWORD PTR [rax], 1
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L19:
	.cfi_restore_state
	mov	esi, ebp
	mov	rdi, rbx
	lea	rdx, .LC1[rip]
	call	VCPU_CTR0@PLT
	mov	edx, DWORD PTR VCPU_SLEEPING[rip]
	mov	esi, ebp
	mov	rdi, rbx
	call	vcpu_require_state_locked@PLT
	mov	ecx, DWORD PTR hz[rip]
	mov	rsi, r12
	mov	rdi, r12
	lea	rdx, .LC2[rip]
	call	msleep_spin@PLT
	mov	edx, DWORD PTR VCPU_FROZEN[rip]
	mov	esi, ebp
	mov	rdi, rbx
	call	vcpu_require_state_locked@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	vm_handle_suspend, .-vm_handle_suspend
	.comm	hz,4,4
	.comm	VCPU_SLEEPING,4,4
	.comm	VCPU_FROZEN,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_vmm.c_vm_handle_suspend.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"All vcpus suspended\000"
	.align	2
.LC1:
	.ascii	"Sleeping during suspend\000"
	.align	2
.LC2:
	.ascii	"vmsusp\000"
	.align	2
.LC3:
	.ascii	"Rendezvous during suspend\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vm_handle_suspend, %function
vm_handle_suspend:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r1
	ldr	r6, [r0, #16]
	add	r7, r0, #4
	sub	sp, sp, #12
	mov	r4, r0
	add	r6, r6, r1, lsl #2
	mov	r0, r5
	mov	r1, r7
	str	r2, [sp, #4]
	bl	CPU_SET_ATOMIC
	mov	r0, r6
	bl	vcpu_lock
	ldr	r9, .L20
	ldr	fp, .L20+4
	add	r8, r4, #12
.L2:
	mov	r1, r8
	mov	r0, r7
	bl	CPU_CMP
	cmp	r0, #0
	beq	.L18
	ldr	r3, [r4, #8]
	cmp	r3, #0
	beq	.L19
	mov	r2, r9
	mov	r1, r5
	mov	r0, r4
	bl	VCPU_CTR0
	mov	r0, r6
	bl	vcpu_unlock
	mov	r1, r5
	mov	r0, r4
	bl	vm_handle_rendezvous
	mov	r0, r6
	bl	vcpu_lock
	b	.L2
.L19:
	mov	r2, fp
	mov	r1, r5
	mov	r0, r4
	bl	VCPU_CTR0
	ldr	r3, .L20+8
	mov	r1, r5
	ldr	r2, [r3]
	mov	r0, r4
	bl	vcpu_require_state_locked
	ldr	r3, .L20+12
	mov	r1, r6
	mov	r0, r6
	ldr	r3, [r3]
	ldr	r2, .L20+16
	bl	msleep_spin
	ldr	r3, .L20+20
	mov	r1, r5
	mov	r0, r4
	ldr	r2, [r3]
	bl	vcpu_require_state_locked
	b	.L2
.L18:
	ldr	r2, .L20+24
	mov	r1, r5
	mov	r10, r0
	mov	r0, r4
	bl	VCPU_CTR0
	mov	r0, r6
	bl	vcpu_unlock
	ldr	r2, [r4]
	cmp	r2, #0
	bgt	.L4
	b	.L8
.L7:
	ldr	r3, [r4]
	add	r10, r10, #1
	cmp	r3, r10
	ble	.L8
.L4:
	mov	r1, r7
	mov	r0, r10
	bl	CPU_ISSET
	cmp	r0, #0
	beq	.L7
	mov	r1, r10
	mov	r2, #0
	mov	r0, r4
	bl	vcpu_notify_event
	ldr	r3, [r4]
	add	r10, r10, #1
	cmp	r3, r10
	bgt	.L4
.L8:
	mov	r3, #1
	mov	r0, #0
	ldr	r2, [sp, #4]
	str	r3, [r2]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC3
	.word	.LC1
	.word	VCPU_SLEEPING
	.word	hz
	.word	.LC2
	.word	VCPU_FROZEN
	.word	.LC0
	.size	vm_handle_suspend, .-vm_handle_suspend
	.comm	hz,4,4
	.comm	VCPU_SLEEPING,4,4
	.comm	VCPU_FROZEN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
