// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x2100
movq -0x2e8(%rbp), %rsi
movq -0x2e0(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x3840
jmp 0x2547
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
xorl %edx, %edx
callq 0x2250
jmp 0x2558
leaq -0x68(%rbp), %rdi
callq 0x2190
leaq -0x69(%rbp), %rdi
callq 0x23a0
leaq -0x48(%rbp), %rdi
callq 0x20c0
movb %al, -0x2e9(%rbp)
jmp 0x257b
movb -0x2e9(%rbp), %al
testb $0x1, %al
jne 0x25dc
jmp 0x2587
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x80(%rbp)
jmp 0x2bab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x25bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2190
leaq -0x69(%rbp), %rdi
callq 0x23a0
jmp 0x2bc9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2bc0
movl $0xffffffff, -0x84(%rbp) # imm = 0xFFFFFFFF
leaq -0xe8(%rbp), %rdi
callq 0x2070
leaq -0x148(%rbp), %rdi
callq 0x2070
leaq -0x169(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x2100
movq -0x2f8(%rbp), %rdx
leaq 0x29f9(%rip), %rsi      # 0x5018
leaq -0x168(%rbp), %rdi
callq 0x3840
jmp 0x262d
leaq -0x168(%rbp), %rdi
movl $0x1, %esi
callq 0x21b0
jmp 0x2640
leaq -0x168(%rbp), %rdi
callq 0x2190
leaq -0x169(%rbp), %rdi
callq 0x23a0
cmpl $-0x1, -0x84(%rbp)
jne 0x2aa1
leaq -0x188(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x38f0
jmp 0x267a
leaq -0x48(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x2370
jmp 0x268c
leaq -0x188(%rbp), %rdi
callq 0x3950
leaq -0xe8(%rbp), %rdi
callq 0x2170
movb %al, -0x2f9(%rbp)
jmp 0x26ac
movb -0x2f9(%rbp), %al
testb $0x1, %al
jne 0x26b8
jmp 0x2722
jmp 0x2aa1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x26e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x2190
leaq -0x169(%rbp), %rdi
callq 0x23a0
jmp 0x2b91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2b91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x3950
jmp 0x2b91
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x2100
movq -0x308(%rbp), %rdx
leaq 0x28d5(%rip), %rsi      # 0x5018
leaq -0x1a8(%rbp), %rdi
callq 0x3840
jmp 0x2751
leaq 0x488(%rip), %rsi       # 0x2be0
leaq -0x1a8(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0x2350
jmp 0x276d
leaq -0x1a8(%rbp), %rdi
callq 0x2190
leaq -0x1a9(%rbp), %rdi
callq 0x23a0
testb $0x1, 0x5a78(%rip)      # 0x8204
je 0x29ae
leaq -0x210(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x20f0
jmp 0x27a7
leaq -0x148(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x2080
jmp 0x27bc
leaq -0x210(%rbp), %rdi
callq 0x2090
leaq -0x228(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x3970
jmp 0x27dd
leaq 0x5a10(%rip), %rsi      # 0x81f4
leaq -0x230(%rbp), %rdi
callq 0x39b0
jmp 0x27f2
leaq 0x5a03(%rip), %rsi      # 0x81fc
leaq -0x238(%rbp), %rdi
callq 0x39b0
jmp 0x2807
leaq -0x258(%rbp), %rdi
movsd 0x27f2(%rip), %xmm1     # 0x5008
xorps %xmm3, %xmm3
movaps %xmm3, %xmm0
movaps %xmm3, %xmm2
callq 0x39e0
jmp 0x2826
movq %rsp, %rax
movl $0x0, (%rax)
leaq -0x228(%rbp), %rdi
leaq -0x230(%rbp), %rsi
leaq -0x238(%rbp), %rdx
leaq -0x258(%rbp), %rcx
movl $0x1, %r8d
movl $0x8, %r9d
callq 0x2060
jmp 0x285e
leaq -0x228(%rbp), %rdi
callq 0x3a40
leaq -0x279(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x2100
movq -0x310(%rbp), %rdx
leaq 0x278d(%rip), %rsi      # 0x5018
leaq -0x278(%rbp), %rdi
callq 0x3840
jmp 0x2899
leaq -0x298(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x3a60
jmp 0x28ae
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x2030
jmp 0x28c3
leaq -0x298(%rbp), %rdi
callq 0x3aa0
leaq -0x278(%rbp), %rdi
callq 0x2190
leaq -0x279(%rbp), %rdi
callq 0x23a0
jmp 0x2a7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2912
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x2190
leaq -0x1a9(%rbp), %rdi
callq 0x23a0
jmp 0x2b91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x2090
jmp 0x2b91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x3a40
jmp 0x2b91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x299d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2991
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x3aa0
leaq -0x278(%rbp), %rdi
callq 0x2190
leaq -0x279(%rbp), %rdi
callq 0x23a0
jmp 0x2b91
leaq -0x2b9(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x2100
movq -0x318(%rbp), %rdx
leaq 0x2649(%rip), %rsi      # 0x5018
leaq -0x2b8(%rbp), %rdi
callq 0x3840
jmp 0x29dd
leaq -0x2d8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3a60
jmp 0x29f2
leaq -0x2b8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x2030
jmp 0x2a07
leaq -0x2d8(%rbp), %rdi
callq 0x3aa0
leaq -0x2b8(%rbp), %rdi
callq 0x2190
leaq -0x2b9(%rbp), %rdi
callq 0x23a0
jmp 0x2a7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2a6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2a61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x3aa0
leaq -0x2b8(%rbp), %rdi
callq 0x2190
leaq -0x2b9(%rbp), %rdi
callq 0x23a0
jmp 0x2b91
movl $0xa, %edi
callq 0x2340
movl %eax, -0x31c(%rbp)
jmp 0x2a90
movl -0x31c(%rbp), %eax
movl %eax, -0x84(%rbp)
jmp 0x2658
callq 0x20d0
jmp 0x2aa8
callq 0x2360
jmp 0x2aaf
testb $0x1, 0x574e(%rip)      # 0x8204
je 0x2b69
movl 0x5732(%rip), %eax      # 0x81f4
cmpl 0x5734(%rip), %eax      # 0x81fc
jge 0x2ad8
movl 0x5724(%rip), %eax      # 0x81f4
movl %eax, -0x320(%rbp)
jmp 0x2ae4
movl 0x571e(%rip), %eax      # 0x81fc
movl %eax, -0x320(%rbp)
movl -0x320(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl 0x5702(%rip), %eax      # 0x81f8
cmpl 0x5704(%rip), %eax      # 0x8200
jge 0x2b0c
movl 0x56f4(%rip), %eax      # 0x81f8
movl %eax, -0x324(%rbp)
jmp 0x2b18
movl 0x56ee(%rip), %eax      # 0x8200
movl %eax, -0x324(%rbp)
movl -0x324(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x56d1(%rip), %ecx      # 0x81fc
subl 0x56c3(%rip), %ecx      # 0x81f4
movl %ecx, %eax
negl %eax
cmovnsl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movl 0x56bb(%rip), %ecx      # 0x8200
subl 0x56ad(%rip), %ecx      # 0x81f8
movl %ecx, %eax
negl %eax
cmovnsl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movl $0x0, -0x4(%rbp)
movl $0x1, -0x80(%rbp)
jmp 0x2b77
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x80(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x2090
leaq -0xe8(%rbp), %rdi
callq 0x2090
jmp 0x2bab
leaq -0x148(%rbp), %rdi
callq 0x2090
leaq -0xe8(%rbp), %rdi
callq 0x2090
jmp 0x2bc0
leaq -0x48(%rbp), %rdi
callq 0x2180
movl -0x4(%rbp), %eax
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x2180
movq -0x78(%rbp), %rdi
callq 0x2270
nopw %cs:(%rax,%rax)