	.file	"extr_aw_spi.c_aw_spi_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"cannot allocate resources for device\n"
	.align 8
.LC1:
	.string	"cannot setup interrupt handler\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"cannot de-assert reset\n"
.LC3:
	.string	"ahb"
.LC4:
	.string	"cannot get ahb clock\n"
.LC5:
	.string	"mod"
.LC6:
	.string	"cannot get mod clock\n"
.LC7:
	.string	"cannot enable ahb clock\n"
.LC8:
	.string	"cannot enable mod clock\n"
.LC9:
	.string	"spibus"
	.text
	.p2align 4
	.type	aw_spi_attach, @function
aw_spi_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	device_get_softc@PLT
	mov	r12d, DWORD PTR MTX_DEF[rip]
	mov	edi, ebp
	mov	DWORD PTR 32[rax], ebp
	mov	rbx, rax
	call	device_get_nameunit@PLT
	xor	edx, edx
	lea	rdi, 28[rbx]
	mov	ecx, r12d
	mov	esi, eax
	call	mtx_init@PLT
	mov	rdx, QWORD PTR 16[rbx]
	mov	esi, DWORD PTR aw_spi_spec[rip]
	mov	edi, ebp
	call	bus_alloc_resources@PLT
	test	rax, rax
	jne	.L16
	mov	rax, QWORD PTR 16[rbx]
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	edx, DWORD PTR INTR_TYPE_MISC[rip]
	xor	ecx, ecx
	mov	r8d, DWORD PTR aw_spi_intr[rip]
	or	edx, DWORD PTR INTR_MPSAFE[rip]
	mov	r9, rbx
	mov	edi, ebp
	mov	esi, DWORD PTR 4[rax]
	lea	rax, 24[rbx]
	push	rax
	.cfi_def_cfa_offset 48
	call	bus_setup_intr@PLT
	pop	rdx
	.cfi_def_cfa_offset 40
	pop	rcx
	.cfi_def_cfa_offset 32
	test	rax, rax
	jne	.L17
	xor	edx, edx
	xor	esi, esi
	lea	rcx, 12[rbx]
	mov	edi, ebp
	call	hwreset_get_by_ofw_idx@PLT
	test	rax, rax
	jne	.L6
	mov	edi, DWORD PTR 12[rbx]
	call	hwreset_deassert@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L18
