	.file	"extr_huf_compress.c_HUF_writeCTable.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	HUF_writeCTable
	.type	HUF_writeCTable, @function
HUF_writeCTable:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r14
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_offset 13, -32
	mov	r13d, ecx
	push	r12
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbx
	sub	rsp, 16
	.cfi_offset 3, -48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR HUF_TABLELOG_MAX[rip]
	mov	rbx, rsp
	add	eax, 1
	cdqe
	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
.L39:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L39
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L40
.L4:
	movsx	rax, DWORD PTR HUF_SYMBOLVALUE_MAX[rip]
	mov	rbx, rsp
	lea	rsi, 3[rsp]
	mov	rcx, rsi
	and	rsi, -4
	mov	r9, rax
	lea	rax, 15[0+rax*4]
	shr	rcx, 2
	mov	rdi, rax
	and	rax, -4096
	sub	rbx, rax
	and	rdi, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L6
.L41:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L41
.L6:
	and	edi, 4095
	sub	rsp, rdi
	test	rdi, rdi
	jne	.L42
.L7:
	mov	rbx, rsp
	cmp	r9d, r13d
	jl	.L43
	mov	DWORD PTR 0[0+rcx*4], 0
	lea	rax, 4[rsi]
	test	r8d, r8d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	mov	DWORD PTR [rax], r8d
	add	rax, 4
	sub	r8d, 1
	jne	.L13
.L14:
	lea	edi, -1[r13]
	xor	eax, eax
	test	r13d, r13d
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rcx, QWORD PTR [rdx+rax*8]
	mov	ecx, DWORD PTR [rsi+rcx*4]
	mov	DWORD PTR [rbx+rax*4], ecx
	mov	rcx, rax
	add	rax, 1
	cmp	rdi, rcx
	jne	.L18
.L12:
	mov	rdx, rbx
	lea	rsi, -1[r14]
	lea	rdi, 4[r12]
	mov	ecx, r13d
	call	HUF_compressWeights@PLT
	mov	edi, DWORD PTR hSize[rip]
	mov	esi, eax
	call	CHECK_V_F@PLT
	mov	edx, r13d
	mov	eax, DWORD PTR hSize[rip]
	shr	edx, 31
	add	edx, r13d
	sar	edx
	cmp	eax, edx
	jge	.L17
	cmp	eax, 1
	jle	.L17
	mov	DWORD PTR [r12], eax
	add	eax, 1
	cdqe
.L1:
	mov	rdi, QWORD PTR -40[rbp]
	xor	rdi, QWORD PTR fs:40
	jne	.L44
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L17:
	cmp	r13d, 128
	jg	.L45
	lea	edx, 1[r13]
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	sar	eax
	add	eax, 1
	cdqe
	cmp	rax, r14
	ja	.L46
	lea	edx, 127[r13]
	mov	DWORD PTR [r12], edx
	movsx	rdx, r13d
	mov	DWORD PTR [rbx+rdx*4], 0
	test	r13d, r13d
	jle	.L1
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L21:
	mov	esi, DWORD PTR [rbx+rdx*4]
	mov	ecx, edx
	sar	ecx
	movsx	rcx, ecx
	sal	esi, 4
	add	esi, DWORD PTR 4[rbx+rdx*4]
	add	rdx, 2
	mov	DWORD PTR 4[r12+rcx*4], esi
	cmp	r13d, edx
	jg	.L21
	jmp	.L1
.L43:
	mov	edi, DWORD PTR maxSymbolValue_tooLarge[rip]
	call	ERROR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L45:
	mov	edi, DWORD PTR GENERIC[rip]
	call	ERROR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L46:
	mov	edi, DWORD PTR dstSize_tooSmall[rip]
	call	ERROR@PLT
	jmp	.L1
.L42:
	or	QWORD PTR -8[rsp+rdi], 0
	jmp	.L7
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	HUF_writeCTable, .-HUF_writeCTable
	.comm	maxSymbolValue_tooLarge,4,4
	.comm	hSize,4,4
	.comm	dstSize_tooSmall,4,4
	.comm	HUF_TABLELOG_MAX,4,4
	.comm	HUF_SYMBOLVALUE_MAX,4,4
	.comm	GENERIC,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_huf_compress.c_HUF_writeCTable.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	HUF_writeCTable
	.syntax unified
	.arm
	.fpu softvfp
	.type	HUF_writeCTable, %function
