	.file	"extr_vlapic.c_vlapic_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"vlapic_init: vm is not initialized"
	.align 8
.LC1:
	.string	"vlapic_init: vcpuid is not initialized"
	.align 8
.LC2:
	.string	"vlapic_init: apic_page is not initialized"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"vlapic timer mtx"
	.text
	.p2align 4
	.globl	vlapic_init
	.type	vlapic_init, @function
vlapic_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	lea	rsi, .LC0[rip]
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	cmp	QWORD PTR 32[rdi], 0
	setne	dil
	movzx	edi, dil
	call	KASSERT@PLT
	mov	rbx, QWORD PTR 0[rbp]
	xor	edi, edi
	test	rbx, rbx
	js	.L2
	mov	rdi, QWORD PTR 32[rbp]
	call	vm_get_maxcpus@PLT
	xor	edi, edi
	cmp	rbx, rax
	setl	dil
.L2:
	lea	rsi, .LC1[rip]
	call	KASSERT@PLT
	xor	edi, edi
	cmp	QWORD PTR 24[rbp], 0
	lea	rsi, .LC2[rip]
	setne	dil
	call	KASSERT@PLT
	mov	ecx, DWORD PTR MTX_SPIN[rip]
	xor	edx, edx
	lea	rdi, 16[rbp]
	lea	rsi, .LC3[rip]
	call	mtx_init@PLT
	lea	rdi, 12[rbp]
	mov	esi, 1
	call	callout_init@PLT
	mov	eax, DWORD PTR DEFAULT_APIC_BASE[rip]
	or	eax, DWORD PTR APICBASE_ENABLED[rip]
	cmp	QWORD PTR 0[rbp], 0
	mov	DWORD PTR 8[rbp], eax
	jne	.L3
	or	eax, DWORD PTR APICBASE_BSP[rip]
	mov	DWORD PTR 8[rbp], eax
.L3:
	add	rsp, 8
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	vlapic_reset@PLT
	.cfi_endproc
.LFE0:
	.size	vlapic_init, .-vlapic_init
	.comm	MTX_SPIN,4,4
	.comm	DEFAULT_APIC_BASE,4,4
	.comm	APICBASE_ENABLED,4,4
	.comm	APICBASE_BSP,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_vlapic.c_vlapic_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"vlapic_init: vm is not initialized\000"
	.align	2
.LC1:
	.ascii	"vlapic_init: vcpuid is not initialized\000"
	.align	2
.LC2:
	.ascii	"vlapic_init: apic_page is not initialized\000"
	.align	2
.LC3:
	.ascii	"vlapic timer mtx\000"
	.text
	.align	2
	.global	vlapic_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	vlapic_init, %function
vlapic_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r0, [r0, #20]
	ldr	r1, .L7
	subs	r0, r0, #0
	movne	r0, #1
	bl	KASSERT
	ldr	r5, [r4]
	cmp	r5, #0
	movlt	r0, #0
	blt	.L2
	ldr	r0, [r4, #20]
	bl	vm_get_maxcpus
	cmp	r5, r0
	movge	r0, #0
	movlt	r0, #1
.L2:
	ldr	r1, .L7+4
	bl	KASSERT
	ldr	r0, [r4, #16]
	ldr	r1, .L7+8
	subs	r0, r0, #0
	movne	r0, #1
	bl	KASSERT
	ldr	r3, .L7+12
	mov	r2, #0
	ldr	r3, [r3]
	ldr	r1, .L7+16
	add	r0, r4, #12
	bl	mtx_init
	mov	r1, #1
	add	r0, r4, #8
	bl	callout_init
	ldr	r2, .L7+20
	ldr	r3, .L7+24
	ldr	r1, [r2]
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, #0
	ldreq	r2, .L7+28
	orr	r3, r3, r1
	ldreq	r2, [r2]
	str	r3, [r4, #4]
	orreq	r3, r2, r3
	mov	r0, r4
	streq	r3, [r4, #4]
	pop	{r4, r5, r6, lr}
	b	vlapic_reset
.L8:
	.align	2
.L7:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	MTX_SPIN
	.word	.LC3
	.word	APICBASE_ENABLED
	.word	DEFAULT_APIC_BASE
	.word	APICBASE_BSP
	.size	vlapic_init, .-vlapic_init
	.comm	MTX_SPIN,4,4
	.comm	DEFAULT_APIC_BASE,4,4
	.comm	APICBASE_ENABLED,4,4
	.comm	APICBASE_BSP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
