// File: /workspace/github_c_makefile_star2_O2/ranbenbasat[P]RHHH/check2.cpp
// Function: main
int main(int argc, char * argv[]) {
	if (argc != 6 && argc != 7 && argc != 3 && argc != 4) {
		printf("Usage: %s <n> <c> <t> <data> <output> [<exact>]\n", argv[0]);
		printf("Usage: %s <data> <output> [<exact>]\n", argv[0]);
		printf("\t<n>=number of IP pairs\n");
		printf("\t<c>=counters (1/eps)\n");
		printf("\t<data>=data file (IP pairs)\n");
		printf("\t<output>=output of HHH algorithm to check\n");
		printf("\t<exact>=file to output exact HHH\n");
		return 0;
	}
	int n, counters, threshold, num;
	float time=-1; char * algname = dummy;
	FILE * data, * output, * exactfile;
	if (argc > 4) {
		n = atoi(argv[1]);
		counters = atoi(argv[2]);
		threshold = atoi(argv[3]);
		data = fopen(argv[4], "r");
		output = fopen(argv[5], "r");
		exactfile = (argc == 7 ? fopen(argv[6], "w") : NULL);
		fscanf(output, "%d", &num);
	} else {
		data = fopen(argv[1], "r");
		output = fopen(argv[2], "r");
		exactfile = (argc == 4 ? fopen(argv[3], "w") : NULL);
		fscanf(output, "%as %d %d %d %d %f\n", &algname, &n, &counters, &threshold, &num, &time);
	}

	if (getenv("DONTCHECKABOVE") != NULL && atoi(getenv("DONTCHECKABOVE")) < n) {
		fclose(data);
		fclose(output);
		if (exactfile != NULL) fclose(exactfile);
		return 0;
	}

	FILE * fsummary = (getenv("SUMMARYFILE") != NULL ? fopen(getenv("SUMMARYFILE"), "a") : NULL);

	map<Item, Counter> m[NUM_MASKS];
	for (int i = 0; i < n; i++) {
		Item x;
		Item item = 0;
		for (int j = 0; j < 8; j++) {
			fscanf(data, "%llu", &x);
			item = ((item << 8) | x);
		}
		for (int j = 0; j < NUM_MASKS; j++) {
			m[j][item & masks[j]].inc();
		}
	}	

	vector<Pair> exact;
	vector<int> exactcount;
	for (int i = 0; i < NUM_MASKS; i++) {
		for (map<Item, Counter>::const_iterator it = m[i].begin(); it != m[i].end(); ++it) {
			if (it->second.get() >= threshold && conditionedcount(m, exact, it->first, i) >= threshold) {
				exact.push_back(Pair(i, it->first));
				exactcount.push_back(it->second.get());
			}
		}
	}
	if (exactfile != NULL) {
		fprintf(exactfile, "%d\n", (int)exact.size()); 
		vector< Pair >::const_iterator it1 = exact.begin();
		vector< int >::const_iterator it2 = exactcount.begin();
		while (it1 != exact.end())  {
			fprintf(exactfile, "%d ", it1->first);
			printip(it1->second >> 32, exactfile);
			fprintf(exactfile, " ");
			printip(it1->second, exactfile);
			fprintf(exactfile, " %d %d\n", *it2, *it2);
			++it1;
			++it2;
		}
	}
	if (fsummary != NULL && argc > 4) {
		fprintf(fsummary, "algorithm=%s nitems=%d counters=%d threshold=%d outputsize=%d\n",
		                   argv[0],     n,        counters,   threshold,   (int)exact.size()); 
	}

	int accErrors=0;
	int covErrors=0;
	double eps=-1;
	double epsil=-1;
	
	vector<Pair> p;
	set<Pair> s;
	for (int i = 0; i < num; i++) {
		int mask;
		fscanf(output, "%d", &mask);
		Item item = 0;
		Item w, x, y, z;
		fscanf(output, "%llu.%llu.%llu.%llu", &w, &x, &y, &z);
		item = ((item << 8)|w);
		item = ((item << 8)|x);
		item = ((item << 8)|y);
		item = ((item << 8)|z);
		fscanf(output, "%llu.%llu.%llu.%llu", &w, &x, &y, &z);
		item = ((item << 8)|w);
		item = ((item << 8)|x);
		item = ((item << 8)|y);
		item = ((item << 8)|z);
		int fmin, fmax;
		fscanf(output, "%d%d", &fmin, &fmax);

		int truecount = m[mask][item].get();
		if (truecount < fmin - n/counters || truecount > fmax + n/counters) {
			accErrors++;
			if (getenv("NONVERBOSE") == NULL){
				printf("Accuracy: [%d] ", mask);
				printip(item >> 32);
				printf(" ");
				printip(item);
				printf(" [%d] %d %d\n", truecount, fmin, fmax);
			}
		}

		double epscand = ((double) (fmax-fmin)) / truecount;
		if (epscand > eps) eps = epscand;
		epsil = max(epsil, ((double)(fmax-fmin))/n);

		p.push_back(Pair(mask, item));
		s.insert(Pair(mask, item));
	}

	for (int i = 0; i < NUM_MASKS; i++) {
		for (map<Item, Counter>::const_iterator it = m[i].begin(); it != m[i].end(); ++it) {
			if (it->second.get() >= threshold && conditionedcount(m, p, it->first, i) >= threshold && 0==s.count(Pair(it->first, i))) {
				covErrors++;
				if (getenv("NONVERBOSE") == NULL){
					printf("Coverage: [%d] ", i);
					printip(it->first);
					printf(" [%d/%d]\n", it->second.get(), conditionedcount(m, p, it->first, i));
				}
			}
		}
	}

	if (accErrors+covErrors > 0 && fsummary != NULL) {
		fprintf(fsummary, "Error: algorithm=%s nitems=%d counters=%d threshold=%d accErrors=%d covErrors=%d\n",
			                  argv[0],     n,        counters,   threshold, accErrors, covErrors); 
	}

	if (fsummary != NULL && argc <= 4) {
		fprintf(fsummary, "check=true  algorithm=%-14s nitems=%-10d counters=%-5d threshold=%-9d outputsize=%-3d exactsize=%-3d time=%f accuracy=%lf epsilon=%lf\n",
		                   algname,        n,           counters,     threshold,     num,        (int)exact.size(), time,   eps, epsil); 
	}

	if (exactfile != NULL) fclose(exactfile);
	if (fsummary != NULL) fclose(fsummary);
	fclose(data);
	fclose(output);
	if (argc <= 4) free(algname);

	printf("%d accErrors %d covErrors %d exact hhhs\n", accErrors, covErrors, (int)exact.size());

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xcd88, %rsp           # imm = 0xCD88
movq %rsi, %r14
cmpl $0x7, %edi
ja 0x2003
movl %edi, %ebp
movl $0xd8, %eax
btl %edi, %eax
jae 0x2003
movl $0xbf800000, 0x4c(%rsp) # imm = 0xBF800000
leaq 0x6c8d(%rip), %rax      # 0x8301
movq %rax, 0x98(%rsp)
movq 0x8(%r14), %rdi
cmpl $0x5, %ebp
jb 0x16eb
callq 0x1180
movl %eax, 0x10(%rsp)
movq 0x10(%r14), %rdi
callq 0x1180
movl %eax, 0x14(%rsp)
movq 0x18(%r14), %rdi
callq 0x1180
movl %eax, 0xc(%rsp)
movq 0x20(%r14), %rdi
leaq 0x1a46(%rip), %rbx      # 0x30f9
movq %rbx, %rsi
callq 0x1110
movq %rax, 0x78(%rsp)
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x1110
movq %rax, 0x40(%rsp)
cmpl $0x7, %ebp
jne 0x172a
movq 0x30(%r14), %rdi
leaq 0x1a1a(%rip), %rsi      # 0x30fb
callq 0x1110
movq %rax, %rbx
jmp 0x172c
leaq 0x1a07(%rip), %rbx      # 0x30f9
movq %rbx, %rsi
callq 0x1110
movq %rax, 0x78(%rsp)
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x1110
movq %rax, 0x40(%rsp)
cmpl $0x4, %ebp
jne 0x1746
movq 0x18(%r14), %rdi
leaq 0x19db(%rip), %rsi      # 0x30fb
callq 0x1110
movq %rax, %rbx
jmp 0x1748
xorl %ebx, %ebx
leaq 0x1906(%rip), %rsi      # 0x3039
leaq 0x3c(%rsp), %rdx
movq 0x40(%rsp), %rdi
xorl %eax, %eax
callq 0x11b0
jmp 0x1782
xorl %ebx, %ebx
leaq 0x4c(%rsp), %r10
leaq 0x3c(%rsp), %r11
leaq 0x19a4(%rip), %rsi      # 0x30fd
leaq 0x98(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0xc(%rsp), %r9
movq 0x40(%rsp), %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x11b0
popq %rcx
popq %rdx
leaq 0x1988(%rip), %rdi      # 0x3111
callq 0x1130
testq %rax, %rax
je 0x17cb
movq %rax, %rdi
callq 0x1180
cmpl 0x10(%rsp), %eax
jge 0x17cb
movq 0x78(%rsp), %rdi
callq 0x10d0
movq 0x40(%rsp), %rdi
callq 0x10d0
testq %rbx, %rbx
je 0x2061
movq %rbx, %rdi
callq 0x10d0
jmp 0x2061
leaq 0x194e(%rip), %rdi      # 0x3120
callq 0x1130
testq %rax, %rax
je 0x17ed
leaq 0x1949(%rip), %rsi      # 0x312c
movq %rax, %rdi
callq 0x1110
jmp 0x17ef
xorl %eax, %eax
movq %rax, 0xa8(%rsp)
movq %rbx, 0x70(%rsp)
movq %r14, 0xa0(%rsp)
movl %ebp, 0x48(%rsp)
leaq 0x158(%rsp), %rax
xorl %ecx, %ecx
leaq (%rax,%rcx), %rdx
andl $0x0, 0x158(%rsp,%rcx)
andq $0x0, 0x160(%rsp,%rcx)
movq %rdx, 0x168(%rsp,%rcx)
movq %rdx, 0x170(%rsp,%rcx)
andq $0x0, 0x178(%rsp,%rcx)
addq $0x30, %rcx
cmpq $0xcc30, %rcx           # imm = 0xCC30
jne 0x1812
leaq 0x50(%rsp), %rbx
leaq 0x1923(%rip), %r15      # 0x317c
leaq 0xe0(%rsp), %r12
xorl %eax, %eax
cmpl 0x10(%rsp), %eax
jge 0x18de
movl %eax, 0x28(%rsp)
pushq $0x8
popq %rbp
xorl %r13d, %r13d
subl $0x1, %ebp
jb 0x1898
movq 0x78(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x11b0
shlq $0x8, %r13
orq 0xe0(%rsp), %r13
jmp 0x1873
leaq 0x150(%rsp), %r14
xorl %ebp, %ebp
cmpq $0x2208, %rbp           # imm = 0x2208
je 0x18d6
leaq 0x483e(%rip), %rax      # 0x60f0
movq (%rbp,%rax), %rax
andq %r13, %rax
movq %rax, 0x50(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x220c
incl (%rax)
addq $0x8, %rbp
addq $0x30, %r14
jmp 0x18a2
movl 0x28(%rsp), %eax
incl %eax
jmp 0x1863
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rbx
movaps %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x130(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
xorl %r12d, %r12d
leaq 0x150(%rsp), %r13
leaq 0xe0(%rsp), %rbp
cmpq $0x441, %r12            # imm = 0x441
je 0x19a7
imulq $0x30, %r12, %rax
leaq (%rsp,%rax), %r15
addq $0x158, %r15            # imm = 0x158
movq 0x10(%r15), %r14
cmpq %r15, %r14
je 0x199f
movl 0x28(%r14), %eax
cmpl 0xc(%rsp), %eax
jl 0x1992
movq 0x20(%r14), %rdx
movq %r13, %rdi
movq %rbx, %rsi
movl %r12d, %ecx
callq 0x12f0
cmpl 0xc(%rsp), %eax
jl 0x1992
movl %r12d, 0xe0(%rsp)
movq 0x20(%r14), %rax
movq %rax, 0xe8(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2120
movl 0x28(%r14), %eax
movl %eax, 0xe0(%rsp)
leaq 0x130(%rsp), %rdi
movq %rbp, %rsi
callq 0x2254
movq %r14, %rdi
callq 0x1100
movq %rax, %r14
jmp 0x1931
incq %r12
jmp 0x1911
cmpq $0x0, 0x70(%rsp)
je 0x1a4d
movq 0x58(%rsp), %rdx
subq 0x50(%rsp), %rdx
shrq $0x4, %rdx
leaq 0x17e2(%rip), %rsi      # 0x31aa
movq 0x70(%rsp), %rdi
xorl %eax, %eax
callq 0x1160
movq 0x50(%rsp), %r15
movq 0x130(%rsp), %r12
leaq 0x1654(%rip), %rbx      # 0x303c
pushq $0x20
popq %rbp
leaq 0x17b4(%rip), %r14      # 0x31a6
movq 0x70(%rsp), %r13
cmpq 0x58(%rsp), %r15
je 0x1a4d
movl (%r15), %edx
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1160
movl 0xc(%r15), %edi
movq %r13, %rsi
callq 0x12bc
movl %ebp, %edi
movq %r13, %rsi
callq 0x1140
movq 0x8(%r15), %rdi
movq %r13, %rsi
callq 0x12bc
movl (%r12), %ecx
movq %r13, %rdi
movq %r14, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1160
addq $0x10, %r15
addq $0x4, %r12
jmp 0x19f7
cmpl $0x5, 0x48(%rsp)
setb %al
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x1aa4
movq 0xa0(%rsp), %rax
movq (%rax), %rdx
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl 0xc(%rsp), %r9d
movq 0x58(%rsp), %r10
subq 0x50(%rsp), %r10
shrq $0x4, %r10
subq $0x8, %rsp
leaq 0x1695(%rip), %rsi      # 0x312e
xorl %eax, %eax
pushq %r10
callq 0x1160
popq %rcx
popq %rdx
leaq 0x110(%rsp), %rcx
andq $0x0, 0x10(%rcx)
leaq 0xe8(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rcx)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movaps 0x1545(%rip), %xmm0     # 0x3020
movaps %xmm0, 0xd0(%rsp)
movq $0x0, 0x80(%rsp)
xorl %eax, %eax
cmpl 0x3c(%rsp), %eax
jge 0x1d70
movl %eax, 0x28(%rsp)
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
leaq 0x152b(%rip), %rsi      # 0x3039
leaq 0x24(%rsp), %rdx
xorl %eax, %eax
callq 0x11b0
andq $0x0, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x1643(%rip), %r15      # 0x316d
movq %r15, %rsi
leaq 0xc8(%rsp), %r13
movq %r13, %rdx
leaq 0xc0(%rsp), %rbp
movq %rbp, %rcx
leaq 0xb8(%rsp), %r12
movq %r12, %r8
leaq 0xb0(%rsp), %r14
movq %r14, %r9
xorl %eax, %eax
callq 0x11b0
movq 0x18(%rsp), %rax
movq 0xc8(%rsp), %rcx
shlq $0x10, %rax
shlq $0x8, %rcx
orq %rax, %rcx
orq 0xc0(%rsp), %rcx
movq 0xb8(%rsp), %rax
shlq $0x10, %rcx
shlq $0x8, %rax
orq %rcx, %rax
orq 0xb0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x11b0
movq 0x18(%rsp), %rax
movq 0xc8(%rsp), %rcx
shlq $0x10, %rax
shlq $0x8, %rcx
orq %rax, %rcx
orq 0xc0(%rsp), %rcx
movq 0xb8(%rsp), %rax
shlq $0x10, %rcx
shlq $0x8, %rax
orq %rcx, %rax
orq 0xb0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x157e(%rip), %rsi      # 0x3181
leaq 0x38(%rsp), %rdx
leaq 0x34(%rsp), %rcx
xorl %eax, %eax
callq 0x11b0
movslq 0x24(%rsp), %rax
imulq $0x30, %rax, %rax
leaq (%rsp,%rax), %rdi
addq $0x150, %rdi            # imm = 0x150
leaq 0x18(%rsp), %rsi
callq 0x220c
movl (%rax), %r15d
movl 0x38(%rsp), %r13d
movl 0x10(%rsp), %ebp
movl %ebp, %eax
cltd
idivl 0x14(%rsp)
movl %r13d, %ecx
subl %eax, %ecx
cmpl %ecx, %r15d
leaq 0x88(%rsp), %r14
jl 0x1c60
addl 0x34(%rsp), %eax
cmpl %eax, %r15d
jle 0x1cdf
movq 0x80(%rsp), %rax
incl %eax
movq %rax, 0x80(%rsp)
leaq 0x150d(%rip), %rdi      # 0x3186
callq 0x1130
testq %rax, %rax
jne 0x1cdf
movl 0x24(%rsp), %esi
leaq 0x1503(%rip), %rdi      # 0x3191
xorl %eax, %eax
callq 0x1030
movl 0x1c(%rsp), %edi
movq 0x4330(%rip), %rbx      # 0x5fd0
movq (%rbx), %rsi
callq 0x12bc
pushq $0x20
popq %rdi
callq 0x1150
movq 0x18(%rsp), %rdi
movq (%rbx), %rsi
callq 0x12bc
movl 0x38(%rsp), %edx
movl 0x34(%rsp), %ecx
leaq 0x14d5(%rip), %rdi      # 0x31a1
movl %r15d, %esi
xorl %eax, %eax
callq 0x1030
movl 0x38(%rsp), %r13d
movl 0x10(%rsp), %ebp
movl 0x34(%rsp), %ebx
movl 0x24(%rsp), %eax
movl %eax, 0x88(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x110(%rsp), %rdi
movq %r14, %rsi
callq 0x2120
movl 0x24(%rsp), %eax
movl %eax, 0x88(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0xe0(%rsp), %rdi
movq %r14, %rsi
callq 0x2866
subl %r13d, %ebx
cvtsi2sd %ebx, %xmm0
movd %r15d, %xmm1
movd %ebp, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2pd %xmm2, %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm1, %xmm0
maxpd 0xd0(%rsp), %xmm0
movl 0x28(%rsp), %eax
incl %eax
movapd %xmm0, 0xd0(%rsp)
jmp 0x1af1
leaq 0x150(%rsp), %rbx
leaq 0x110(%rsp), %r13
xorl %r12d, %r12d
movq $0x0, 0x28(%rsp)
cmpq $0x441, %r12            # imm = 0x441
je 0x1e8c
imulq $0x30, %r12, %rax
leaq (%rsp,%rax), %r15
addq $0x158, %r15            # imm = 0x158
movq 0x10(%r15), %rbp
cmpq %r15, %rbp
je 0x1e84
movl 0x28(%rbp), %eax
cmpl 0xc(%rsp), %eax
jl 0x1e74
movq 0x20(%rbp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %ecx
callq 0x12f0
cmpl 0xc(%rsp), %eax
jl 0x1e74
movl 0x20(%rbp), %eax
movl %eax, 0x88(%rsp)
movq %r12, 0x90(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x2272
testq %rax, %rax
jne 0x1e74
movq 0x28(%rsp), %rax
incl %eax
movq %rax, 0x28(%rsp)
leaq 0x1369(%rip), %rdi      # 0x3186
callq 0x1130
testq %rax, %rax
jne 0x1e74
leaq 0x1380(%rip), %rdi      # 0x31ae
movl %r12d, %esi
xorl %eax, %eax
callq 0x1030
movq 0x20(%rbp), %rdi
movq 0x418d(%rip), %rax      # 0x5fd0
movq (%rax), %rsi
callq 0x12bc
movl 0x28(%rbp), %r14d
movq 0x20(%rbp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %ecx
callq 0x12f0
leaq 0x1356(%rip), %rdi      # 0x31be
movl %r14d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x1030
movq %rbp, %rdi
callq 0x1100
movq %rax, %rbp
jmp 0x1dac
incq %r12
jmp 0x1d8c
movq 0xa8(%rsp), %r15
testq %r15, %r15
movq 0x80(%rsp), %r12
movq 0x28(%rsp), %r13
je 0x1ede
leal (%r12,%r13), %eax
testl %eax, %eax
jle 0x1ede
movq 0xa0(%rsp), %rax
movq (%rax), %rdx
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl 0xc(%rsp), %r9d
leaq 0x12fa(%rip), %rsi      # 0x31c8
movq %r15, %rdi
xorl %eax, %eax
pushq %r13
pushq %r12
callq 0x1160
popq %rcx
popq %rdx
testq %r15, %r15
sete %al
movl 0x48(%rsp), %ebx
cmpl $0x5, %ebx
setge %cl
orb %al, %cl
movq 0x70(%rsp), %r14
jne 0x1f4e
movq 0x98(%rsp), %rdx
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl 0xc(%rsp), %r9d
movl 0x3c(%rsp), %r10d
movq 0x58(%rsp), %r11
subq 0x50(%rsp), %r11
shrq $0x4, %r11
cvtss2sd 0x4c(%rsp), %xmm0
movapd 0xd0(%rsp), %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
leaq 0x12dc(%rip), %rsi      # 0x321a
movq %r15, %rdi
movb $0x3, %al
pushq %r11
pushq %r10
callq 0x1160
popq %rcx
popq %rdx
testq %r14, %r14
je 0x1f5b
movq %r14, %rdi
callq 0x10d0
testq %r15, %r15
je 0x1f68
movq %r15, %rdi
callq 0x10d0
movq 0x78(%rsp), %rdi
callq 0x10d0
movq 0x40(%rsp), %rdi
callq 0x10d0
cmpl $0x4, %ebx
jg 0x1f8e
movq 0x98(%rsp), %rdi
callq 0x1120
movq 0x58(%rsp), %rcx
subq 0x50(%rsp), %rcx
shrq $0x4, %rcx
leaq 0x12fe(%rip), %rdi      # 0x32a1
movl %r12d, %esi
movl %r13d, %edx
xorl %eax, %eax
callq 0x1030
leaq 0xe0(%rsp), %rdi
callq 0x22ca
leaq 0x110(%rsp), %rdi
callq 0x2308
leaq 0x130(%rsp), %rdi
callq 0x272a
leaq 0x50(%rsp), %rdi
callq 0x2308
movl $0xcbd0, %r14d          # imm = 0xCBD0
leaq (%rsp,%r14), %rdi
addq $0x180, %rdi            # imm = 0x180
callq 0x228c
addq $-0x30, %r14
cmpq $-0x60, %r14
jne 0x1fe7
jmp 0x2061
movq (%r14), %rsi
leaq 0x1096(%rip), %rdi      # 0x30a3
xorl %eax, %eax
callq 0x1030
movq (%r14), %rsi
leaq 0x10b6(%rip), %rdi      # 0x30d4
xorl %eax, %eax
callq 0x1030
leaq 0x12b8(%rip), %rdi      # 0x32e4
callq 0x1170
leaq 0x12c4(%rip), %rdi      # 0x32fc
callq 0x1170
leaq 0x12ce(%rip), %rdi      # 0x3312
callq 0x1170
leaq 0x12df(%rip), %rdi      # 0x332f
callq 0x1170
leaq 0x12fe(%rip), %rdi      # 0x335a
callq 0x1170
xorl %eax, %eax
addq $0xcd88, %rsp           # imm = 0xCD88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20eb
movq %rax, %rbx
jmp 0x20c0
jmp 0x20b0
movq %rax, %rbx
jmp 0x20dc
jmp 0x20cc
jmp 0x20cc
jmp 0x20cc
movq %rax, %rbx
cmpq $-0x30, %r14
je 0x210e
leaq (%rsp,%r14), %rdi
addq $0x150, %rdi            # imm = 0x150
callq 0x228c
addq $-0x30, %r14
jmp 0x208c
jmp 0x2118
jmp 0x20cc
jmp 0x20b0
jmp 0x20b0
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x272a
leaq 0x50(%rsp), %rdi
callq 0x2308
jmp 0x20ee
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x22ca
leaq 0x110(%rsp), %rdi
callq 0x2308
jmp 0x20b3
movq %rax, %rbx
movl $0xcc00, %r14d          # imm = 0xCC00
leaq (%rsp,%r14), %rdi
addq $0x150, %rdi            # imm = 0x150
callq 0x228c
addq $-0x30, %r14
cmpq $-0x30, %r14
jne 0x20f4
movq %rbx, %rdi
callq 0x11a0
jmp 0x2118
movq %rax, %rdi
callq 0x2201