	.file	"extr_tcd.c_opj_tcd_makelayer.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	opj_tcd_makelayer
	.type	opj_tcd_makelayer, @function
opj_tcd_makelayer:
.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
	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, 104
	.cfi_def_cfa_offset 160
	mov	rax, QWORD PTR [rdi]
	mov	QWORD PTR 16[rsp], rsi
	mov	rbx, QWORD PTR [rax]
	mov	QWORD PTR 40[rsp], rcx
	lea	rax, 0[0+rsi*8]
	mov	QWORD PTR 32[rsp], rax
	mov	rax, QWORD PTR [rbx]
	mov	QWORD PTR 24[rsp], rbx
	mov	QWORD PTR 72[rsp], 0
	mov	QWORD PTR [rax+rsi*8], 0
	sal	rsi, 5
	cmp	QWORD PTR 8[rbx], 0
	mov	QWORD PTR 8[rsp], rsi
	je	.L1
	mov	r13, rdx
.L4:
	mov	rax, QWORD PTR 72[rsp]
	mov	rbx, QWORD PTR 24[rsp]
	mov	r14, r13
	mov	QWORD PTR 80[rsp], 0
	sal	rax, 4
	add	rax, QWORD PTR 16[rbx]
	cmp	QWORD PTR [rax], 0
	mov	QWORD PTR 88[rsp], rax
	je	.L7
.L3:
	mov	rax, QWORD PTR 80[rsp]
	mov	rbx, QWORD PTR 88[rsp]
	mov	QWORD PTR 64[rsp], 0
	sal	rax, 5
	add	rax, QWORD PTR 8[rbx]
	cmp	QWORD PTR [rax], 0
	mov	QWORD PTR 56[rsp], rax
	jne	.L6
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rbx, QWORD PTR 56[rsp]
	add	QWORD PTR 64[rsp], 1
	mov	rax, QWORD PTR 64[rsp]
	cmp	QWORD PTR [rbx], rax
	jbe	.L9
.L6:
	mov	rax, QWORD PTR 56[rsp]
	mov	rbx, QWORD PTR 64[rsp]
	mov	rax, QWORD PTR 24[rax]
	lea	rbx, [rax+rbx*8]
	mov	rdi, rbx
	call	opj_tcd_is_band_empty@PLT
	test	rax, rax
	jne	.L10
	mov	rsi, QWORD PTR 56[rsp]
	mov	rax, QWORD PTR 16[rsi]
	imul	rax, QWORD PTR 8[rsi]
	test	rax, rax
	je	.L10
	mov	QWORD PTR 48[rsp], 0
	mov	rbp, QWORD PTR [rbx]
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rax, QWORD PTR 8[rbp]
	imul	rax, QWORD PTR 0[rbp]
	test	rax, rax
	je	.L26
	mov	r8, QWORD PTR 16[rbp]
	xor	ebx, ebx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L55:
	mov	r10, QWORD PTR [r8]
	mov	r9, QWORD PTR 8[r8]
	test	r14, r14
	jns	.L54
.L15:
	mov	rax, r9
	sub	rax, r10
	mov	QWORD PTR [r11], rax
	je	.L27
.L21:
	mov	rcx, QWORD PTR 24[r8]
	mov	rax, r9
	mov	rsi, QWORD PTR 16[r8]
	sal	rax, 4
	lea	rax, -16[rcx+rax]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR 8[rax]
	test	r10, r10
	jne	.L23
	mov	QWORD PTR 16[r11], rdx
	mov	QWORD PTR 24[r11], rsi
	mov	QWORD PTR 8[r11], rax
.L24:
	mov	rdi, QWORD PTR 24[rsp]
	mov	rdx, QWORD PTR 32[rsp]
	add	rdx, QWORD PTR [rdi]
	add	QWORD PTR [rdx], rax
	cmp	QWORD PTR 40[rsp], 0
	je	.L22
	mov	QWORD PTR [r8], r9
.L22:
	mov	rax, QWORD PTR 0[rbp]
	imul	rax, QWORD PTR 8[rbp]
	add	rbx, 1
	add	r8, 40
	cmp	rax, rbx
	jbe	.L26
.L25:
	mov	r11, QWORD PTR 8[rsp]
	add	r11, QWORD PTR 32[r8]
	cmp	QWORD PTR 16[rsp], 0
	jne	.L55
	mov	QWORD PTR [r8], 0
	mov	r9, QWORD PTR 8[r8]
	xor	r10d, r10d
	test	r14, r14
	js	.L15
.L54:
	cmp	r10, r9
	jnb	.L16
	mov	r13, QWORD PTR 24[r8]
	mov	rcx, r10
	mov	rdi, r10
	mov	rsi, r10
	sal	rcx, 4
	mov	r12, QWORD PTR DBL_EPSILON[rip]
	add	rcx, r13
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L18:
	xor	edx, edx
	div	r15
	mov	rdx, r14
	sub	rdx, rax
	cmp	rdx, r12
	cmovb	rdi, rsi
	add	rcx, 16
	cmp	r9, rsi
	je	.L56
