	.file	"extr_mockbuffer.c_CopyPacketToBufferChain.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	CopyPacketToBufferChain
	.type	CopyPacketToBufferChain, @function
CopyPacketToBufferChain:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rcx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	mov	rsi, r8
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	sub	rsp, 104
	.cfi_def_cfa_offset 160
	mov	DWORD PTR 28[rsp], edi
	mov	edi, DWORD PTR DEBUG_PBUFFER[rip]
	lea	r13, 48[rsp]
	lea	rbp, 64[rsp]
	mov	DWORD PTR 8[rsp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 88[rsp], rax
	xor	eax, eax
	call	TI_DbgPrint@PLT
	mov	edi, DWORD PTR 28[rsp]
	mov	rdx, rbp
	mov	esi, r13d
	call	XNdisQueryBuffer@PLT
	mov	edi, DWORD PTR 28[rsp]
	mov	rcx, rbp
	mov	rdx, r13
	mov	rsi, r12
	call	SkipToOffset@PLT
	mov	r9d, DWORD PTR 8[rsp]
	cmp	eax, -1
	je	.L4
	lea	rax, 56[rsp]
	lea	r12, 72[rsp]
	mov	r14d, r13d
	mov	edi, r9d
	lea	r13, 44[rsp]
	mov	rcx, r12
	mov	rdx, rax
	mov	QWORD PTR 8[rsp], rax
	mov	rsi, r13
	lea	r8, 80[rsp]
	call	XNdisGetFirstBufferFromPacket@PLT
	mov	rdx, QWORD PTR 8[rsp]
	mov	rcx, r12
	mov	rsi, r15
	mov	edi, DWORD PTR 44[rsp]
	call	SkipToOffset@PLT
	cmp	eax, -1
	je	.L4
	lea	rdx, 28[rsp]
	mov	rax, QWORD PTR 72[rsp]
	mov	QWORD PTR 80[rsp], 0
	mov	QWORD PTR 16[rsp], rdx
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	QWORD PTR 64[rsp], rbx
	mov	rcx, rbx
	cmovle	rcx, QWORD PTR 64[rsp]
	mov	esi, DWORD PTR 56[rsp]
	mov	edi, DWORD PTR 48[rsp]
	cmp	rcx, rax
	cmovle	rax, rcx
	mov	rdx, rax
	mov	r15, rax
	call	RtlCopyMemory@PLT
	mov	rax, QWORD PTR 80[rsp]
	add	rax, r15
	mov	QWORD PTR 80[rsp], rax
	sub	rbx, r15
	je	.L1
	sub	QWORD PTR 64[rsp], r15
	je	.L21
.L7:
	mov	rax, QWORD PTR 72[rsp]
	sub	rax, r15
	mov	QWORD PTR 72[rsp], rax
	jne	.L5
	mov	edi, DWORD PTR 44[rsp]
	mov	rsi, r13
	call	NdisGetNextBuffer@PLT
	mov	edi, DWORD PTR 44[rsp]
	test	edi, edi
	je	.L19
	mov	esi, DWORD PTR 8[rsp]
	mov	rdx, r12
	call	XNdisQueryBuffer@PLT
	mov	rax, QWORD PTR 72[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edi, DWORD PTR 28[rsp]
	mov	rsi, QWORD PTR 16[rsp]
	call	NdisGetNextBuffer@PLT
	mov	edi, DWORD PTR 28[rsp]
	test	edi, edi
	je	.L19
	mov	rdx, rbp
	mov	esi, r14d
	call	XNdisQueryBuffer@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rax, QWORD PTR 80[rsp]
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rdx, QWORD PTR 88[rsp]
	xor	rdx, QWORD PTR fs:40
	jne	.L22
	add	rsp, 104
	.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
.L4:
	.cfi_restore_state
	xor	eax, eax
	jmp	.L1
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	CopyPacketToBufferChain, .-CopyPacketToBufferChain
	.comm	DEBUG_PBUFFER,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_mockbuffer.c_CopyPacketToBufferChain.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	CopyPacketToBufferChain
	.syntax unified
	.arm
	.fpu softvfp
	.type	CopyPacketToBufferChain, %function
CopyPacketToBufferChain:
	@ args = 4, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r1
	sub	sp, sp, #52
	ldr	ip, .L23
	ldr	r5, [sp, #72]
	mov	r6, r3
	ldr	r3, .L23+4
	str	r0, [sp, #12]
	mov	r1, r5
	ldr	r0, [ip]
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	mov	r7, r2
	bl	TI_DbgPrint
	add	r1, sp, #24
	add	r2, sp, #32
	ldr	r0, [sp, #12]
	bl	XNdisQueryBuffer
	mov	r1, r4
	ldr	r0, [sp, #12]
	add	r3, sp, #32
	add	r2, sp, #24
	bl	SkipToOffset
	cmn	r0, #1
	beq	.L4
	add	ip, sp, #40
	add	r3, sp, #36
	add	r2, sp, #28
	add	r1, sp, #20
	str	ip, [sp]
	mov	r0, r7
	bl	XNdisGetFirstBufferFromPacket
	mov	r1, r6
	ldr	r0, [sp, #20]
	add	r3, sp, #36
	add	r2, sp, #28
	bl	SkipToOffset
	cmn	r0, #1
	beq	.L4
	mov	r3, #0
	ldr	r4, [sp, #36]
	str	r3, [sp, #40]
.L5:
	ldr	r3, [sp, #32]
	ldr	r1, [sp, #28]
	cmp	r5, r3
	movlt	r3, r5
	cmp	r3, r4
	movlt	r4, r3
	ldr	r0, [sp, #24]
	mov	r2, r4
	bl	RtlCopyMemory
	ldr	r0, [sp, #40]
	subs	r5, r5, r4
	add	r0, r4, r0
	str	r0, [sp, #40]
	beq	.L1
	ldr	r3, [sp, #32]
	sub	r3, r3, r4
	cmp	r3, #0
	str	r3, [sp, #32]
	beq	.L21
.L7:
	ldr	r3, [sp, #36]
	sub	r4, r3, r4
	cmp	r4, #0
	str	r4, [sp, #36]
	bne	.L5
	ldr	r0, [sp, #20]
	add	r1, sp, #20
	bl	NdisGetNextBuffer
	ldr	r0, [sp, #20]
	cmp	r0, #0
	beq	.L19
	add	r2, sp, #36
	add	r1, sp, #28
	bl	XNdisQueryBuffer
	ldr	r4, [sp, #36]
	b	.L5
.L21:
	ldr	r0, [sp, #12]
	add	r1, sp, #12
	bl	NdisGetNextBuffer
	ldr	r0, [sp, #12]
	cmp	r0, #0
	beq	.L19
	add	r2, sp, #32
	add	r1, sp, #24
	bl	XNdisQueryBuffer
	b	.L7
.L19:
	ldr	r0, [sp, #40]
.L1:
	ldr	r3, .L23+4
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L22
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L4:
	mov	r0, #0
	b	.L1
.L22:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	DEBUG_PBUFFER
	.word	.LC0
	.size	CopyPacketToBufferChain, .-CopyPacketToBufferChain
	.comm	DEBUG_PBUFFER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