HUF_writeCTable:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #8
	mov	r4, r3
	ldr	r3, .L27
	ldr	ip, .L27+4
	ldr	r3, [r3]
	ldr	r5, [ip]
	lsl	r3, r3, #2
	add	r3, r3, #11
	lsl	ip, r5, #2
	bic	r3, r3, #7
	add	ip, ip, #7
	sub	sp, sp, r3
	bic	r3, ip, #7
	mov	lr, sp
	sub	sp, sp, r3
	ldr	r3, .L27+8
	cmp	r5, r4
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	blt	.L22
	mov	r3, #0
	mov	r6, r1
	ldr	r1, [fp, #4]
	str	r3, [lr]
	cmp	r1, r3
	mov	r5, r0
	mov	r7, sp
	movgt	r3, lr
	ldrgt	ip, [fp, #4]
	ble	.L8
.L7:
	str	ip, [r3, #4]!
	subs	ip, ip, #1
	bne	.L7
.L8:
	cmp	r4, #0
	subgt	ip, r2, #4
	addgt	r1, ip, r4, lsl #2
	subgt	r3, r7, #4
	ble	.L6
.L11:
	ldr	r2, [ip, #4]!
	ldr	r2, [lr, r2, lsl #2]
	cmp	ip, r1
	str	r2, [r3, #4]!
	bne	.L11
.L6:
	ldr	r8, .L27+12
	mov	r3, r4
	mov	r2, r7
	sub	r1, r6, #1
	add	r0, r5, #4
	ldr	r9, [r8]
	bl	HUF_compressWeights
	mov	r1, r0
	mov	r0, r9
	bl	CHECK_V_F
	ldr	r0, [r8]
	add	r1, r4, r4, lsr #31
	asr	r1, r1, #1
	cmp	r0, #1
	cmpgt	r1, r0
	movgt	r1, #1
	movle	r1, #0
	bgt	.L23
	cmp	r4, #128
	bgt	.L24
	add	r0, r4, #1
	add	r0, r0, r0, lsr #31
	asr	r0, r0, #1
	add	r0, r0, #1
	cmp	r0, r6
	bhi	.L25
	add	r3, r4, #127
	cmp	r4, #0
	str	r1, [r7, r4, lsl #2]
	str	r3, [r5]
	ble	.L1
	add	lr, r7, #4
.L14:
	ldr	ip, [r7, r1, lsl #2]
	ldr	r2, [lr, r1, lsl #2]
	asr	r3, r1, #1
	add	r1, r1, #2
	add	r2, r2, ip, lsl #4
	add	r3, r3, #1
	cmp	r4, r1
	str	r2, [r5, r3, lsl #2]
	bgt	.L14
.L1:
	ldr	r3, .L27+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L26
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L23:
	str	r0, [r5]
	add	r0, r0, #1
	b	.L1
.L22:
	ldr	r3, .L27+16
	ldr	r0, [r3]
	bl	ERROR
	b	.L1
.L24:
	ldr	r3, .L27+20
	ldr	r0, [r3]
	bl	ERROR
	b	.L1
.L25:
	ldr	r3, .L27+24
	ldr	r0, [r3]
	bl	ERROR
	b	.L1
.L26:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	HUF_TABLELOG_MAX
	.word	HUF_SYMBOLVALUE_MAX
	.word	.LC0
	.word	hSize
	.word	maxSymbolValue_tooLarge
	.word	GENERIC
	.word	dstSize_tooSmall
	.size	HUF_writeCTable, .-HUF_writeCTable
	.comm	maxSymbolValue_tooLarge,4,4
	.comm	hSize,4,4
	.comm	dstSize_tooSmall,4,4
	.comm	HUF_TABLELOG_MAX,4,4
	.comm	HUF_SYMBOLVALUE_MAX,4,4
	.comm	GENERIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