.L20:
	mov	r15, QWORD PTR [rcx]
	mov	rax, QWORD PTR 8[rcx]
	test	rdi, rdi
	je	.L17
	mov	rdx, rdi
	sal	rdx, 4
	lea	rdx, -16[r13+rdx]
	sub	r15, QWORD PTR [rdx]
	sub	rax, QWORD PTR 8[rdx]
.L17:
	add	rsi, 1
	test	r15, r15
	jne	.L18
	test	rax, rax
	cmovne	rdi, rsi
	add	rcx, 16
	cmp	r9, rsi
	jne	.L20
.L56:
	mov	r9, rdi
	mov	rax, r9
	sub	rax, r10
	mov	QWORD PTR [r11], rax
	jne	.L21
.L27:
	mov	QWORD PTR 8[r11], 0
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L23:
	sal	r10, 4
	lea	rdi, -16[rcx+r10]
	mov	rcx, QWORD PTR [rdi]
	sub	rax, QWORD PTR 8[rdi]
	mov	QWORD PTR 8[r11], rax
	sub	rdx, rcx
	add	rsi, rcx
	mov	QWORD PTR 16[r11], rdx
	mov	QWORD PTR 24[r11], rsi
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rdi, QWORD PTR 56[rsp]
	add	QWORD PTR 48[rsp], 1
	add	rbp, 24
	mov	rbx, QWORD PTR 48[rsp]
	mov	rax, QWORD PTR 8[rdi]
	imul	rax, QWORD PTR 16[rdi]
	cmp	rax, rbx
	ja	.L12
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	mov	QWORD PTR [r11], 0
	mov	QWORD PTR 8[r11], 0
	jmp	.L22
.L9:
	mov	rbx, QWORD PTR 88[rsp]
	add	QWORD PTR 80[rsp], 1
	mov	rax, QWORD PTR 80[rsp]
	cmp	QWORD PTR [rbx], rax
	ja	.L3
	mov	r13, r14
.L7:
	mov	rbx, QWORD PTR 24[rsp]
	add	QWORD PTR 72[rsp], 1
	mov	rax, QWORD PTR 72[rsp]
	cmp	QWORD PTR 8[rbx], rax
	ja	.L4
.L1:
	add	rsp, 104
	.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
	.cfi_endproc
.LFE0:
	.size	opj_tcd_makelayer, .-opj_tcd_makelayer
	.comm	DBL_EPSILON,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_tcd.c_opj_tcd_makelayer.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.global	opj_tcd_makelayer
	.syntax unified
	.arm
	.fpu softvfp
	.type	opj_tcd_makelayer, %function
