	.file	"extr_mtk_intr_v2.c_mtk_pic_intr.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Stray interrupt %u detected\n"
.LC1:
	.string	"all interrupts handled"
	.text
	.p2align 4
	.type	mtk_pic_intr, @function
mtk_pic_intr:
.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
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, 1
	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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	r14, QWORD PTR curthread[rip]
	mov	esi, DWORD PTR MTK_IRQ0STAT[rip]
	sub	DWORD PTR [r14], 1
	call	READ4@PLT
	mov	ebx, eax
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edi, ebx
	call	fls@PLT
	test	eax, eax
	je	.L10
.L4:
	lea	r12d, -1[rax]
	mov	eax, r13d
	mov	rdi, rbp
	mov	ecx, r12d
	mov	esi, r12d
	sal	eax, cl
	not	eax
	and	ebx, eax
	mov	rax, QWORD PTR curthread[rip]
	mov	r15d, DWORD PTR 4[rax]
	call	PIC_INTR_ISRC@PLT
	mov	edi, eax
	mov	esi, r15d
	call	intr_isrc_dispatch@PLT
	test	rax, rax
	je	.L2
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, r12d
	lea	rsi, .LC0[rip]
	call	device_printf@PLT
	mov	rdi, rbp
	mov	esi, r12d
	call	pic_irq_mask@PLT
	mov	edi, ebx
	call	fls@PLT
	test	eax, eax
	jne	.L4
.L10:
	lea	rsi, .LC1[rip]
	mov	edi, 1
	call	KASSERT@PLT
	add	DWORD PTR [r14], 1
	mov	eax, DWORD PTR FILTER_HANDLED[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE0:
	.size	mtk_pic_intr, .-mtk_pic_intr
	.comm	curthread,8,8
	.comm	MTK_IRQ1STAT,4,4
	.comm	MTK_IRQ0STAT,4,4
	.comm	FILTER_HANDLED,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_mtk_intr_v2.c_mtk_pic_intr.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Stray interrupt %u detected\012\000"
	.align	2
.LC1:
	.ascii	"all interrupts handled\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtk_pic_intr, %function
mtk_pic_intr:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r7, .L11
	ldr	r3, .L11+4
	ldr	r9, [r7]
	ldr	r1, [r3]
	ldr	r3, [r9]
	mov	r6, r0
	sub	r3, r3, #1
	str	r3, [r9]
	bl	READ4
	mov	r8, #1
	mov	r5, r0
	ldr	r10, .L11+8
.L2:
	mov	r0, r5
	bl	fls
	cmp	r0, #0
	sub	r4, r0, #1
	beq	.L10
	mov	r1, r4
	mov	r0, r6
	bl	PIC_INTR_ISRC
	ldr	r3, [r7]
	bic	r5, r5, r8, lsl r4
	ldr	r1, [r3, #4]
	bl	intr_isrc_dispatch
	cmp	r0, #0
	beq	.L2
	mov	r1, r10
	mov	r2, r4
	ldr	r0, [r6]
	bl	device_printf
	mov	r1, r4
	mov	r0, r6
	bl	pic_irq_mask
	b	.L2
.L10:
	ldr	r1, .L11+12
	mov	r0, #1
	bl	KASSERT
	ldr	r3, [r9]
	ldr	r2, .L11+16
	add	r3, r3, #1
	ldr	r0, [r2]
	str	r3, [r9]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	.align	2
.L11:
	.word	curthread
	.word	MTK_IRQ0STAT
	.word	.LC0
	.word	.LC1
	.word	FILTER_HANDLED
	.size	mtk_pic_intr, .-mtk_pic_intr
	.comm	curthread,4,4
	.comm	MTK_IRQ1STAT,4,4
	.comm	MTK_IRQ0STAT,4,4
	.comm	FILTER_HANDLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
