	.file	"extr_peak_pciefd_main.c_pciefd_alloc_tx_msg.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pciefd_alloc_tx_msg, @function
pciefd_alloc_tx_msg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	r15, 8[rdi]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, esi
	xor	esi, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	movsx	rax, DWORD PTR [rdi]
	lea	rdx, [rax+rax*2]
	mov	rax, QWORD PTR 16[rdi]
	mov	rdi, r15
	lea	rbp, [rax+rdx*8]
	call	spin_lock_irqsave@PLT
	movsx	r12, DWORD PTR 0[rbp]
	mov	eax, DWORD PTR 4[rbp]
	lea	edx, [r12+r14]
	cmp	edx, eax
	jle	.L2
	mov	eax, DWORD PTR 4[rbx]
	test	eax, eax
	je	.L7
	sub	eax, 1
	sal	r12, 5
	add	r12, QWORD PTR 16[rbp]
	mov	edi, 32
	mov	DWORD PTR 4[rbx], eax
	mov	eax, DWORD PTR [rbx]
	add	eax, 1
	cdq
	idiv	DWORD PTR PCIEFD_TX_PAGE_COUNT[rip]
	mov	rax, QWORD PTR 16[rbx]
	mov	DWORD PTR [rbx], edx
	movsx	rdx, edx
	lea	rdx, [rdx+rdx*2]
	lea	rbp, [rax+rdx*8]
	call	cpu_to_le16@PLT
	mov	edi, DWORD PTR CANFD_MSG_LNK_TX[rip]
	mov	QWORD PTR 24[r12], rax
	call	cpu_to_le16@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	QWORD PTR 16[r12], rax
	call	cpu_to_le32@PLT
	mov	QWORD PTR [r12], 0
	mov	QWORD PTR 8[r12], rax
	mov	eax, DWORD PTR 4[rbp]
	mov	DWORD PTR 0[rbp], 0
.L2:
	imul	eax, DWORD PTR 4[rbx]
	xor	esi, esi
	mov	rdi, r15
	mov	DWORD PTR 0[r13], eax
	call	spin_unlock_irqrestore@PLT
	movsx	rax, DWORD PTR 0[rbp]
	mov	edx, DWORD PTR 4[rbp]
	mov	rsi, rax
	sal	rax, 5
	add	rax, QWORD PTR 16[rbp]
	add	esi, r14d
	sub	edx, esi
	add	DWORD PTR 0[r13], edx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L7:
	.cfi_restore_state
	mov	rdi, r15
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	add	rsp, 8
	.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
	.cfi_endproc
.LFE0:
	.size	pciefd_alloc_tx_msg, .-pciefd_alloc_tx_msg
	.comm	PCIEFD_TX_PAGE_COUNT,4,4
	.comm	CANFD_MSG_LNK_TX,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_peak_pciefd_main.c_pciefd_alloc_tx_msg.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pciefd_alloc_tx_msg, %function
pciefd_alloc_tx_msg:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r1
	ldr	r9, [r0]
	ldr	r5, [r0, #12]
	add	r10, r0, #8
	mov	r4, r0
	mov	r1, #0
	mov	r0, r10
	sub	sp, sp, #12
	mov	r8, r2
	add	r6, r5, r9, lsl #4
	bl	spin_lock_irqsave
	ldr	r9, [r5, r9, lsl #4]
	ldr	r2, [r6, #4]
	add	r3, r9, r7
	cmp	r3, r2
	ble	.L2
	ldr	r5, [r4, #4]
	cmp	r5, #0
	beq	.L7
	ldr	r0, [r4]
	ldr	r3, .L8
	sub	r5, r5, #1
	ldr	r1, [r3]
	str	r5, [r4, #4]
	add	r0, r0, #1
	bl	__aeabi_idivmod
	ldr	r3, [r4, #12]
	ldr	r6, [r6, #12]
	mov	r0, #16
	str	r1, [r4]
	mov	r5, r1
	str	r3, [sp]
	bl	cpu_to_le16
	ldr	r2, .L8+4
	add	fp, r6, r9, lsl #4
	str	r0, [fp, #12]
	ldr	r0, [r2]
	str	r6, [sp, #4]
	bl	cpu_to_le16
	ldr	r2, [sp]
	str	r0, [fp, #8]
	add	r6, r2, r5, lsl #4
	ldr	r0, [r6, #8]
	bl	cpu_to_le32
	mov	ip, #0
	ldr	r3, [sp, #4]
	ldr	r2, [r6, #4]
	str	r0, [fp, #4]
	str	ip, [r3, r9, lsl #4]
	ldr	r3, [sp]
	str	ip, [r3, r5, lsl #4]
.L2:
	ldr	r3, [r4, #4]
	mov	r0, r10
	mul	r3, r2, r3
	mov	r1, #0
	str	r3, [r8]
	bl	spin_unlock_irqrestore
	ldr	r5, [r6]
	ldr	r1, [r6, #4]
	ldr	r3, [r8]
	ldr	r0, [r6, #12]
	add	r7, r5, r7
	sub	r7, r1, r7
	add	r7, r3, r7
	add	r0, r0, r5, lsl #4
	str	r7, [r8]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	mov	r0, r10
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	.align	2
.L8:
	.word	PCIEFD_TX_PAGE_COUNT
	.word	CANFD_MSG_LNK_TX
	.size	pciefd_alloc_tx_msg, .-pciefd_alloc_tx_msg
	.comm	PCIEFD_TX_PAGE_COUNT,4,4
	.comm	CANFD_MSG_LNK_TX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
