	.file	"extr_siis.c_siis_setup_interrupt.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"msi"
.LC1:
	.string	"unable to map interrupt\n"
.LC2:
	.string	"unable to setup interrupt\n"
	.text
	.p2align 4
	.type	siis_setup_interrupt, @function
siis_setup_interrupt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	lea	r13, 4[rsp]
	call	device_get_softc@PLT
	mov	edi, ebp
	mov	rbx, rax
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR SIIS_Q_NOMSI[rip], eax
	sete	al
	movzx	eax, al
	mov	DWORD PTR 4[rsp], eax
	call	device_get_unit@PLT
	mov	edi, ebp
	mov	r12d, eax
	call	device_get_name@PLT
	mov	esi, r12d
	mov	rcx, r13
	lea	rdx, .LC0[rip]
	mov	edi, eax
	call	resource_int_value@PLT
	mov	esi, DWORD PTR 4[rsp]
	test	esi, esi
	js	.L5
	jne	.L20
.L18:
	xor	eax, eax
.L4:
	mov	DWORD PTR 4[rbx], eax
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	lea	rdx, 4[rbx]
	mov	edi, ebp
	mov	ecx, DWORD PTR RF_SHAREABLE[rip]
	or	ecx, DWORD PTR RF_ACTIVE[rip]
	call	bus_alloc_resource_any@PLT
	mov	DWORD PTR 12[rbx], eax
	mov	esi, eax
	test	eax, eax
	je	.L21
	sub	rsp, 8
	.cfi_def_cfa_offset 72
	lea	rax, 8[rbx]
	mov	edx, DWORD PTR ATA_INTR_FLAGS[rip]
	xor	ecx, ecx
	push	rax
	.cfi_def_cfa_offset 80
	mov	r8d, DWORD PTR siis_intr[rip]
	mov	r9, rbx
	mov	edi, ebp
	call	bus_setup_intr@PLT
	mov	r8, rax
	pop	rax
	.cfi_def_cfa_offset 72
	xor	eax, eax
	pop	rdx
	.cfi_def_cfa_offset 64
	test	r8, r8
	jne	.L22
.L1:
	mov	rdx, QWORD PTR 8[rsp]
	xor	rdx, QWORD PTR fs:40
	jne	.L23
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	mov	edi, ebp
	call	pci_msi_count@PLT
	mov	edi, 1
	mov	esi, eax
	call	min@PLT
	mov	DWORD PTR 4[rsp], eax
	test	eax, eax
	je	.L4
	mov	rsi, r13
	mov	edi, ebp
	call	pci_alloc_msi@PLT
	test	rax, rax
	je	.L24
.L5:
	mov	DWORD PTR 4[rsp], 0
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L21:
	lea	rsi, .LC1[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L24:
	mov	ecx, DWORD PTR 4[rsp]
	xor	eax, eax
	test	ecx, ecx
	setne	al
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L22:
	lea	rsi, .LC2[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	siis_setup_interrupt, .-siis_setup_interrupt
	.comm	siis_intr,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	SIIS_Q_NOMSI,4,4
	.comm	RF_SHAREABLE,4,4
	.comm	RF_ACTIVE,4,4
	.comm	ENXIO,4,4
	.comm	ATA_INTR_FLAGS,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_siis.c_siis_setup_interrupt.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"msi\000"
	.align	2
.LC1:
	.ascii	"unable to map interrupt\012\000"
	.align	2
.LC2:
	.ascii	"unable to setup interrupt\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	siis_setup_interrupt, %function
siis_setup_interrupt:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L22
	sub	sp, sp, #24
	mov	r4, r0
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	device_get_softc
	ldr	r3, .L22+4
	ldr	r2, [r0]
	ldr	r3, [r3]
	mov	r5, r0
	tst	r2, r3
	moveq	r3, #1
	movne	r3, #0
	mov	r0, r4
	str	r3, [sp, #16]
	bl	device_get_name
	mov	r6, r0
	mov	r0, r4
	bl	device_get_unit
	add	r3, sp, #16
	mov	r1, r0
	ldr	r2, .L22+8
	mov	r0, r6
	bl	resource_int_value
	ldr	r3, [sp, #16]
	cmp	r3, #0
	movlt	r3, #0
	strlt	r3, [sp, #16]
	blt	.L3
	bne	.L17
.L3:
	mov	r0, #0
.L4:
	mov	r2, r5
	ldr	r1, .L22+12
	ldr	r3, .L22+16
	ldr	ip, [r1]
	ldr	r3, [r3]
	ldr	r1, .L22+20
	str	r0, [r2, #4]!
	ldr	r1, [r1]
	mov	r0, r4
	orr	r3, ip, r3
	bl	bus_alloc_resource_any
	cmp	r0, #0
	mov	r1, r0
	str	r0, [r5, #12]
	beq	.L18
	ldr	r2, .L22+24
	ldr	r3, .L22+28
	ldr	r2, [r2]
	add	r0, r5, #8
	str	r0, [sp, #8]
	str	r5, [sp, #4]
	str	r2, [sp]
	ldr	r2, [r3]
	mov	r0, r4
	mov	r3, #0
	bl	bus_setup_intr
	cmp	r0, #0
	bne	.L19
.L1:
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L20
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, pc}
.L17:
	mov	r0, r4
	bl	pci_msi_count
	mov	r1, r0
	mov	r0, #1
	bl	min
	cmp	r0, #0
	str	r0, [sp, #16]
	beq	.L4
	mov	r0, r4
	add	r1, sp, #16
	bl	pci_alloc_msi
	cmp	r0, #0
	beq	.L21
	mov	r3, #0
	mov	r0, r3
	str	r3, [sp, #16]
	b	.L4
.L18:
	mov	r0, r4
	ldr	r1, .L22+32
	bl	device_printf
	ldr	r3, .L22+36
	ldr	r0, [r3]
	b	.L1
.L21:
	ldr	r0, [sp, #16]
	subs	r0, r0, #0
	movne	r0, #1
	b	.L4
.L19:
	mov	r0, r4
	ldr	r1, .L22+40
	bl	device_printf
	ldr	r3, .L22+36
	ldr	r0, [r3]
	b	.L1
.L20:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC3
	.word	SIIS_Q_NOMSI
	.word	.LC0
	.word	RF_SHAREABLE
	.word	RF_ACTIVE
	.word	SYS_RES_IRQ
	.word	siis_intr
	.word	ATA_INTR_FLAGS
	.word	.LC1
	.word	ENXIO
	.word	.LC2
	.size	siis_setup_interrupt, .-siis_setup_interrupt
	.comm	siis_intr,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	SIIS_Q_NOMSI,4,4
	.comm	RF_SHAREABLE,4,4
	.comm	RF_ACTIVE,4,4
	.comm	ENXIO,4,4
	.comm	ATA_INTR_FLAGS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
