// File: /workspace/github_c_makefile_star2_O0/szanni[P]slideextract/slideextract.cpp
// Function: se_extract_slides
int
se_extract_slides(const char *file, const char *outprefix, struct roi *roi)
{
	int num = 0;
	char str[64];

	std::vector<int> image_properties;
	image_properties.push_back(IMWRITE_PNG_COMPRESSION);
	image_properties.push_back(9);

	Mat current;
	Mat last;

	VideoCapture capture = VideoCapture(file, CAP_ANY);
	if (!capture.isOpened())
		return -1;

	bool is_final_frame = false;
	while (!is_final_frame) {
		capture.read(current);

		is_final_frame = current.empty();
		bool is_changed_frame = !current.empty() && !last.empty()
			&& _se_compare_image (last, current, roi) <= 0.999;

		if (is_final_frame || is_changed_frame) {
			snprintf (str, sizeof(str)/sizeof(*str), "%s%d.png", outprefix, num++);
			imwrite(str, last, image_properties);
		}

		last = current.clone();
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x3ab0
movq -0x288(%rbp), %rdi
movl $0x10, -0x8c(%rbp)
leaq -0x8c(%rbp), %rsi
callq 0x3ad0
jmp 0x2fd0
movl $0x9, -0xa0(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3ad0
jmp 0x2fef
leaq -0x100(%rbp), %rdi
callq 0x2070
leaq -0x160(%rbp), %rdi
callq 0x2070
movq -0x10(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq -0x1b1(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x2100
movq -0x298(%rbp), %rsi
movq -0x290(%rbp), %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x3840
jmp 0x3041
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
xorl %edx, %edx
callq 0x2250
jmp 0x3058
leaq -0x1b0(%rbp), %rdi
callq 0x2190
leaq -0x1b1(%rbp), %rdi
callq 0x23a0
leaq -0x190(%rbp), %rdi
callq 0x20c0
movb %al, -0x299(%rbp)
jmp 0x3084
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0x311b
jmp 0x3094
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x1b8(%rbp)
jmp 0x33e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x3448
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x30f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x2190
leaq -0x1b1(%rbp), %rdi
callq 0x23a0
jmp 0x3430
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x3424
movb $0x0, -0x1b9(%rbp)
movb -0x1b9(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3133
jmp 0x33d7
leaq -0x1d8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x38f0
jmp 0x3148
leaq -0x190(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x2370
jmp 0x315d
leaq -0x1d8(%rbp), %rdi
callq 0x3950
leaq -0x100(%rbp), %rdi
callq 0x2170
movb %al, -0x29a(%rbp)
jmp 0x317d
movb -0x29a(%rbp), %al
andb $0x1, %al
movb %al, -0x1b9(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x2170
movb %al, -0x29b(%rbp)
jmp 0x319f
movb -0x29b(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x29c(%rbp)
jne 0x321b
jmp 0x31b4
leaq -0x160(%rbp), %rdi
callq 0x2170
movb %al, -0x29d(%rbp)
jmp 0x31c8
movb -0x29d(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x29c(%rbp)
jne 0x321b
jmp 0x31dd
movq -0x20(%rbp), %rdx
leaq -0x160(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3460
movsd %xmm0, -0x2a8(%rbp)
jmp 0x31fe
movsd -0x2a8(%rbp), %xmm1
movsd 0x1e02(%rip), %xmm0     # 0x5010
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x29c(%rbp)
movb -0x29c(%rbp), %al
andb $0x1, %al
movb %al, -0x1d9(%rbp)
testb $0x1, -0x1b9(%rbp)
jne 0x323f
testb $0x1, -0x1d9(%rbp)
je 0x337c
movq -0x18(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl %r8d, %eax
incl %eax
movl %eax, -0x24(%rbp)
leaq 0x1dc8(%rip), %rdx      # 0x501e
xorl %eax, %eax
leaq -0x70(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
movl $0x40, %esi
callq 0x2160
leaq -0x201(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x2100
movq -0x2b8(%rbp), %rsi
movq -0x2b0(%rbp), %rdx
leaq -0x200(%rbp), %rdi
callq 0x3840
jmp 0x329c
leaq -0x220(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x3a60
jmp 0x32b1
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x20a0
jmp 0x32cd
leaq -0x220(%rbp), %rdi
callq 0x3aa0
leaq -0x200(%rbp), %rdi
callq 0x2190
leaq -0x201(%rbp), %rdi
callq 0x23a0
jmp 0x337c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x3950
jmp 0x3424
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x336b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x335f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x3aa0
leaq -0x200(%rbp), %rdi
callq 0x2190
leaq -0x201(%rbp), %rdi
callq 0x23a0
jmp 0x3424
leaq -0x280(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x20f0
jmp 0x3391
leaq -0x160(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x2080
jmp 0x33a6
leaq -0x280(%rbp), %rdi
callq 0x2090
jmp 0x3122
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x2090
jmp 0x3424
movl $0x0, -0x4(%rbp)
movl $0x1, -0x1b8(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x2180
leaq -0x160(%rbp), %rdi
callq 0x2090
leaq -0x100(%rbp), %rdi
callq 0x2090
leaq -0x88(%rbp), %rdi
callq 0x3b00
movl -0x4(%rbp), %eax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
leaq -0x190(%rbp), %rdi
callq 0x2180
leaq -0x160(%rbp), %rdi
callq 0x2090
leaq -0x100(%rbp), %rdi
callq 0x2090
leaq -0x88(%rbp), %rdi
callq 0x3b00
movq -0x98(%rbp), %rdi
callq 0x2270