	.file	"extr_tzic.c_tzic_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"could not allocate resources\n"
.LC1:
	.string	"could not attach PIC\n"
	.text
	.p2align 4
	.type	tzic_attach, @function
tzic_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
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	device_get_softc@PLT
	cmp	QWORD PTR tzic_sc[rip], 0
	je	.L2
.L15:
	mov	eax, DWORD PTR ENXIO[rip]
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L17
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	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 8[rax], r12d
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	mov	edi, r12d
	mov	rbp, rax
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	lea	rdx, 4[rsp]
	mov	QWORD PTR tzic_sc[rip], rax
	mov	DWORD PTR 4[rsp], 0
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 0[rbp], rax
	test	rax, rax
	je	.L18
	mov	DWORD PTR 4[rsp], 0
	xor	edi, edi
	.p2align 4,,10
	.p2align 3
.L5:
	call	TZIC_INTSEC@PLT
	mov	rdi, rbp
	mov	edx, -1
	mov	esi, eax
	call	tzic_write_4@PLT
	mov	eax, DWORD PTR 4[rsp]
	lea	edi, 1[rax]
	mov	DWORD PTR 4[rsp], edi
	cmp	edi, 3
	jle	.L5
	mov	DWORD PTR 4[rsp], 0
	xor	edi, edi
	.p2align 4,,10
	.p2align 3
.L6:
	call	TZIC_ENCLEAR@PLT
	mov	rdi, rbp
	mov	edx, -1
	mov	esi, eax
	call	tzic_write_4@PLT
	mov	eax, DWORD PTR 4[rsp]
	lea	edi, 1[rax]
	mov	DWORD PTR 4[rsp], edi
	cmp	edi, 3
	jle	.L6
	mov	DWORD PTR 4[rsp], 0
	xor	edi, edi
	.p2align 4,,10
	.p2align 3
.L7:
	call	TZIC_PRIORITY@PLT
	mov	rdi, rbp
	xor	edx, edx
	mov	esi, eax
	call	tzic_write_4@PLT
	mov	eax, DWORD PTR 4[rsp]
	lea	edi, 1[rax]
	mov	DWORD PTR 4[rsp], edi
	cmp	edi, 31
	jle	.L7
	mov	esi, DWORD PTR TZIC_PRIOMASK[rip]
	mov	edx, 255
	mov	rdi, rbp
	call	tzic_write_4@PLT
	mov	esi, DWORD PTR TZIC_SYNCCTRL[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	tzic_write_4@PLT
	mov	esi, DWORD PTR TZIC_INTCNTL[rip]
	mov	edx, DWORD PTR INTCNTL_NSEN_MASK[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR INTCNTL_NSEN[rip]
	or	edx, DWORD PTR INTCNTL_EN[rip]
	call	tzic_write_4@PLT
	mov	rdi, rbp
	call	tzic_pic_attach@PLT
	mov	r8, rax
	xor	eax, eax
	test	r8, r8
	je	.L1
	lea	rsi, .LC1[rip]
	mov	edi, r12d
	call	device_printf@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L18:
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tzic_attach, .-tzic_attach
	.comm	tzic_sc,8,8
	.comm	TZIC_SYNCCTRL,4,4
	.comm	TZIC_PRIOMASK,4,4
	.comm	TZIC_INTCNTL,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	RF_ACTIVE,4,4
	.comm	INTCNTL_NSEN_MASK,4,4
	.comm	INTCNTL_NSEN,4,4
	.comm	INTCNTL_EN,4,4
	.comm	ENXIO,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_tzic.c_tzic_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"could not allocate resources\012\000"
	.align	2
.LC1:
	.ascii	"could not attach PIC\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tzic_attach, %function
tzic_attach:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L20
	sub	sp, sp, #8
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	mov	r5, r0
	bl	device_get_softc
	ldr	ip, .L20+4
	ldr	r6, [ip]
	cmp	r6, #0
	beq	.L2
.L16:
	ldr	r3, .L20+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L2:
	mov	r4, r0
	ldr	r2, .L20+12
	ldr	r3, .L20+16
	ldr	r1, [r2]
	str	r5, [r0, #4]
	mov	r2, sp
	mov	r0, r5
	ldr	r3, [r3]
	str	r4, [ip]
	str	r6, [sp]
	bl	bus_alloc_resource_any
	cmp	r0, #0
	str	r0, [r4]
	movne	r0, r6
	strne	r6, [sp]
	beq	.L19
.L5:
	bl	TZIC_INTSEC
	mvn	r2, #0
	mov	r1, r0
	mov	r0, r4
	bl	tzic_write_4
	ldr	r3, [sp]
	add	r0, r3, #1
	cmp	r0, #3
	str	r0, [sp]
	ble	.L5
	mov	r3, #0
	mov	r0, r3
	str	r3, [sp]
.L6:
	bl	TZIC_ENCLEAR
	mvn	r2, #0
	mov	r1, r0
	mov	r0, r4
	bl	tzic_write_4
	ldr	r3, [sp]
	add	r0, r3, #1
	cmp	r0, #3
	str	r0, [sp]
	ble	.L6
	mov	r3, #0
	mov	r0, r3
	str	r3, [sp]
.L7:
	bl	TZIC_PRIORITY
	mov	r2, #0
	mov	r1, r0
	mov	r0, r4
	bl	tzic_write_4
	ldr	r3, [sp]
	add	r0, r3, #1
	cmp	r0, #31
	str	r0, [sp]
	ble	.L7
	ldr	r3, .L20+20
	mov	r2, #255
	ldr	r1, [r3]
	mov	r0, r4
	bl	tzic_write_4
	ldr	r3, .L20+24
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	tzic_write_4
	ldr	r1, .L20+28
	ldr	r3, .L20+32
	ldr	r2, .L20+36
	ldr	r0, [r1]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, .L20+40
	orr	r3, r3, r0
	ldr	r1, [r1]
	orr	r2, r3, r2
	mov	r0, r4
	bl	tzic_write_4
	mov	r0, r4
	bl	tzic_pic_attach
	cmp	r0, #0
	beq	.L1
	mov	r0, r5
	ldr	r1, .L20+44
	bl	device_printf
	b	.L16
.L19:
	mov	r0, r5
	ldr	r1, .L20+48
	bl	device_printf
	ldr	r3, .L20+8
	ldr	r0, [r3]
	b	.L1
.L18:
	bl	__stack_chk_fail
.L21:
	.align	2
.L20:
	.word	.LC2
	.word	tzic_sc
	.word	ENXIO
	.word	SYS_RES_MEMORY
	.word	RF_ACTIVE
	.word	TZIC_PRIOMASK
	.word	TZIC_SYNCCTRL
	.word	INTCNTL_NSEN
	.word	INTCNTL_NSEN_MASK
	.word	INTCNTL_EN
	.word	TZIC_INTCNTL
	.word	.LC1
	.word	.LC0
	.size	tzic_attach, .-tzic_attach
	.comm	tzic_sc,4,4
	.comm	TZIC_SYNCCTRL,4,4
	.comm	TZIC_PRIOMASK,4,4
	.comm	TZIC_INTCNTL,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	RF_ACTIVE,4,4
	.comm	INTCNTL_NSEN_MASK,4,4
	.comm	INTCNTL_NSEN,4,4
	.comm	INTCNTL_EN,4,4
	.comm	ENXIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
