// File: /workspace/github_cpp_makefile_star2_O2/Mengjintao[P]SWAPCounter/src/sequence.cpp
// Function: parameter::getParameters(int, char**, MPIEnviroment*)
void parameter::getParameters(int argc, char **argv, MPIEnviroment *MPIcontrol)
{
    getopt(argc, argv);

    if(MPIcontrol->rank==0)
    {    
    	int stat = mkdir(this->outputPath, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH);
    	if(stat==-1)	
    	{
		printf("Error: Creating directory %s\n", this->outputPath);
		exit(0);
    	} 
    }

    strcpy(this->contigsPath, this->outputPath);
    strcpy(this->LogPath, this->outputPath);
    strcpy(this->graphPath, this->outputPath);
    strcpy(this->masterContigPath,this->outputPath);
    strcpy(this->JungGraph_arc, this->outputPath);
    strcpy(this->JungGraph_mul, this->outputPath);
    strcpy(this->arcFrequency, this->outputPath);
    strcpy(this->kmerGraph, this->outputPath);
    strcpy(this->kmerCount, this->outputPath);
    
    strcat(this->contigsPath, "/noCEcontigs.fasta");
    strcat(this->LogPath, "/logtime.txt"); 
    strcat(this->graphPath, "/contigGraph.txt");
    strcat(this->masterContigPath,"/CEContig.fasta");
    strcat(this->JungGraph_arc, "/JungGraph_arc.txt");
    strcat(this->JungGraph_mul, "/JungGraph_mul.txt");
    strcat(this->arcFrequency, "/arcFrequency.txt");    
    strcat(this->kmerGraph, "/kmerGraph.txt");
    strcat(this->kmerCount, "/kmerCount.txt");

    MPIcontrol->groupProc = this->groupProc;

    if(MPIcontrol->rank==0)
    {    printf("Runing command: %s -k %d -c %d -i %s -o %s\n", argv[0], this->hashLength, this->cutoffThreshold, this->fastaPath, this->outputPath);
         printf("contigsPath=%s, logPath=%s, graphPath=%s\n", this->contigsPath, this->LogPath, this->graphPath);
    }
//    strcpy(this->LogPath, "logtime.txt");
//    strcpy(this->graphPath, "distGraph.txt");

    char ch0='A', ch1='C', ch2='G', ch3='T';
    this->nucleotideValue[(int)ch0] = 0;
    this->nucleotideValue[(int)ch1] = 1;
    this->nucleotideValue[(int)ch2] = 2;
    this->nucleotideValue[(int)ch3] = 3;

    this->nucleotideArray[0] = 'A';
    this->nucleotideArray[1] = 'C';
    this->nucleotideArray[2] = 'G';
    this->nucleotideArray[3] = 'T';

    this->nucleotideReverse[(int)ch0] = 'T';
    this->nucleotideReverse[(int)ch1] = 'G';
    this->nucleotideReverse[(int)ch2] = 'C';
    this->nucleotideReverse[(int)ch3] = 'A';

    this->MASK = ~(3ull<<(2*hashLength));
    this->filterThreshold = Filter_Threshold;
 //   this->arcThreshold    = 5;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdi, %rbx
movq %rdx, 0x10(%rsp)
callq 0x4acc
movq %r14, 0x40(%rsp)
cmpl $0x0, (%r14)
jne 0x4e7a
leaq 0xff(%rbx), %r14
movq %r14, %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x20f0
cmpl $-0x1, %eax
je 0x5147
leaq 0x1fe(%rbx), %r14
leaq 0xff(%rbx), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2200
leaq 0x2fd(%rbx), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2200
leaq 0x3fc(%rbx), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2200
leaq 0x4fb(%rbx), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2200
leaq 0x5fa(%rbx), %rdi
movq %rdi, 0x18(%rsp)
movq %rbp, %rsi
callq 0x2200
leaq 0x6f9(%rbx), %rdi
movq %rdi, 0x20(%rsp)
movq %rbp, %rsi
callq 0x2200
leaq 0x7f8(%rbx), %rdi
movq %rdi, 0x28(%rsp)
movq %rbp, %rsi
callq 0x2200
leaq 0x8f7(%rbx), %rdi
movq %rdi, 0x30(%rsp)
movq %rbp, %rsi
callq 0x2200
leaq 0x9f6(%rbx), %rdi
movq %rdi, 0x38(%rsp)
movq %rbp, %rsi
callq 0x2200
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %r14
callq 0x20d0
movups 0x1847(%rip), %xmm0     # 0x678b
movups %xmm0, 0x1fe(%rbx,%rax)
movl $0x617473, 0x20d(%rbx,%rax) # imm = 0x617473
movq %r12, %rdi
callq 0x20d0
movabsq $0x656d6974676f6c2f, %rcx # imm = 0x656D6974676F6C2F
movq %rcx, 0x2fd(%rbx,%rax)
movabsq $0x7478742e656d69, %rcx # imm = 0x7478742E656D69
movq %rcx, 0x302(%rbx,%rax)
movq %r15, %rdi
callq 0x20d0
movups 0x1819(%rip), %xmm0     # 0x67ab
movups %xmm0, 0x3fc(%rbx,%rax)
movb $0x0, 0x40c(%rbx,%rax)
movq %r13, %rdi
callq 0x20d0
movups 0x180b(%rip), %xmm0     # 0x67bc
movups %xmm0, 0x4fb(%rbx,%rax)
movq 0x18(%rsp), %rdi
callq 0x20d0
movl $0x747874, %r12d        # imm = 0x747874
movl %r12d, 0x609(%rbx,%rax)
movups 0x17f4(%rip), %xmm0     # 0x67cc
movups %xmm0, 0x5fa(%rbx,%rax)
movq 0x20(%rsp), %rdi
callq 0x20d0
movl %r12d, 0x708(%rbx,%rax)
movups 0x17e6(%rip), %xmm0     # 0x67df
movups %xmm0, 0x6f9(%rbx,%rax)
movq 0x28(%rsp), %rdi
callq 0x20d0
movups 0x17e0(%rip), %xmm0     # 0x67f2
movups %xmm0, 0x7f8(%rbx,%rax)
movw $0x74, 0x808(%rbx,%rax)
movq 0x30(%rsp), %rdi
callq 0x20d0
movabsq $0x61724772656d6b2f, %rcx # imm = 0x61724772656D6B2F
movq %rcx, 0x8f7(%rbx,%rax)
movabsq $0x7478742e687061, %rcx # imm = 0x7478742E687061
movq %rcx, 0x8fe(%rbx,%rax)
movq 0x38(%rsp), %rdi
callq 0x20d0
movabsq $0x756f4372656d6b2f, %rcx # imm = 0x756F4372656D6B2F
movq %rcx, 0x9f6(%rbx,%rax)
movabsq $0x7478742e746e75, %rcx # imm = 0x7478742E746E75
movq %rcx, 0x9fd(%rbx,%rax)
movl 0xb20(%rbx), %eax
movq 0x40(%rsp), %rcx
movl %eax, 0x278(%rcx)
cmpl $0x0, (%rcx)
jne 0x50d7
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movl 0xaf8(%rbx), %edx
movl 0xb0c(%rbx), %ecx
leaq 0x1771(%rip), %rdi      # 0x6822
movq %rbx, %r8
movq %rbp, %r9
xorl %eax, %eax
callq 0x2040
leaq 0x1789(%rip), %rdi      # 0x684e
movq 0x8(%rsp), %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2040
movb $0x0, 0xb79(%rbx)
movb $0x1, 0xb7b(%rbx)
movb $0x2, 0xb7f(%rbx)
movb $0x3, 0xb8c(%rbx)
movl $0x54474341, 0xbb8(%rbx) # imm = 0x54474341
movb $0x54, 0xbfd(%rbx)
movb $0x47, 0xbff(%rbx)
movb $0x43, 0xc03(%rbx)
movb $0x41, 0xc10(%rbx)
movb 0xaf8(%rbx), %cl
addb %cl, %cl
pushq $0x3
popq %rax
shlq %cl, %rax
notq %rax
movq %rax, 0xb00(%rbx)
andl $0x0, 0xb08(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x161f(%rip), %rdi      # 0x676d
movq %r14, %rsi
xorl %eax, %eax
callq 0x2040
xorl %edi, %edi
callq 0x22c0
nop