	.file	"extr_tif_dirread.c_ChopUpSingleUncompressedStrip.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"for chopped \"StripByteCounts\" array"
	.align 8
.LC1:
	.string	"for chopped \"StripOffsets\" array"
	.text
	.p2align 4
	.type	ChopUpSingleUncompressedStrip, @function
ChopUpSingleUncompressedStrip:
.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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR 8[rdi]
	mov	r12d, DWORD PTR [rax]
	test	r12d, r12d
	jne	.L2
	mov	rax, QWORD PTR O_RDONLY[rip]
	cmp	QWORD PTR [rdi], rax
	jne	.L1
.L2:
	mov	rax, QWORD PTR 16[rbp]
	xor	edi, edi
	mov	r13d, DWORD PTR [rax]
	mov	rax, QWORD PTR PLANARCONFIG_CONTIG[rip]
	cmp	QWORD PTR 24[rbp], rax
	sete	dil
	call	assert@PLT
	mov	rax, QWORD PTR PHOTOMETRIC_YCBCR[rip]
	cmp	QWORD PTR 32[rbp], rax
	je	.L4
.L6:
	mov	r14d, 1
.L5:
	mov	esi, r14d
	mov	rdi, rbp
	call	TIFFVTileSize64@PLT
	mov	ebx, eax
	mov	eax, DWORD PTR STRIP_SIZE_DEFAULT[rip]
	cmp	eax, ebx
	jl	.L7
	test	ebx, ebx
	jle	.L1
	cdq
	idiv	ebx
	imul	r14d, eax
	imul	ebx, eax
.L7:
	cmp	DWORD PTR 48[rbp], r14d
	jg	.L37
.L1:
	add	rsp, 40
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	mov	edi, DWORD PTR 64[rbp]
	mov	esi, r14d
	call	TIFFhowmany_32@PLT
	mov	esi, eax
	test	eax, eax
	je	.L1
	mov	rax, QWORD PTR O_RDONLY[rip]
	cmp	QWORD PTR 0[rbp], rax
	jne	.L9
	cmp	esi, 1000000
	jg	.L38
.L9:
	lea	rcx, .LC0[rip]
	mov	edx, 4
	mov	rdi, rbp
	mov	DWORD PTR 20[rsp], esi
	call	_TIFFCheckMalloc@PLT
	mov	esi, DWORD PTR 20[rsp]
	mov	edx, 4
	mov	rdi, rbp
	lea	rcx, .LC1[rip]
	mov	QWORD PTR 24[rsp], rax
	mov	QWORD PTR 8[rsp], rax
	call	_TIFFCheckMalloc@PLT
	mov	r8, QWORD PTR 8[rsp]
	mov	r15, rax
	mov	rdx, rax
	test	r8, r8
	je	.L14
	test	rax, rax
	je	.L11
	mov	esi, DWORD PTR 20[rsp]
	test	esi, esi
	jle	.L13
.L12:
	xor	eax, eax
	xor	ecx, ecx
	.p2align 4,,10
	.p2align 3
.L16:
	cmp	ebx, r12d
	mov	edx, ecx
	cmovg	ebx, r12d
	test	ebx, ebx
	mov	DWORD PTR [r8+rax*4], ebx
	cmovne	edx, r13d
	add	r13d, ebx
	sub	r12d, ebx
	mov	DWORD PTR [r15+rax*4], edx
	add	rax, 1
	cmp	esi, eax
	jg	.L16
