// File: /workspace/github_c_makefile_star2_O0/szanni[P]slideextract/main.c
// Function: main
int
main (int argc, char **argv)
{
	struct roi roi;
	bool gflag = 0;
	bool rflag = 0;
	int c;
	int ret;

	while ((c = getopt(argc, argv, "gr:Vh")) != -1) {
		switch (c) {
			case 'g':
				gflag = 1;
				break;

			case 'r':
				rflag = 1;
				if (sscanf(optarg, "%d.%d:%dx%d", &roi.x, &roi.y, &roi.width, &roi.height) != 4)
					help();
				break;

			case 'V':
				version();
				break;

			case 'h':
			case '?':
			default:
				help();
		}
	}
	argc -= optind;
	argv += optind;

	if (argc != 2 || (gflag && rflag))
		help();

	const char *file = *argv++;
	const char *outprefix = *argv;

	if (rflag)
		return se_extract_slides(file, outprefix, &roi);

	if (gflag)
	{
		if ((ret = se_select_roi(file, &roi)))
			return ret;

		printf("Selected ROI: %d.%d:%dx%d\n", roi.x, roi.y, roi.width, roi.height);
		return se_extract_slides(file, outprefix, &roi);
	}

	return se_extract_slides(file, outprefix, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x21(%rbp)
movb $0x0, -0x22(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x57f(%rip), %rdx       # 0x506b
callq 0x2290
movl %eax, -0x28(%rbp)
cmpl $-0x1, %eax
je 0x4b8f
movl -0x28(%rbp), %eax
movl %eax, -0x44(%rbp)
subl $0x3f, %eax
je 0x4b83
jmp 0x4b0a
movl -0x44(%rbp), %eax
subl $0x56, %eax
je 0x4b7c
jmp 0x4b14
movl -0x44(%rbp), %eax
subl $0x67, %eax
je 0x4b32
jmp 0x4b1e
movl -0x44(%rbp), %eax
subl $0x68, %eax
je 0x4b83
jmp 0x4b28
movl -0x44(%rbp), %eax
subl $0x72, %eax
je 0x4b38
jmp 0x4b85
movb $0x1, -0x21(%rbp)
jmp 0x4b8a
movb $0x1, -0x22(%rbp)
movq 0x349d(%rip), %rax      # 0x7fe0
movq (%rax), %rdi
leaq -0x20(%rbp), %rdx
leaq -0x20(%rbp), %rcx
addq $0x4, %rcx
leaq -0x20(%rbp), %r8
addq $0x8, %r8
leaq -0x20(%rbp), %r9
addq $0xc, %r9
leaq 0x508(%rip), %rsi       # 0x5071
movb $0x0, %al
callq 0x2200
cmpl $0x4, %eax
je 0x4b7a
callq 0x4c80
jmp 0x4b8a
callq 0x4ca0
jmp 0x4b8a
jmp 0x4b85
callq 0x4c80
jmp 0x4ade
movq 0x3432(%rip), %rax      # 0x7fc8
movl (%rax), %ecx
movl -0x8(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8(%rbp)
movq 0x3421(%rip), %rax      # 0x7fc8
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x4bcd
testb $0x1, -0x21(%rbp)
je 0x4bd2
testb $0x1, -0x22(%rbp)
je 0x4bd2
callq 0x4c80
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
testb $0x1, -0x22(%rbp)
je 0x4c0f
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f80
movl %eax, -0x4(%rbp)
jmp 0x4c77
testb $0x1, -0x21(%rbp)
je 0x4c63
movq -0x38(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2500
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x4c32
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4c77
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x14(%rbp), %r8d
leaq 0x437(%rip), %rdi       # 0x507d
movb $0x0, %al
callq 0x2140
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2f80
movl %eax, -0x4(%rbp)
jmp 0x4c77
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2f80
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq