	.file	"extr_rtwn_pci_tx.c_rtwn_pci_tx_start_beacon.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"can't map beacon (error %d)\n"
	.text
	.p2align 4
	.type	rtwn_pci_tx_start_beacon, @function
rtwn_pci_tx_start_beacon:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movsx	r15, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r15
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 8[rsp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	RTWN_PCI_SOFTC@PLT
	mov	rdi, rbp
	mov	r12, rax
	call	RTWN_ASSERT_LOCKED@PLT
	xor	edi, edi
	cmp	r15d, 1
	mov	rsi, r15
	setbe	dil
	call	KASSERT@PLT
	mov	r10, QWORD PTR RTWN_PCI_BEACON_QUEUE[rip]
	imul	ebx, DWORD PTR 0[rbp]
	mov	edx, DWORD PTR BUS_DMASYNC_POSTREAD[rip]
	sal	r10, 5
	add	r10, QWORD PTR [r12]
	mov	rax, QWORD PTR 24[r10]
	mov	esi, DWORD PTR 4[r10]
	movsx	rbx, ebx
	mov	r13, r10
	mov	edi, DWORD PTR 8[r10]
	lea	r15, [rax+r15*4]
	mov	rax, QWORD PTR 16[r10]
	lea	rbx, [rax+rbx*4]
	call	bus_dmamap_sync@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR RTWN_FLAGS0_OWN[rip], eax
	jne	.L12
	mov	rdx, r14
	mov	rsi, rbx
	mov	rdi, r12
	call	rtwn_pci_copy_tx_desc@PLT
	mov	eax, DWORD PTR 0[rbp]
	mov	DWORD PTR 16[rbx], eax
.L7:
	lea	r14, 20[rsp]
	mov	rdx, QWORD PTR 8[rsp]
	mov	esi, DWORD PTR [r15]
	lea	r8, 16[rsp]
	mov	r9d, DWORD PTR BUS_DMA_NOWAIT[rip]
	mov	edi, DWORD PTR 0[r13]
	mov	rcx, r14
	call	bus_dmamap_load_mbuf_sg@PLT
	test	eax, eax
	jne	.L13
	mov	rax, QWORD PTR 8[rsp]
	mov	edi, DWORD PTR [rax]
	call	htole16@PLT
	mov	rdx, r14
	mov	rsi, rbx
	mov	rdi, r12
	mov	QWORD PTR 8[rbx], rax
	call	rtwn_pci_tx_postsetup@PLT
	mov	eax, DWORD PTR RTWN_FLAGS0_OWN[rip]
	or	DWORD PTR [rbx], eax
.L6:
	mov	esi, DWORD PTR 4[r13]
	mov	edi, DWORD PTR 8[r13]
	mov	edx, DWORD PTR BUS_DMASYNC_PREWRITE[rip]
	call	bus_dmamap_sync@PLT
.L4:
	mov	rsi, rbx
	mov	rdi, rbp
	call	rtwn_dump_tx_desc@PLT
	mov	edx, DWORD PTR BUS_DMASYNC_PREWRITE[rip]
	mov	esi, DWORD PTR [r15]
	mov	edi, DWORD PTR 0[r13]
	call	bus_dmamap_sync@PLT
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rsp]
	mov	r14, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rax]
	call	htole16@PLT
	cmp	r14, rax
	je	.L4
	mov	esi, DWORD PTR [r15]
	mov	edi, DWORD PTR 0[r13]
	call	bus_dmamap_unload@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edi, DWORD PTR 4[rbp]
	mov	edx, eax
	lea	rsi, .LC0[rip]
	call	device_printf@PLT
	mov	eax, DWORD PTR RTWN_FLAGS0_OWN[rip]
	not	eax
	and	DWORD PTR [rbx], eax
	jmp	.L6
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rtwn_pci_tx_start_beacon, .-rtwn_pci_tx_start_beacon
	.comm	RTWN_PCI_BEACON_QUEUE,8,8
	.comm	RTWN_FLAGS0_OWN,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	BUS_DMASYNC_PREWRITE,4,4
	.comm	BUS_DMASYNC_POSTREAD,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_tx.c_rtwn_pci_tx_start_beacon.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"can't map beacon (error %d)\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtwn_pci_tx_start_beacon, %function
