// File: /workspace/github_cpp_makefile_star2_O2/simonrharris[P]SKA/src/sk_weed.cpp
// Function: weedKmers(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, float, float, int, int)
int weedKmers(const std::vector < std::string > & weedfiles, const std::string & kmerfile, const float minproportion, const float maxproportion, int minsamples, int maxsamples)
{

	const std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();
	// Create the kmer map
	std::set < std::string > kmerSet;
	
	std::ifstream fileStream;

	

	int kmersize=0;
	char base;
	
	

	if (kmerfile!=""){
		if (openFileStream(kmerfile, fileStream)){return 1;};
		std::vector < std::string > weednames;
		
		readKmerHeader(fileStream, kmersize, weednames);
		char kmerbuffer[kmersize*2/3];
		char asciibuffer[int(ceil(float(weednames.size())/6))];
		
		while (fileStream.read(asciibuffer, sizeof(asciibuffer))){
			std::string asciibits (asciibuffer, sizeof(asciibuffer));
			
			while (fileStream.peek()!='\n' && fileStream.get(base)){
				fileStream.read(kmerbuffer, sizeof(kmerbuffer));
				std::string kmer (kmerbuffer, sizeof(kmerbuffer));
				kmerSet.insert(kmer);
			}
			fileStream.ignore(256,'\n');//skip the end ofline character
	    }
		fileStream.close();
		
		std::cout << kmerSet.size() << " unique kmers in weed set" << std::endl;

		
	}


	std:: vector < std::string > sampleNames;
	if (collectSampleNames(weedfiles, sampleNames)!=0){return 1;}

	if (maxsamples==0){
		maxsamples=sampleNames.size();
	}
	else if (maxsamples>sampleNames.size()){
		std::cerr << "Warning: Maxsamples is greater than the number of samples in your files." << std::endl;
	}
	if (minsamples>sampleNames.size()){
		std::cerr << "Error: Minsamples is greater than the number of samples in your files." << std::endl;
		return 1;
	}

	int myminsamples=std::ceil(minproportion*sampleNames.size());
	int mymaxsamples;
	if (maxproportion==1.0){
		mymaxsamples=sampleNames.size();
	}
	else{
		mymaxsamples=std::floor(maxproportion*sampleNames.size());
	}

	if (myminsamples>minsamples){
		minsamples=myminsamples;
	}
	if (mymaxsamples<maxsamples){
		maxsamples=mymaxsamples;
	}

	if (minsamples>0 || maxsamples<sampleNames.size()){
		if (addKmersByFilters (kmerSet, weedfiles, minsamples, maxsamples, kmersize, sampleNames.size())){return 1;};
		std::cout << kmerSet.size() << " unique kmers in weed set" << std::endl;
	}
	
	int weeded=0;
	int totalweedkmers=0;
	
	for (std::vector < std::string >::const_iterator it = weedfiles.begin(); it != weedfiles.end(); ++it){

		if (openFileStream(*it, fileStream)){return 1;};

		int weedkmersize;
		std::vector < std::string > names;
		
		readKmerHeader(fileStream, weedkmersize, names);
		char kmerbuffer[weedkmersize*2/3];
		
		if (weedkmersize!=kmersize){
			std::cerr << "Files have different kmer sizes" << std::endl << std::endl;
			return 1;
		}
		std::string filename=std::string(*it);
		std::string outputfile=filename.substr(0, filename.find_last_of("."))+".weeded"+filename.substr(filename.find_last_of("."), filename.length());

		std::cout << "Writing weeded kmers to " << outputfile << std::endl;
	
		std::ofstream weededfile(outputfile);
		weededfile << "SKA v" << versionNumber << std::endl;
		weededfile << kmersize << std::endl;
		for ( std::vector < std::string >::iterator it=names.begin(); it!=names.end(); ++it){ //print each sample name to output file stream
			weededfile << *it << " "; 
		}
		weededfile << std::endl;

		bool firstkmer=true;

		char asciibuffer[int(ceil(float(names.size())/6))];
		while (fileStream.read(asciibuffer, sizeof(asciibuffer))){
			std::string asciibits (asciibuffer, sizeof(asciibuffer));
			
			while (fileStream.peek()!='\n' && fileStream.get(base)){
				fileStream.read(kmerbuffer, sizeof(kmerbuffer));
				std::string kmer (kmerbuffer, kmersize*2/3);
				
				std::set < std::string >::iterator it2 = kmerSet.find(kmer);//check if the kmer is in the hash
				if ( it2 == kmerSet.end() ){//if the kmer is not in the hash
					if (firstkmer){//if it's the first kmer, print the ascii bitstring
						weededfile << asciibits;
						firstkmer=false;
					}
					weededfile << base << kmer;//print the kmer
					weeded++;
				}
				totalweedkmers++;
			}
			if (firstkmer==false){
				weededfile << std::endl;
			}
			firstkmer=true;
			fileStream.ignore(256,'\n');//skip the end ofline character
    	}
		fileStream.close();
		weededfile.close();
	}
	std::cout << totalweedkmers << " kmers prior to weeding" << std::endl;
	std::cout << weeded << " kmers remaining after weeding" << std::endl;
	std::cout << totalweedkmers-weeded << " kmers weeded (Note this may be more than the number of kmers in the weed set due to mulitple variants of a kmer being in the file)" << std::endl;

	printDuration(start);
	
	return 0;
	
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x558, %rsp            # imm = 0x558
movl %ecx, %r14d
movl %edx, %r13d
movss %xmm1, -0x78(%rbp)
movss %xmm0, -0x70(%rbp)
movq %rsi, %rbx
movq %rdi, %r12
callq 0x5050
movq %rax, -0x128(%rbp)
leaq -0x150(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x580(%rbp), %rdi
callq 0x5450
andl $0x0, -0x30(%rbp)
leaq 0x9594(%rip), %rsi      # 0x262c2
movq %rbx, %rdi
callq 0x13394
testb %al, %al
je 0x1cf42
leaq -0x580(%rbp), %rsi
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r15d, %edx
callq 0x73fe
testl %eax, %eax
jne 0x1d5a4
movq %r12, -0x58(%rbp)
xorps %xmm0, %xmm0
leaq -0xe0(%rbp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq -0x580(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x832b
movq %rsp, -0x60(%rbp)
movl -0x30(%rbp), %eax
addl %eax, %eax
cltd
pushq $0x3
popq %rcx
idivl %ecx
movl %eax, %r15d
leaq 0xf(%r15), %rax
andq $-0x10, %rax
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
movq -0xd8(%rbp), %rax
subq -0xe0(%rbp), %rax
sarq $0x5, %rax
movl %r13d, -0x68(%rbp)
movq %r14, -0x38(%rbp)
js 0x1cdc8
cvtsi2ss %rax, %xmm0
jmp 0x1cddd
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x888b(%rip), %xmm0     # 0x25670
callq 0x5220
cvttss2si %xmm0, %ecx
leaq 0xf(%rcx), %rax
andq $-0x10, %rax
movq %rsp, %rdx
subq %rax, %rdx
movq %rdx, %rsp
movq %rcx, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
leaq (%rdx,%rcx), %rax
movq %rax, -0x80(%rbp)
leaq (%r12,%r15), %r14
leaq -0x580(%rbp), %r13
leaq -0x120(%rbp), %rbx
movq %r13, %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x54c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1cef0
leaq -0x368(%rbp), %rax
movq %rax, -0x378(%rbp)
leaq -0x378(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x80(%rbp), %rdx
callq 0x7828
movq %r13, %rdi
callq 0x5140
cmpl $0xa, %eax
je 0x1cecf
movq %r13, %rdi
leaq -0x29(%rbp), %rsi
callq 0x5550
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1cecf
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x54c0
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x7828
leaq -0x158(%rbp), %rdi
movq %rbx, %rsi
callq 0x9a1e
movq %rbx, %rdi
callq 0x5778
jmp 0x1ce65
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
pushq $0xa
popq %rdx
callq 0x5260
leaq -0x378(%rbp), %rdi
callq 0x5778
jmp 0x1ce21
leaq -0x580(%rbp), %rdi
callq 0x50a0
movl -0x68(%rbp), %r13d
movq -0x38(%rbp), %r14
movq -0x130(%rbp), %rsi
movq 0x190a6(%rip), %rdi     # 0x35fb8
callq 0x5280
leaq 0x9856(%rip), %rsi      # 0x26774
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq -0x60(%rbp), %rsp
leaq -0xe0(%rbp), %rdi
callq 0x911e
movq -0x58(%rbp), %r12
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
pushq $0x1
popq %r15
movq %r12, %rdi
movl %r15d, %edx
callq 0x8436
testl %eax, %eax
jne 0x1d598
testl %r14d, %r14d
je 0x1cfb8
movq -0xb8(%rbp), %rbx
subq -0xc0(%rbp), %rbx
movslq %r14d, %rax
movq %rbx, %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
jae 0x1cfcd
movq 0x1905c(%rip), %rdi     # 0x35ff0
leaq 0x97f3(%rip), %rsi      # 0x2678e
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq -0xb8(%rbp), %rbx
subq -0xc0(%rbp), %rbx
jmp 0x1cfcd
movq -0xb8(%rbp), %rbx
subq -0xc0(%rbp), %rbx
movq %rbx, %r14
shrq $0x5, %r14
movslq %r13d, %rax
sarq $0x5, %rbx
cmpq %rax, %rbx
jae 0x1cff9
movq 0x19010(%rip), %rdi     # 0x35ff0
leaq 0x97f0(%rip), %rsi      # 0x267d7
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
jmp 0x1d598
testq %rbx, %rbx
movq %r14, -0x38(%rbp)
js 0x1d009
cvtsi2ss %rbx, %xmm1
jmp 0x1d020
movq %rbx, %rax
shrq %rax
movl %ebx, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
movss -0x70(%rbp), %xmm0
movss %xmm1, -0x48(%rbp)
mulss %xmm1, %xmm0
callq 0x5220
cvttss2si %xmm0, %r14d
movss -0x78(%rbp), %xmm1
ucomiss 0x7fc0(%rip), %xmm1     # 0x25004
jne 0x1d04c
jp 0x1d04c
movl %ebx, %eax
jmp 0x1d05e
movss -0x48(%rbp), %xmm0
mulss %xmm1, %xmm0
callq 0x5160
cvttss2si %xmm0, %eax
cmpl %r13d, %r14d
cmovgl %r14d, %r13d
movq -0x38(%rbp), %rcx
cmpl %ecx, %eax
cmovll %eax, %ecx
testl %r13d, %r13d
jg 0x1d07b
movslq %ecx, %rax
cmpq %rax, %rbx
jbe 0x1d0c6
leaq -0x158(%rbp), %rdi
leaq -0x30(%rbp), %r8
movq %r12, %rsi
movl %r13d, %edx
movl %ebx, %r9d
callq 0x1c80c
testl %eax, %eax
jne 0x1d598
movq -0x130(%rbp), %rsi
movq 0x18f0e(%rip), %rdi     # 0x35fb8
callq 0x5280
leaq 0x96be(%rip), %rsi      # 0x26774
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq (%r12), %rdi
movq $0x0, -0x40(%rbp)
leaq -0x580(%rbp), %r14
leaq -0x178(%rbp), %r15
xorl %r13d, %r13d
movq %r12, -0x58(%rbp)
cmpq 0x8(%r12), %rdi
je 0x1d512
movq %rdi, -0x38(%rbp)
movq %r14, %rsi
pushq $0x1
popq %rdx
callq 0x73fe
testl %eax, %eax
jne 0x1d509
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
andq $0x0, -0x90(%rbp)
movq %r14, %rdi
leaq -0x4c(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x832b
movq %rsp, -0x68(%rbp)
movl -0x4c(%rbp), %eax
addl %eax, %eax
cltd
pushq $0x3
popq %rcx
idivl %ecx
movq %rax, -0x48(%rbp)
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
movl -0x4c(%rbp), %eax
movl -0x30(%rbp), %ecx
movl %eax, -0x60(%rbp)
movl %ecx, -0x84(%rbp)
cmpl %ecx, %eax
jne 0x1d2c5
leaq -0x120(%rbp), %rbx
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x5540
movq %rbx, %rdi
leaq 0xb244(%rip), %rsi      # 0x283ca
pushq $-0x1
popq %rdx
callq 0x53d0
leaq -0x100(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x5420
leaq -0x378(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq 0x9667(%rip), %rdx      # 0x2681e
callq 0xf751
movq %rbx, %rdi
leaq 0xb204(%rip), %rsi      # 0x283ca
pushq $-0x1
popq %rdx
callq 0x53d0
movq -0x118(%rbp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5420
leaq -0xe0(%rbp), %rdi
leaq -0x378(%rbp), %rbx
movq %rbx, %rsi
movq %r15, %rdx
callq 0xf770
movq %r15, %rdi
callq 0x5778
movq %rbx, %rdi
callq 0x5778
leaq -0x100(%rbp), %rdi
callq 0x5778
movq 0x18d99(%rip), %rdi     # 0x35fb8
leaq 0x9600(%rip), %rsi      # 0x26826
callq 0x53f0
movq %rax, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x53a0
movq %rax, %rdi
callq 0x51c0
movq %rbx, %rdi
leaq -0xe0(%rbp), %rsi
pushq $0x10
popq %rdx
callq 0x5740
movq %rbx, %rdi
leaq 0x8b2c(%rip), %rsi      # 0x25d8a
callq 0x53f0
movq %rax, %rdi
leaq 0x192b3(%rip), %rsi     # 0x36520
callq 0x53a0
movq %rax, %rdi
callq 0x51c0
movl -0x30(%rbp), %esi
leaq -0x378(%rbp), %rdi
callq 0x56a0
movq %rax, %rdi
callq 0x51c0
movq -0xa0(%rbp), %rbx
cmpq -0x98(%rbp), %rbx
je 0x1d2ed
leaq -0x378(%rbp), %rdi
movq %rbx, %rsi
callq 0x53a0
movq %rax, %rdi
leaq 0x90a3(%rip), %rsi      # 0x2635d
callq 0x53f0
addq $0x20, %rbx
jmp 0x1d298
movq 0x18d24(%rip), %rdi     # 0x35ff0
leaq 0x9481(%rip), %rsi      # 0x26754
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq %rax, %rdi
callq 0x51c0
jmp 0x1d4de
leaq -0x378(%rbp), %rdi
callq 0x51c0
movq -0x98(%rbp), %rax
subq -0xa0(%rbp), %rax
sarq $0x5, %rax
js 0x1d314
cvtsi2ss %rax, %xmm0
jmp 0x1d329
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x833f(%rip), %xmm0     # 0x25670
callq 0x5220
cvttss2si %xmm0, %ecx
leaq 0xf(%rcx), %rax
andq $-0x10, %rax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq %rcx, -0x80(%rbp)
leaq (%rbx,%rcx), %rax
movq %rax, -0x78(%rbp)
movq %rbx, -0x70(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movq -0x80(%rbp), %rdx
callq 0x54c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1d4a7
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x100(%rbp), %rdi
movq %rbx, %rsi
movq -0x78(%rbp), %rdx
callq 0x7828
movb $0x1, %bl
movq %r14, %rdi
callq 0x5140
cmpl $0xa, %eax
je 0x1d471
movq %r14, %rdi
leaq -0x29(%rbp), %rsi
callq 0x5550
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1d471
movq %r14, %rdi
movq %r12, %rsi
movq -0x48(%rbp), %rdx
callq 0x54c0
movl -0x30(%rbp), %eax
addl %eax, %eax
cltd
pushq $0x3
popq %rcx
idivl %ecx
movslq %eax, %rdx
leaq -0x168(%rbp), %rax
movq %rax, -0x178(%rbp)
addq %r12, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x7828
leaq -0x158(%rbp), %rdi
movq %r15, %rsi
callq 0x9c1c
leaq -0x150(%rbp), %rcx
cmpq %rcx, %rax
jne 0x1d461
testb $0x1, %bl
je 0x1d43c
leaq -0x378(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x53a0
xorl %ebx, %ebx
movsbl -0x29(%rbp), %esi
leaq -0x378(%rbp), %rdi
callq 0x5480
movq %rax, %rdi
movq %r15, %rsi
callq 0x53a0
movq -0x40(%rbp), %rax
incl %eax
movq %rax, -0x40(%rbp)
incl %r13d
movq %r15, %rdi
callq 0x5778
jmp 0x1d39f
testb $0x1, %bl
jne 0x1d482
leaq -0x378(%rbp), %rdi
callq 0x51c0
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
pushq $0xa
popq %rdx
callq 0x5260
leaq -0x100(%rbp), %rdi
callq 0x5778
movq -0x70(%rbp), %rbx
jmp 0x1d35b
movq %r14, %rdi
callq 0x50a0
leaq -0x378(%rbp), %rbx
movq %rbx, %rdi
callq 0x5560
movq %rbx, %rdi
callq 0x55c0
leaq -0xe0(%rbp), %rdi
callq 0x5778
leaq -0x120(%rbp), %rdi
callq 0x5778
movq -0x68(%rbp), %rsp
leaq -0xa0(%rbp), %rdi
callq 0x911e
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
movl -0x84(%rbp), %eax
cmpl %eax, -0x60(%rbp)
movq -0x58(%rbp), %r12
je 0x1d0e7
pushq $0x1
popq %r15
jmp 0x1d598
movq 0x18a9f(%rip), %rdi     # 0x35fb8
movl %r13d, %esi
callq 0x56a0
leaq 0x9317(%rip), %rsi      # 0x2683f
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq 0x18a79(%rip), %rdi     # 0x35fb8
movq -0x40(%rbp), %rsi
callq 0x56a0
leaq 0x9308(%rip), %rsi      # 0x26857
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
subl -0x40(%rbp), %r13d
movq 0x18a4e(%rip), %rdi     # 0x35fb8
movl %r13d, %esi
callq 0x56a0
leaq 0x92fd(%rip), %rsi      # 0x26876
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
xorl %r15d, %r15d
movq -0x128(%rbp), %rdi
callq 0x7657
leaq -0xc0(%rbp), %rdi
callq 0x911e
leaq -0x580(%rbp), %rdi
callq 0x50e0
leaq -0x158(%rbp), %rdi
callq 0x922a
movl %r15d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1d61d
jmp 0x1d61d
jmp 0x1d625
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x5778
jmp 0x1d5e8
movq %rax, %rbx
leaq -0x378(%rbp), %rdi
callq 0x5778
jmp 0x1d5f9
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
jmp 0x1d6b0
movq %rax, %rbx
jmp 0x1d6b5
jmp 0x1d632
jmp 0x1d64b
jmp 0x1d61d
jmp 0x1d640
movq %rax, %rbx
jmp 0x1d6e5
movq %rax, %rbx
jmp 0x1d6cd
movq %rax, %rbx
jmp 0x1d6a9
movq %rax, %rbx
jmp 0x1d6d9
movq %rax, %rbx
jmp 0x1d6c1
jmp 0x1d64b
jmp 0x1d665
jmp 0x1d640
movq %rax, %rbx
jmp 0x1d674
jmp 0x1d64b
jmp 0x1d64b
jmp 0x1d68e
movq %rax, %rbx
jmp 0x1d69d
jmp 0x1d665
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x5778
jmp 0x1d668
jmp 0x1d68e
movq %rax, %rbx
leaq -0x378(%rbp), %rdi
callq 0x5778
leaq -0xe0(%rbp), %rdi
jmp 0x1d6d4
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x5778
jmp 0x1d691
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x5778
leaq -0x378(%rbp), %rdi
callq 0x55c0
leaq -0xe0(%rbp), %rdi
callq 0x5778
leaq -0x120(%rbp), %rdi
callq 0x5778
leaq -0xa0(%rbp), %rdi
callq 0x911e
leaq -0xc0(%rbp), %rdi
callq 0x911e
leaq -0x580(%rbp), %rdi
callq 0x50e0
leaq -0x158(%rbp), %rdi
callq 0x922a
movq %rbx, %rdi
callq 0x56c0
nop