// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xd0f8, %rsp           # imm = 0xD0F8
movl $0x0, 0xd0f4(%rsp)
movl %edi, 0xd0f0(%rsp)
movq %rsi, 0xd0e8(%rsp)
cmpl $0x6, 0xd0f0(%rsp)
je 0x2311
cmpl $0x7, 0xd0f0(%rsp)
je 0x2311
cmpl $0x3, 0xd0f0(%rsp)
je 0x2311
cmpl $0x4, 0xd0f0(%rsp)
je 0x2311
movq 0xd0e8(%rsp), %rax
movq (%rax), %rsi
leaq 0x6de0(%rip), %rdi      # 0x907b
movb $0x0, %al
callq 0x1030
movq 0xd0e8(%rsp), %rax
movq (%rax), %rsi
leaq 0x6df8(%rip), %rdi      # 0x90ac
movb $0x0, %al
callq 0x1030
leaq 0x6e0f(%rip), %rdi      # 0x90d1
movb $0x0, %al
callq 0x1030
leaq 0x6e1a(%rip), %rdi      # 0x90ea
movb $0x0, %al
callq 0x1030
leaq 0x6e23(%rip), %rdi      # 0x9101
movb $0x0, %al
callq 0x1030
leaq 0x6e33(%rip), %rdi      # 0x911f
movb $0x0, %al
callq 0x1030
leaq 0x6e51(%rip), %rdi      # 0x914b
movb $0x0, %al
callq 0x1030
movl $0x0, 0xd0f4(%rsp)
jmp 0x39f5
movss 0x6ceb(%rip), %xmm0     # 0x9004
movss %xmm0, 0xd0d4(%rsp)
leaq 0xcfd8(%rip), %rax      # 0xf301
movq %rax, 0xd0c8(%rsp)
cmpl $0x4, 0xd0f0(%rsp)
jle 0x2432
movq 0xd0e8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1160
movl %eax, 0xd0e4(%rsp)
movq 0xd0e8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1160
movl %eax, 0xd0e0(%rsp)
movq 0xd0e8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1160
movl %eax, 0xd0dc(%rsp)
movq 0xd0e8(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x6dd4(%rip), %rsi      # 0x916e
callq 0x1110
movq %rax, 0xd0c0(%rsp)
movq 0xd0e8(%rsp), %rax
movq 0x28(%rax), %rdi
leaq 0x6db4(%rip), %rsi      # 0x916e
callq 0x1110
movq %rax, 0xd0b8(%rsp)
cmpl $0x7, 0xd0f0(%rsp)
jne 0x23f3
movq 0xd0e8(%rsp), %rax
movq 0x30(%rax), %rdi
leaq 0x6d8c(%rip), %rsi      # 0x9170
callq 0x1110
movq %rax, 0x278(%rsp)
jmp 0x23ff
xorl %eax, %eax
movq %rax, 0x278(%rsp)
jmp 0x23ff
movq 0x278(%rsp), %rax
movq %rax, 0xd0b0(%rsp)
movq 0xd0b8(%rsp), %rdi
leaq 0x6bf3(%rip), %rsi      # 0x9011
leaq 0xd0d8(%rsp), %rdx
movb $0x0, %al
callq 0x11a0
jmp 0x2509
movq 0xd0e8(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x6d29(%rip), %rsi      # 0x916e
callq 0x1110
movq %rax, 0xd0c0(%rsp)
movq 0xd0e8(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x6d09(%rip), %rsi      # 0x916e
callq 0x1110
movq %rax, 0xd0b8(%rsp)
cmpl $0x4, 0xd0f0(%rsp)
jne 0x249e
movq 0xd0e8(%rsp), %rax
movq 0x18(%rax), %rdi
leaq 0x6ce1(%rip), %rsi      # 0x9170
callq 0x1110
movq %rax, 0x270(%rsp)
jmp 0x24aa
xorl %eax, %eax
movq %rax, 0x270(%rsp)
jmp 0x24aa
movq 0x270(%rsp), %rax
movq %rax, 0xd0b0(%rsp)
movq 0xd0b8(%rsp), %rdi
leaq 0x6ca9(%rip), %rsi      # 0x9172
leaq 0xd0c8(%rsp), %rdx
leaq 0xd0e4(%rsp), %rcx
leaq 0xd0e0(%rsp), %r8
leaq 0xd0dc(%rsp), %r9
leaq 0xd0d8(%rsp), %r10
leaq 0xd0d4(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x11a0
leaq 0x6c76(%rip), %rdi      # 0x9186
callq 0x1130
cmpq $0x0, %rax
je 0x257a
leaq 0x6c64(%rip), %rdi      # 0x9186
callq 0x1130
movq %rax, %rdi
callq 0x1160
cmpl 0xd0e4(%rsp), %eax
jge 0x257a
movq 0xd0c0(%rsp), %rdi
callq 0x10d0
movq 0xd0b8(%rsp), %rdi
callq 0x10d0
cmpq $0x0, 0xd0b0(%rsp)
je 0x256a
movq 0xd0b0(%rsp), %rdi
callq 0x10d0
movl $0x0, 0xd0f4(%rsp)
jmp 0x39f5
leaq 0x6c14(%rip), %rdi      # 0x9195
callq 0x1130
cmpq $0x0, %rax
je 0x25b1
leaq 0x6c02(%rip), %rdi      # 0x9195
callq 0x1130
movq %rax, %rdi
leaq 0x6bff(%rip), %rsi      # 0x91a1
callq 0x1110
movq %rax, 0x268(%rsp)
jmp 0x25bd
xorl %eax, %eax
movq %rax, 0x268(%rsp)
jmp 0x25bd
movq 0x268(%rsp), %rax
movq %rax, 0xd0a8(%rsp)
leaq 0x470(%rsp), %rax
movq %rax, 0x250(%rsp)
movq %rax, %rcx
addq $0xcc30, %rcx           # imm = 0xCC30
movq %rcx, 0x258(%rsp)
movq %rax, 0x260(%rsp)
movq 0x260(%rsp), %rdi
movq %rdi, 0x248(%rsp)
callq 0x40a0
jmp 0x260e
movq 0x258(%rsp), %rcx
movq 0x248(%rsp), %rax
addq $0x30, %rax
cmpq %rcx, %rax
movq %rax, 0x260(%rsp)
jne 0x25f7
movl $0x0, 0x460(%rsp)
movl 0x460(%rsp), %eax
cmpl 0xd0e4(%rsp), %eax
jge 0x27e8
movq $0x0, 0x450(%rsp)
movl $0x0, 0x44c(%rsp)
cmpl $0x8, 0x44c(%rsp)
jge 0x2747
movq 0xd0c0(%rsp), %rdi
leaq 0x6b6f(%rip), %rsi      # 0x91f1
xorl %eax, %eax
leaq 0x458(%rsp), %rdx
callq 0x11a0
jmp 0x2693
movq 0x450(%rsp), %rax
shlq $0x8, %rax
orq 0x458(%rsp), %rax
movq %rax, 0x450(%rsp)
movl 0x44c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44c(%rsp)
jmp 0x2665
movq 0x250(%rsp), %rcx
movq %rax, %rsi
movq 0x248(%rsp), %rax
movq %rsi, 0x468(%rsp)
movl %edx, 0x464(%rsp)
cmpq %rax, %rcx
movq %rax, 0x240(%rsp)
je 0x2729
movq 0x240(%rsp), %rdi
addq $-0x30, %rdi
movq %rdi, 0x238(%rsp)
callq 0x40b0
jmp 0x270c
movq 0x238(%rsp), %rax
movq 0x250(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x240(%rsp)
jne 0x26f1
jmp 0x3a04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x468(%rsp)
movl %eax, 0x464(%rsp)
jmp 0x39b2
movl $0x0, 0x448(%rsp)
cmpl $0x441, 0x448(%rsp) # imm = 0x441
jge 0x27d0
movslq 0x448(%rsp), %rdx
leaq (%rdx,%rdx,2), %rax
shlq $0x4, %rax
leaq 0x470(%rsp,%rax), %rdi
movq 0x450(%rsp), %rax
leaq 0xa96a(%rip), %rcx      # 0xd0f0
movq (%rcx,%rdx,8), %rcx
andq %rcx, %rax
movq %rax, 0x440(%rsp)
leaq 0x440(%rsp), %rsi
callq 0x40c0
movq %rax, 0x230(%rsp)
jmp 0x27ac
movq 0x230(%rsp), %rdi
callq 0x41c0
jmp 0x27bb
jmp 0x27bd
movl 0x448(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x448(%rsp)
jmp 0x2752
jmp 0x27d2
movl 0x460(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x460(%rsp)
jmp 0x263a
leaq 0x428(%rsp), %rdi
callq 0x3a20
jmp 0x27f7
leaq 0x410(%rsp), %rdi
callq 0x41e0
jmp 0x2806
movl $0x0, 0x40c(%rsp)
cmpl $0x441, 0x40c(%rsp) # imm = 0x441
jge 0x2aa3
movslq 0x40c(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x470(%rsp,%rax), %rdi
callq 0x41f0
movq %rax, 0x228(%rsp)
jmp 0x2849
movq 0x228(%rsp), %rax
movq %rax, 0x3f8(%rsp)
leaq 0x400(%rsp), %rdi
leaq 0x3f8(%rsp), %rsi
callq 0x4220
jmp 0x2870
jmp 0x2872
movslq 0x40c(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x470(%rsp,%rax), %rdi
callq 0x4240
movq %rax, 0x220(%rsp)
jmp 0x2899
movq 0x220(%rsp), %rax
movq %rax, 0x3e8(%rsp)
leaq 0x3f0(%rsp), %rdi
leaq 0x3e8(%rsp), %rsi
callq 0x4220
jmp 0x28c0
leaq 0x400(%rsp), %rdi
leaq 0x3f0(%rsp), %rsi
callq 0x3fe0
movb %al, 0x21f(%rsp)
jmp 0x28de
movb 0x21f(%rsp), %al
testb $0x1, %al
jne 0x28ee
jmp 0x2a8b
leaq 0x400(%rsp), %rdi
callq 0x4030
movq %rax, 0x210(%rsp)
jmp 0x2905
movq 0x210(%rsp), %rdi
addq $0x8, %rdi
callq 0x4050
movl %eax, 0x20c(%rsp)
jmp 0x291f
movl 0x20c(%rsp), %eax
cmpl 0xd0dc(%rsp), %eax
jl 0x2a75
leaq 0x470(%rsp), %rax
movq %rax, 0x1f8(%rsp)
leaq 0x400(%rsp), %rdi
callq 0x4030
movq %rax, 0x200(%rsp)
jmp 0x295a
movq 0x1f8(%rsp), %rdi
movq 0x200(%rsp), %rax
movq (%rax), %rdx
movl 0x40c(%rsp), %ecx
leaq 0x428(%rsp), %rsi
callq 0x1320
movl %eax, 0x1f4(%rsp)
jmp 0x298a
movl 0x1f4(%rsp), %eax
cmpl 0xd0dc(%rsp), %eax
jl 0x2a75
leaq 0x400(%rsp), %rdi
callq 0x4030
movq %rax, 0x1e8(%rsp)
jmp 0x29b5
movq 0x1e8(%rsp), %rdx
leaq 0x3d8(%rsp), %rdi
leaq 0x40c(%rsp), %rsi
callq 0x4270
jmp 0x29d4
leaq 0x428(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
callq 0x3bc0
jmp 0x29eb
leaq 0x400(%rsp), %rdi
callq 0x4030
movq %rax, 0x1e0(%rsp)
jmp 0x2a02
movq 0x1e0(%rsp), %rdi
addq $0x8, %rdi
callq 0x4050
movl %eax, 0x1dc(%rsp)
jmp 0x2a1c
movl 0x1dc(%rsp), %eax
movl %eax, 0x3d4(%rsp)
leaq 0x410(%rsp), %rdi
leaq 0x3d4(%rsp), %rsi
callq 0x42a0
jmp 0x2a41
jmp 0x2a75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x468(%rsp)
movl %eax, 0x464(%rsp)
jmp 0x3922
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x468(%rsp)
movl %eax, 0x464(%rsp)
jmp 0x38f7
jmp 0x2a77
leaq 0x400(%rsp), %rdi
callq 0x4310
jmp 0x2a86
jmp 0x2872
jmp 0x2a8d
movl 0x40c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40c(%rsp)
jmp 0x2811
cmpq $0x0, 0xd0b0(%rsp)
je 0x2d25
movq 0xd0b0(%rsp), %rax
movq %rax, 0x1c8(%rsp)
leaq 0x428(%rsp), %rdi
callq 0x4340
movq %rax, 0x1d0(%rsp)
jmp 0x2ad9
movq 0x1c8(%rsp), %rdi
movq 0x1d0(%rsp), %rax
movl %eax, %edx
leaq 0x672d(%rip), %rsi      # 0x921f
xorl %eax, %eax
callq 0x1140
leaq 0x428(%rsp), %rdi
callq 0x3ae0
movq %rax, 0x1c0(%rsp)
jmp 0x2b10
movq 0x1c0(%rsp), %rax
movq %rax, 0x3c0(%rsp)
leaq 0x3c8(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x3b10
jmp 0x2b37
leaq 0x410(%rsp), %rdi
callq 0x4360
movq %rax, 0x1b8(%rsp)
jmp 0x2b4e
movq 0x1b8(%rsp), %rax
movq %rax, 0x3b0(%rsp)
leaq 0x3b8(%rsp), %rdi
leaq 0x3b0(%rsp), %rsi
callq 0x4390
jmp 0x2b75
jmp 0x2b77
leaq 0x428(%rsp), %rdi
callq 0x3b90
movq %rax, 0x1b0(%rsp)
jmp 0x2b8e
movq 0x1b0(%rsp), %rax
movq %rax, 0x3a8(%rsp)
leaq 0x3c8(%rsp), %rdi
leaq 0x3a8(%rsp), %rsi
callq 0x3b50
movb %al, 0x1af(%rsp)
jmp 0x2bbc
movb 0x1af(%rsp), %al
testb $0x1, %al
jne 0x2bcc
jmp 0x2d23
movq 0xd0b0(%rsp), %rax
movq %rax, 0x198(%rsp)
leaq 0x3c8(%rsp), %rdi
callq 0x3ad0
movq %rax, 0x1a0(%rsp)
jmp 0x2bf3
movq 0x198(%rsp), %rdi
movq 0x1a0(%rsp), %rax
movl (%rax), %edx
leaq 0x6408(%rip), %rsi      # 0x9014
xorl %eax, %eax
callq 0x1140
leaq 0x3c8(%rsp), %rdi
callq 0x3ad0
movq %rax, 0x190(%rsp)
jmp 0x2c2a
movq 0x190(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
movq 0xd0b0(%rsp), %rsi
callq 0x12b0
movq 0xd0b0(%rsp), %rdi
leaq 0x65de(%rip), %rsi      # 0x9231
xorl %eax, %eax
callq 0x1140
leaq 0x3c8(%rsp), %rdi
callq 0x3ad0
movq %rax, 0x188(%rsp)
jmp 0x2c71
movq 0x188(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0xd0b0(%rsp), %rsi
callq 0x12b0
movq 0xd0b0(%rsp), %rax
movq %rax, 0x178(%rsp)
leaq 0x3b8(%rsp), %rdi
callq 0x43d0
movq %rax, 0x180(%rsp)
jmp 0x2cb1
movq 0x180(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x16c(%rsp)
leaq 0x3b8(%rsp), %rdi
callq 0x43d0
movq %rax, 0x170(%rsp)
jmp 0x2cd9
movl 0x16c(%rsp), %edx
movq 0x178(%rsp), %rdi
movq 0x170(%rsp), %rax
movl (%rax), %ecx
leaq 0x6522(%rip), %rsi      # 0x921b
xorl %eax, %eax
callq 0x1140
leaq 0x3c8(%rsp), %rdi
callq 0x3c40
jmp 0x2d0f
leaq 0x3b8(%rsp), %rdi
callq 0x43e0
jmp 0x2d1e
jmp 0x2b77
jmp 0x2d25
cmpq $0x0, 0xd0a8(%rsp)
je 0x2de6
cmpl $0x4, 0xd0f0(%rsp)
jle 0x2de6
movq 0xd0a8(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0xd0e8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x148(%rsp)
movl 0xd0e4(%rsp), %eax
movl %eax, 0x154(%rsp)
movl 0xd0e0(%rsp), %eax
movl %eax, 0x158(%rsp)
movl 0xd0dc(%rsp), %eax
movl %eax, 0x15c(%rsp)
leaq 0x428(%rsp), %rdi
callq 0x4340
movq %rax, 0x160(%rsp)
jmp 0x2da6
movl 0x15c(%rsp), %r9d
movl 0x158(%rsp), %r8d
movl 0x154(%rsp), %ecx
movq 0x148(%rsp), %rdx
movq 0x140(%rsp), %rdi
movq 0x160(%rsp), %rax
leaq 0x63c7(%rip), %rsi      # 0x91a3
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1140
movl $0x0, 0x3a4(%rsp)
movl $0x0, 0x3a0(%rsp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x398(%rsp)
movq %rax, 0x390(%rsp)
leaq 0x378(%rsp), %rdi
callq 0x3a20
jmp 0x2e25
leaq 0x348(%rsp), %rdi
callq 0x4400
jmp 0x2e34
movl $0x0, 0x344(%rsp)
movl 0x344(%rsp), %eax
cmpl 0xd0d8(%rsp), %eax
jge 0x330c
movq 0xd0b8(%rsp), %rdi
leaq 0x61af(%rip), %rsi      # 0x9011
xorl %eax, %eax
leaq 0x340(%rsp), %rdx
callq 0x11a0
jmp 0x2e73
movq $0x0, 0x338(%rsp)
movq 0xd0b8(%rsp), %rdi
leaq 0x6354(%rip), %rsi      # 0x91e2
xorl %eax, %eax
leaq 0x330(%rsp), %rdx
leaq 0x328(%rsp), %rcx
leaq 0x320(%rsp), %r8
leaq 0x318(%rsp), %r9
callq 0x11a0
jmp 0x2eb7
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x330(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x328(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x320(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x318(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0xd0b8(%rsp), %rdi
leaq 0x62a0(%rip), %rsi      # 0x91e2
xorl %eax, %eax
leaq 0x330(%rsp), %rdx
leaq 0x328(%rsp), %rcx
leaq 0x320(%rsp), %r8
leaq 0x318(%rsp), %r9
callq 0x11a0
jmp 0x2f6b
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x330(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x328(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x320(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0x338(%rsp), %rax
shlq $0x8, %rax
movq 0x318(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x338(%rsp)
movq 0xd0b8(%rsp), %rdi
leaq 0x6200(%rip), %rsi      # 0x91f6
xorl %eax, %eax
leaq 0x314(%rsp), %rdx
leaq 0x310(%rsp), %rcx
callq 0x11a0
jmp 0x300f
movslq 0x340(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x470(%rsp,%rax), %rdi
leaq 0x338(%rsp), %rsi
callq 0x40c0
movq %rax, 0x138(%rsp)
jmp 0x303e
movq 0x138(%rsp), %rdi
callq 0x4050
movl %eax, 0x134(%rsp)
jmp 0x3054
movl 0x134(%rsp), %eax
movl %eax, 0x30c(%rsp)
movl 0x30c(%rsp), %eax
movl %eax, 0x130(%rsp)
movl 0x314(%rsp), %ecx
movl 0xd0e4(%rsp), %eax
cltd
idivl 0xd0e0(%rsp)
movl %eax, %edx
movl 0x130(%rsp), %eax
subl %edx, %ecx
cmpl %ecx, %eax
jl 0x30cc
movl 0x30c(%rsp), %eax
movl %eax, 0x12c(%rsp)
movl 0x310(%rsp), %ecx
movl 0xd0e4(%rsp), %eax
cltd
idivl 0xd0e0(%rsp)
movl %eax, %edx
movl 0x12c(%rsp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x31b1
movl 0x3a4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3a4(%rsp)
leaq 0x6117(%rip), %rdi      # 0x91fb
callq 0x1130
cmpq $0x0, %rax
jne 0x31af
movl 0x340(%rsp), %esi
leaq 0x6105(%rip), %rdi      # 0x9206
xorl %eax, %eax
callq 0x1030
jmp 0x310a
movl 0x33c(%rsp), %eax
movl %eax, %edi
movq 0x9eb6(%rip), %rax      # 0xcfd0
movq (%rax), %rsi
callq 0x12b0
leaq 0x6108(%rip), %rdi      # 0x9231
xorl %eax, %eax
callq 0x1030
jmp 0x3132
movq 0x338(%rsp), %rdi
movq 0x9e8f(%rip), %rax      # 0xcfd0
movq (%rax), %rsi
callq 0x12b0
movl 0x30c(%rsp), %esi
movl 0x314(%rsp), %edx
movl 0x310(%rsp), %ecx
leaq 0x60b1(%rip), %rdi      # 0x9216
xorl %eax, %eax
callq 0x1030
jmp 0x316e
jmp 0x31af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x468(%rsp)
movl %eax, 0x464(%rsp)
jmp 0x38d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x468(%rsp)
movl %eax, 0x464(%rsp)
leaq 0x348(%rsp), %rdi
callq 0x4530
jmp 0x38c6
jmp 0x31b1
movl 0x310(%rsp), %eax
subl 0x314(%rsp), %eax
cvtsi2sd %eax, %xmm0
cvtsi2sdl 0x30c(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x300(%rsp)
movsd 0x300(%rsp), %xmm0
ucomisd 0x398(%rsp), %xmm0
jbe 0x31ff
movsd 0x300(%rsp), %xmm0
movsd %xmm0, 0x398(%rsp)
movl 0x310(%rsp), %eax
movl 0x314(%rsp), %ecx
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
cvtsi2sdl 0xd0e4(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x2f8(%rsp)
leaq 0x390(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0x4410
movq %rax, 0x120(%rsp)
jmp 0x3248
movq 0x120(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x390(%rsp)
leaq 0x2e8(%rsp), %rdi
leaq 0x340(%rsp), %rsi
leaq 0x338(%rsp), %rdx
callq 0x4270
jmp 0x327c
leaq 0x378(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x3bc0
jmp 0x3293
leaq 0x2d8(%rsp), %rdi
leaq 0x340(%rsp), %rsi
leaq 0x338(%rsp), %rdx
callq 0x4270
jmp 0x32b2
leaq 0x348(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x4450
movb %dl, 0x117(%rsp)
movq %rax, 0x118(%rsp)
jmp 0x32d8
movb 0x117(%rsp), %al
movq 0x118(%rsp), %rcx
movq %rcx, 0x2c8(%rsp)
movb %al, 0x2d0(%rsp)
movl 0x344(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x344(%rsp)
jmp 0x2e3f
movl $0x0, 0x2c4(%rsp)
cmpl $0x441, 0x2c4(%rsp) # imm = 0x441
jge 0x369a
movslq 0x2c4(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x470(%rsp,%rax), %rdi
callq 0x41f0
movq %rax, 0x108(%rsp)
jmp 0x334f
movq 0x108(%rsp), %rax
movq %rax, 0x2b0(%rsp)
leaq 0x2b8(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x4220
jmp 0x3376
jmp 0x3378
movslq 0x2c4(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x470(%rsp,%rax), %rdi
callq 0x4240
movq %rax, 0x100(%rsp)
jmp 0x339f
movq 0x100(%rsp), %rax
movq %rax, 0x2a0(%rsp)
leaq 0x2a8(%rsp), %rdi
leaq 0x2a0(%rsp), %rsi
callq 0x4220
jmp 0x33c6
leaq 0x2b8(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
callq 0x3fe0
movb %al, 0xff(%rsp)
jmp 0x33e4
movb 0xff(%rsp), %al
testb $0x1, %al
jne 0x33f4
jmp 0x3682
leaq 0x2b8(%rsp), %rdi
callq 0x4030
movq %rax, 0xf0(%rsp)
jmp 0x340b
movq 0xf0(%rsp), %rdi
addq $0x8, %rdi
callq 0x4050
movl %eax, 0xec(%rsp)
jmp 0x3425
movl 0xec(%rsp), %ecx
xorl %eax, %eax
cmpl 0xd0dc(%rsp), %ecx
movb %al, 0xeb(%rsp)
jl 0x3543
leaq 0x470(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0x2b8(%rsp), %rdi
callq 0x4030
movq %rax, 0xe0(%rsp)
jmp 0x3469
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rax
movq (%rax), %rdx
movl 0x2c4(%rsp), %ecx
leaq 0x378(%rsp), %rsi
callq 0x1320
movl %eax, 0xd4(%rsp)
jmp 0x3499
movl 0xd4(%rsp), %ecx
xorl %eax, %eax
cmpl 0xd0dc(%rsp), %ecx
movb %al, 0xeb(%rsp)
jl 0x3543
leaq 0x2b8(%rsp), %rdi
callq 0x4030
movq %rax, 0xc8(%rsp)
jmp 0x34cd
movq 0xc8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x28c(%rsp)
movslq 0x2c4(%rsp), %rax
movq %rax, 0x280(%rsp)
leaq 0x290(%rsp), %rdi
leaq 0x28c(%rsp), %rsi
leaq 0x280(%rsp), %rdx
callq 0x4270
jmp 0x350d
leaq 0x348(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x44d0
movq %rax, 0xc0(%rsp)
jmp 0x352c
movq 0xc0(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
sete %al
movb %al, 0xeb(%rsp)
movb 0xeb(%rsp), %al
testb $0x1, %al
jne 0x3553
jmp 0x366c
movl 0x3a0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3a0(%rsp)
leaq 0x5c90(%rip), %rdi      # 0x91fb
callq 0x1130
cmpq $0x0, %rax
jne 0x366a
movl 0x2c4(%rsp), %esi
leaq 0x5c9b(%rip), %rdi      # 0x9223
xorl %eax, %eax
callq 0x1030
jmp 0x3591
leaq 0x2b8(%rsp), %rdi
callq 0x4030
movq %rax, 0xb8(%rsp)
jmp 0x35a8
movq 0xb8(%rsp), %rax
movq (%rax), %rdi
movq 0x9a16(%rip), %rax      # 0xcfd0
movq (%rax), %rsi
callq 0x12b0
leaq 0x2b8(%rsp), %rdi
callq 0x4030
movq %rax, 0xb0(%rsp)
jmp 0x35d9
movq 0xb0(%rsp), %rdi
addq $0x8, %rdi
callq 0x4050
movl %eax, 0xac(%rsp)
jmp 0x35f3
leaq 0x470(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x2b8(%rsp), %rdi
callq 0x4030
movq %rax, 0xa0(%rsp)
jmp 0x361a
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rax
movq (%rax), %rdx
movl 0x2c4(%rsp), %ecx
leaq 0x378(%rsp), %rsi
callq 0x1320
movl %eax, 0x94(%rsp)
jmp 0x364a
movl 0x94(%rsp), %edx
movl 0xac(%rsp), %esi
leaq 0x5bd4(%rip), %rdi      # 0x9233
xorl %eax, %eax
callq 0x1030
jmp 0x3668
jmp 0x366a
jmp 0x366c
jmp 0x366e
leaq 0x2b8(%rsp), %rdi
callq 0x4310
jmp 0x367d
jmp 0x3378
jmp 0x3684
movl 0x2c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c4(%rsp)
jmp 0x3317
movl 0x3a4(%rsp), %eax
addl 0x3a0(%rsp), %eax
cmpl $0x0, %eax
jle 0x3707
cmpq $0x0, 0xd0a8(%rsp)
je 0x3707
movq 0xd0a8(%rsp), %rdi
movq 0xd0e8(%rsp), %rax
movq (%rax), %rdx
movl 0xd0e4(%rsp), %ecx
movl 0xd0e0(%rsp), %r8d
movl 0xd0dc(%rsp), %r9d
movl 0x3a4(%rsp), %r10d
movl 0x3a0(%rsp), %eax
leaq 0x5b45(%rip), %rsi      # 0x923d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x1140
cmpq $0x0, 0xd0a8(%rsp)
je 0x37e7
cmpl $0x4, 0xd0f0(%rsp)
jg 0x37e7
movq 0xd0a8(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xd0c8(%rsp), %rax
movq %rax, 0x70(%rsp)
movl 0xd0e4(%rsp), %eax
movl %eax, 0x78(%rsp)
movl 0xd0e0(%rsp), %eax
movl %eax, 0x7c(%rsp)
movl 0xd0dc(%rsp), %eax
movl %eax, 0x80(%rsp)
movl 0xd0d8(%rsp), %eax
movl %eax, 0x84(%rsp)
leaq 0x428(%rsp), %rdi
callq 0x4340
movq %rax, 0x88(%rsp)
jmp 0x3787
movl 0x84(%rsp), %r10d
movl 0x80(%rsp), %r9d
movl 0x7c(%rsp), %r8d
movl 0x78(%rsp), %ecx
movq 0x70(%rsp), %rdx
movq 0x68(%rsp), %rdi
movq 0x88(%rsp), %rax
movss 0xd0d4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x398(%rsp), %xmm1
movsd 0x390(%rsp), %xmm2
leaq 0x5ab7(%rip), %rsi      # 0x928f
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x3, %al
callq 0x1140
cmpq $0x0, 0xd0b0(%rsp)
je 0x3803
movq 0xd0b0(%rsp), %rdi
callq 0x10d0
jmp 0x3801
jmp 0x3803
cmpq $0x0, 0xd0a8(%rsp)
je 0x381f
movq 0xd0a8(%rsp), %rdi
callq 0x10d0
jmp 0x381d
jmp 0x381f
movq 0xd0c0(%rsp), %rdi
callq 0x10d0
jmp 0x382e
movq 0xd0b8(%rsp), %rdi
callq 0x10d0
jmp 0x383d
cmpl $0x4, 0xd0f0(%rsp)
jg 0x3854
movq 0xd0c8(%rsp), %rdi
callq 0x1120
movl 0x3a4(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0x3a0(%rsp), %eax
movl %eax, 0x5c(%rsp)
leaq 0x428(%rsp), %rdi
callq 0x4340
movq %rax, 0x60(%rsp)
jmp 0x387e
movl 0x5c(%rsp), %edx
movl 0x58(%rsp), %esi
movq 0x60(%rsp), %rax
movl %eax, %ecx
leaq 0x5a82(%rip), %rdi      # 0x9316
xorl %eax, %eax
callq 0x1030
jmp 0x389d
movl $0x0, 0xd0f4(%rsp)
leaq 0x348(%rsp), %rdi
callq 0x4530
jmp 0x38b7
leaq 0x378(%rsp), %rdi
callq 0x3f20
jmp 0x38c8
jmp 0x38d7
leaq 0x410(%rsp), %rdi
callq 0x4540
jmp 0x38e8
leaq 0x378(%rsp), %rdi
callq 0x3f20
jmp 0x38e6
jmp 0x38f7
leaq 0x428(%rsp), %rdi
callq 0x3f20
jmp 0x3908
leaq 0x410(%rsp), %rdi
callq 0x4540
jmp 0x3906
jmp 0x3922
leaq 0x470(%rsp), %rax
movq %rax, 0x48(%rsp)
addq $0xcc30, %rax           # imm = 0xCC30
movq %rax, 0x50(%rsp)
jmp 0x3933
leaq 0x428(%rsp), %rdi
callq 0x3f20
jmp 0x3931
jmp 0x39b2
movq 0x50(%rsp), %rdi
addq $-0x30, %rdi
movq %rdi, 0x40(%rsp)
callq 0x40b0
jmp 0x3948
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x50(%rsp)
jne 0x3933
jmp 0x39f5
movq 0x48(%rsp), %rcx
movq %rax, %rsi
movq 0x40(%rsp), %rax
movq %rsi, 0x468(%rsp)
movl %edx, 0x464(%rsp)
cmpq %rax, %rcx
movq %rax, 0x38(%rsp)
je 0x39b0
movq 0x38(%rsp), %rdi
addq $-0x30, %rdi
movq %rdi, 0x30(%rsp)
callq 0x40b0
jmp 0x399c
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x38(%rsp)
jne 0x3987
jmp 0x3a04
leaq 0x470(%rsp), %rax
movq %rax, 0x20(%rsp)
addq $0xcc30, %rax           # imm = 0xCC30
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
addq $-0x30, %rdi
movq %rdi, 0x18(%rsp)
callq 0x40b0
jmp 0x39df
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x39ca
jmp 0x3a04
movl 0xd0f4(%rsp), %eax
addq $0xd0f8, %rsp           # imm = 0xD0F8
retq
movq 0x468(%rsp), %rdi
callq 0x1190
movq %rax, %rdi
callq 0x3fa0
nopl (%rax)