// File: /workspace/github_c_makefile_star2_O1/tvlabs[P]edge264/edge264_test.c
// Function: decode_file
static int decode_file(const char *name0)
{
	// process file names
	if (trace_file)
		fprintf(trace_file, "\n--- # %s\n", name0);
	int len = strrchr(name0, '.') - name0;
	if (strcmp(name0 + len + 1, "264") != 0)
		return 0;
	char name1[len + 5], name2[len + 7];
	snprintf(name1, sizeof(name1), "%.*s.yuv", len, name0);
	snprintf(name2, sizeof(name2), "%.*s.1.yuv", len, name0);
	
	// open and memory map all input files
	int quit = 0;
	conf[0] = conf[1] = NULL;
	#ifdef _WIN32
		HANDLE f0 = NULL, f1 = NULL, f2 = NULL, m0 = NULL, m1 = NULL, m2 = NULL;
		void *v0 = NULL, *v1 = NULL, *v2 = NULL;
		if ((f0 = CreateFileA(name0, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE ||
			(m0 = CreateFileMappingA(f0, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL ||
			(v0 = MapViewOfFile(m0, FILE_MAP_READ, 0, 0, 0)) == NULL) {
			printf("Error opening file %s: %lu\n", name0, GetLastError());
			quit = 1;
		}
		if (enable_yuv) {
			if ((f1 = CreateFileA(name1, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) {
				printf("%s%s not found\n", moveup, name1);
				moveup = "";
			} else if ((m1 = CreateFileMappingA(f1, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL ||
				(conf[0] = v1 = MapViewOfFile(m1, FILE_MAP_READ, 0, 0, 0)) == NULL) {
				printf("Error opening file %s: %lu\n", name1, GetLastError());
				quit = 1;
			}
			f2 = CreateFileA(name2, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
			if (f2 != INVALID_HANDLE_VALUE &&
				((m2 = CreateFileMappingA(f2, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL ||
				(conf[1] = v2 = MapViewOfFile(m2, FILE_MAP_READ, 0, 0, 0)) == NULL)) {
				printf("Error opening file %s: %lu\n", name2, GetLastError());
				quit = 1;
			}
		}
		const uint8_t *nal = v0;
		const uint8_t *end0 = v0 + GetFileSize(f0, NULL);
		const uint8_t *end1 = v1 + GetFileSize(f1, NULL);
	#else
		int fd0 = -1, fd1 = -1, fd2 = -1;
		struct stat st0, st1, st2;
		uint8_t *mm0 = MAP_FAILED, *mm1 = MAP_FAILED, *mm2 = MAP_FAILED;
		if ((fd0 = open(name0, O_RDONLY)) < 0 ||
			fstat(fd0, &st0) < 0 ||
			(mm0 = mmap(NULL, st0.st_size, PROT_READ, MAP_SHARED, fd0, 0)) == MAP_FAILED) {
			perror(name0);
			quit = 1;
		}
		if (enable_yuv) {
			if ((fd1 = open(name1, O_RDONLY)) < 0) {
				printf("%s%s not found\n", moveup, name1);
				moveup = "";
			} else if (fstat(fd1, &st1) < 0 ||
				(conf[0] = mm1 = mmap(NULL, st1.st_size, PROT_READ, MAP_SHARED, fd1, 0)) == MAP_FAILED) {
				perror(name1);
				quit = 1;
			}
			fd2 = open(name2, O_RDONLY);
			if (fd2 >= 0 && (fstat(fd2, &st2) < 0 ||
				(conf[1] = mm2 = mmap(NULL, st2.st_size, PROT_READ, MAP_SHARED, fd2, 0)) == MAP_FAILED)) {
				perror(name2);
				quit = 1;
			}
		}
		const uint8_t *nal = mm0;
		const uint8_t *end0 = mm0 + st0.st_size;
		const uint8_t *end1 = mm1 + st1.st_size;
	#endif
	
	// print the success counts
	if (!quit) {
		if (count_flag > 0)
			printf("%s%d " GREEN "PASS" RESET ", %d " YELLOW "UNSUPPORTED" RESET ", %d " RED "FAIL" RESET ", %d " BLUE "FLAGGED" RESET " (%s)\n", moveup, count_pass, count_unsup, count_fail, count_flag, name0);
		else
			printf("%s%d " GREEN "PASS" RESET ", %d " YELLOW "UNSUPPORTED" RESET ", %d " RED "FAIL" RESET " (%s)\n", moveup, count_pass, count_unsup, count_fail, name0);
		moveup = "\e[A\e[K";
		
		// decode the entire file and FAIL on any error
		nal += 3 + (nal[2] == 0); // skip the [0]001 delimiter
		int res;
		do {
			res = edge264_decode_NAL(d, nal, end0, 0, NULL, NULL, &nal);
			while (!edge264_get_frame(d, &out, 0)) {
				if (conf[0] != NULL && check_frame()) {
					res = EBADMSG;
					break;
				} else if (display && draw_frame()) {
					res = ENODATA;
					quit = 1;
					break;
				}
			}
		} while (res == 0 || res == ENOBUFS);
		edge264_flush(d);
		if (res == ENOBUFS || (res == ENODATA && conf[0] != NULL && conf[0] != end1))
			res = EBADMSG;
		// FIXME interrupt all threads before closing the files!
		
		// print the file that was decoded
		count_pass += res == ENODATA;
		count_unsup += res == ENOTSUP;
		count_fail += res == EBADMSG;
		count_flag += res == ESRCH;
		if (res == ENODATA && print_passed) {
			printf("%s%s: " GREEN "PASS" RESET "\n", moveup, name0);
			moveup = "";
		} else if (res == ENOTSUP && print_unsupported) {
			printf("%s%s: " YELLOW "UNSUPPORTED" RESET "\n", moveup, name0);
			moveup = "";
		} else if (res == EBADMSG && print_failed) {
			printf("%s%s: " RED "FAIL" RESET "\n", moveup, name0);
			moveup = "";
		} else if (res == ESRCH) {
			printf("%s%s: " BLUE "FLAGGED" RESET "\n", moveup, name0);
			moveup = "";
		}
	}
	
	// close everything
	#ifdef _WIN32
		UnmapViewOfFile(v0);
		UnmapViewOfFile(v1);
		UnmapViewOfFile(v2);
		CloseHandle(m0);
		CloseHandle(m1);
		CloseHandle(m2);
		CloseHandle(f0);
		CloseHandle(f1);
		CloseHandle(f2);
	#else
		munmap(mm0, st0.st_size);
		munmap(mm1, st1.st_size);
		munmap(mm2, st2.st_size);
		close(fd0);
		close(fd1);
		close(fd2);
	#endif
	return quit;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rdi, %r13
movq 0x3710(%rip), %rdi      # 0x5140
testq %rdi, %rdi
je 0x1a46
leaq 0x1ae0(%rip), %rsi      # 0x351c
movq %r13, %rdx
xorl %eax, %eax
callq 0x1160
movq %r13, %rdi
movl $0x2e, %esi
callq 0x10f0
movq %rax, %r15
subq %r13, %r15
movslq %r15d, %rax
leaq (%rax,%r13), %rdi
incq %rdi
leaq 0x1c9d(%rip), %rsi      # 0x3707
callq 0x1140
xorl %ecx, %ecx
testl %eax, %eax
jne 0x27fb
movq %rsp, -0x120(%rbp)
leal 0x5(%r15), %esi
movq %rsp, %r14
leaq 0xf(%rsi), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
leal 0x7(%r15), %r12d
movq %rsp, %rbx
leaq 0xf(%r12), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
leaq 0x1a75(%rip), %rdx      # 0x3527
movq %r14, %rdi
movl %r15d, %ecx
movq %r13, %r8
xorl %eax, %eax
callq 0x10e0
leaq 0x1a67(%rip), %rdx      # 0x3530
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %ecx
movq %r13, %r8
xorl %eax, %eax
callq 0x10e0
xorps %xmm0, %xmm0
movaps %xmm0, 0x374a(%rip)     # 0x5230
movq %r13, -0x78(%rbp)
movq %r13, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x11a0
testl %eax, %eax
movl %eax, -0x50(%rbp)
js 0x1cfa
leaq -0x290(%rbp), %rsi
movl %eax, %edi
callq 0x1210
testl %eax, %eax
movl -0x50(%rbp), %r8d
js 0x1cfa
movq -0x260(%rbp), %rsi
xorl %r15d, %r15d
xorl %edi, %edi
movl $0x1, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
callq 0x10c0
movq %rax, %rdi
cmpq $-0x1, %rax
je 0x1cfa
movq $-0x1, -0x100(%rbp)
cmpb $0x0, 0x3600(%rip)      # 0x5158
je 0x1b75
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movq $-0x1, -0x48(%rbp)
jmp 0x1c78
movq %rdi, %r12
movq %r14, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x11a0
testl %eax, %eax
movl %eax, -0x3c(%rbp)
js 0x1be5
leaq -0x200(%rbp), %rsi
movl %eax, %edi
callq 0x1210
testl %eax, %eax
js 0x1bcd
movq -0x1d0(%rbp), %rsi
xorl %edi, %edi
movl $0x1, %edx
movl $0x1, %ecx
movl -0x3c(%rbp), %r8d
xorl %r9d, %r9d
callq 0x10c0
movq %rax, 0x366d(%rip)      # 0x5230
movq %rax, -0x48(%rbp)
cmpq $-0x1, %rax
jne 0x1c13
movq %r14, %rdi
callq 0x11d0
movq $-0x1, -0x48(%rbp)
movl $0x1, %r15d
jmp 0x1c13
movq 0x3534(%rip), %rsi      # 0x5120
leaq 0x1948(%rip), %rdi      # 0x353b
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
leaq 0x1a95(%rip), %rax      # 0x3699
movq %rax, 0x3515(%rip)      # 0x5120
movq $-0x1, -0x48(%rbp)
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x11a0
testl %eax, %eax
movl %eax, -0x4c(%rbp)
js 0x1c75
leaq -0x320(%rbp), %rsi
movl %eax, %r14d
movl %eax, %edi
callq 0x1210
testl %eax, %eax
js 0x280c
movq -0x2f0(%rbp), %rsi
xorl %edi, %edi
movl $0x1, %edx
movl $0x1, %ecx
movl %r14d, %r8d
xorl %r9d, %r9d
callq 0x10c0
movq %rax, 0x35d4(%rip)      # 0x5238
cmpq $-0x1, %rax
je 0x280c
movq %rax, -0x100(%rbp)
movq %r12, %rdi
movq %rdi, -0xb0(%rbp)
movl $0x1, -0x40(%rbp)
testl %r15d, %r15d
jne 0x27aa
movq -0x260(%rbp), %rax
movq %rdi, -0xf8(%rbp)
addq %rdi, %rax
movq %rax, -0x128(%rbp)
movq -0x1d0(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x118(%rbp)
movl 0x34a8(%rip), %r9d      # 0x5168
movq 0x3459(%rip), %rsi      # 0x5120
movl 0x349f(%rip), %edx      # 0x516c
movl 0x349d(%rip), %ecx      # 0x5170
movl 0x349a(%rip), %r8d      # 0x5174
testl %r9d, %r9d
jle 0x1d15
subq $0x8, %rsp
leaq 0x1861(%rip), %rdi      # 0x354b
xorl %eax, %eax
pushq -0x78(%rbp)
callq 0x10d0
addq $0x10, %rsp
jmp 0x1d27
movq -0x78(%rbp), %rdi
callq 0x11d0
movq $-0x1, %rdi
movl $0x1, %r15d
jmp 0x1b46
leaq 0x1888(%rip), %rdi      # 0x35a4
movq -0x78(%rbp), %r9
xorl %eax, %eax
callq 0x10d0
leaq 0x18ba(%rip), %rax      # 0x35e8
movq %rax, 0x33eb(%rip)      # 0x5120
leaq -0xb0(%rbp), %rcx
movq (%rcx), %rax
cmpb $0x1, 0x2(%rax)
adcq $0x3, %rax
movq %rax, (%rcx)
movl $0x0, -0x40(%rbp)
movq 0x3408(%rip), %rdi      # 0x5160
movq -0xb0(%rbp), %rsi
subq $0x8, %rsp
movq -0x128(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
leaq -0xb0(%rbp), %rax
pushq %rax
callq 0x1060
addq $0x10, %rsp
movl %eax, -0x54(%rbp)
movq 0x33d3(%rip), %rdi      # 0x5160
leaq 0x34ac(%rip), %rsi      # 0x5240
xorl %edx, %edx
callq 0x11f0
testl %eax, %eax
jne 0x266f
cmpq $0x0, 0x3485(%rip)      # 0x5230
je 0x23f4
movq 0x34a0(%rip), %rax      # 0x5258
testq %rax, %rax
setne %dl
movq 0x3473(%rip), %rcx      # 0x5238
testq %rcx, %rcx
setne %sil
cmpb %sil, %dl
jne 0x2674
movswl 0x34b4(%rip), %ecx      # 0x5290
movswl 0x34af(%rip), %edx      # 0x5292
movswl 0x34aa(%rip), %esi      # 0x5294
movswl 0x34a5(%rip), %edi      # 0x5296
movswl 0x3482(%rip), %eax      # 0x527a
movl %edi, -0xbc(%rbp)
addl %edi, %edx
addl %eax, %edx
sarl $0x4, %edx
movswl 0x3472(%rip), %eax      # 0x527e
movl %ecx, -0xb4(%rbp)
addl %ecx, %esi
addl %eax, %esi
sarl $0x4, %esi
movl %esi, -0x5c(%rbp)
movl %edx, -0x58(%rbp)
testl %edx, %edx
setg -0x2b(%rbp)
xorl %ecx, %ecx
leaq 0x3402(%rip), %rax      # 0x5230
cmpq $0x0, (%rax,%rcx,8)
je 0x23f4
xorl %eax, %eax
movq %rcx, -0x88(%rbp)
testq %rcx, %rcx
setne %cl
movb -0x2b(%rbp), %sil
cmpl $0x0, -0x58(%rbp)
jle 0x2391
movb %cl, %al
leaq 0x33e1(%rip), %rcx      # 0x5240
movl 0x48(%rcx,%rax,4), %eax
movl %eax, -0xb8(%rbp)
cmpq $0x0, -0x88(%rbp)
leaq 0x33e0(%rip), %rax      # 0x5258
cmoveq %rcx, %rax
movq %rax, -0x130(%rbp)
movl $0x0, -0x38(%rbp)
movb $0x1, %sil
movb %sil, -0x2c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jle 0x236c
movzwl 0x33e0(%rip), %eax      # 0x5282
movl %eax, -0xd8(%rbp)
movsbl 0x33c9(%rip), %ecx      # 0x5278
movsbl 0x33c3(%rip), %eax      # 0x5279
movswl 0x33bc(%rip), %r11d     # 0x527a
movl %r11d, %ebx
movl %ecx, -0xd4(%rbp)
shll %cl, %ebx
movswl 0x33ab(%rip), %r12d     # 0x527c
movswl 0x33a6(%rip), %edx      # 0x527e
movl %r12d, %esi
movl %eax, -0xd0(%rbp)
movl %eax, %ecx
shll %cl, %esi
movl %esi, -0xe4(%rbp)
movl -0x38(%rbp), %eax
movl %eax, %ecx
shll $0x4, %ecx
subl -0xb4(%rbp), %ecx
xorl %esi, %esi
testl %ecx, %ecx
movl $0x0, %eax
cmovgl %ecx, %eax
movl %eax, -0xe0(%rbp)
movq %rcx, -0x90(%rbp)
leal 0x10(%rcx), %eax
cmpl %edx, %eax
movl %edx, -0x6c(%rbp)
movl %eax, -0x34(%rbp)
cmovll %eax, %edx
movl %edx, -0xdc(%rbp)
movb $0x1, %dl
movzwl 0x3355(%rip), %eax      # 0x5284
movl %eax, -0xc0(%rbp)
movswl 0x3344(%rip), %eax      # 0x5280
movl %eax, -0x68(%rbp)
leaq 0x32ea(%rip), %rax      # 0x5230
movq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x138(%rbp)
movl %r11d, -0xcc(%rbp)
movl %ebx, -0xc8(%rbp)
movl %r12d, -0xc4(%rbp)
movb %dl, -0x2d(%rbp)
movl %esi, -0x60(%rbp)
movl %esi, %eax
shll $0x4, %eax
subl -0xbc(%rbp), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
movl %ecx, -0xec(%rbp)
movq %rax, -0x108(%rbp)
leal 0x10(%rax), %r15d
cmpl %r11d, %r15d
movl %r11d, %eax
cmovll %r15d, %eax
movl %eax, -0xe8(%rbp)
xorl %esi, %esi
movl %r15d, -0x64(%rbp)
movl -0x68(%rbp), %eax
cmpw -0x6c(%rbp), %ax
setl %r10b
cmpw %r11w, %r12w
setl %cl
testq %rsi, %rsi
movl $0x0, %eax
cmovnel %ebx, %eax
setne %dl
andb %dl, %cl
andb %dl, %r10b
movq %rsi, -0x98(%rbp)
cmpq $0x2, %rsi
movl $0x0, %r8d
cmovel -0xe4(%rbp), %r8d
movl -0xec(%rbp), %r9d
shrl %cl, %r9d
movl -0xe8(%rbp), %edx
movb %cl, -0x29(%rbp)
sarl %cl, %edx
movl -0xe0(%rbp), %edi
movl %r10d, %ecx
shrl %cl, %edi
movl -0xdc(%rbp), %esi
movb %r10b, -0x2a(%rbp)
sarl %cl, %esi
subl %r9d, %edx
jle 0x2126
cmpl %esi, %edi
jge 0x2126
imull -0x6c(%rbp), %eax
movslq %eax, %r10
movq -0x138(%rbp), %r14
leaq (%r14,%r10), %rax
imull -0x68(%rbp), %r8d
movslq %r8d, %r12
addq %r12, %rax
movq %rax, -0x110(%rbp)
movq -0x98(%rbp), %r15
testq %r15, %r15
movl -0xc0(%rbp), %eax
movl %eax, %r8d
cmovel -0xd8(%rbp), %r8d
movl -0xd0(%rbp), %eax
cmovel -0xd4(%rbp), %eax
movl %eax, %ecx
shll %cl, %r9d
movslq %r9d, %r9
movb -0x29(%rbp), %cl
sarl %cl, %r11d
movl %eax, %ecx
shll %cl, %r11d
movl %edi, %ebx
movslq %r11d, %rcx
addq %r9, %r12
addq %r10, %r12
movq %rcx, -0xa8(%rbp)
imulq %rbx, %rcx
addq %r14, %r12
addq %rcx, %r12
movq -0x130(%rbp), %rcx
movq (%rcx,%r15,8), %rdi
movl %eax, %ecx
shll %cl, %edx
movslq %edx, %rax
movq %rax, -0xa0(%rbp)
movswq %r8w, %rcx
movslq %esi, %r13
subq %rbx, %r13
imulq %rcx, %rbx
addq %r9, %rbx
movq %rdi, -0x80(%rbp)
addq %rdi, %rbx
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r12, %rsi
movq -0xa0(%rbp), %rdx
movq %rcx, %r14
callq 0x1130
movq %r14, %rcx
orl %eax, %r15d
addq -0xa8(%rbp), %r12
addq %r14, %rbx
decq %r13
jne 0x20d8
testl %r15d, %r15d
leaq 0x15d5(%rip), %r13      # 0x36e1
movl -0x64(%rbp), %r15d
movl -0xcc(%rbp), %r11d
movl -0xc8(%rbp), %ebx
movl -0xc4(%rbp), %r12d
jne 0x2150
movq -0x98(%rbp), %rsi
incq %rsi
cmpq $0x3, %rsi
jne 0x1fae
movl -0x60(%rbp), %esi
incl %esi
cmpl -0x5c(%rbp), %esi
setl %dl
jne 0x1f6c
jmp 0x236c
movq -0x98(%rbp), %rcx
cmpq $0x1, %rcx
leaq 0x157c(%rip), %r8       # 0x36de
leaq 0x1572(%rip), %rax      # 0x36db
cmoveq %rax, %r8
testq %rcx, %rcx
leaq 0x155f(%rip), %rax      # 0x36d6
cmoveq %rax, %r8
leaq 0x1518(%rip), %rdi      # 0x369a
movl -0xb8(%rbp), %esi
movl -0x38(%rbp), %edx
movl -0x60(%rbp), %ecx
xorl %eax, %eax
callq 0x10d0
movb -0x2a(%rbp), %cl
movq -0x90(%rbp), %rdx
sarl %cl, %edx
movl -0x34(%rbp), %eax
sarl %cl, %eax
movl %eax, -0x34(%rbp)
cmpl %eax, %edx
jge 0x234c
movq -0x108(%rbp), %rax
movb -0x29(%rbp), %cl
sarl %cl, %eax
movl %r15d, %ebx
sarl %cl, %ebx
movl %eax, -0xa8(%rbp)
cltq
movq %rax, -0xa0(%rbp)
movq %rdx, -0x90(%rbp)
movslq %edx, %r12
movq %r12, %rax
imulq %r14, %rax
addq %rax, -0x80(%rbp)
movq -0xa0(%rbp), %r15
cmpl %ebx, -0xa8(%rbp)
jge 0x2273
movq %r13, %rdi
testq %r12, %r12
js 0x225b
movswl 0x307a(%rip), %eax      # 0x527e
movb -0x2a(%rbp), %cl
sarl %cl, %eax
movq %r13, %rdi
testq %r15, %r15
js 0x225b
cltq
movq %r13, %rdi
cmpq %rax, %r12
jge 0x225b
movswl 0x3058(%rip), %eax      # 0x527a
movb -0x29(%rbp), %cl
sarl %cl, %eax
movslq %eax, %rcx
movq %r13, %rdi
cmpq %rcx, %r15
jge 0x225b
movq -0x80(%rbp), %rcx
movb (%rcx,%r15), %cl
imull %r12d, %eax
addl %r15d, %eax
leaq 0x149e(%rip), %rdi      # 0x36e6
movq -0x110(%rbp), %rdx
cmpb (%rdx,%rax), %cl
je 0x225b
leaq 0x1490(%rip), %rdi      # 0x36eb
movq -0x80(%rbp), %rax
movzbl (%rax,%r15), %esi
xorl %eax, %eax
callq 0x10d0
incq %r15
cmpl %r15d, %ebx
jne 0x21f5
movl $0xa, %edi
callq 0x1040
incq %r12
addq %r14, -0x80(%rbp)
cmpl %r12d, -0x34(%rbp)
jne 0x21e6
leaq 0x14ff(%rip), %rdi      # 0x3794
callq 0x1070
movq -0x90(%rbp), %r14
cmpl -0x34(%rbp), %r14d
movq -0x108(%rbp), %r15
movl -0x64(%rbp), %r12d
jge 0x2358
movb -0x29(%rbp), %cl
sarl %cl, %r15d
sarl %cl, %r12d
movl %r15d, %ebx
cmpl %r12d, %r15d
jge 0x2333
movq %r13, %rdi
testl %r14d, %r14d
js 0x2306
movswl 0x2fa8(%rip), %eax      # 0x527e
movb -0x2a(%rbp), %cl
sarl %cl, %eax
movq %r13, %rdi
testl %ebx, %ebx
js 0x2306
movq %r13, %rdi
cmpl %eax, %r14d
jge 0x2306
movswl 0x2f89(%rip), %eax      # 0x527a
movb -0x29(%rbp), %cl
sarl %cl, %eax
cmpl %eax, %ebx
movq %r13, %rdi
leaq 0x13e4(%rip), %rax      # 0x36e6
cmovlq %rax, %rdi
movswl 0x2f6d(%rip), %eax      # 0x527a
movb -0x29(%rbp), %cl
sarl %cl, %eax
imull %r14d, %eax
addl %ebx, %eax
cltq
movq -0x110(%rbp), %rcx
movzbl (%rcx,%rax), %esi
xorl %eax, %eax
callq 0x10d0
incl %ebx
cmpl %ebx, %r12d
jne 0x22c7
movl $0xa, %edi
callq 0x1040
incl %r14d
cmpl -0x34(%rbp), %r14d
jne 0x22bf
jmp 0x2358
leaq 0x1441(%rip), %rdi      # 0x3794
callq 0x1070
leaq 0x133a(%rip), %rax      # 0x3699
movq %rax, 0x2dba(%rip)      # 0x5120
testb $0x1, -0x2d(%rbp)
jne 0x2383
movl -0x38(%rbp), %eax
incl %eax
movl %eax, -0x38(%rbp)
cmpl -0x58(%rbp), %eax
setl %sil
jne 0x1e8d
jmp 0x2391
movb -0x2c(%rbp), %sil
testb $0x1, %sil
jne 0x26a8
movswl 0x2ee2(%rip), %eax      # 0x527a
movb 0x2eda(%rip), %cl       # 0x5278
shll %cl, %eax
movswl 0x2ed7(%rip), %edx      # 0x527e
imull %eax, %edx
movswl 0x2ecb(%rip), %eax      # 0x527c
movb 0x2ec2(%rip), %cl       # 0x5279
shll %cl, %eax
movswl 0x2ec0(%rip), %ecx      # 0x5280
imull %eax, %ecx
leal (%rdx,%rcx,2), %eax
cltq
leaq 0x2e61(%rip), %rcx      # 0x5230
movq -0x88(%rbp), %rdx
addq %rax, (%rcx,%rdx,8)
testb $0x1, %sil
jne 0x26a8
leaq 0x1(%rdx), %rax
testq %rdx, %rdx
movq %rax, %rcx
je 0x1e27
cmpb $0x1, 0x2d4d(%rip)      # 0x5148
jne 0x1d86
xorl %eax, %eax
cmpq $0x0, 0x2e4d(%rip)      # 0x5258
setne %al
movswl 0x2e65(%rip), %esi      # 0x527a
cmpl %esi, 0x2e85(%rip)      # 0x52a0
jne 0x2438
movswl 0x2e5a(%rip), %ecx      # 0x527e
cmpl %ecx, 0x2e7a(%rip)      # 0x52a4
jne 0x2438
cmpl %eax, 0x2e76(%rip)      # 0x52a8
je 0x2562
movl %esi, 0x2e62(%rip)      # 0x52a0
movswl 0x2e39(%rip), %edx      # 0x527e
movl %edx, 0x2e59(%rip)      # 0x52a4
movl %eax, 0x2e57(%rip)      # 0x52a8
movq 0x2d50(%rip), %rdi      # 0x51a8
testq %rdi, %rdi
je 0x2496
callq *0x2d75(%rip)           # 0x51d8
movq 0x2d3e(%rip), %rdi      # 0x51a8
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
callq *0x2d66(%rip)           # 0x51e0
movq 0x2cff(%rip), %rdi      # 0x5180
callq *0x2cf1(%rip)           # 0x5178
movq 0x2cfa(%rip), %rdi      # 0x5188
callq *0x2ce4(%rip)           # 0x5178
jmp 0x24ec
movl $0x4020, %edi           # imm = 0x4020
callq *0x2d1f(%rip)           # 0x51c0
movl 0x2df9(%rip), %ecx      # 0x52a0
movl 0x2df6(%rip), %r8d      # 0x52a4
leaq 0x1244(%rip), %rdi      # 0x36f9
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
movl $0x14, %r9d
callq *0x2cfd(%rip)           # 0x51c8
movq %rax, 0x2cd6(%rip)      # 0x51a8
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x6, %edx
callq *0x2ceb(%rip)           # 0x51d0
movq %rax, 0x2cac(%rip)      # 0x5198
movq 0x2ca5(%rip), %rdi      # 0x5198
movl 0x2da7(%rip), %ecx      # 0x52a0
movl 0x2da4(%rip), %r8d      # 0x52a4
movl $0x56555949, %esi       # imm = 0x56555949
movl $0x1, %edx
callq *0x2cd8(%rip)           # 0x51e8
movq %rax, 0x2c69(%rip)      # 0x5180
movq 0x2c7a(%rip), %rdi      # 0x5198
movl 0x2d7c(%rip), %ecx      # 0x52a0
movl 0x2d79(%rip), %r8d      # 0x52a4
movl $0x56555949, %esi       # imm = 0x56555949
movl $0x1, %edx
callq *0x2cad(%rip)           # 0x51e8
movq %rax, 0x2c46(%rip)      # 0x5188
movq %rax, %rdi
movl $0x1, %esi
callq *0x2ca0(%rip)           # 0x51f0
movq 0x2c31(%rip), %rdi      # 0x5188
movl $0x80, %esi
callq *0x2c96(%rip)           # 0x51f8
movq 0x2c17(%rip), %rdi      # 0x5180
movq 0x2cd0(%rip), %rdx      # 0x5240
movswl 0x2d0b(%rip), %ecx      # 0x5282
movq 0x2cca(%rip), %r8       # 0x5248
movswl 0x2cfe(%rip), %r9d      # 0x5284
xorl %esi, %esi
pushq %r9
pushq 0x2cc0(%rip)            # 0x5250
callq *0x2c6a(%rip)           # 0x5200
addq $0x10, %rsp
movq 0x2bf7(%rip), %rdi      # 0x5198
callq *0x2c61(%rip)           # 0x5208
movq 0x2bea(%rip), %rdi      # 0x5198
movq 0x2bcb(%rip), %rsi      # 0x5180
xorl %edx, %edx
xorl %ecx, %ecx
callq *0x2c51(%rip)           # 0x5210
cmpl $0x0, 0x2ce2(%rip)      # 0x52a8
je 0x2618
movq 0x2bb9(%rip), %rdi      # 0x5188
movq 0x2c82(%rip), %rdx      # 0x5258
movswl 0x2ca5(%rip), %ecx      # 0x5282
movq 0x2c7c(%rip), %r8       # 0x5260
movswl 0x2c98(%rip), %r9d      # 0x5284
xorl %esi, %esi
pushq %r9
pushq 0x2c72(%rip)            # 0x5268
callq *0x2c04(%rip)           # 0x5200
addq $0x10, %rsp
movq 0x2b91(%rip), %rdi      # 0x5198
movq 0x2b7a(%rip), %rsi      # 0x5188
xorl %edx, %edx
xorl %ecx, %ecx
callq *0x2bf8(%rip)           # 0x5210
movq 0x2b79(%rip), %rdi      # 0x5198
callq *0x2bf3(%rip)           # 0x5218
leaq -0x170(%rbp), %rdi
callq *0x2bee(%rip)           # 0x5220
testl %eax, %eax
je 0x1d86
movl -0x170(%rbp), %ecx
cmpl $0x100, %ecx            # imm = 0x100
je 0x2659
cmpl $0x300, %ecx            # imm = 0x300
jne 0x2625
cmpl $0x1b, -0x15c(%rbp)
jne 0x2625
testl %eax, %eax
je 0x1d86
movl $0x3d, %eax
movl $0x1, -0x40(%rbp)
jmp 0x26ad
movl -0x54(%rbp), %eax
jmp 0x26ad
cmpq $0x1, %rax
movl $0x1, %esi
sbbl $-0x1, %esi
cmpq $0x1, %rcx
movl $0x1, %edx
sbbl $-0x1, %edx
leaq 0xfba(%rip), %rdi       # 0x364d
xorl %eax, %eax
callq 0x10d0
leaq 0xff8(%rip), %rax       # 0x3699
movq %rax, 0x2a78(%rip)      # 0x5120
movl $0x4a, %eax
testl %eax, %eax
je 0x1d51
cmpl $0x69, %eax
je 0x1d51
movq 0x2a9b(%rip), %rdi      # 0x5160
movl %eax, %ebx
callq 0x1170
movq 0x2b5d(%rip), %rcx      # 0x5230
cmpq -0x118(%rbp), %rcx
movl $0x3d, %edx
movl $0x4a, %eax
cmovel %edx, %eax
testq %rcx, %rcx
cmovel %ebx, %eax
cmpl $0x3d, %ebx
cmovnel %ebx, %eax
xorl %ecx, %ecx
cmpl $0x3d, %eax
sete %cl
addl %ecx, 0x2a6b(%rip)      # 0x516c
xorl %ecx, %ecx
cmpl $0x5f, %eax
sete %cl
addl %ecx, 0x2a61(%rip)      # 0x5170
xorl %ecx, %ecx
cmpl $0x4a, %eax
sete %cl
addl %ecx, 0x2a57(%rip)      # 0x5174
xorl %ecx, %ecx
cmpl $0x3, %eax
sete %cl
addl %ecx, 0x2a3d(%rip)      # 0x5168
cmpl $0x3d, %eax
jne 0x2742
testb $0x1, 0x2a19(%rip)      # 0x5150
je 0x2742
leaq 0xeaf(%rip), %rdi       # 0x35ef
jmp 0x2783
cmpl $0x5f, %eax
jne 0x2759
testb $0x1, 0x2a06(%rip)      # 0x5154
je 0x2759
leaq 0xead(%rip), %rdi       # 0x3604
jmp 0x2783
cmpl $0x3, %eax
setne %cl
cmpl $0x4a, %eax
sete %al
andb 0x29e1(%rip), %al       # 0x514c
notb %al
leaq 0xeac(%rip), %rdx       # 0x3620
leaq 0xeba(%rip), %rdi       # 0x3635
cmovneq %rdx, %rdi
testb %cl, %al
jne 0x27a3
movq 0x2996(%rip), %rsi      # 0x5120
movq -0x78(%rbp), %rdx
xorl %eax, %eax
callq 0x10d0
leaq 0xefd(%rip), %rax       # 0x3699
movq %rax, 0x297d(%rip)      # 0x5120
movq -0xf8(%rbp), %rdi
movq -0x260(%rbp), %rsi
callq 0x1180
movq -0x1d0(%rbp), %rsi
movq -0x48(%rbp), %rdi
callq 0x1180
movq -0x2f0(%rbp), %rsi
movq -0x100(%rbp), %rdi
callq 0x1180
movl -0x50(%rbp), %edi
callq 0x1110
movl -0x3c(%rbp), %edi
callq 0x1110
movl -0x4c(%rbp), %edi
callq 0x1110
movq -0x120(%rbp), %rsp
movl -0x40(%rbp), %ecx
movl %ecx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x11d0
movl $0x1, %r15d
jmp 0x1c75