// File: /workspace/github_c_makefile_star2_O3/szanni[P]slideextract/slideextract.cpp
// Function: se_select_roi
int
se_select_roi(const char *file, struct roi *roi)
{
	VideoCapture capture = VideoCapture(file, CAP_ANY);

	if (!capture.isOpened())
		return -1;

	int key = -1;
	Mat frame;
	Mat clone;
	namedWindow("frame", WINDOW_AUTOSIZE);

	while (key == -1)
	{
		capture.read(frame);
		if (frame.empty())
			break;

		setMouseCallback("frame", _se_mouseHandler, &frame);

		if (selected_roi)
		{
			clone = frame.clone();
			rectangle(clone, point1, point2, CV_RGB(0, 255, 0), 1, 8, 0);
			imshow("frame", clone);
		}
		else
		{
			imshow("frame", frame);
		}

		key = waitKey (10);
	}

	startWindowThread();

	destroyAllWindows();

	if (selected_roi)
	{
		roi->x = (point1.x < point2.x) ? point1.x : point2.x;
		roi->y = (point1.y < point2.y) ? point1.y : point2.y;
		roi->width = abs(point2.x - point1.x);
		roi->height = abs(point2.y - point1.y);
		return 0;
	}

	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %r12
movq %rdi, %rsi
leaq 0xe8(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x2ffe
leaq 0xb8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
xorl %edx, %edx
callq 0x21c0
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2440
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0xb8(%rsp), %rdi
callq 0x20b0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0x2735
leaq 0xe8(%rsp), %r14
movq %r14, %rdi
callq 0x2060
leaq 0x148(%rsp), %rdi
callq 0x2060
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ba9(%rip), %rsi      # 0x4030
leaq 0x1ba7(%rip), %rdx      # 0x4035
leaq 0x30(%rsp), %rdi
callq 0x303c
leaq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x2140
movq %r12, 0x98(%rsp)
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x24c6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x30(%rsp), %r13
leaq 0x1b59(%rip), %rbp      # 0x4030
leaq 0x1b57(%rip), %rbx      # 0x4035
xorps %xmm0, %xmm0
movhps 0x1b20(%rip), %xmm0     # xmm0 = xmm0[0,1],mem[0,1]
movaps %xmm0, 0xa0(%rsp)
cmpl $-0x1, %eax
jne 0x26b6
movq $0x0, 0x40(%rsp)
movl $0x2010000, 0x30(%rsp)  # imm = 0x2010000
movq %r14, 0x38(%rsp)
leaq 0xb8(%rsp), %rdi
movq %r13, %rsi
callq 0x22b0
movq %r14, %rdi
callq 0x2120
testb %al, %al
jne 0x26b6
movq %r15, 0x30(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x303c
movq %r13, %rdi
leaq 0x2b0(%rip), %rsi       # 0x27fc
movq %r14, %rdx
callq 0x2290
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x256b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
cmpb $0x1, 0x3c1a(%rip)      # 0x618c
jne 0x265a
movq %r13, %rdi
movq %r14, %rsi
callq 0x20d0
leaq 0x148(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2070
movq %r13, %rdi
callq 0x2080
movq $0x0, 0x18(%rsp)
movl $0x3010000, 0x8(%rsp)   # imm = 0x3010000
movq %r12, 0x10(%rsp)
movl 0x3bc2(%rip), %eax      # 0x617c
movl %eax, 0x28(%rsp)
movl 0x3bbc(%rip), %eax      # 0x6180
movl %eax, 0x2c(%rsp)
movl 0x3bb6(%rip), %eax      # 0x6184
movl %eax, 0x20(%rsp)
movl 0x3bb0(%rip), %eax      # 0x6188
movl %eax, 0x24(%rsp)
movaps 0xa0(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movl $0x0, (%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %r13, %rcx
movl $0x1, %r8d
movl $0x8, %r9d
callq 0x2050
movq %r15, 0x30(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x303c
movq $0x0, 0x18(%rsp)
movl $0x1010000, 0x8(%rsp)   # imm = 0x1010000
leaq 0x148(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2030
jmp 0x2690
movq %r15, 0x30(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x303c
movq $0x0, 0x18(%rsp)
movl $0x1010000, 0x8(%rsp)   # imm = 0x1010000
movq %r14, 0x10(%rsp)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2030
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x26a7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
movl $0xa, %edi
callq 0x2280
jmp 0x24f0
callq 0x20c0
callq 0x22a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, 0x3ac0(%rip)      # 0x618c
movq 0x98(%rsp), %rdi
jne 0x271b
movl 0x3aa0(%rip), %eax      # 0x617c
movl 0x3aa2(%rip), %ecx      # 0x6184
movl %eax, %edx
subl %ecx, %edx
cmovll %eax, %ecx
negl %edx
movl %ecx, (%rdi)
movl 0x3a8d(%rip), %eax      # 0x6180
movl 0x3a8f(%rip), %ecx      # 0x6188
movl %eax, %esi
subl %ecx, %esi
cmovll %eax, %ecx
negl %esi
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
movl %ecx, 0x4(%rdi)
movl %eax, 0x8(%rdi)
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
movl %eax, 0xc(%rdi)
xorl %ebx, %ebx
leaq 0x148(%rsp), %rdi
callq 0x2080
leaq 0xe8(%rsp), %rdi
callq 0x2080
leaq 0xb8(%rsp), %rdi
callq 0x2130
movl %ebx, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27aa
jmp 0x27ca
jmp 0x27ca
movq %rax, %rbx
jmp 0x27e7
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27f4
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x27f4
movq %rax, %rbx
jmp 0x27f4
jmp 0x27ca
jmp 0x27ca
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2080
jmp 0x27cd
jmp 0x27ca
jmp 0x27aa
jmp 0x27ca
jmp 0x27aa
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x27cd
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x27cd
jmp 0x27ca
jmp 0x27ca
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x2080
leaq 0xe8(%rsp), %rdi
callq 0x2080
leaq 0xb8(%rsp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x21e0