.L13:
	mov	DWORD PTR 56[rbp], esi
	mov	edx, r14d
	mov	rdi, rbp
	mov	DWORD PTR 52[rbp], esi
	mov	esi, DWORD PTR TIFFTAG_ROWSPERSTRIP[rip]
	mov	QWORD PTR 8[rsp], r8
	call	TIFFSetField@PLT
	mov	rdi, QWORD PTR 8[rbp]
	call	_TIFFfree@PLT
	mov	rdi, QWORD PTR 16[rbp]
	call	_TIFFfree@PLT
	mov	r8, QWORD PTR 8[rsp]
	mov	QWORD PTR 16[rbp], r15
	mov	DWORD PTR 60[rbp], 1
	mov	QWORD PTR 8[rbp], r8
	add	rsp, 40
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rdi, rbp
	call	isUpSampled@PLT
	test	eax, eax
	jne	.L6
	mov	rax, QWORD PTR 40[rbp]
	mov	r14d, DWORD PTR 4[rax]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	cmp	QWORD PTR 24[rsp], 0
	je	.L14
	mov	rdi, r8
	mov	QWORD PTR 8[rsp], rdx
	call	_TIFFfree@PLT
	mov	rdx, QWORD PTR 8[rsp]
.L14:
	test	rdx, rdx
	je	.L1
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r15
	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
	jmp	_TIFFfree@PLT
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	mov	rdi, rbp
	mov	DWORD PTR 8[rsp], esi
	call	TIFFGetFileSize@PLT
	cmp	eax, r13d
	jle	.L1
	mov	rdi, rbp
	call	TIFFGetFileSize@PLT
	mov	esi, DWORD PTR 8[rsp]
	sub	eax, r13d
	lea	ecx, -1[rsi]
	cdq
	idiv	ecx
	cmp	eax, ebx
	jl	.L1
	lea	rcx, .LC0[rip]
	mov	edx, 4
	mov	rdi, rbp
	mov	DWORD PTR 20[rsp], esi
	call	_TIFFCheckMalloc@PLT
	mov	esi, DWORD PTR 20[rsp]
	mov	edx, 4
	mov	rdi, rbp
	lea	rcx, .LC1[rip]
	mov	QWORD PTR 24[rsp], rax
	mov	QWORD PTR 8[rsp], rax
	call	_TIFFCheckMalloc@PLT
	mov	r8, QWORD PTR 8[rsp]
	test	rax, rax
	mov	rdx, rax
	mov	r15, rax
	je	.L11
	cmp	QWORD PTR 24[rsp], 0
	mov	esi, DWORD PTR 20[rsp]
	jne	.L12
	jmp	.L14
	.cfi_endproc
.LFE0:
	.size	ChopUpSingleUncompressedStrip, .-ChopUpSingleUncompressedStrip
	.comm	TIFFTAG_ROWSPERSTRIP,4,4
	.comm	STRIP_SIZE_DEFAULT,4,4
	.comm	PLANARCONFIG_CONTIG,8,8
	.comm	PHOTOMETRIC_YCBCR,8,8
	.comm	O_RDONLY,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_tif_dirread.c_ChopUpSingleUncompressedStrip.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"for chopped \"StripByteCounts\" array\000"
	.align	2
.LC1:
	.ascii	"for chopped \"StripOffsets\" array\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ChopUpSingleUncompressedStrip, %function
ChopUpSingleUncompressedStrip:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r0, #4]
	mov	r5, r0
	ldr	r6, [r3]
	sub	sp, sp, #12
	cmp	r6, #0
	bne	.L2
	ldr	r3, .L34
	ldr	r2, [r0]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L1
