	.file	"extr_LzmaEnc.c_FillDistancesPrices.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	FillDistancesPrices, @function
FillDistancesPrices:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 88
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -104[rbp], rdi
	mov	rbx, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR kNumFullDistances[rip]
	mov	rdx, rax
	lea	rax, 15[0+rax*4]
	mov	rcx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rcx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L3
.L37:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L37
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L38
.L4:
	mov	rax, QWORD PTR -104[rbp]
	mov	QWORD PTR -88[rbp], rsp
	mov	QWORD PTR 40[rax], 0
	mov	eax, DWORD PTR kStartPosModelIndex[rip]
	mov	r12d, eax
	shr	r12d, 31
	add	r12d, eax
	mov	eax, edx
	shr	eax, 31
	sar	r12d
	add	edx, eax
	sar	edx
	cmp	r12d, edx
	jb	.L5
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR -80[rbp]
	add	r12d, 1
	mov	r13d, DWORD PTR [rax+rdx]
	mov	edi, r13d
	call	GET_PRICEa_0@PLT
	mov	edx, DWORD PTR -72[rbp]
	mov	r15, QWORD PTR -88[rbp]
	mov	edi, r13d
	add	eax, ebx
	mov	DWORD PTR [r15+rdx*4], eax
	mov	r14, rdx
	call	GET_PRICEa_1@PLT
	mov	edx, DWORD PTR -96[rbp]
	add	ebx, eax
	add	edx, r14d
	mov	DWORD PTR [r15+rdx*4], ebx
	mov	edx, DWORD PTR kNumFullDistances[rip]
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	sar	eax
	cmp	eax, r12d
	jbe	.L10
.L5:
	mov	edi, r12d
	xor	ebx, ebx
	call	GetPosSlot1@PLT
	mov	r14, rax
	mov	ecx, eax
	mov	rax, QWORD PTR -104[rbp]
	shr	ecx
	and	r14d, 1
	sub	ecx, 1
	or	r14d, 2
	mov	rax, QWORD PTR [rax]
	sal	r14d, cl
	mov	edx, r14d
	lea	rax, [rax+rdx*8]
	mov	edx, 4
	mov	QWORD PTR -80[rbp], rax
	mov	eax, 1
	sal	eax, cl
	mov	DWORD PTR -96[rbp], eax
	lea	eax, [r14+r12]
	mov	DWORD PTR -72[rbp], eax
	test	ecx, ecx
	je	.L8
	mov	r14d, r12d
	mov	r15d, 1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdx, QWORD PTR -80[rbp]
	mov	eax, r15d
	mov	r13d, r14d
	mov	DWORD PTR -68[rbp], ecx
	and	r13d, 1
	shr	r14d
	mov	edi, DWORD PTR [rdx+rax*4]
	mov	esi, r13d
	lea	r15d, 0[r13+r15*2]
	call	GET_PRICEa@PLT
	mov	ecx, DWORD PTR -68[rbp]
	add	ebx, eax
	sub	ecx, 1
	jne	.L9
	mov	edx, r15d
	sal	rdx, 2
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	mov	eax, DWORD PTR kNumLenToPosStates[rip]
	mov	DWORD PTR -72[rbp], 0
	mov	r14d, 1
	test	eax, eax
	je	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rbx, QWORD PTR -104[rbp]
	mov	esi, DWORD PTR -72[rbp]
	mov	r15d, 0
	mov	eax, DWORD PTR 8[rbx]
	mov	QWORD PTR -112[rbp], rsi
	mov	DWORD PTR -68[rbp], eax
	add	eax, 1
	sar	eax
	mov	edx, eax
	mov	DWORD PTR -116[rbp], eax
	mov	rax, QWORD PTR 16[rbx]
	mov	r13, QWORD PTR [rax+rsi*8]
	mov	rax, QWORD PTR 24[rbx]
	mov	r12, QWORD PTR [rax+rsi*8]
	lea	eax, -1[rdx]
	mov	QWORD PTR -96[rbp], rax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	mov	eax, DWORD PTR kNumPosSlotBits[rip]
	mov	ebx, r14d
	lea	ecx, -1[rax]
	sal	ebx, cl
	add	ebx, r15d
	mov	r8d, ebx
	mov	esi, ebx
	shr	r8d
	and	esi, 1
	mov	eax, r8d
	mov	DWORD PTR -80[rbp], r8d
	mov	edi, DWORD PTR [r12+rax*4]
	call	GET_PRICEa@PLT
	mov	ecx, ebx
	mov	r8d, DWORD PTR -80[rbp]
	shr	ecx, 2
	mov	DWORD PTR -68[rbp], eax
	mov	eax, ecx
	mov	esi, r8d
	mov	DWORD PTR -80[rbp], ecx
	mov	edi, DWORD PTR [r12+rax*4]
	and	esi, 1
	call	GET_PRICEa@PLT
	mov	r8d, ebx
	mov	ecx, DWORD PTR -80[rbp]
	add	eax, DWORD PTR -68[rbp]
	shr	r8d, 3
	mov	DWORD PTR -68[rbp], eax
	mov	eax, r8d
	mov	esi, ecx
	mov	DWORD PTR -80[rbp], r8d
	mov	edi, DWORD PTR [r12+rax*4]
	and	esi, 1
	call	GET_PRICEa@PLT
	mov	ecx, ebx
	mov	r8d, DWORD PTR -80[rbp]
	add	eax, DWORD PTR -68[rbp]
	shr	ecx, 4
	mov	DWORD PTR -68[rbp], eax
	shr	ebx, 5
	mov	eax, ecx
	mov	esi, r8d
	mov	DWORD PTR -80[rbp], ecx
	mov	edi, DWORD PTR [r12+rax*4]
	and	esi, 1
	call	GET_PRICEa@PLT
	mov	ecx, DWORD PTR -80[rbp]
	mov	edi, DWORD PTR [r12+rbx*4]
	add	eax, DWORD PTR -68[rbp]
	and	ecx, 1
	mov	DWORD PTR -68[rbp], eax
	mov	esi, ecx
	call	GET_PRICEa@PLT
	mov	edx, DWORD PTR -68[rbp]
	lea	ebx, [rdx+rax]
	mov	eax, DWORD PTR kNumPosSlotBits[rip]
	lea	ecx, -1[rax]
	mov	eax, r14d
	sal	eax, cl
	cdqe
	add	rax, r15
	mov	edi, DWORD PTR [r12+rax*4]
	mov	DWORD PTR -68[rbp], edi
	call	GET_PRICEa_0@PLT
	mov	edi, DWORD PTR -68[rbp]
	add	eax, ebx
	mov	DWORD PTR 0[r13+r15*8], eax
	call	GET_PRICEa_1@PLT
	add	ebx, eax
	mov	rax, r15
	mov	DWORD PTR 4[r13+r15*8], ebx
	add	r15, 1
	cmp	QWORD PTR -96[rbp], rax
	jne	.L14
	mov	eax, DWORD PTR kEndPosModelIndex[rip]
	mov	ecx, DWORD PTR kNumBitPriceShiftBits[rip]
	mov	ebx, DWORD PTR -116[rbp]
	mov	esi, eax
	shr	esi, 31
	add	esi, eax
	sar	esi
	lea	edx, -1[rsi]
	sub	edx, DWORD PTR kNumAlignBits[rip]
	sal	edx, cl
	cmp	ebx, esi
	jbe	.L15
	mov	ecx, esi
	not	esi
	add	esi, ebx
	lea	rax, 0[r13+rcx*8]
	lea	rcx, 1[rcx+rsi]
	lea	rsi, 0[r13+rcx*8]
	.p2align 4,,10
	.p2align 3
