	.file	"extr_deftree.c_build_tree.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	build_tree, @function
build_tree:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR 8[rsi]
	mov	r15, QWORD PTR 16[rsi]
	mov	QWORD PTR 24[rsp], rsi
	mov	r10, QWORD PTR 8[rax]
	movsx	rbx, DWORD PTR [rax]
	mov	QWORD PTR [rdi], 0
	mov	rax, QWORD PTR HEAP_SIZE[rip]
	mov	QWORD PTR 8[rdi], rax
	test	ebx, ebx
	jle	.L13
	mov	rsi, r15
	lea	r9d, -1[rbx]
	xor	edx, edx
	xor	eax, eax
	mov	ebp, -1
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rdi, QWORD PTR 16[r14]
	add	rax, 1
	mov	ebp, edx
	add	rsi, 24
	mov	QWORD PTR [r14], rax
	mov	DWORD PTR [rdi+rax*4], edx
	mov	rax, QWORD PTR 40[r14]
	lea	rdi, 1[rdx]
	mov	QWORD PTR [rax+rdx*8], 0
	mov	rax, QWORD PTR [r14]
	cmp	rdx, r9
	je	.L25
.L14:
	mov	rdx, rdi
.L5:
	mov	ecx, DWORD PTR [rsi]
	test	ecx, ecx
	jne	.L26
	mov	QWORD PTR 16[rsi], 0
	lea	rdi, 1[rdx]
	add	rsi, 24
	cmp	rdx, r9
	jne	.L14
.L25:
	cmp	rax, 1
	ja	.L6
.L2:
	mov	r11, QWORD PTR 16[r14]
	mov	r12, QWORD PTR 40[r14]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L15:
	mov	rsi, r12
	mov	rdi, r15
	xor	edx, edx
	xor	r9d, r9d
.L7:
	add	rax, 1
	mov	QWORD PTR [r14], rax
	mov	DWORD PTR [r11+rax*4], r9d
	mov	DWORD PTR [rdi], 1
	mov	QWORD PTR [rsi], 0
	sub	DWORD PTR 52[r14], 1
	test	r10, r10
	je	.L8
	mov	rax, QWORD PTR 16[r10+rdx]
	sub	DWORD PTR 48[r14], eax
.L8:
	mov	rax, QWORD PTR [r14]
	cmp	rax, 1
	ja	.L6
.L9:
	cmp	ebp, 1
	jg	.L15
	add	ebp, 1
	movsx	rsi, ebp
	mov	r9d, ebp
	lea	rdx, [rsi+rsi*2]
	lea	rsi, [r12+rsi*8]
	sal	rdx, 3
	lea	rdi, [r15+rdx]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rcx, QWORD PTR 24[rsp]
	shr	rax
	mov	r12d, eax
	mov	DWORD PTR [rcx], ebp
	test	eax, eax
	jle	.L10
	movsx	rdx, eax
	sub	eax, 1
	lea	r13, -1[rdx]
	mov	r12, r13
	sub	r12, rax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L27:
	sub	r13, 1
.L11:
	mov	rsi, r15
	mov	rdi, r14
	call	pqdownheap@PLT
	mov	rdx, r13
	cmp	r12, r13
	jne	.L27
	xor	r12d, r12d
.L10:
	movsx	rdx, r12d
	lea	rax, [rdx+rdx*2]
	lea	r13, [r15+rax*8]
	lea	rax, 0[0+rdx*8]
	mov	QWORD PTR 16[rsp], rax
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edx, r12d
	mov	rsi, r15
	mov	rdi, r14
	call	pqremove@PLT
	mov	rsi, QWORD PTR 16[r14]
	mov	rax, QWORD PTR SMALLEST[rip]
	mov	rdx, QWORD PTR 8[r14]
	movsx	rax, DWORD PTR [rsi+rax*4]
	lea	rdi, -1[rdx]
	sub	rdx, 2
	mov	DWORD PTR [rsi+rdi*4], r12d
	mov	QWORD PTR 8[r14], rdx
	lea	rdx, [rax+rax*2]
	lea	rdx, [r15+rdx*8]
	mov	DWORD PTR -4[rsi+rdi*4], eax
	lea	rdi, [rbx+rbx*2]
	mov	esi, DWORD PTR [rdx]
	add	esi, DWORD PTR 0[r13]
	mov	QWORD PTR 8[rsp], rdx
	mov	DWORD PTR [r15+rdi*8], esi
	mov	rsi, QWORD PTR 40[r14]
	mov	r9, QWORD PTR [rsi+rax*8]
	mov	rax, QWORD PTR 16[rsp]
	mov	rdi, QWORD PTR [rsi+rax]
	mov	rsi, r9
	call	max@PLT
	mov	rsi, QWORD PTR 40[r14]
	mov	rdx, QWORD PTR 8[rsp]
	mov	rdi, r14
	add	rax, 1
	mov	QWORD PTR [rsi+rbx*8], rax
	mov	rax, QWORD PTR 16[r14]
	mov	rsi, r15
	mov	QWORD PTR 8[rdx], rbx
	mov	rdx, QWORD PTR SMALLEST[rip]
	mov	QWORD PTR 8[r13], rbx
	mov	DWORD PTR [rax+rdx*4], ebx
	add	rbx, 1
	call	pqdownheap@PLT
	cmp	QWORD PTR [r14], 1
	ja	.L12
	mov	rdx, QWORD PTR 16[r14]
	mov	rsi, QWORD PTR SMALLEST[rip]
	mov	rdi, r14
	mov	rax, QWORD PTR 8[r14]
	mov	esi, DWORD PTR [rdx+rsi*4]
	sub	rax, 1
	mov	QWORD PTR 8[r14], rax
	mov	DWORD PTR [rdx+rax*4], esi
	mov	rsi, QWORD PTR 24[rsp]
	call	gen_bitlen@PLT
	mov	edx, DWORD PTR 24[r14]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	esi, ebp
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	rdi, r15
	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
	jmp	gen_codes@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	ebp, -1
	xor	eax, eax
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	build_tree, .-build_tree
	.comm	stderr,4,4
	.comm	SMALLEST,8,8
	.comm	HEAP_SIZE,8,8
	.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_deftree.c_build_tree.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	build_tree, %function
