	.file	"extr_bcm_bmips.c_bcm_bmips_pic_intr.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"invalid irq %u"
.LC1:
	.string	"Stray interrupt %u detected\n"
	.text
	.p2align 4
	.type	bcm_bmips_pic_intr, @function
bcm_bmips_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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	rbp, QWORD PTR 16[rdi]
	mov	esi, DWORD PTR SIBA_CFG0_FLAGST[rip]
	mov	edi, DWORD PTR 16[rbp]
	call	bus_read_4@PLT
	mov	r13d, DWORD PTR [r12]
	mov	edi, DWORD PTR 16[rbp]
	mov	ebx, eax
	test	r13d, r13d
	jne	.L2
	mov	esi, DWORD PTR SIBA_CFG0_INTVEC[rip]
	call	bus_read_4@PLT
	mov	r15d, eax
.L3:
	mov	r12, QWORD PTR 8[r12]
	and	ebx, r15d
	mov	r14d, 1
	test	r12, r12
	je	.L10
	mov	rdi, r12
	call	BCM_MIPS_IVEC_MASK@PLT
	test	eax, ebx
	jne	.L32
.L12:
	mov	rdi, r12
	mov	r14d, 1
	call	BCM_MIPS_IVEC_MASK@PLT
	not	eax
	and	ebx, eax
	jne	.L14
.L30:
	mov	eax, DWORD PTR FILTER_HANDLED[rip]
	add	rsp, 8
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, r12d
	lea	rsi, .LC1[rip]
	call	device_printf@PLT
	mov	edx, r12d
	mov	esi, r13d
	mov	rdi, rbp
	call	bcm_bmips_mask_irq@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, ebx
	call	fls@PLT
	test	eax, eax
	je	.L30
	lea	r12d, -1[rax]
	mov	eax, r14d
	mov	rdi, QWORD PTR 8[rbp]
	mov	ecx, r12d
	movsx	r15, r12d
	sal	eax, cl
	not	eax
	and	ebx, eax
	call	nitems@PLT
	xor	edi, edi
	mov	rsi, r15
	cmp	eax, r12d
	setg	dil
	call	KASSERT@PLT
	mov	rax, QWORD PTR 8[rbp]
	lea	rdi, [rax+r15*4]
	mov	rax, QWORD PTR curthread[rip]
	mov	esi, DWORD PTR [rax]
	call	intr_isrc_dispatch@PLT
	test	eax, eax
	je	.L10
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L16:
	lea	r12d, -1[rax]
	mov	eax, r14d
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC1[rip]
	mov	ecx, r12d
	mov	edx, r12d
	sal	eax, cl
	not	eax
	and	ebx, eax
	call	device_printf@PLT
	mov	edx, r12d
	mov	esi, r13d
	mov	rdi, rbp
	call	bcm_bmips_mask_irq@PLT