.L16:
	add	DWORD PTR [rax], edx
	mov	edi, r14d
	add	DWORD PTR 4[rax], edx
	mov	ecx, DWORD PTR kNumBitPriceShiftBits[rip]
	add	rax, 8
	sal	edi, cl
	add	edx, edi
	cmp	rax, rsi
	jne	.L16
.L15:
	mov	rax, QWORD PTR -104[rbp]
	mov	rdx, QWORD PTR -112[rbp]
	mov	ebx, 4
	mov	rax, QWORD PTR 32[rax]
	mov	r12, QWORD PTR [rax+rdx*8]
	mov	eax, DWORD PTR 0[r13]
	mov	DWORD PTR [r12], eax
	mov	eax, DWORD PTR 4[r13]
	cmp	DWORD PTR kNumFullDistances[rip], 4
	mov	DWORD PTR 4[r12], eax
	mov	eax, DWORD PTR 8[r13]
	mov	DWORD PTR 8[r12], eax
	mov	eax, DWORD PTR 12[r13]
	mov	DWORD PTR 12[r12], eax
	jbe	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edi, ebx
	call	GetPosSlot1@PLT
	mov	rdi, QWORD PTR -88[rbp]
	mov	edx, ebx
	mov	eax, DWORD PTR 0[r13+rax*4]
	mov	ecx, DWORD PTR [rdi+rdx*4]
	add	ecx, eax
	mov	DWORD PTR [r12+rdx*4], ecx
	lea	edx, 1[rbx]
	add	ebx, 2
	add	eax, DWORD PTR [rdi+rdx*4]
	mov	DWORD PTR [r12+rdx*4], eax
	cmp	DWORD PTR kNumFullDistances[rip], ebx
	ja	.L12
