	.file	"extr_vioapic.c_vioapic_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"ioapic pin%d: redir table entry %#llx"
	.align 8
.LC1:
	.string	"ioapic pin%d: recalculate vlapic trigger-mode register"
	.align 8
.LC2:
	.string	"ioapic pin%d: asserted at rtbl write, acnt %d"
	.text
	.p2align 4
	.type	vioapic_write, @function
vioapic_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movzx	eax, dl
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	cmp	dl, -127
	jne	.L2
	mov	edx, DWORD PTR APIC_ID_MASK[rip]
	and	edx, ecx
	mov	DWORD PTR [rdi], edx
.L2:
	mov	edx, DWORD PTR IOAPIC_REDTBL[rip]
	cmp	edx, eax
	jg	.L1
	mov	esi, DWORD PTR REDIR_ENTRIES[rip]
	lea	esi, [rdx+rsi*2]
	cmp	esi, eax
	jg	.L12
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	sub	eax, edx
	mov	rdx, QWORD PTR 8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rbp
	mov	r13d, eax
	shr	r13d, 31
	add	r13d, eax
	mov	eax, ecx
	sar	r13d
	movsx	rbx, r13d
	sal	rbx, 3
	add	rdx, rbx
	mov	r14d, DWORD PTR [rdx]
	xor	eax, r14d
	and	eax, DWORD PTR RTBL_RO_BITS[rip]
	xor	ecx, eax
	mov	DWORD PTR [rdx], ecx
	mov	edx, r13d
	call	VIOAPIC_CTR2@PLT
	mov	rsi, QWORD PTR 8[rbp]
	mov	eax, DWORD PTR IOART_INTMASK[rip]
	mov	edx, DWORD PTR IOART_INTPOL[rip]
	add	rsi, rbx
	mov	ecx, DWORD PTR [rsi]
	or	edx, eax
	not	edx
	xor	r14d, ecx
	test	edx, r14d
	jne	.L13
.L6:
	and	eax, ecx
	cmp	eax, DWORD PTR IOART_INTMCLR[rip]
	jne	.L1
	test	DWORD PTR IOART_REM_IRR[rip], ecx
	jne	.L1
	mov	ecx, DWORD PTR 4[rsi]
	test	ecx, ecx
	jle	.L1
	mov	rdi, rbp
	mov	edx, r13d
	lea	rsi, .LC2[rip]
	call	VIOAPIC_CTR2@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	esi, r13d
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	vioapic_send_intr@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	edx, r13d
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	call	VIOAPIC_CTR1@PLT
	mov	rdi, rbp
	call	VIOAPIC_UNLOCK@PLT
	mov	edi, DWORD PTR 16[rbp]
	call	vm_active_cpus@PLT
	mov	edi, DWORD PTR 16[rbp]
	mov	esi, r12d
	xor	r8d, r8d
	mov	ecx, DWORD PTR vioapic_update_tmr[rip]
	mov	edx, eax
	call	vm_smp_rendezvous@PLT
	mov	rdi, rbp
	call	VIOAPIC_LOCK@PLT
	add	rbx, QWORD PTR 8[rbp]
	mov	eax, DWORD PTR IOART_INTMASK[rip]
	mov	ecx, DWORD PTR [rbx]
	mov	rsi, rbx
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	vioapic_write, .-vioapic_write
	.comm	vioapic_update_tmr,4,4
	.comm	RTBL_RO_BITS,4,4
	.comm	REDIR_ENTRIES,4,4
	.comm	IOART_REM_IRR,4,4
	.comm	IOART_INTPOL,4,4
	.comm	IOART_INTMCLR,4,4
	.comm	IOART_INTMASK,4,4
	.comm	IOAPIC_REDTBL,4,4
	.comm	APIC_ID_MASK,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_vioapic.c_vioapic_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ioapic pin%d: redir table entry %#llx\000"
	.align	2
.LC1:
	.ascii	"ioapic pin%d: recalculate vlapic trigger-mode regis"
	.ascii	"ter\000"
	.align	2