.L14:
	mov	edi, ebx
	call	fls@PLT
	test	eax, eax
	jne	.L16
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L2:
	mov	esi, DWORD PTR SIBA_CFG0_IPSFLAG[rip]
	call	bus_read_4@PLT
	cmp	r13d, 3
	je	.L4
	jg	.L5
	cmp	r13d, 1
	je	.L6
	cmp	r13d, 2
	jne	.L8
	mov	ecx, DWORD PTR SIBA_IPS_INT2_SHIFT[rip]
	and	eax, DWORD PTR SIBA_IPS_INT2_MASK[rip]
	sar	eax, cl
	mov	r15d, eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	r13d, 4
	jne	.L8
	mov	ecx, DWORD PTR SIBA_IPS_INT4_SHIFT[rip]
	and	eax, DWORD PTR SIBA_IPS_INT4_MASK[rip]
	sar	eax, cl
	mov	r15d, eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ecx, DWORD PTR SIBA_IPS_INT1_SHIFT[rip]
	and	eax, DWORD PTR SIBA_IPS_INT1_MASK[rip]
	sar	eax, cl
	mov	r15d, eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L32:
	mov	rax, QWORD PTR curthread[rip]
	lea	r14, 4[r12]
	mov	rdi, r14
	mov	esi, DWORD PTR [rax]
	call	intr_isrc_dispatch@PLT
	test	eax, eax
	je	.L12
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, DWORD PTR [r12]
	lea	rsi, .LC1[rip]
	call	device_printf@PLT
	mov	edi, DWORD PTR 0[rbp]
	mov	rsi, r14
	call	bcm_bmips_pic_disable_intr@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	mov	esi, r13d
	lea	rdi, .LC0[rip]
	call	panic@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	mov	ecx, DWORD PTR SIBA_IPS_INT3_SHIFT[rip]
	and	eax, DWORD PTR SIBA_IPS_INT3_MASK[rip]
	sar	eax, cl
	mov	r15d, eax
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	bcm_bmips_pic_intr, .-bcm_bmips_pic_intr
	.comm	curthread,8,8
	.comm	SIBA_IPS_INT4_SHIFT,4,4
	.comm	SIBA_IPS_INT4_MASK,4,4
	.comm	SIBA_IPS_INT3_SHIFT,4,4
	.comm	SIBA_IPS_INT3_MASK,4,4
	.comm	SIBA_IPS_INT2_SHIFT,4,4
	.comm	SIBA_IPS_INT2_MASK,4,4
	.comm	SIBA_IPS_INT1_SHIFT,4,4
	.comm	SIBA_IPS_INT1_MASK,4,4
	.comm	SIBA_CFG0_IPSFLAG,4,4
	.comm	SIBA_CFG0_INTVEC,4,4
	.comm	SIBA_CFG0_FLAGST,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_bcm_bmips.c_bcm_bmips_pic_intr.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"invalid irq %u\000"
	.align	2
.LC1:
	.ascii	"Stray interrupt %u detected\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bcm_bmips_pic_intr, %function