.L6:
	lea	rcx, 8[rbx]
	lea	rdx, .LC3[rip]
	xor	esi, esi
	mov	edi, ebp
	call	clk_get_by_ofw_name@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L19
	lea	rcx, 4[rbx]
	lea	rdx, .LC5[rip]
	xor	esi, esi
	mov	edi, ebp
	call	clk_get_by_ofw_name@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L20
	mov	edi, DWORD PTR 8[rbx]
	call	clk_enable@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L21
	mov	edi, DWORD PTR 4[rbx]
	call	clk_enable@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L22
	mov	edx, -1
	lea	rsi, .LC9[rip]
	mov	edi, ebp
	call	device_add_child@PLT
	mov	DWORD PTR [rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdx, QWORD PTR 16[rbx]
	mov	esi, DWORD PTR aw_spi_spec[rip]
	mov	edi, ebp
	call	bus_release_resources@PLT
	lea	rsi, .LC1[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
.L1:
	mov	eax, r12d
	pop	rbx
	.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
.L16:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
.L3:
	mov	edi, ebp
	call	aw_spi_detach@PLT
	mov	eax, r12d
	pop	rbx
	.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
.L20:
	.cfi_restore_state
	lea	rsi, .LC6[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L19:
	lea	rsi, .LC4[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L21:
	lea	rsi, .LC7[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	lea	rsi, .LC2[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	lea	rsi, .LC8[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	aw_spi_attach, .-aw_spi_attach
	.comm	aw_spi_spec,4,4
	.comm	aw_spi_intr,4,4
	.comm	MTX_DEF,4,4
	.comm	INTR_TYPE_MISC,4,4
	.comm	INTR_MPSAFE,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_aw_spi.c_aw_spi_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"cannot allocate resources for device\012\000"
	.align	2
.LC1:
	.ascii	"cannot setup interrupt handler\012\000"
	.align	2
.LC2:
	.ascii	"cannot de-assert reset\012\000"
	.align	2
.LC3:
	.ascii	"ahb\000"
	.align	2
.LC4:
	.ascii	"cannot get ahb clock\012\000"
	.align	2
.LC5:
	.ascii	"mod\000"
	.align	2
.LC6:
	.ascii	"cannot get mod clock\012\000"
	.align	2
.LC7:
	.ascii	"cannot enable ahb clock\012\000"
	.align	2
.LC8:
	.ascii	"cannot enable mod clock\012\000"
	.align	2
.LC9:
	.ascii	"spibus\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aw_spi_attach, %function
aw_spi_attach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	sub	sp, sp, #16
	mov	r5, r0
	bl	device_get_softc
	mov	r4, r0
	mov	r0, r5
	str	r5, [r4, #28]
	bl	device_get_nameunit
	ldr	r3, .L23
	ldr	r6, .L23+4
	mov	r1, r0
	ldr	r3, [r3]
	mov	r2, #0
	add	r0, r4, #24
	bl	mtx_init
	mov	r0, r5
	ldr	r2, [r4, #16]
	ldr	r1, [r6]
	bl	bus_alloc_resources
	subs	r3, r0, #0
	bne	.L16
	ldr	r0, .L23+8
	ldr	r2, .L23+12
	ldr	ip, .L23+16
	ldr	r0, [r0]
	ldr	r2, [r2]
	ldr	r1, [r4, #16]
	ldr	ip, [ip]
	orr	r2, r0, r2
	add	r0, r4, #20
	ldr	r1, [r1, #4]
	str	r0, [sp, #8]
	str	r4, [sp, #4]
	mov	r0, r5
	str	ip, [sp]
	bl	bus_setup_intr
	subs	r2, r0, #0
	bne	.L17
	mov	r1, r2
	mov	r0, r5
	add	r3, r4, #12
	bl	hwreset_get_by_ofw_idx
	cmp	r0, #0
	bne	.L6
	ldr	r0, [r4, #12]
	bl	hwreset_deassert
	subs	r6, r0, #0
	bne	.L18
.L6:
	mov	r1, #0
	mov	r0, r5
	ldr	r2, .L23+20
	add	r3, r4, #8
	bl	clk_get_by_ofw_name
	subs	r6, r0, #0
	bne	.L19
	mov	r1, r6
	mov	r0, r5
	ldr	r2, .L23+24
	add	r3, r4, #4
	bl	clk_get_by_ofw_name
	subs	r6, r0, #0
	bne	.L20
	ldr	r0, [r4, #8]
	bl	clk_enable
	subs	r6, r0, #0
	bne	.L21
	ldr	r0, [r4, #4]
	bl	clk_enable
	subs	r6, r0, #0
	bne	.L22
	mov	r0, r5
	mvn	r2, #0
	ldr	r1, .L23+28
	bl	device_add_child
	str	r0, [r4]
	b	.L1
.L17:
	ldr	r1, [r6]
	ldr	r2, [r4, #16]
	mov	r0, r5
	bl	bus_release_resources
	mov	r0, r5
	ldr	r1, .L23+32
	bl	device_printf
	ldr	r3, .L23+36
	ldr	r6, [r3]
.L1:
	mov	r0, r6
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L16:
	mov	r0, r5
	ldr	r1, .L23+40
	bl	device_printf
	ldr	r3, .L23+36
	ldr	r6, [r3]
.L3:
	mov	r0, r5
	bl	aw_spi_detach
	mov	r0, r6
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L20:
	mov	r0, r5
	ldr	r1, .L23+44
	bl	device_printf
	b	.L3
.L19:
	mov	r0, r5
	ldr	r1, .L23+48
	bl	device_printf
	b	.L3
.L21:
	mov	r0, r5
	ldr	r1, .L23+52
	bl	device_printf
	b	.L3
.L18:
	mov	r0, r5
	ldr	r1, .L23+56
	bl	device_printf
	b	.L3
.L22:
	mov	r0, r5
	ldr	r1, .L23+60
	bl	device_printf
	b	.L3
.L24:
	.align	2
.L23:
	.word	MTX_DEF
	.word	aw_spi_spec
	.word	INTR_TYPE_MISC
	.word	INTR_MPSAFE
	.word	aw_spi_intr
	.word	.LC3
	.word	.LC5
	.word	.LC9
	.word	.LC1
	.word	ENXIO
	.word	.LC0
	.word	.LC6
	.word	.LC4
	.word	.LC7
	.word	.LC2
	.word	.LC8
	.size	aw_spi_attach, .-aw_spi_attach
	.comm	aw_spi_spec,4,4
	.comm	aw_spi_intr,4,4
	.comm	MTX_DEF,4,4
	.comm	INTR_TYPE_MISC,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	ENXIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
