// File: /workspace/github_c_makefile_star2_O1/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 $0x188, %rsp            # imm = 0x188
movq %rsi, %r12
movq %rdi, %rsi
leaq 0xc8(%rsp), %rdi
leaq 0x128(%rsp), %rdx
callq 0x301e
leaq 0x98(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
xorl %edx, %edx
callq 0x21c0
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2440
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x98(%rsp), %rdi
callq 0x20b0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0x2730
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
callq 0x2060
leaq 0x128(%rsp), %rdi
callq 0x2060
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ba1(%rip), %rsi      # 0x4028
leaq 0x1b9f(%rip), %rdx      # 0x402d
leaq 0x30(%rsp), %rdi
callq 0x305c
leaq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x2140
movq %r12, 0x90(%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 0x1b51(%rip), %rbp      # 0x4028
leaq 0x1b4f(%rip), %rbx      # 0x402d
cmpl $-0x1, %eax
jne 0x26b1
leaq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x2010000, 0x30(%rsp)  # imm = 0x2010000
movq %r14, 0x38(%rsp)
leaq 0x98(%rsp), %rdi
movq %r13, %rsi
callq 0x22b0
movq %r14, %rdi
callq 0x2120
testb %al, %al
jne 0x26b1
movq %r15, 0x30(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x305c
movq %r13, %rdi
leaq 0x2bb(%rip), %rsi       # 0x27f7
movq %r14, %rdx
callq 0x2290
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x255b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
cmpb $0x1, 0x3c2a(%rip)      # 0x618c
jne 0x2655
movq %r13, %rdi
movq %r14, %rsi
callq 0x20d0
leaq 0x128(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2070
movq %r13, %rdi
callq 0x2080
leaq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x3010000, 0x8(%rsp)   # imm = 0x3010000
movq %r12, 0x10(%rsp)
movl 0x3bd0(%rip), %eax      # 0x617c
movl %eax, 0x28(%rsp)
movl 0x3bca(%rip), %eax      # 0x6180
movl %eax, 0x2c(%rsp)
movl 0x3bc4(%rip), %eax      # 0x6184
movl %eax, 0x20(%rsp)
movl 0x3bbe(%rip), %eax      # 0x6188
movl %eax, 0x24(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movabsq $0x406fe00000000000, %rax # imm = 0x406FE00000000000
movq %rax, 0x38(%rsp)
movups %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 0x305c
movq $0x0, 0x18(%rsp)
movl $0x1010000, 0x8(%rsp)   # imm = 0x1010000
leaq 0x128(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2030
jmp 0x268b
movq %r15, 0x30(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x305c
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 0x26a2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
movl $0xa, %edi
callq 0x2280
jmp 0x24de
callq 0x20c0
callq 0x22a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, 0x3ac5(%rip)      # 0x618c
movq 0x90(%rsp), %rdi
jne 0x2716
movl 0x3aa5(%rip), %eax      # 0x617c
movl 0x3aa7(%rip), %ecx      # 0x6184
movl %eax, %edx
subl %ecx, %edx
cmovll %eax, %ecx
negl %edx
movl %ecx, (%rdi)
movl 0x3a92(%rip), %eax      # 0x6180
movl 0x3a94(%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 0x128(%rsp), %rdi
callq 0x2080
leaq 0xc8(%rsp), %rdi
callq 0x2080
leaq 0x98(%rsp), %rdi
callq 0x2130
movl %ebx, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27a5
jmp 0x27c5
jmp 0x27c5
movq %rax, %rbx
jmp 0x27e2
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27ef
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x27ef
movq %rax, %rbx
jmp 0x27ef
jmp 0x27c5
jmp 0x27c5
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2080
jmp 0x27c8
jmp 0x27c5
jmp 0x27a5
jmp 0x27c5
jmp 0x27a5
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x27c8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x27c8
jmp 0x27c5
jmp 0x27c5
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x2080
leaq 0xc8(%rsp), %rdi
callq 0x2080
leaq 0x98(%rsp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x21e0