.L13:
	add	DWORD PTR -72[rbp], 1
	mov	eax, DWORD PTR -72[rbp]
	cmp	DWORD PTR kNumLenToPosStates[rip], eax
	ja	.L6
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L39
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L38:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L4
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	FillDistancesPrices, .-FillDistancesPrices
	.comm	kStartPosModelIndex,4,4
	.comm	kNumPosSlotBits,4,4
	.comm	kNumLenToPosStates,4,4
	.comm	kNumFullDistances,4,4
	.comm	kNumBitPriceShiftBits,4,4
	.comm	kNumAlignBits,4,4
	.comm	kEndPosModelIndex,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_LzmaEnc.c_FillDistancesPrices.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	FillDistancesPrices, %function
FillDistancesPrices:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #44
	mov	r1, #0
	ldr	r3, .L29
	ldr	r2, .L29+4
	ldr	r3, [r3]
	ldr	r8, [r2]
	lsl	r2, r3, #2
	add	r3, r3, r3, lsr #31
	asr	r3, r3, #1
	add	r8, r8, r8, lsr #31
	add	r2, r2, #7
	cmp	r3, r8, asr #1
	bic	r2, r2, #7
	ldr	r3, .L29+8
	str	r0, [fp, #-60]
	sub	sp, sp, r2
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	asrhi	r8, r8, #1
	str	r1, [r0, #20]
	str	sp, [fp, #-68]
	bhi	.L2
	b	.L7
.L5:
	ldr	r5, [r7, r3]
	add	r8, r8, #1
	mov	r0, r5
	bl	GET_PRICEa_0
	mov	r3, r0
	ldr	r4, [fp, #-52]
	mov	r0, r5
	ldr	r5, [fp, #-68]
	add	r3, r3, r6
	str	r3, [r5, r4, lsl #2]
	bl	GET_PRICEa_1
	ldr	r3, .L29
	ldr	r2, [fp, #-48]
	ldr	r3, [r3]
	add	r6, r0, r6
	add	r3, r3, r3, lsr #31
	add	r4, r2, r4
	cmp	r8, r3, asr #1
	str	r6, [r5, r4, lsl #2]
	bcs	.L7
.L2:
	mov	r0, r8
	bl	GetPosSlot1
	lsr	r5, r0, #1
	and	r4, r0, #1
	sub	r5, r5, #1
	ldr	r3, [fp, #-60]
	orr	r4, r4, #2
	lsl	r4, r4, r5
	ldr	r7, [r3]
	add	r3, r4, r8
	str	r3, [fp, #-52]
	mov	r3, #1
	cmp	r5, #0
	lsl	r3, r3, r5
	str	r3, [fp, #-48]
	moveq	r6, r5
	moveq	r3, #4
	add	r7, r7, r4, lsl #3
	beq	.L5
	mov	r9, r8
	mov	r10, #1
	mov	r6, #0
.L6:
	and	r4, r9, #1
	ldr	r0, [r7, r10, lsl #2]
	mov	r1, r4
	bl	GET_PRICEa
	subs	r5, r5, #1
	lsr	r9, r9, #1
	add	r10, r4, r10, lsl #1
	add	r6, r6, r0
	bne	.L6
	lsl	r3, r10, #2
	b	.L5
.L7:
	ldr	r3, .L29+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L1
	mov	r3, #0
	mov	r9, #1
	ldr	r10, .L29+16
	str	r3, [fp, #-64]
.L3:
	ldr	r2, [fp, #-60]
	ldr	r3, [r2, #4]
	ldr	r1, [r2, #8]
	add	r3, r3, #1
	asrs	r3, r3, #1
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-64]
	ldr	r2, [r2, #12]
	ldr	r1, [r1, r3, lsl #2]
	ldr	r5, [r2, r3, lsl #2]
	lsl	r3, r3, #2
	str	r1, [fp, #-56]
	str	r3, [fp, #-72]
	beq	.L12
	mov	r6, #0
	ldr	r3, [fp, #-56]
	add	r8, r3, #4
.L11:
	ldr	r4, [r10]
	sub	r4, r4, #1
	add	r4, r6, r9, lsl r4
	lsr	r7, r4, #1
	and	r1, r4, #1
	ldr	r0, [r5, r7, lsl #2]
	bl	GET_PRICEa
	mov	r3, r0
	lsr	r2, r4, #2
	and	r1, r7, #1
	ldr	r0, [r5, r2, lsl #2]
	mov	r7, r3
	str	r2, [fp, #-48]
	bl	GET_PRICEa
	mov	ip, r0
	ldr	r2, [fp, #-48]
	lsr	r3, r4, #3
	and	r1, r2, #1
	ldr	r0, [r5, r3, lsl #2]
	add	r7, r7, ip
	str	r3, [fp, #-48]
	bl	GET_PRICEa
	mov	ip, r0
	ldr	r3, [fp, #-48]
	lsr	r2, r4, #4
	and	r1, r3, #1
	ldr	r0, [r5, r2, lsl #2]
	add	r7, r7, ip
	str	r2, [fp, #-48]
	bl	GET_PRICEa
	mov	r3, r0
	ldr	r2, [fp, #-48]
	lsr	r4, r4, #5
	and	r1, r2, #1
	ldr	r0, [r5, r4, lsl #2]
	add	r7, r7, r3
	bl	GET_PRICEa
	ldr	r3, [r10]
	add	r7, r7, r0
	sub	r3, r3, #1
	add	r3, r6, r9, lsl r3
	ldr	r4, [r5, r3, lsl #2]
	add	r6, r6, #1
	mov	r0, r4
	bl	GET_PRICEa_0
	add	r0, r0, r7
	str	r0, [r8, #-4]
	mov	r0, r4
	bl	GET_PRICEa_1
	ldr	r3, [fp, #-52]
	add	r7, r0, r7
	cmp	r3, r6
	str	r7, [r8], #8
	bne	.L11
	ldr	r3, .L29+20
	ldr	r2, .L29+24
	ldr	r3, [r3]
	ldr	r1, .L29+28
	add	r3, r3, r3, lsr #31
	ldr	r0, [r2]
	asr	r3, r3, #1
	ldr	ip, [fp, #-52]
	ldr	r1, [r1]
	sub	r2, r3, #1
	sub	r2, r2, r0
	cmp	r3, ip
	lsl	r2, r2, r1
	bcs	.L12
	ldr	r0, [fp, #-56]
	add	r1, r0, r3, lsl #3
	add	ip, r0, ip, lsl #3
	add	r1, r1, #4
	add	r3, r0, r3, lsl #3
.L13:
	ldr	r0, [r1, #-4]
	add	r3, r3, #8
	add	r0, r0, r2
	str	r0, [r1, #-4]
	ldr	r0, [r3, #-4]
	add	r1, r1, #8
	add	r0, r0, r2
	str	r0, [r3, #-4]
	ldr	r0, .L29+28
	cmp	ip, r3
	ldr	r0, [r0]
	add	r2, r2, r9, lsl r0
	bne	.L13
.L12:
	ldr	r3, [fp, #-60]
	ldr	r1, [fp, #-56]
	ldr	r2, [r3, #16]
	ldr	r0, [fp, #-72]
	ldr	r3, [r1]
	ldr	r4, [r2, r0]
	ldr	r2, .L29
	str	r3, [r4]
	ldr	r3, [r1, #4]
	ldr	r2, [r2]
	str	r3, [r4, #4]
	ldr	r3, [r1, #8]
	cmp	r2, #4
	str	r3, [r4, #8]
	ldr	r3, [r1, #12]
	str	r3, [r4, #12]
	bls	.L10
	mov	r5, #4
	ldr	r6, [fp, #-68]
	ldr	r7, [fp, #-56]
.L14:
	mov	r0, r5
	bl	GetPosSlot1
	ldr	r3, [r6, #20]
	ldr	r1, [r7, r0, lsl #2]
	ldr	r2, [r6, #16]
	add	r3, r3, r1
	str	r3, [r4, #20]
	add	r2, r2, r1
	ldr	r3, .L29
	str	r2, [r4, #16]
	ldr	r3, [r3]
	add	r5, r5, #2
	cmp	r3, r5
	add	r6, r6, #8
	add	r4, r4, #8
	bhi	.L14
.L10:
	ldr	r3, .L29+12
	ldr	r2, [fp, #-64]
	ldr	r3, [r3]
	add	r2, r2, #1
	cmp	r3, r2
	str	r2, [fp, #-64]
	bhi	.L3
.L1:
	ldr	r3, .L29+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L28:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	kNumFullDistances
	.word	kStartPosModelIndex
	.word	.LC0
	.word	kNumLenToPosStates
	.word	kNumPosSlotBits
	.word	kEndPosModelIndex
	.word	kNumAlignBits
	.word	kNumBitPriceShiftBits
	.size	FillDistancesPrices, .-FillDistancesPrices
	.comm	kStartPosModelIndex,4,4
	.comm	kNumPosSlotBits,4,4
	.comm	kNumLenToPosStates,4,4
	.comm	kNumFullDistances,4,4
	.comm	kNumBitPriceShiftBits,4,4
	.comm	kNumAlignBits,4,4
	.comm	kEndPosModelIndex,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
