	.file	"extr_alps.c_alps_process_bitmap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	alps_process_bitmap, @function
alps_process_bitmap:
.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
	sub	rsp, 120
	.cfi_def_cfa_offset 160
	mov	r12d, DWORD PTR 20[rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 8[rsp], 0
	mov	DWORD PTR 12[rsp], 0
	mov	QWORD PTR 16[rsp], 0
	mov	DWORD PTR 24[rsp], 0
	mov	QWORD PTR 28[rsp], 0
	mov	DWORD PTR 36[rsp], 0
	mov	QWORD PTR 40[rsp], 0
	mov	DWORD PTR 48[rsp], 0
	mov	QWORD PTR 52[rsp], 0
	mov	DWORD PTR 60[rsp], 0
	test	r12d, r12d
	je	.L1
	mov	eax, DWORD PTR 16[rsi]
	mov	rbx, rsi
	test	eax, eax
	jne	.L23
	xor	r12d, r12d
.L1:
	mov	rax, QWORD PTR 104[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L24
	add	rsp, 120
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L23:
	.cfi_restore_state
	lea	rcx, 8[rsp]
	lea	rdx, 28[rsp]
	mov	rbp, rdi
	mov	edi, r12d
	lea	rsi, 16[rsp]
	call	alps_get_bitmap_points@PLT
	mov	edi, DWORD PTR 16[rbx]
	lea	rcx, 12[rsp]
	lea	rdx, 52[rsp]
	lea	rsi, 40[rsp]
	call	alps_get_bitmap_points@PLT
	mov	esi, DWORD PTR 12[rsp]
	mov	edi, DWORD PTR 8[rsp]
	call	max@PLT
	cmp	DWORD PTR 8[rsp], 1
	mov	r12d, eax
	je	.L25
.L3:
	cmp	DWORD PTR 12[rsp], 1
	mov	r10d, DWORD PTR 40[rsp]
	mov	r13d, DWORD PTR 44[rsp]
	je	.L4
	mov	r11d, DWORD PTR 52[rsp]
.L5:
	mov	eax, DWORD PTR 4[rbp]
	mov	edx, DWORD PTR 20[rsp]
	mov	edi, DWORD PTR 0[rbp]
	mov	ecx, DWORD PTR 8[rbp]
	lea	r9d, -2[rax+rax]
	mov	eax, DWORD PTR 16[rsp]
	lea	eax, -1[rax+rdx*2]
	imul	eax, edi
	cdq
	idiv	r9d
	mov	r8d, eax
	mov	DWORD PTR 64[rsp], eax
	mov	eax, DWORD PTR 12[rbp]
	mov	DWORD PTR 88[rsp], r8d
	lea	esi, -2[rax+rax]
	lea	eax, -1[r10+r13*2]
	imul	eax, ecx
	cdq
	idiv	esi
	mov	edx, DWORD PTR 32[rsp]
	mov	r10d, eax
	mov	DWORD PTR 68[rsp], eax
	mov	eax, DWORD PTR 28[rsp]
	mov	DWORD PTR 76[rsp], r10d
	lea	eax, -1[rax+rdx*2]
	imul	eax, edi
	cdq
	idiv	r9d
	mov	DWORD PTR 72[rsp], eax
	mov	r9d, eax
	mov	DWORD PTR 80[rsp], eax
	mov	eax, DWORD PTR 56[rsp]
	lea	eax, -1[r11+rax*2]
	imul	eax, ecx
	cdq
	idiv	esi
	mov	DWORD PTR 84[rsp], eax
	mov	DWORD PTR 92[rsp], eax
	mov	rax, QWORD PTR 16[rbp]
	cmp	rax, QWORD PTR ALPS_PROTO_V5[rip]
	jne	.L6
	mov	edx, edi
	sub	edi, r9d
	sub	edx, r8d
	mov	DWORD PTR 72[rsp], edi
	mov	DWORD PTR 64[rsp], edx
	mov	DWORD PTR 80[rsp], edi
	mov	DWORD PTR 88[rsp], edx
.L6:
	cmp	rax, QWORD PTR ALPS_PROTO_V3[rip]
	je	.L7
	cmp	rax, QWORD PTR ALPS_PROTO_V4[rip]
	je	.L7
	mov	eax, DWORD PTR 24[rbp]
	cmp	eax, -1
	je	.L26
.L9:
	cdqe
	mov	rdx, QWORD PTR [rbx]
	mov	rcx, QWORD PTR 8[rbx]
	mov	rax, QWORD PTR 64[rsp+rax*8]
	mov	QWORD PTR [rdx], rcx
	mov	QWORD PTR 8[rdx], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	lea	rax, 64[rsp]
	lea	rsi, 96[rsp]
.L10:
	mov	edx, ecx
	sub	edx, DWORD PTR 4[rax]
	add	rax, 8
	mov	DWORD PTR -4[rax], edx
	cmp	rax, rsi
	jne	.L10
	mov	eax, DWORD PTR 24[rbp]
	cmp	eax, -1
	jne	.L9
.L26:
	mov	r9d, DWORD PTR 8[rbx]
	mov	r8d, DWORD PTR 12[rbx]
	lea	rcx, 64[rsp]
	xor	esi, esi
	mov	edi, 2147483647
.L13:
	mov	eax, r9d
	mov	edx, r8d
	sub	eax, DWORD PTR [rcx]
	sub	edx, DWORD PTR 4[rcx]
	imul	eax, eax
	imul	edx, edx
	add	eax, edx
	cmp	eax, edi
	jge	.L12
	mov	DWORD PTR 24[rbp], esi
	mov	edi, eax
.L12:
	add	esi, 1
	add	rcx, 8
	cmp	esi, 4
	jne	.L13
	mov	eax, DWORD PTR 24[rbp]
	add	eax, 2
	cdq
	shr	edx, 30
	add	eax, edx
	and	eax, 3
	sub	eax, edx
	mov	DWORD PTR 24[rbp], eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	lea	eax, -1[r10]
	mov	esi, 1
	mov	edi, eax
	shr	edi, 31
	add	edi, eax
	sar	edi
	sub	r10d, edi
	add	r13d, edi
	mov	DWORD PTR 40[rsp], r10d
	mov	DWORD PTR 56[rsp], r13d
	call	max@PLT
	mov	r13d, DWORD PTR 44[rsp]
	mov	r10d, DWORD PTR 40[rsp]
	mov	DWORD PTR 52[rsp], eax
	mov	r11d, eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	mov	eax, DWORD PTR 16[rsp]
	mov	esi, 1
	lea	edx, -1[rax]
	mov	edi, edx
	shr	edi, 31
	add	edi, edx
	sar	edi
	sub	eax, edi
	mov	DWORD PTR 16[rsp], eax
	mov	eax, DWORD PTR 20[rsp]
	add	eax, edi
	mov	DWORD PTR 32[rsp], eax
	call	max@PLT
	mov	DWORD PTR 28[rsp], eax
	jmp	.L3
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	alps_process_bitmap, .-alps_process_bitmap
	.comm	ALPS_PROTO_V5,8,8
	.comm	ALPS_PROTO_V4,8,8
	.comm	ALPS_PROTO_V3,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_alps.c_alps_process_bitmap.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alps_process_bitmap, %function
alps_process_bitmap:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r6, [r1, #16]
	ldr	r2, .L27
	sub	sp, sp, #108
	cmp	r6, r3
	ldr	r2, [r2]
	str	r2, [sp, #100]
	mov	r2,#0
	str	r3, [sp, #12]
	str	r3, [sp, #16]
	str	r3, [sp, #20]
	str	r3, [sp, #32]
	str	r3, [sp, #44]
	str	r3, [sp, #56]
	str	r3, [sp, #24]
	str	r3, [sp, #28]
	str	r3, [sp, #36]
	str	r3, [sp, #40]
	str	r3, [sp, #48]
	str	r3, [sp, #52]
	str	r3, [sp, #60]
	str	r3, [sp, #64]
	beq	.L1
	ldr	r3, [r1, #12]
	mov	r4, r1
	cmp	r3, #0
	moveq	r6, r3
	bne	.L23
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #100]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	mov	r0, r6
	add	sp, sp, #108
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	add	r2, sp, #32
	add	r1, sp, #20
	add	r3, sp, #12
	mov	r5, r0
	mov	r0, r6
	bl	alps_get_bitmap_points
	add	r2, sp, #56
	add	r1, sp, #44
	add	r3, sp, #16
	ldr	r0, [r4, #12]
	bl	alps_get_bitmap_points
	ldr	r1, [sp, #16]
	ldr	r0, [sp, #12]
	bl	max
	ldr	r1, [sp, #12]
	mov	r6, r0
	cmp	r1, #1
	beq	.L25
.L3:
	ldr	r1, [sp, #16]
	ldr	r7, [sp, #44]
	cmp	r1, #1
	ldr	r9, [sp, #48]
	beq	.L4
	ldr	fp, [sp, #56]
.L5:
	ldr	r3, [sp, #24]
	ldr	r8, [r5, #4]
	ldr	r0, [sp, #20]
	ldr	r10, [r5]
	add	r0, r0, r3, lsl #1
	sub	r8, r8, #1
	lsl	r8, r8, #1
	sub	r0, r0, #1
	mov	r1, r8
	mul	r0, r10, r0
	bl	__aeabi_idiv
	mov	r3, r0
	ldr	r2, [r5, #12]
	add	r7, r7, r9, lsl #1
	sub	r2, r2, #1
	ldr	r9, [r5, #8]
	lsl	r2, r2, #1
	sub	r7, r7, #1
	mov	r1, r2
	mul	r0, r9, r7
	str	r3, [sp, #68]
	str	r3, [sp]
	str	r2, [sp, #4]
	bl	__aeabi_idiv
	mov	r7, r0
	ldr	ip, [sp, #36]
	ldr	r0, [sp, #32]
	mov	r1, r8
	add	r0, r0, ip, lsl #1
	sub	r0, r0, #1
	mul	r0, r10, r0
	str	r7, [sp, #72]
	bl	__aeabi_idiv
	mov	r8, r0
	ldr	r0, [sp, #60]
	ldr	r2, [sp, #4]
	add	r0, fp, r0, lsl #1
	sub	r0, r0, #1
	mov	r1, r2
	mul	r0, r9, r0
	str	r7, [sp, #80]
	str	r8, [sp, #76]
	str	r8, [sp, #84]
	bl	__aeabi_idiv
	ldr	r1, .L27+4
	ldr	r2, [r5, #16]
	ldr	r1, [r1]
	ldr	r3, [sp]
	cmp	r2, r1
	str	r3, [sp, #92]
	str	r0, [sp, #88]
	str	r0, [sp, #96]
	bne	.L6
	sub	r3, r10, r3
	sub	r10, r10, r8
	str	r3, [sp, #68]
	str	r3, [sp, #92]
	str	r10, [sp, #76]
	str	r10, [sp, #84]
.L6:
	ldr	r3, .L27+8
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L7
	ldr	r3, .L27+12
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L7
	ldr	r3, [r5, #20]
	cmn	r3, #1
	beq	.L26
.L9:
	ldr	r2, [r4], #4
	add	r1, sp, #104
	add	r3, r1, r3, lsl #3
	ldm	r4, {r0, r1}
	stm	r2, {r0, r1}
	ldr	r1, [r3, #-32]
	ldr	r0, [r3, #-36]
	add	r2, r2, #8
	stm	r2, {r0, r1}
	b	.L1
.L7:
	add	r3, sp, #68
	add	r1, sp, #100
.L10:
	ldr	r2, [r3, #4]
	add	r3, r3, #8
	sub	r2, r9, r2
	str	r2, [r3, #-4]
	cmp	r3, r1
	bne	.L10
	ldr	r3, [r5, #20]
	cmn	r3, #1
	bne	.L9
.L26:
	mvn	lr, #-2147483648
	mov	ip, #0
	ldr	r8, [r4, #4]
	ldr	r7, [r4, #8]
	add	r0, sp, #68
.L13:
	ldm	r0, {r2, r3}
	sub	r3, r7, r3
	mul	r1, r3, r3
	sub	r3, r8, r2
	mov	r2, r3
	mla	r2, r3, r2, r1
	cmp	r2, lr
	strlt	ip, [r5, #20]
	add	ip, ip, #1
	movlt	lr, r2
	cmp	ip, #4
	add	r0, r0, #8
	bne	.L13
	ldr	r3, [r5, #20]
	add	r3, r3, #2
	rsbs	r2, r3, #0
	and	r2, r2, #3
	and	r3, r3, #3
	rsbpl	r3, r2, #0
	str	r3, [r5, #20]
	b	.L9
.L4:
	sub	r0, r7, #1
	add	r0, r0, r0, lsr #31
	sub	r3, r7, r0, asr #1
	add	r7, r9, r0, asr #1
	asr	r0, r0, #1
	str	r7, [sp, #60]
	str	r3, [sp, #44]
	bl	max
	ldr	r9, [sp, #48]
	mov	fp, r0
	ldr	r7, [sp, #44]
	str	r0, [sp, #56]
	b	.L5
.L25:
	ldr	r3, [sp, #20]
	ldr	r2, [sp, #24]
	sub	r0, r3, #1
	add	r0, r0, r0, lsr #31
	sub	r3, r3, r0, asr #1
	add	r2, r2, r0, asr #1
	asr	r0, r0, #1
	str	r3, [sp, #20]
	str	r2, [sp, #36]
	bl	max
	str	r0, [sp, #32]
	b	.L3
.L24:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC0
	.word	ALPS_PROTO_V5
	.word	ALPS_PROTO_V3
	.word	ALPS_PROTO_V4
	.size	alps_process_bitmap, .-alps_process_bitmap
	.comm	ALPS_PROTO_V5,4,4
	.comm	ALPS_PROTO_V4,4,4
	.comm	ALPS_PROTO_V3,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
