	.file	"extr_vf_deshake_opencl.c_optimize_model.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	optimize_model, @function
optimize_model:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	r15d, -1[rcx]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xor	r12d, r12d
	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
	mov	ebx, ecx
	sub	rsp, 120
	.cfi_def_cfa_offset 176
	movss	xmm7, DWORD PTR .LC0[rip]
	mov	QWORD PTR 24[rsp], rdx
	lea	r14, 48[rsp]
	mov	QWORD PTR 8[rsp], r8
	movaps	xmm2, xmm7
	movss	DWORD PTR 32[rsp], xmm0
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rax
	xor	eax, eax
	lea	rax, 0[0+r15*8]
	mov	DWORD PTR 36[rsp], 0
	mov	r15d, 1
	mov	QWORD PTR 40[rsp], rax
	movss	DWORD PTR 20[rsp], xmm7
	.p2align 4,,10
	.p2align 3
.L15:
	mov	rax, QWORD PTR 0[r13]
	test	r15d, r15d
	je	.L2
	movss	xmm0, DWORD PTR [rax]
	addss	xmm0, xmm2
	movss	DWORD PTR [rax], xmm0
.L3:
	mov	rsi, r14
	mov	rdi, r13
	movss	DWORD PTR 16[rsp], xmm2
	call	run_estimate_kernel@PLT
	mov	rcx, QWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 24[rsp]
	mov	esi, ebx
	mov	rdx, r14
	call	compute_error@PLT
	test	ebx, ebx
	movss	xmm2, DWORD PTR 16[rsp]
	jle	.L17
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 40[rsp]
	pxor	xmm0, xmm0
	lea	rsi, [rax+rdi]
	.p2align 4,,10
	.p2align 3
.L5:
	pxor	xmm1, xmm1
	mov	rcx, rax
	add	rax, 8
	cvtsi2ss	xmm1, QWORD PTR -8[rax]
	addss	xmm0, xmm1
	cmp	rcx, rsi
	jne	.L5
.L4:
	movss	xmm3, DWORD PTR 32[rsp]
	comiss	xmm3, xmm0
	ja	.L26
	mov	rcx, QWORD PTR 0[r13]
	mov	eax, r12d
	sub	eax, DWORD PTR 36[rsp]
	movss	xmm0, DWORD PTR [rcx]
	test	r15d, r15d
	je	.L10
	subss	xmm0, xmm2
	movss	DWORD PTR [rcx], xmm0
	cmp	eax, 4
	jg	.L1
	movaps	xmm0, xmm2
	xorps	xmm0, XMMWORD PTR .LC2[rip]
.L14:
	pxor	xmm4, xmm4
	xor	r15d, r15d
	comiss	xmm4, xmm2
	movaps	xmm2, xmm0
	setbe	r15b
.L9:
	add	r12d, 1
	cmp	r12d, 200
	jne	.L15
