	.file	"extr_lodepng.c_HuffmanTree_make2DTree.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	HuffmanTree_make2DTree, @function
HuffmanTree_make2DTree:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	eax, DWORD PTR 8[rdi]
	lea	edi, 0[0+rax*8]
	call	lodepng_malloc@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L16
	mov	edx, DWORD PTR 8[rbx]
	test	edx, edx
	je	.L3
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L4:
	mov	ecx, edx
	add	edx, 1
	mov	DWORD PTR [rax+rcx*4], 32767
	mov	edi, DWORD PTR 8[rbx]
	lea	ecx, [rdi+rdi]
	cmp	ecx, edx
	ja	.L4
	test	edi, edi
	je	.L3
	mov	r13, QWORD PTR 16[rbx]
	xor	r12d, r12d
	xor	r8d, r8d
	xor	r11d, r11d
.L6:
	mov	r10d, r12d
	sal	r10, 2
	lea	rbp, 0[r13+r10]
	mov	r9d, DWORD PTR 0[rbp]
	test	r9d, r9d
	je	.L13
	add	r10, QWORD PTR 24[rbx]
	xor	esi, esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	cmp	r9d, esi
	jbe	.L13
.L10:
	mov	edx, DWORD PTR [r10]
	lea	ecx, -1[r9]
	sub	ecx, esi
	shr	edx, cl
	lea	ecx, -2[rdi]
	and	edx, 1
	cmp	ecx, r8d
	jb	.L17
	movzx	edx, dl
	add	esi, 1
	lea	edx, [rdx+r8*2]
	lea	rcx, [rax+rdx*4]
	mov	edx, DWORD PTR [rcx]
	mov	r8d, edx
	sub	r8d, edi
	cmp	edx, 32767
	jne	.L9
	cmp	r9d, esi
	je	.L26
	add	r11d, 1
	add	edi, r11d
	mov	r8d, r11d
	mov	DWORD PTR [rcx], edi
	mov	r9d, DWORD PTR 0[rbp]
	mov	edi, DWORD PTR 8[rbx]
	cmp	r9d, esi
	ja	.L10
.L13:
	add	r12d, 1
	cmp	edi, r12d
	ja	.L6
	test	edi, edi
	je	.L3
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L15:
	mov	ecx, edx
	lea	rcx, [rax+rcx*4]
	cmp	DWORD PTR [rcx], 32767
	jne	.L14
	mov	DWORD PTR [rcx], 0
	mov	edi, DWORD PTR 8[rbx]
.L14:
	add	edx, 1
	lea	ecx, [rdi+rdi]
	cmp	ecx, edx
	ja	.L15
.L3:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	mov	DWORD PTR [rcx], r12d
	xor	r8d, r8d
	mov	edi, DWORD PTR 8[rbx]
	mov	r9d, DWORD PTR 0[rbp]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L17:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, 55
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	eax, 83
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	HuffmanTree_make2DTree, .-HuffmanTree_make2DTree
	.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_lodepng.c_HuffmanTree_make2DTree.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	HuffmanTree_make2DTree, %function
HuffmanTree_make2DTree:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r0, [r0, #4]
	lsl	r0, r0, #3
	bl	lodepng_malloc
	cmp	r0, #0
	str	r0, [r4]
	beq	.L16
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L3
	mov	r2, r0
	mov	r3, #0
	ldr	r1, .L30
.L4:
	str	r1, [r2], #4
	ldr	ip, [r4, #4]
	add	r3, r3, #1
	cmp	r3, ip, lsl #1
	bcc	.L4
	cmp	ip, #0
	beq	.L3
	mov	r9, #0
	mov	r10, r9
	mov	r7, r9
	ldr	r8, [r4, #8]
	ldr	r6, .L30
	sub	r8, r8, #4
.L6:
	ldr	lr, [r8, #4]!
	lsl	r5, r9, #2
	cmp	lr, #0
	beq	.L13
	ldr	r3, [r4, #12]
	mov	r1, #0
	add	r5, r3, r5
	b	.L10
.L29:
	ldr	r10, [r0, r3, lsl #2]
	add	r1, r1, #1
	cmp	r10, r6
	subne	r10, r10, ip
	bne	.L9
	cmp	lr, r1
	addne	r7, r7, #1
	moveq	r10, #0
	movne	r10, r7
	addne	ip, ip, r7
	streq	r9, [r0, r3, lsl #2]
	strne	ip, [r0, r3, lsl #2]
	ldreq	ip, [r4, #4]
	ldreq	lr, [r8]
	ldrne	ip, [r4, #4]
	ldrne	lr, [r8]
.L9:
	cmp	lr, r1
	bls	.L13
.L10:
	ldr	r2, [r5]
	sub	r3, lr, #1
	sub	r3, r3, r1
	sub	fp, ip, #2
	lsr	r3, r2, r3
	and	r3, r3, #1
	cmp	fp, r10
	add	r3, r3, r10, lsl #1
	bcs	.L29
	mov	r0, #55
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	add	r9, r9, #1
	cmp	ip, r9
	bhi	.L6
	cmp	ip, #0
	beq	.L3
	mov	r3, #0
	mov	lr, r3
	ldr	r1, .L30
.L15:
	ldr	r2, [r0]
	add	r3, r3, #1
	cmp	r2, r1
	streq	lr, [r0]
	ldreq	ip, [r4, #4]
	add	r0, r0, #4
	cmp	r3, ip, lsl #1
	bcc	.L15
.L3:
	mov	r0, #0
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	mov	r0, #83
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L31:
	.align	2
.L30:
	.word	32767
	.size	HuffmanTree_make2DTree, .-HuffmanTree_make2DTree
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
