	.file	"948588.c"
	.intel_syntax noprefix
	.text
	.globl	estimateBlackPoint
	.type	estimateBlackPoint, @function
estimateBlackPoint:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -72[rbp], rdi
	mov	DWORD PTR -76[rbp], esi
	mov	eax, DWORD PTR -76[rbp]
	mov	DWORD PTR -24[rbp], eax
	mov	DWORD PTR -64[rbp], 0
	mov	DWORD PTR -60[rbp], 0
	mov	DWORD PTR -56[rbp], 0
	mov	DWORD PTR -52[rbp], 0
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -56[rbp], eax
	jge	.L3
	mov	eax, DWORD PTR -52[rbp]
	mov	DWORD PTR -60[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -56[rbp], eax
.L3:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -64[rbp], eax
	jge	.L4
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -64[rbp], eax
.L4:
	add	DWORD PTR -52[rbp], 1
.L2:
	mov	eax, DWORD PTR -52[rbp]
	cmp	eax, DWORD PTR -24[rbp]
	jl	.L5
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -44[rbp], 0
	mov	DWORD PTR -40[rbp], 0
	jmp	.L6
.L8:
	mov	eax, DWORD PTR -40[rbp]
	sub	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	imul	eax, DWORD PTR -8[rbp]
	mov	edx, DWORD PTR -8[rbp]
	imul	eax, edx
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -44[rbp]
	jle	.L7
	mov	eax, DWORD PTR -40[rbp]
	mov	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR -44[rbp], eax
.L7:
	add	DWORD PTR -40[rbp], 1
.L6:
	mov	eax, DWORD PTR -40[rbp]
	cmp	eax, DWORD PTR -24[rbp]
	jl	.L8
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, DWORD PTR -48[rbp]
	jle	.L9
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -48[rbp]
	mov	DWORD PTR -60[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -48[rbp], eax
.L9:
	mov	eax, DWORD PTR -24[rbp]
	lea	edx, 15[rax]
	test	eax, eax
	mov	eax, DWORD PTR -48[rbp]
	sub	eax, 1
	mov	DWORD PTR -36[rbp], eax
	mov	DWORD PTR -32[rbp], -1
	mov	eax, DWORD PTR -48[rbp]
	sub	eax, 1
	mov	DWORD PTR -28[rbp], eax
	jmp	.L10
.L12:
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	imul	eax, eax
	mov	edx, eax
	mov	eax, DWORD PTR -48[rbp]
	sub	eax, DWORD PTR -28[rbp]
	imul	eax, edx
	mov	edx, DWORD PTR -28[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -72[rbp]
	add	rdx, rcx
	mov	ecx, DWORD PTR [rdx]
	mov	edx, DWORD PTR -64[rbp]
	sub	edx, ecx
	imul	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	jle	.L11
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -32[rbp], eax
.L11:
	sub	DWORD PTR -28[rbp], 1
.L10:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -60[rbp]
	jg	.L12
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 3
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	estimateBlackPoint, .-estimateBlackPoint
	.globl	globalHistogramThreshold
	.type	globalHistogramThreshold, @function
globalHistogramThreshold:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	QWORD PTR -72[rbp], rdi
	mov	DWORD PTR -76[rbp], esi
	mov	DWORD PTR -80[rbp], edx
	mov	QWORD PTR -88[rbp], rcx
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 128
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -56[rbp], 1
	jmp	.L15
.L18:
	mov	eax, DWORD PTR -80[rbp]
	imul	eax, DWORD PTR -56[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	sal	eax, 2
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	imul	eax, DWORD PTR -76[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -52[rbp], eax
	jmp	.L16
.L17:
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, DWORD PTR -52[rbp]
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	sar	eax, 3
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	add	edx, 1
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -52[rbp], 1
.L16:
	mov	eax, DWORD PTR -52[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L17
	add	DWORD PTR -56[rbp], 1
.L15:
	cmp	DWORD PTR -56[rbp], 4
	jle	.L18
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 32
	mov	rdi, rax
	call	estimateBlackPoint
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	add	eax, 31
	lea	edx, 31[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 5
	mov	DWORD PTR -36[rbp], eax
	mov	DWORD PTR -48[rbp], 0
	jmp	.L19
.L23:
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, DWORD PTR -76[rbp]
	mov	DWORD PTR -32[rbp], eax
	mov	DWORD PTR -44[rbp], 0
	jmp	.L20
.L22:
	mov	edx, DWORD PTR -32[rbp]
	mov	eax, DWORD PTR -44[rbp]
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jge	.L21
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, DWORD PTR -36[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -44[rbp]
	lea	edx, 31[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 5
	mov	edi, eax
	lea	eax, [rdi+rcx]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	and	eax, 31
	mov	esi, 1
	mov	ecx, eax
	sal	esi, cl
	mov	ecx, esi
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, DWORD PTR -36[rbp]
	add	eax, edi
	cdqe
	lea	rsi, 0[0+rax*4]
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rsi
	or	edx, ecx
	mov	DWORD PTR [rax], edx
.L21:
	add	DWORD PTR -44[rbp], 1
.L20:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, DWORD PTR -76[rbp]
	jl	.L22
	add	DWORD PTR -48[rbp], 1
.L19:
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, DWORD PTR -80[rbp]
	jl	.L23
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	globalHistogramThreshold, .-globalHistogramThreshold
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"948588.c"
	.text
	.align	2
	.global	estimateBlackPoint
	.syntax unified
	.arm
	.fpu softvfp
	.type	estimateBlackPoint, %function
estimateBlackPoint:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #76
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, [fp, #-76]
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-68]
	mov	r3, #0
	str	r3, [fp, #-64]
	mov	r3, #0
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L2
.L5:
	ldr	r3, [fp, #-56]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-60]
	cmp	r2, r3
	bge	.L3
	ldr	r3, [fp, #-56]
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-56]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-60]
.L3:
	ldr	r3, [fp, #-56]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-68]
	cmp	r2, r3
	bge	.L4
	ldr	r3, [fp, #-56]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-68]
.L4:
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L2:
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L5
	mov	r3, #0
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L6
.L8:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-64]
	sub	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	mul	r2, r3, r2
	ldr	r3, [fp, #-12]
	mul	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	ble	.L7
	ldr	r3, [fp, #-44]
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-48]
.L7:
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L6:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L8
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	ble	.L9
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-52]
.L9:
	ldr	r3, [fp, #-28]
	add	r2, r3, #15
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	ldr	r3, [fp, #-52]
	sub	r3, r3, #1
	str	r3, [fp, #-40]
	mvn	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-52]
	sub	r3, r3, #1
	str	r3, [fp, #-32]
	b	.L10
.L12:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-64]
	sub	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	mov	r2, r3
	mul	r2, r3, r2
	mov	r3, r2
	ldr	r1, [fp, #-52]
	ldr	r2, [fp, #-32]
	sub	r2, r1, r2
	mul	r3, r2, r3
	ldr	r2, [fp, #-32]
	lsl	r2, r2, #2
	ldr	r1, [fp, #-72]
	add	r2, r1, r2
	ldr	r2, [r2]
	ldr	r1, [fp, #-68]
	sub	r2, r1, r2
	mul	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-36]
	cmp	r2, r3
	ble	.L11
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-36]
.L11:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	str	r3, [fp, #-32]
.L10:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-64]
	cmp	r2, r3
	bgt	.L12
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	estimateBlackPoint, .-estimateBlackPoint
	.align	2
	.global	globalHistogramThreshold
	.syntax unified
	.arm
	.fpu softvfp
	.type	globalHistogramThreshold, %function
globalHistogramThreshold:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	str	r2, [fp, #-72]
	str	r3, [fp, #-76]
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-40]
	mov	r2, #128
	mov	r1, #0
	ldr	r0, [fp, #-40]
	bl	memset
	mov	r3, #1
	str	r3, [fp, #-56]
	b	.L15
.L18:
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-56]
	mul	r3, r2, r3
	ldr	r2, .L24
	smull	r1, r2, r3, r2
	asr	r2, r2, #1
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #2
	ldr	r2, .L24
	smull	r1, r2, r3, r2
	asr	r2, r2, #1
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-68]
	mul	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-68]
	ldr	r2, .L24
	smull	r1, r2, r3, r2
	asr	r2, r2, #1
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-52]
	b	.L16
.L17:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-52]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-64]
	add	r3, r3, r2
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	asr	r3, r3, #3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L16:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L17
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L15:
	ldr	r3, [fp, #-56]
	cmp	r3, #4
	ble	.L18
	mov	r1, #32
	ldr	r0, [fp, #-40]
	bl	estimateBlackPoint
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-68]
	add	r3, r3, #31
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L19
.L23:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-68]
	mul	r3, r2, r3
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L20
.L22:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-44]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-64]
	add	r3, r3, r2
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-24]
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-36]
	cmp	r2, r3
	bge	.L21
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-32]
	mul	r2, r3, r2
	ldr	r3, [fp, #-44]
	add	r1, r3, #31
	cmp	r3, #0
	movlt	r3, r1
	movge	r3, r3
	asr	r3, r3, #5
	add	r2, r3, r2
	lsl	r2, r2, #2
	ldr	r1, [fp, #-76]
	add	r2, r1, r2
	ldr	r1, [r2]
	ldr	r2, [fp, #-44]
	and	r2, r2, #31
	mov	r0, #1
	lsl	r2, r0, r2
	ldr	r0, [fp, #-48]
	ldr	ip, [fp, #-32]
	mul	r0, ip, r0
	add	r3, r3, r0
	lsl	r3, r3, #2
	ldr	r0, [fp, #-76]
	add	r3, r0, r3
	orr	r2, r1, r2
	str	r2, [r3]
.L21:
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L20:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	blt	.L22
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L19:
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-72]
	cmp	r2, r3
	blt	.L23
	ldr	r0, [fp, #-40]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	1717986919
	.size	globalHistogramThreshold, .-globalHistogramThreshold
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