build_tree:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r2, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	mov	r0, r1
	ldr	r3, [r1, #4]
	sub	sp, sp, #12
	str	r1, [sp, #4]
	ldr	r1, .L23
	ldr	r6, [r3]
	ldr	r1, [r1]
	cmp	r6, r2
	ldr	lr, [r3, #4]
	ldr	r5, [r0, #8]
	mvn	r7, #0
	str	r1, [r4, #4]
	str	r2, [r4]
	ble	.L2
	mov	r3, r2
	mov	r8, r2
	add	r1, r5, #8
.L5:
	ldr	r0, [r1, #-8]
	add	ip, r2, #1
	cmp	r0, #0
	ldrne	r2, [r4, #20]
	ldrne	r0, [r4, #8]
	strne	ip, [r4]
	movne	r7, r3
	strne	r3, [r0, ip, lsl #2]
	strne	r8, [r2, r3, lsl #2]
	add	r3, r3, #1
	streq	r0, [r1]
	ldrne	r2, [r4]
	cmp	r6, r3
	add	r1, r1, #12
	bne	.L5
	cmp	r2, #1
	bhi	.L6
.L2:
	mov	r10, #0
	mov	r9, #1
	ldr	r8, [r4, #8]
	ldr	fp, [r4, #20]
.L9:
	cmp	r7, #1
	movgt	r1, #0
	addle	r7, r7, #1
	movgt	r3, r1
	movle	r3, r7
	movgt	ip, fp
	movgt	r0, r5
	add	r2, r2, #1
	str	r2, [r4]
	str	r3, [r8, r2, lsl #2]
	ldr	r3, [r4, #28]
	addle	r0, r7, r7, lsl #1
	lslle	r1, r0, #2
	addle	ip, fp, r7, lsl #2
	addle	r0, r5, r0, lsl #2
	cmp	lr, #0
	sub	r3, r3, #1
	str	r9, [r0]
	addne	r1, lr, r1
	str	r10, [ip]
	ldrne	r2, [r1, #8]
	str	r3, [r4, #28]
	ldrne	r3, [r4, #24]
	subne	r3, r3, r2
	ldr	r2, [r4]
	strne	r3, [r4, #24]
	cmp	r2, #1
	bls	.L9
.L6:
	ldr	r3, [sp, #4]
	lsr	r8, r2, #1
	str	r7, [r3]
.L10:
	mov	r2, r8
	mov	r1, r5
	mov	r0, r4
	bl	pqdownheap
	subs	r8, r8, #1
	bne	.L10
	ldr	r10, .L23+4
	lsl	r9, r6, #2
.L11:
	mov	r2, #0
	mov	r1, r5
	mov	r0, r4
	bl	pqremove
	ldr	r1, [r4, #8]
	ldr	r2, [r4, #4]
	ldr	r3, [r10]
	sub	r0, r2, #1
	ldr	r3, [r1, r3, lsl #2]
	add	ip, r1, r0, lsl #2
	sub	r2, r2, #2
	str	r8, [r1, r0, lsl #2]
	add	fp, r3, r3, lsl #1
	str	r2, [r4, #4]
	str	r3, [ip, #-4]
	ldr	r1, [r5, fp, lsl #2]
	ldr	r2, [r5]
	ldr	r0, [r4, #20]
	add	r2, r2, r1
	add	r1, r9, r9, lsl #1
	str	r2, [r5, r1]
	ldr	r1, [r0, r3, lsl #2]
	ldr	r0, [r0]
	bl	max
	ldr	r2, [r4, #20]
	add	r0, r0, #1
	str	r0, [r2, r9]
	ldr	r2, [r10]
	ldr	r0, [r4, #8]
	add	fp, r5, fp, lsl #2
	str	r6, [fp, #4]
	mov	r1, r5
	str	r6, [r5, #4]
	str	r6, [r0, r2, lsl #2]
	mov	r0, r4
	bl	pqdownheap
	ldr	r3, [r4]
	add	r9, r9, #4
	cmp	r3, #1
	add	r6, r6, #1
	bhi	.L11
	ldr	r1, [r10]
	ldr	r2, [r4, #8]
	ldr	r3, [r4, #4]
	ldr	r0, [r2, r1, lsl #2]
	sub	r3, r3, #1
	ldr	r1, [sp, #4]
	str	r3, [r4, #4]
	str	r0, [r2, r3, lsl #2]
	mov	r0, r4
	bl	gen_bitlen
	mov	r1, r7
	mov	r0, r5
	ldr	r2, [r4, #12]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	gen_codes
.L24:
	.align	2
.L23:
	.word	HEAP_SIZE
	.word	SMALLEST
	.size	build_tree, .-build_tree
	.comm	stderr,4,4
	.comm	SMALLEST,4,4
	.comm	HEAP_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