opj_tcd_makelayer:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #76
	mov	ip, r1
	str	r1, [sp, #16]
	mov	r1, #0
	ldr	r0, [r0]
	str	r2, [sp, #20]
	ldr	r2, [r0]
	str	r3, [sp, #32]
	ldr	r3, [r2]
	lsl	r0, ip, #2
	str	r1, [r3, ip, lsl #2]
	ldr	r3, [r2, #4]
	str	r2, [sp, #24]
	cmp	r3, r1
	str	r0, [sp, #28]
	beq	.L1
	lsl	r2, ip, #4
	str	r1, [sp, #60]
	str	r2, [sp, #8]
.L4:
	ldr	r2, [sp, #24]
	ldr	r0, [sp, #60]
	ldr	r1, [r2, #8]
	ldr	r2, [r1, r0, lsl #3]
	add	r1, r1, r0, lsl #3
	cmp	r2, #0
	movne	r3, #0
	str	r1, [sp, #68]
	strne	r3, [sp, #64]
	beq	.L7
.L3:
	ldr	r3, [sp, #68]
	ldr	r0, [sp, #64]
	ldr	r3, [r3, #4]
	ldr	r1, [r3, r0, lsl #4]
	add	r3, r3, r0, lsl #4
	cmp	r1, #0
	str	r3, [sp, #52]
	movne	r3, #0
	strne	r3, [sp, #56]
	bne	.L6
	b	.L9
.L10:
	ldr	r3, [sp, #52]
	ldr	r2, [sp, #56]
	ldr	r3, [r3]
	add	r2, r2, #1
	cmp	r3, r2
	str	r2, [sp, #56]
	bls	.L49
.L6:
	ldr	r3, [sp, #52]
	ldr	r5, [r3, #12]
	ldr	r3, [sp, #56]
	add	r0, r5, r3, lsl #2
	lsl	r4, r3, #2
	bl	opj_tcd_is_band_empty
	cmp	r0, #0
	bne	.L10
	ldr	r3, [sp, #52]
	ldr	r1, [r3, #8]
	ldr	r2, [r3, #4]
	muls	r3, r2, r1
	beq	.L10
	ldr	fp, [r5, r4]
	str	r0, [sp, #48]
.L12:
	ldm	fp, {r0, r3}
	muls	ip, r0, r3
	beq	.L26
	mov	r3, #0
	ldr	r6, [fp, #8]
	str	r3, [sp, #4]
	b	.L25
.L15:
	sub	r1, r7, r9
	ldr	r3, [sp, #12]
	ldr	r2, [sp, #8]
	cmp	r1, #0
	str	r1, [r3, r2]
	beq	.L27
	cmp	r9, #0
	ldr	r0, [r6, #12]
	subne	r3, r9, #-536870911
	sub	ip, r7, #-536870911
	addne	r4, r0, r3, lsl #3
	add	r1, r0, ip, lsl #3
	ldrne	r3, [r0, r3, lsl #3]
	ldr	r1, [r1, #4]
	ldr	ip, [r0, ip, lsl #3]
	ldrne	r4, [r4, #4]
	ldr	lr, [r6, #8]
	subne	r1, r1, r4
	subne	ip, ip, r3
	addne	lr, r3, lr
	stmib	r10, {r1, ip, lr}
	ldr	r3, [sp, #24]
	ldr	r2, [sp, #28]
	ldr	r0, [r3]
	ldr	r3, [sp, #32]
	cmp	r3, #0
	ldr	r3, [r0, r2]
	add	r1, r3, r1
	str	r1, [r0, r2]
	strne	r7, [r6]
.L22:
	ldr	r3, [fp]
	ldr	r1, [fp, #4]
	ldr	r2, [sp, #4]
	mul	r3, r1, r3
	add	r2, r2, #1
	cmp	r3, r2
	str	r2, [sp, #4]
	add	r6, r6, #20
	bls	.L50
.L25:
	ldr	r2, [sp, #16]
	ldr	r3, [r6, #16]
	cmp	r2, #0
	ldr	r2, [sp, #8]
	str	r3, [sp, #12]
	add	r10, r3, r2
	ldreq	r3, [sp, #16]
	ldrne	r9, [r6]
	moveq	r9, r3
	streq	r3, [r6]
	ldr	r3, [sp, #20]
	ldr	r7, [r6, #4]
	cmp	r3, #0
	blt	.L15
	cmp	r9, r7
	bcs	.L16
	ldr	r3, .L52
	ldr	r8, [r6, #12]
	ldr	r3, [r3]
	add	r2, r8, #4
	str	r10, [sp, #36]
	str	r6, [sp, #40]
	mov	r4, r9
	mov	r6, r8
	mov	r5, r3
	mov	r8, r2
	ldr	r10, [sp, #20]
	str	r9, [sp, #44]
	b	.L20
.L18:
	bl	__aeabi_uidiv
	sub	r0, r10, r0
	cmp	r0, r5
	movcc	r9, r4
	cmp	r7, r4
	beq	.L51
.L20:
	cmp	r9, #0
	ldr	r1, [r6, r4, lsl #3]
	ldr	r0, [r8, r4, lsl #3]
	beq	.L17
	sub	ip, r9, #-536870911
	add	lr, r6, ip, lsl #3
	ldr	lr, [lr, #4]
	ldr	ip, [r6, ip, lsl #3]
	sub	r0, r0, lr
	sub	r1, r1, ip
.L17:
	cmp	r1, #0
	add	r4, r4, #1
	bne	.L18
	cmp	r0, #0
	movne	r9, r4
	cmp	r7, r4
	bne	.L20
.L51:
	mov	r5, r9
	ldr	r10, [sp, #36]
	mov	r7, r5
	ldr	r6, [sp, #40]
	ldr	r9, [sp, #44]
	b	.L15
.L16:
	mov	r1, #0
	ldr	r3, [sp, #12]
	ldr	r2, [sp, #8]
	str	r1, [r3, r2]
.L27:
	mov	r3, #0
	str	r3, [r10, #4]
	b	.L22
.L50:
	ldr	r3, [sp, #52]
	ldr	r1, [r3, #8]
	ldr	r2, [r3, #4]
.L26:
	mul	r3, r1, r2
	ldr	r0, [sp, #48]
	add	fp, fp, #12
	add	r0, r0, #1
	cmp	r3, r0
	str	r0, [sp, #48]
	bhi	.L12
	b	.L10
.L49:
	ldr	r3, [sp, #68]
	ldr	r2, [r3]
.L9:
	ldr	r3, [sp, #64]
	add	r3, r3, #1
	cmp	r2, r3
	str	r3, [sp, #64]
	bhi	.L3
	ldr	r3, [sp, #24]
	ldr	r3, [r3, #4]
.L7:
	ldr	r2, [sp, #60]
	add	r2, r2, #1
	cmp	r3, r2
	str	r2, [sp, #60]
	bhi	.L4
.L1:
	add	sp, sp, #76
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L53:
	.align	2
.L52:
	.word	DBL_EPSILON
	.size	opj_tcd_makelayer, .-opj_tcd_makelayer
	.comm	DBL_EPSILON,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