bcm_bmips_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	r3, .L34
	mov	r8, r0
	ldr	r6, [r0, #8]
	ldr	r1, [r3]
	ldr	r0, [r6, #8]
	bl	bus_read_4
	ldr	r7, [r8]
	mov	r10, r0
	cmp	r7, #0
	bne	.L2
	ldr	r3, .L34+4
	ldr	r0, [r6, #8]
	ldr	r1, [r3]
	bl	bus_read_4
	mov	r5, r0
.L3:
	ldr	r4, [r8, #4]
	and	r5, r5, r10
	cmp	r4, #0
	beq	.L32
	mov	r0, r4
	bl	BCM_MIPS_IVEC_MASK
	tst	r0, r5
	bne	.L33
.L12:
	mov	r0, r4
	bl	BCM_MIPS_IVEC_MASK
	bics	r4, r5, r0
	beq	.L30
	mov	r9, #1
	ldr	r8, .L34+8
	b	.L14
.L16:
	mov	r2, r5
	mov	r1, r8
	ldr	r0, [r6]
	bl	device_printf
	mov	r2, r5
	mov	r1, r7
	mov	r0, r6
	bic	r4, r4, r9, lsl r5
	bl	bcm_bmips_mask_irq
.L14:
	mov	r0, r4
	bl	fls
	cmp	r0, #0
	sub	r5, r0, #1
	bne	.L16
.L30:
	ldr	r3, .L34+12
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r3, .L34+16
	ldr	r0, [r6, #8]
	ldr	r1, [r3]
	bl	bus_read_4
	sub	r3, r7, #1
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L4
.L6:
	.word	.L9
	.word	.L8
	.word	.L7
	.word	.L5
.L32:
	mov	r9, #1
	ldr	r8, .L34+20
	ldr	r10, .L34+8
.L10:
	mov	r0, r5
	bl	fls
	cmp	r0, #0
	sub	r4, r0, #1
	beq	.L30
	ldr	r0, [r6, #4]
	bl	nitems
	cmp	r0, r4
	movle	r0, #0
	movgt	r0, #1
	mov	r1, r4
	bl	KASSERT
	ldr	r3, [r8]
	ldr	r0, [r6, #4]
	ldr	r1, [r3]
	add	r0, r0, r4, lsl #2
	bl	intr_isrc_dispatch
	cmp	r0, #0
	bic	r5, r5, r9, lsl r4
	beq	.L10
	mov	r2, r4
	mov	r1, r10
	ldr	r0, [r6]
	bl	device_printf
	mov	r2, r4
	mov	r1, r7
	mov	r0, r6
	bl	bcm_bmips_mask_irq
	b	.L10
.L33:
	ldr	r3, .L34+20
	add	r8, r4, #4
	ldr	r3, [r3]
	mov	r0, r8
	ldr	r1, [r3]
	bl	intr_isrc_dispatch
	cmp	r0, #0
	beq	.L12
	ldr	r2, [r4]
	ldr	r1, .L34+8
	ldr	r0, [r6]
	bl	device_printf
	mov	r1, r8
	ldr	r0, [r6]
	bl	bcm_bmips_pic_disable_intr
	b	.L12
.L9:
	ldr	r2, .L34+24
	ldr	r3, .L34+28
	ldr	r9, [r2]
	ldr	r5, [r3]
	and	r0, r0, r9
	asr	r5, r0, r5
	b	.L3
.L8:
	ldr	r2, .L34+32
	ldr	r3, .L34+36
	ldr	r9, [r2]
	ldr	r5, [r3]
	and	r0, r0, r9
	asr	r5, r0, r5
	b	.L3
.L7:
	ldr	r2, .L34+40
	ldr	r3, .L34+44
	ldr	r9, [r2]
	ldr	r5, [r3]
	and	r0, r0, r9
	asr	r5, r0, r5
	b	.L3
.L5:
	ldr	r2, .L34+48
	ldr	r3, .L34+52
	ldr	r9, [r2]
	ldr	r5, [r3]
	and	r3, r0, r9
	asr	r5, r3, r5
	b	.L3
.L4:
	mov	r1, r7
	ldr	r0, .L34+56
	bl	panic
	b	.L3
.L35:
	.align	2
.L34:
	.word	SIBA_CFG0_FLAGST
	.word	SIBA_CFG0_INTVEC
	.word	.LC1
	.word	FILTER_HANDLED
	.word	SIBA_CFG0_IPSFLAG
	.word	curthread
	.word	SIBA_IPS_INT1_MASK
	.word	SIBA_IPS_INT1_SHIFT
	.word	SIBA_IPS_INT2_MASK
	.word	SIBA_IPS_INT2_SHIFT
	.word	SIBA_IPS_INT3_MASK
	.word	SIBA_IPS_INT3_SHIFT
	.word	SIBA_IPS_INT4_MASK
	.word	SIBA_IPS_INT4_SHIFT
	.word	.LC0
	.size	bcm_bmips_pic_intr, .-bcm_bmips_pic_intr
	.comm	curthread,4,4
	.comm	SIBA_IPS_INT4_SHIFT,4,4
	.comm	SIBA_IPS_INT4_MASK,4,4
	.comm	SIBA_IPS_INT3_SHIFT,4,4
	.comm	SIBA_IPS_INT3_MASK,4,4
	.comm	SIBA_IPS_INT2_SHIFT,4,4
	.comm	SIBA_IPS_INT2_MASK,4,4
	.comm	SIBA_IPS_INT1_SHIFT,4,4
	.comm	SIBA_IPS_INT1_MASK,4,4
	.comm	SIBA_CFG0_IPSFLAG,4,4
	.comm	SIBA_CFG0_INTVEC,4,4
	.comm	SIBA_CFG0_FLAGST,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