.LC2:
	.ascii	"ioapic pin%d: asserted at rtbl write, acnt %d\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vioapic_write, %function
vioapic_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	and	r2, r2, #255
	cmp	r2, #129
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	ldreq	r1, .L14
	mov	r4, r0
	ldreq	r1, [r1]
	sub	sp, sp, #8
	andeq	r1, r1, r3
	streq	r1, [r0]
	ldr	r1, .L14+4
	ldr	r1, [r1]
	cmp	r1, r2
	bgt	.L1
	ldr	r0, .L14+8
	ldr	r0, [r0]
	add	r0, r1, r0, lsl #1
	cmp	r0, r2
	bgt	.L12
.L1:
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	sub	r2, r2, r1
	add	r2, r2, r2, lsr #31
	ldr	r1, [r4, #4]
	asr	r6, r2, #1
	ldr	r2, .L14+12
	ldr	r7, [r1, r6, lsl #3]
	ldr	r0, [r2]
	eor	r2, r3, r7
	and	r2, r2, r0
	eor	r3, r3, r2
	str	r3, [r1, r6, lsl #3]
	mov	r2, r6
	ldr	r1, .L14+16
	mov	r0, r4
	bl	VIOAPIC_CTR2
	ldr	r8, .L14+20
	ldr	r3, [r4, #4]
	ldr	r1, .L14+24
	ldr	r0, [r3, r6, lsl #3]
	ldr	r2, [r8]
	ldr	r1, [r1]
	eor	r7, r7, r0
	orr	r1, r2, r1
	bics	r1, r7, r1
	lsl	r7, r6, #3
	add	r3, r3, r7
	bne	.L13
.L6:
	ldr	r1, .L14+28
	and	r2, r2, r0
	ldr	r1, [r1]
	cmp	r2, r1
	bne	.L1
	ldr	r2, .L14+32
	ldr	r2, [r2]
	tst	r0, r2
	bne	.L1
	ldr	r3, [r3, #4]
	cmp	r3, #0
	ble	.L1
	mov	r2, r6
	mov	r0, r4
	ldr	r1, .L14+36
	bl	VIOAPIC_CTR2
	mov	r1, r6
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, lr}
	b	vioapic_send_intr
.L13:
	mov	r2, r6
	ldr	r1, .L14+40
	mov	r0, r4
	bl	VIOAPIC_CTR1
	mov	r0, r4
	bl	VIOAPIC_UNLOCK
	ldr	r0, [r4, #8]
	bl	vm_active_cpus
	mov	ip, #0
	ldr	r3, .L14+44
	str	ip, [sp]
	mov	r2, r0
	ldr	r3, [r3]
	mov	r1, r5
	ldr	r0, [r4, #8]
	bl	vm_smp_rendezvous
	mov	r0, r4
	bl	VIOAPIC_LOCK
	ldr	r3, [r4, #4]
	ldr	r2, [r8]
	ldr	r0, [r3, r6, lsl #3]
	add	r3, r3, r7
	b	.L6
.L15:
	.align	2
.L14:
	.word	APIC_ID_MASK
	.word	IOAPIC_REDTBL
	.word	REDIR_ENTRIES
	.word	RTBL_RO_BITS
	.word	.LC0
	.word	IOART_INTMASK
	.word	IOART_INTPOL
	.word	IOART_INTMCLR
	.word	IOART_REM_IRR
	.word	.LC2
	.word	.LC1
	.word	vioapic_update_tmr
	.size	vioapic_write, .-vioapic_write
	.comm	vioapic_update_tmr,4,4
	.comm	RTBL_RO_BITS,4,4
	.comm	REDIR_ENTRIES,4,4
	.comm	IOART_REM_IRR,4,4
	.comm	IOART_INTPOL,4,4
	.comm	IOART_INTMCLR,4,4
	.comm	IOART_INTMASK,4,4
	.comm	IOAPIC_REDTBL,4,4
	.comm	APIC_ID_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
