	.file	"extr_rtwn_pci_attach.c_rtwn_pci_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"PCIe capability structure not found!\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"can't map mem space\n"
.LC2:
	.string	"can't map interrupt\n"
	.section	.rodata.str1.8
	.align 8
.LC3:
	.string	"could not allocate Rx buffers, error %d\n"
	.align 8
.LC4:
	.string	"could not allocate Tx buffers, error %d\n"
	.align 8
.LC5:
	.string	"can't establish interrupt, error %d\n"
	.text
	.p2align 4
	.type	rtwn_pci_attach, @function
rtwn_pci_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	device_get_softc@PLT
	mov	edi, ebp
	mov	rbx, rax
	call	rtwn_pci_probe_sub@PLT
	test	rax, rax
	je	.L22
	mov	esi, DWORD PTR PCIY_EXPRESS[rip]
	mov	rdx, rsp
	mov	edi, ebp
	mov	r14, rax
	call	pci_find_cap@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L24
	mov	edi, ebp
	lea	r13, 4[rsp]
	call	pci_enable_busmaster@PLT
	mov	edi, 2
	call	PCIR_BAR@PLT
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	mov	edi, ebp
	mov	rdx, r13
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	DWORD PTR 4[rsp], eax
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 16[rbx], rax
	mov	rdi, rax
	test	rax, rax
	je	.L25
	call	rman_get_bustag@PLT
	mov	rdi, QWORD PTR 16[rbx]
	mov	DWORD PTR 28[rbx], eax
	call	rman_get_bushandle@PLT
	mov	rsi, r13
	mov	edi, ebp
	mov	DWORD PTR 4[rsp], 1
	mov	DWORD PTR 24[rbx], eax
	call	pci_alloc_msi@PLT
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	xor	edx, edx
	mov	edi, ebp
	test	rax, rax
	cmovne	r12d, DWORD PTR RF_SHAREABLE[rip]
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	sete	dl
	mov	DWORD PTR 4[rsp], edx
	or	ecx, r12d
	mov	rdx, r13
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 8[rbx], rax
	test	rax, rax
	je	.L26
	movsx	rsi, DWORD PTR [rsp]
	mov	edx, 4
	mov	edi, ebp
	lea	r13, 32[rbx]
	add	rsi, QWORD PTR PCIER_LINK_CTL[rip]
	call	pci_read_config@PLT
	mov	ecx, 4
	movsx	rsi, DWORD PTR [rsp]
	mov	edi, ebp
	mov	edx, DWORD PTR PCIEM_LINK_CTL_ASPMC[rip]
	add	rsi, QWORD PTR PCIER_LINK_CTL[rip]
	not	edx
	and	edx, eax
	call	pci_write_config@PLT
	mov	DWORD PTR 36[rbx], ebp
	mov	edi, ebp
	call	device_get_nameunit@PLT
	mov	rdi, r13
	mov	DWORD PTR 40[rbx], eax
	call	rtwn_sysctlattach@PLT
	mov	ecx, DWORD PTR MTX_DEF[rip]
	mov	esi, DWORD PTR 40[rbx]
	mov	rdi, r13
	mov	edx, DWORD PTR MTX_NETWORK_LOCK[rip]
	call	mtx_init@PLT
	mov	rdi, r13
	call	rtwn_pci_attach_methods@PLT
	mov	esi, DWORD PTR [r14]
	mov	rdi, rbx
	call	rtwn_pci_attach_private@PLT
	mov	rdi, r13
	call	rtwn_pci_alloc_rx_list@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L9
	mov	ecx, DWORD PTR RTWN_PCI_NTXQUEUES[rip]
	test	ecx, ecx
	jg	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	add	r12d, 1
	cmp	DWORD PTR RTWN_PCI_NTXQUEUES[rip], r12d
	jle	.L11