.L2:
	ldr	r3, .L34+4
	ldr	r0, [r5, #12]
	ldr	r2, [r3]
	ldr	r3, [r5, #8]
	sub	r0, r0, r2
	clz	r0, r0
	lsr	r0, r0, #5
	ldr	r7, [r3]
	bl	assert
	ldr	r3, .L34+8
	ldr	r2, [r5, #16]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L4
.L6:
	mov	r9, #1
.L5:
	mov	r1, r9
	mov	r0, r5
	bl	TIFFVTileSize64
	mov	r4, r0
	ldr	r3, .L34+12
	ldr	r0, [r3]
	cmp	r0, r4
	blt	.L7
	cmp	r4, #0
	ble	.L1
	mov	r1, r4
	bl	__aeabi_idiv
	mul	r9, r0, r9
	mul	r4, r0, r4
.L7:
	ldr	r3, [r5, #24]
	cmp	r3, r9
	bgt	.L31
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L31:
	mov	r1, r9
	ldr	r0, [r5, #40]
	bl	TIFFhowmany_32
	subs	r8, r0, #0
	beq	.L1
	ldr	r2, .L34
	ldr	r3, [r5]
	ldr	r1, [r2]
	ldr	r2, .L34+16
	sub	r3, r3, r1
	clz	r3, r3
	cmp	r8, r2
	lsr	r3, r3, #5
	movle	r3, #0
	cmp	r3, #0
	bne	.L32
	mov	r2, #4
	mov	r1, r8
	ldr	r3, .L34+20
	mov	r0, r5
	bl	_TIFFCheckMalloc
	mov	r2, #4
	mov	r10, r0
	mov	r1, r8
	mov	r0, r5
	ldr	r3, .L34+24
	bl	_TIFFCheckMalloc
	cmp	r0, #0
	cmpne	r10, #0
	mov	fp, r0
	mov	r2, r0
	str	r10, [sp, #4]
	beq	.L11
	cmp	r8, #0
	ble	.L13
.L12:
	mov	r2, #0
	sub	r0, r10, #4
	sub	r1, fp, #4
.L16:
	cmp	r4, r6
	movge	r4, r6
	cmp	r4, #0
	movne	ip, r7
	moveq	ip, #0
	add	r2, r2, #1
	cmp	r8, r2
	str	r4, [r0, #4]!
	sub	r6, r6, r4
	str	ip, [r1, #4]!
	add	r7, r7, r4
	bgt	.L16
.L13:
	ldr	r1, .L34+28
	mov	r2, r9
	ldr	r1, [r1]
	mov	r0, r5
	str	r8, [r5, #32]
	str	r8, [r5, #28]
	bl	TIFFSetField
	ldr	r0, [r5, #4]
	bl	_TIFFfree
	ldr	r0, [r5, #8]
	bl	_TIFFfree
	mov	r2, #1
	stmib	r5, {r10, fp}
	str	r2, [r5, #36]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	mov	r0, r5
	bl	isUpSampled
	cmp	r0, #0
	bne	.L6
	ldr	r3, [r5, #20]
	ldr	r9, [r3, #4]
	b	.L5
.L32:
	mov	r0, r5
	bl	TIFFGetFileSize
	cmp	r0, r7
	ble	.L1
	mov	r0, r5
	bl	TIFFGetFileSize
	sub	r1, r8, #1
	sub	r0, r0, r7
	bl	__aeabi_idiv
	cmp	r0, r4
	blt	.L1
	mov	r2, #4
	mov	r1, r8
	ldr	r3, .L34+20
	mov	r0, r5
	bl	_TIFFCheckMalloc
	mov	fp, r0
	mov	r2, #4
	mov	r1, r8
	mov	r0, r5
	ldr	r3, .L34+24
	str	fp, [sp, #4]
	bl	_TIFFCheckMalloc
	cmp	fp, #0
	cmpne	r0, #0
	mov	r10, fp
	mov	r2, r0
	mov	fp, r0
	bne	.L12
.L11:
	ldr	r3, [sp, #4]
	cmp	r3, #0
	bne	.L33
.L14:
	cmp	r2, #0
	beq	.L1
	mov	r0, fp
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	_TIFFfree
.L33:
	mov	r0, r10
	str	r2, [sp, #4]
	bl	_TIFFfree
	ldr	r2, [sp, #4]
	b	.L14
.L35:
	.align	2
.L34:
	.word	O_RDONLY
	.word	PLANARCONFIG_CONTIG
	.word	PHOTOMETRIC_YCBCR
	.word	STRIP_SIZE_DEFAULT
	.word	1000000
	.word	.LC0
	.word	.LC1
	.word	TIFFTAG_ROWSPERSTRIP
	.size	ChopUpSingleUncompressedStrip, .-ChopUpSingleUncompressedStrip
	.comm	TIFFTAG_ROWSPERSTRIP,4,4
	.comm	STRIP_SIZE_DEFAULT,4,4
	.comm	PLANARCONFIG_CONTIG,4,4
	.comm	PHOTOMETRIC_YCBCR,4,4
	.comm	O_RDONLY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