rtwn_pci_tx_start_beacon:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	sub	sp, sp, #44
	ldr	r3, .L15
	str	r2, [sp, #20]
	str	r1, [sp, #12]
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	mov	r7, r0
	bl	RTWN_PCI_SOFTC
	mov	r5, r0
	str	r0, [sp, #16]
	mov	r0, r7
	bl	RTWN_ASSERT_LOCKED
	cmp	r4, #1
	movhi	r0, #0
	movls	r0, #1
	mov	r1, r4
	bl	KASSERT
	ldr	r3, .L15+4
	ldr	r6, [r7]
	ldr	r3, [r3]
	ldr	fp, [r5]
	add	r3, r3, r3, lsl #2
	ldr	r2, .L15+8
	add	r5, fp, r3, lsl #2
	mul	r6, r4, r6
	lsl	r3, r3, #2
	ldr	r2, [r2]
	ldr	r1, [r5, #4]
	ldr	r0, [r5, #8]
	ldr	r9, [r5, #12]
	str	r3, [sp, #8]
	ldr	r8, [r5, #16]
	bl	bus_dmamap_sync
	ldr	r3, .L15+12
	ldr	r2, [r9, r6, lsl #2]
	ldr	r3, [r3]
	add	r10, r9, r6, lsl #2
	tst	r2, r3
	bne	.L12
	mov	r1, r10
	ldr	r2, [sp, #20]
	ldr	r0, [sp, #16]
	bl	rtwn_pci_copy_tx_desc
	ldr	r3, [r7]
	str	r3, [r10, #8]
.L7:
	ldr	r3, .L15+16
	ldr	r2, [sp, #8]
	ldr	r3, [r3]
	ldr	r0, [fp, r2]
	add	r2, sp, #28
	ldr	r1, [r8, r4, lsl #2]
	str	r3, [sp, #4]
	str	r2, [sp]
	add	r3, sp, #32
	ldr	r2, [sp, #12]
	bl	bus_dmamap_load_mbuf_sg
	subs	r2, r0, #0
	bne	.L13
	ldr	r3, [sp, #12]
	ldr	r0, [r3]
	bl	htole16
	add	r2, sp, #32
	str	r0, [r10, #4]
	mov	r1, r10
	ldr	r0, [sp, #16]
	bl	rtwn_pci_tx_postsetup
	ldr	r3, .L15+12
	ldr	r2, [r3]
	ldr	r3, [r9, r6, lsl #2]
	orr	r3, r3, r2
	str	r3, [r9, r6, lsl #2]
.L6:
	ldr	r6, .L15+20
	ldr	r1, [r5, #4]
	ldr	r2, [r6]
	ldr	r0, [r5, #8]
	bl	bus_dmamap_sync
.L4:
	mov	r1, r10
	mov	r0, r7
	bl	rtwn_dump_tx_desc
	ldr	r3, [sp, #8]
	ldr	r2, [r6]
	ldr	r0, [fp, r3]
	ldr	r1, [r8, r4, lsl #2]
	bl	bus_dmamap_sync
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, #0
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	ldr	r3, [sp, #12]
	ldr	r0, [r3]
	ldr	r3, [r10, #4]
	str	r3, [sp, #20]
	bl	htole16
	ldr	r3, [sp, #20]
	cmp	r3, r0
	ldreq	r6, .L15+20
	beq	.L4
	ldr	r3, [sp, #8]
	ldr	r1, [r8, r4, lsl #2]
	ldr	r0, [fp, r3]
	bl	bus_dmamap_unload
	b	.L7
.L13:
	ldr	r1, .L15+24
	ldr	r0, [r7, #4]
	bl	device_printf
	ldr	r3, .L15+12
	ldr	r2, [r3]
	ldr	r3, [r9, r6, lsl #2]
	bic	r3, r3, r2
	str	r3, [r9, r6, lsl #2]
	b	.L6
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC1
	.word	RTWN_PCI_BEACON_QUEUE
	.word	BUS_DMASYNC_POSTREAD
	.word	RTWN_FLAGS0_OWN
	.word	BUS_DMA_NOWAIT
	.word	BUS_DMASYNC_PREWRITE
	.word	.LC0
	.size	rtwn_pci_tx_start_beacon, .-rtwn_pci_tx_start_beacon
	.comm	RTWN_PCI_BEACON_QUEUE,4,4
	.comm	RTWN_FLAGS0_OWN,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	BUS_DMASYNC_PREWRITE,4,4
	.comm	BUS_DMASYNC_POSTREAD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
