	.file	"extr_aml8726_pic.c_aml8726_pic_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"could not allocate resources for device\n"
	.text
	.p2align 4
	.type	aml8726_pic_attach, @function
aml8726_pic_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	device_get_softc@PLT
	cmp	QWORD PTR aml8726_pic_sc[rip], 0
	je	.L2
.L11:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, DWORD PTR ENXIO[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	DWORD PTR 4[rax], r12d
	mov	edx, DWORD PTR [rax]
	mov	edi, r12d
	mov	rbp, rax
	mov	esi, DWORD PTR aml8726_pic_spec[rip]
	call	bus_alloc_resources@PLT
	test	rax, rax
	jne	.L4
	mov	eax, DWORD PTR AML_PIC_NCNTRLS[rip]
	xor	r12d, r12d
	test	eax, eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rsi, QWORD PTR AML_PIC_0_MASK_REG[rip]
	mov	rbx, r12
	xor	edx, edx
	mov	rdi, rbp
	sal	rbx, 4
	add	r12, 1
	add	rsi, rbx
	call	CSR_WRITE_4@PLT
	mov	rsi, QWORD PTR AML_PIC_0_STAT_CLR_REG[rip]
	mov	edx, -1
	mov	rdi, rbp
	add	rsi, rbx
	call	CSR_WRITE_4@PLT
	add	rbx, QWORD PTR AML_PIC_0_FIRQ_SEL[rip]
	xor	edx, edx
	mov	rdi, rbp
	mov	rsi, rbx
	call	CSR_WRITE_4@PLT
	cmp	DWORD PTR AML_PIC_NCNTRLS[rip], r12d
	jg	.L5
.L6:
	mov	eax, DWORD PTR aml8726_pic_eoi[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	QWORD PTR aml8726_pic_sc[rip], rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	mov	DWORD PTR arm_post_filter[rip], eax
	xor	eax, eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	call	device_printf@PLT
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	aml8726_pic_attach, .-aml8726_pic_attach
	.comm	arm_post_filter,4,4
	.comm	aml8726_pic_spec,4,4
	.comm	aml8726_pic_sc,8,8
	.comm	aml8726_pic_eoi,4,4
	.comm	ENXIO,4,4
	.comm	AML_PIC_NCNTRLS,4,4
	.comm	AML_PIC_0_STAT_CLR_REG,8,8
	.comm	AML_PIC_0_MASK_REG,8,8
	.comm	AML_PIC_0_FIRQ_SEL,8,8
	.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_aml8726_pic.c_aml8726_pic_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"could not allocate resources for device\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aml8726_pic_attach, %function
aml8726_pic_attach:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r9, .L12
	sub	sp, sp, #12
	mov	r4, r0
	bl	device_get_softc
	ldr	r3, [r9]
	cmp	r3, #0
	beq	.L2
.L10:
	ldr	r3, .L12+4
	ldr	r3, [r3]
	str	r3, [sp, #4]
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r3, .L12+8
	ldr	r2, [r0]
	ldr	r1, [r3]
	str	r4, [r0, #4]
	mov	r5, r0
	mov	r0, r4
	bl	bus_alloc_resources
	subs	r3, r0, #0
	str	r3, [sp, #4]
	bne	.L4
	ldr	r8, .L12+12
	ldr	r3, [r8]
	cmp	r3, #0
	ble	.L6
	ldr	r4, [sp, #4]
	ldr	r7, .L12+16
	ldr	fp, .L12+20
	ldr	r10, .L12+24
.L5:
	ldr	r1, [r7]
	mov	r2, #0
	add	r1, r1, r4, lsl #4
	mov	r0, r5
	bl	CSR_WRITE_4
	ldr	r1, [fp]
	lsl	r6, r4, #4
	mvn	r2, #0
	add	r1, r6, r1
	mov	r0, r5
	bl	CSR_WRITE_4
	ldr	r1, [r10]
	mov	r2, #0
	mov	r0, r5
	add	r1, r6, r1
	bl	CSR_WRITE_4
	ldr	r2, [r8]
	add	r4, r4, #1
	cmp	r2, r4
	bgt	.L5
.L6:
	ldr	r2, .L12+28
	ldr	r3, .L12+32
	ldr	r2, [r2]
	ldr	r0, [sp, #4]
	str	r5, [r9]
	str	r2, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	mov	r0, r4
	ldr	r1, .L12+36
	bl	device_printf
	b	.L10
.L13:
	.align	2
.L12:
	.word	aml8726_pic_sc
	.word	ENXIO
	.word	aml8726_pic_spec
	.word	AML_PIC_NCNTRLS
	.word	AML_PIC_0_MASK_REG
	.word	AML_PIC_0_STAT_CLR_REG
	.word	AML_PIC_0_FIRQ_SEL
	.word	aml8726_pic_eoi
	.word	arm_post_filter
	.word	.LC0
	.size	aml8726_pic_attach, .-aml8726_pic_attach
	.comm	arm_post_filter,4,4
	.comm	aml8726_pic_spec,4,4
	.comm	aml8726_pic_sc,4,4
	.comm	aml8726_pic_eoi,4,4
	.comm	ENXIO,4,4
	.comm	AML_PIC_NCNTRLS,4,4
	.comm	AML_PIC_0_STAT_CLR_REG,4,4
	.comm	AML_PIC_0_MASK_REG,4,4
	.comm	AML_PIC_0_FIRQ_SEL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