.L10:
	mov	esi, r12d
	mov	rdi, r13
	call	rtwn_pci_alloc_tx_list@PLT
	test	eax, eax
	je	.L12
	mov	edx, eax
	lea	rsi, .LC4[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
.L8:
	mov	edi, ebp
	call	rtwn_pci_detach@PLT
.L22:
	mov	r12d, DWORD PTR ENXIO[rip]
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, r13
	call	rtwn_attach@PLT
	test	eax, eax
	jne	.L8
	sub	rsp, 8
	.cfi_def_cfa_offset 72
	mov	rsi, QWORD PTR 8[rbx]
	mov	edx, DWORD PTR INTR_TYPE_NET[rip]
	xor	ecx, ecx
	push	rbx
	.cfi_def_cfa_offset 80
	mov	r8d, DWORD PTR rtwn_pci_intr[rip]
	mov	r9, r13
	mov	edi, ebp
	or	edx, DWORD PTR INTR_MPSAFE[rip]
	call	bus_setup_intr@PLT
	mov	r12d, eax
	pop	rax
	.cfi_def_cfa_offset 72
	pop	rdx
	.cfi_def_cfa_offset 64
	test	r12d, r12d
	je	.L1
	mov	edx, r12d
	lea	rsi, .LC5[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L25:
	lea	rsi, .LC1[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L26:
	lea	rsi, .LC2[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edx, eax
	lea	rsi, .LC3[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L8
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rtwn_pci_attach, .-rtwn_pci_attach
	.comm	rtwn_pci_intr,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RTWN_PCI_NTXQUEUES,4,4
	.comm	RF_SHAREABLE,4,4
	.comm	RF_ACTIVE,4,4
	.comm	PCIY_EXPRESS,4,4
	.comm	PCIER_LINK_CTL,8,8
	.comm	PCIEM_LINK_CTL_ASPMC,4,4
	.comm	MTX_NETWORK_LOCK,4,4
	.comm	MTX_DEF,4,4
	.comm	INTR_TYPE_NET,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,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_rtwn_pci_attach.c_rtwn_pci_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"PCIe capability structure not found!\012\000"
	.align	2
.LC1:
	.ascii	"can't map mem space\012\000"
	.align	2
.LC2:
	.ascii	"can't map interrupt\012\000"
	.align	2
.LC3:
	.ascii	"could not allocate Rx buffers, error %d\012\000"
	.align	2
.LC4:
	.ascii	"could not allocate Tx buffers, error %d\012\000"
	.align	2
.LC5:
	.ascii	"can't establish interrupt, error %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtwn_pci_attach, %function
rtwn_pci_attach:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L29
	sub	sp, sp, #32
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	device_get_softc
	mov	r6, r0
	mov	r0, r5
	bl	rtwn_pci_probe_sub
	subs	r8, r0, #0
	beq	.L23
	ldr	r3, .L29+4
	mov	r0, r5
	ldr	r1, [r3]
	add	r2, sp, #20
	bl	pci_find_cap
	subs	r4, r0, #0
	mov	r0, r5
	bne	.L25
	bl	pci_enable_busmaster
	mov	r0, #2
	bl	PCIR_BAR
	mov	ip, r0
	ldr	r2, .L29+8
	ldr	r4, .L29+12
	ldr	r1, [r2]
	mov	r0, r5
	ldr	r3, [r4]
	add	r2, sp, #24
	str	ip, [sp, #24]
	bl	bus_alloc_resource_any
	cmp	r0, #0
	str	r0, [r6, #8]
	beq	.L26
	bl	rman_get_bustag
	mov	r3, r0
	ldr	r0, [r6, #8]
	str	r3, [r6, #16]
	bl	rman_get_bushandle
	mov	r3, #1
	str	r0, [r6, #12]
	add	r1, sp, #24
	mov	r0, r5
	str	r3, [sp, #24]
	bl	pci_alloc_msi
	cmp	r0, #0
	moveq	r2, #1
	movne	r2, #0
	ldr	r3, .L29+16
	str	r2, [sp, #24]
	ldr	r1, [r3]
	ldrne	r3, .L29+20
	add	r2, sp, #24
	ldrne	r0, [r3]
	ldr	r3, [r4]
	orr	r3, r0, r3
	mov	r0, r5
	bl	bus_alloc_resource_any
	cmp	r0, #0
	str	r0, [r6, #4]
	beq	.L27
	ldr	r4, .L29+24
	ldr	r1, [sp, #20]
	ldr	r3, [r4]
	mov	r2, #4
	add	r1, r1, r3
	mov	r0, r5
	bl	pci_read_config
	ldr	r2, .L29+28
	ldr	r3, [r4]
	ldr	r1, [sp, #20]
	ldr	r2, [r2]
	add	r1, r1, r3
	bic	r2, r0, r2
	mov	r3, #4
	mov	r0, r5
	bl	pci_write_config
	mov	r0, r5
	str	r5, [r6, #24]
	bl	device_get_nameunit
	add	r7, r6, #20
	str	r0, [r6, #28]
	mov	r0, r7
	bl	rtwn_sysctlattach
	ldr	r3, .L29+32
	ldr	r2, .L29+36
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r6, #28]
	mov	r0, r7
	bl	mtx_init
	mov	r0, r7
	bl	rtwn_pci_attach_methods
	ldr	r1, [r8]
	mov	r0, r6
	bl	rtwn_pci_attach_private
	mov	r0, r7
	bl	rtwn_pci_alloc_rx_list
	subs	r4, r0, #0
	bne	.L9
	ldr	r8, .L29+40
	ldr	r3, [r8]
	cmp	r3, #0
	bgt	.L10
	b	.L11
.L12:
	ldr	r3, [r8]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L11
.L10:
	mov	r1, r4
	mov	r0, r7
	bl	rtwn_pci_alloc_tx_list
	cmp	r0, #0
	beq	.L12
	mov	r2, r0
	ldr	r1, .L29+44
	mov	r0, r5
	bl	device_printf
.L8:
	mov	r0, r5
	bl	rtwn_pci_detach
.L23:
	ldr	r3, .L29+48
	ldr	r4, [r3]
.L1:
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	mov	r0, r4
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L25:
	ldr	r1, .L29+52
	bl	device_printf
	b	.L1
.L11:
	mov	r0, r7
	bl	rtwn_attach
	subs	r3, r0, #0
	bne	.L8
	ldr	r0, .L29+56
	ldr	r1, .L29+60
	ldr	r2, .L29+64
	ldr	ip, [r0]
	ldr	r2, [r2]
	ldr	r0, [r1]
	orr	r2, ip, r2
	ldr	r1, [r6, #4]
	str	r0, [sp]
	str	r6, [sp, #8]
	mov	r0, r5
	str	r7, [sp, #4]
	bl	bus_setup_intr
	subs	r4, r0, #0
	beq	.L1
	mov	r2, r4
	mov	r0, r5
	ldr	r1, .L29+68
	bl	device_printf
	b	.L8
.L26:
	mov	r0, r5
	ldr	r1, .L29+72
	bl	device_printf
	ldr	r3, .L29+76
	ldr	r4, [r3]
	b	.L1
.L27:
	mov	r0, r5
	ldr	r1, .L29+80
	bl	device_printf
	b	.L8
.L9:
	mov	r2, r4
	mov	r0, r5
	ldr	r1, .L29+84
	bl	device_printf
	b	.L8
.L28:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	.LC6
	.word	PCIY_EXPRESS
	.word	SYS_RES_MEMORY
	.word	RF_ACTIVE
	.word	SYS_RES_IRQ
	.word	RF_SHAREABLE
	.word	PCIER_LINK_CTL
	.word	PCIEM_LINK_CTL_ASPMC
	.word	MTX_DEF
	.word	MTX_NETWORK_LOCK
	.word	RTWN_PCI_NTXQUEUES
	.word	.LC4
	.word	ENXIO
	.word	.LC0
	.word	INTR_TYPE_NET
	.word	rtwn_pci_intr
	.word	INTR_MPSAFE
	.word	.LC5
	.word	.LC1
	.word	ENOMEM
	.word	.LC2
	.word	.LC3
	.size	rtwn_pci_attach, .-rtwn_pci_attach
	.comm	rtwn_pci_intr,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RTWN_PCI_NTXQUEUES,4,4
	.comm	RF_SHAREABLE,4,4
	.comm	RF_ACTIVE,4,4
	.comm	PCIY_EXPRESS,4,4
	.comm	PCIER_LINK_CTL,4,4
	.comm	PCIEM_LINK_CTL_ASPMC,4,4
	.comm	MTX_NETWORK_LOCK,4,4
	.comm	MTX_DEF,4,4
	.comm	INTR_TYPE_NET,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