.L1:
	mov	rax, QWORD PTR 104[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	add	rsp, 120
	.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
.L2:
	.cfi_restore_state
	movss	xmm0, DWORD PTR 20[rsp]
	addss	xmm0, DWORD PTR [rax]
	movss	DWORD PTR [rax], xmm0
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	subss	xmm0, DWORD PTR 20[rsp]
	movss	DWORD PTR [rcx], xmm0
	cmp	eax, 4
	jg	.L1
	movss	xmm5, DWORD PTR 20[rsp]
	xorps	xmm5, XMMWORD PTR .LC2[rip]
	movaps	xmm0, xmm2
	movss	DWORD PTR 20[rsp], xmm5
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L26:
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L8:
	movsd	xmm1, QWORD PTR [r14+rax]
	mov	rdx, QWORD PTR 8[rsp]
	movsd	QWORD PTR [rdx+rax], xmm1
	add	rax, 8
	cmp	rax, 48
	jne	.L8
	mov	DWORD PTR 36[rsp], r12d
	movss	DWORD PTR 32[rsp], xmm0
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L17:
	pxor	xmm0, xmm0
	jmp	.L4
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	optimize_model, .-optimize_model
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	1008981770
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	2147483648
	.long	0
	.long	0
	.long	0
	.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_vf_deshake_opencl.c_optimize_model.c"
	.text
	.global	__aeabi_fadd
	.global	__aeabi_i2f
	.global	__aeabi_fcmplt
	.global	__aeabi_fsub
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	optimize_model, %function
optimize_model:
	@ args = 8, pretend = 0, frame = 80
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r3
	mov	r6, #0
	mov	r8, r1
	mov	r5, #1
	ldr	r7, .L29
	sub	sp, sp, #84
	ldr	r3, .L29+4
	str	r2, [sp, #8]
	str	r7, [sp]	@ float
	str	r0, [sp, #4]
	ldr	r3, [r3]
	str	r3, [sp, #76]
	mov	r3,#0
	ldr	r2, [sp, #124]
	lsl	r3, r10, #2
	sub	r3, r3, #4
	str	r6, [sp, #12]
	str	r2, [sp, #20]
	str	r3, [sp, #16]
.L16:
	ldr	r4, [r8]
	cmp	r5, #0
	ldreq	r1, [sp]	@ float
	movne	r1, r7
	ldr	r0, [r4]	@ float
	bl	__aeabi_fadd
	add	r1, sp, #24
	str	r0, [r4]	@ float
	mov	r0, r8
	bl	run_estimate_kernel
	ldr	r4, [sp, #4]
	mov	r1, r10
	ldr	r3, [r4]
	ldr	r0, [sp, #8]
	add	r2, sp, #24
	bl	compute_error
	cmp	r10, #0
	mov	fp, #0
	ble	.L4
	ldr	r4, [r4]
	ldr	r3, [sp, #16]
	sub	r9, r4, #4
	add	r4, r4, r3
.L5:
	ldr	r0, [r9, #4]!
	bl	__aeabi_i2f
	mov	r1, r0
	mov	r0, fp
	bl	__aeabi_fadd
	cmp	r4, r9
	mov	fp, r0
	bne	.L5
.L4:
	mov	r0, fp
	ldr	r1, [sp, #120]	@ float
	bl	__aeabi_fcmplt
	cmp	r0, #0
	bne	.L27
	ldr	r3, [sp, #12]
	cmp	r5, #0
	sub	r4, r6, r3
	ldr	r5, [r8]
	beq	.L10
	ldr	r0, [r5]	@ float
	mov	r1, r7
	bl	__aeabi_fsub
	cmp	r4, #4
	str	r0, [r5]	@ float
	bgt	.L1
	add	r4, r7, #-2147483648
.L14:
	mov	r0, r7
	mov	r1, #0
	bl	__aeabi_fcmplt
	clz	r5, r0
	mov	r7, r4
	lsr	r5, r5, #5
.L9:
	add	r6, r6, #1
	cmp	r6, #200
	bne	.L16
.L1:
	ldr	r3, .L29+4
	ldr	r2, [r3]
	ldr	r3, [sp, #76]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	add	sp, sp, #84
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	ldr	r0, [r5]	@ float
	ldr	r1, [sp]	@ float
	bl	__aeabi_fsub
	cmp	r4, #4
	str	r0, [r5]	@ float
	bgt	.L1
	ldr	r3, [sp]
	mov	r4, r7
	add	r3, r3, #-2147483648
	str	r3, [sp]	@ float
	b	.L14
.L27:
	ldr	r3, [sp, #20]
	add	ip, sp, #24
	mov	r2, r3
	add	lr, r3, #48
.L8:
	ldmia	ip!, {r0-r1}
	stm	r2!, {r0-r1}
	cmp	r2, lr
	bne	.L8
	str	fp, [sp, #120]	@ float
	str	r6, [sp, #12]
	b	.L9
.L28:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	1008981770
	.word	.LC0
	.size	optimize_model, .-optimize_model
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
