// File: readmapping[P]alfalfa/src/mapper.cpp
// Function: identifyAndFilter(std::vector<match_t, std::allocator<match_t>>&, bool, int, int, std::vector<lis_t, std::allocator<lis_t>>&, align_opt const&)
void identifyAndFilter(vector<match_t>& matches, bool fw, int qLength, int editDist, vector<lis_t>& lisIntervals, const align_opt & alnOptions){
    if(!matches.empty()){
        size_t emptySize = lisIntervals.size();
        //FIND SMEMS AND REGIONS
        size_t maxSmemOcc = alnOptions.maxSeedCandidates;
        long minMemLength = alnOptions.minMemRegLength;
        size_t maxPossOccIncrease = alnOptions.maxRegionMems;
        //sort according to query offset and len
        sort(matches.begin(),matches.end(), compMatchesSMEM);
        ///////////////////////////////////////////////////
        //TRIAGE: smems and mems to fill candidate regions
        ///////////////////////////////////////////////////
        vector<match_t> smems;
        vector<match_t> reserves;
        smems.reserve(matches.size());
        reserves.reserve(matches.size());
        long previousStart = matches[0].query;
        long previousEnd = matches[0].query + matches[0].len;
        long previousREnd = -1L;
        size_t rangeStart = 0;
        size_t currentSmemRange = 0;
        size_t index = 0;
        ///////////////////////////
        //IDENTIFY SMEMS
        //////////////////////////
        if(alnOptions.print >= 5) cerr << "number of MEMs before calculating regions: " << matches.size() << endl;
        while(index < matches.size()){
            rangeStart = index;
            previousStart = matches[index].query;
            previousEnd = matches[index].query + matches[index].len;
            index++;
            //same mem/smem
            while(index < matches.size() && matches[index].query == previousStart && matches[index].query+matches[index].len == previousEnd)
                index++;
            //region of same query position seeds: insert this region in triage
            assert(index>=rangeStart);
            if(previousEnd > previousREnd)
                currentSmemRange = index-rangeStart;
            else
                currentSmemRange += index-rangeStart;
            if ((previousEnd > previousREnd && currentSmemRange <= maxSmemOcc) || 
                    (currentSmemRange <= maxPossOccIncrease 
                    && previousEnd-previousStart >= minMemLength)){
                        for(size_t j = rangeStart; j < index; j++)
                            smems.push_back(matches[j]);
            }
            else {
                for(size_t j = rangeStart; j < index; j++)
                    reserves.push_back(matches[j]);
            }
            //new values of fields
            previousREnd = previousEnd;
        }
        if(alnOptions.print >= 5){ 
            cerr << "number of SMEMs: " << smems.size() << endl;
            cerr << "number of reserves: " << reserves.size() << endl;
        }
        ///////////////////////////
        //CREATE CANDIDATE REGIONS
        //////////////////////////
        sort(smems.begin(),smems.end(), compMatches);
        int begin, end, longest;
        begin = end = longest = 0;
        long refEnd, refBegin;
        while(begin < (int) smems.size()){
            //left most --> define right most boundary
            refEnd = smems[begin].ref - smems[begin].query + qLength + editDist;
            longest = begin;
            end = begin+1;
            //find right most boundary
            while(end < (int) smems.size() && smems[end].ref + smems[end].len <= refEnd){
                if(smems[longest].len < smems[end].len){
                    longest = end;
                    refEnd = smems[longest].ref - smems[longest].query + qLength + editDist;
                }
                end++;
            }
            //first to left
            refBegin = smems[longest].ref - smems[longest].query - editDist;
            //begin = longest-1;
            begin--;
            int beginFix = begin;//bugfix: merge region contains some seeds twice
            while(begin >= 0 && smems[begin].ref >= refBegin)
                begin--;
            //add interval to list and calculate coverage
            if(emptySize==lisIntervals.size() || lisIntervals.back().refEnd < refBegin){
                //no overlap, calc coverage and push
                lisIntervals.push_back(lis_t(fw));
                lisIntervals.back().addSeeds(smems,begin+1,end-1);
                lisIntervals.back().refBegin = refBegin;
                lisIntervals.back().refEnd = refEnd;
                if(alnOptions.print >= 5) cerr << "region found with " << (end-begin-1) << " seeds" << endl;
            }
            else{//overlap with previous: merge two regions
                lisIntervals.back().addSeeds(smems,beginFix+1,end-1);
                lisIntervals.back().refBegin = min(lisIntervals.back().refBegin,refBegin);
                lisIntervals.back().refEnd = min(lisIntervals.back().refEnd,refEnd);
                if(alnOptions.print >= 5) cerr << "previous region extended with " << (end-beginFix-1) << " seeds" << endl;
            }
            //start new interval
            begin = end;
        }
        if(alnOptions.print >= 5) cerr << (lisIntervals.size() - emptySize) << " regions found" << endl;
        ///////////////////////////
        //FILL CANDIDATE REGIONS
        //////////////////////////
        //region fill: merge reserves in regions fill both matches and lisIntervals
        int reservesAdded = 0;
        if(emptySize < lisIntervals.size()){
            sort(reserves.begin(),reserves.end(), compMatches);
            size_t curReserve = 0;
            size_t curInterval = emptySize;
            while(curReserve < reserves.size() && curInterval < lisIntervals.size()){
                if(reserves[curReserve].ref < lisIntervals[curInterval].refBegin)
                    curReserve++;
                else if(lisIntervals[curInterval].refEnd < reserves[curReserve].ref)
                    curInterval++;
                else{
                    lisIntervals[curInterval].addSeed(reserves[curReserve]);
                    reservesAdded++;
                    curReserve++;
                }
            }
        }
        if(alnOptions.print >= 5) cerr << reservesAdded << " extra seeds added to region" << endl;
    }
}

// Assembly:
subq $0x2e8, %rsp            # imm = 0x2E8
movb %sil, %al
movq %rdi, 0x2e0(%rsp)
andb $0x1, %al
movb %al, 0x2df(%rsp)
movl %edx, 0x2d8(%rsp)
movl %ecx, 0x2d4(%rsp)
movq %r8, 0x2c8(%rsp)
movq %r9, 0x2c0(%rsp)
movq 0x2e0(%rsp), %rdi
callq 0x4c370
testb $0x1, %al
jne 0x3ec02
movq 0x2c8(%rsp), %rdi
callq 0x4c4b0
movq %rax, 0x2b8(%rsp)
movq 0x2c0(%rsp), %rax
movslq 0x40(%rax), %rax
movq %rax, 0x2b0(%rsp)
movq 0x2c0(%rsp), %rax
movslq 0x48(%rax), %rax
movq %rax, 0x2a8(%rsp)
movq 0x2c0(%rsp), %rax
movslq 0x4c(%rax), %rax
movq %rax, 0x2a0(%rsp)
movq 0x2e0(%rsp), %rdi
callq 0x23310
movq %rax, 0x298(%rsp)
movq 0x2e0(%rsp), %rdi
callq 0x23100
movq %rax, 0x290(%rsp)
movq 0x298(%rsp), %rdi
movq 0x290(%rsp), %rsi
leaq -0x140(%rip), %rdx      # 0x3dbb0
callq 0x4c4d0
leaq 0x278(%rsp), %rdi
movq %rdi, 0x170(%rsp)
callq 0x4c520
leaq 0x260(%rsp), %rdi
callq 0x4c520
movq 0x2e0(%rsp), %rdi
callq 0x23440
movq 0x170(%rsp), %rdi
movq %rax, %rsi
callq 0x4c530
jmp 0x3dd36
movq 0x2e0(%rsp), %rdi
callq 0x23440
movq %rax, %rsi
leaq 0x260(%rsp), %rdi
callq 0x4c530
jmp 0x3dd55
movq 0x2e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4c200
movslq 0x8(%rax), %rax
movq %rax, 0x248(%rsp)
movq 0x2e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4c200
movl 0x8(%rax), %eax
movl %eax, 0x16c(%rsp)
movq 0x2e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4c200
movq %rax, %rcx
movl 0x16c(%rsp), %eax
addl 0xc(%rcx), %eax
cltq
movq %rax, 0x240(%rsp)
movq $-0x1, 0x238(%rsp)
movq $0x0, 0x230(%rsp)
movq $0x0, 0x228(%rsp)
movq $0x0, 0x220(%rsp)
movq 0x2c0(%rsp), %rax
cmpl $0x5, 0x78(%rax)
jl 0x3de68
movq 0x591f6(%rip), %rdi     # 0x96ff0
leaq 0x3fefd(%rip), %rsi     # 0x7dcfe
callq 0x8360
movq %rax, 0x160(%rsp)
jmp 0x3de10
movq 0x2e0(%rsp), %rdi
callq 0x23440
movq 0x160(%rsp), %rdi
movq %rax, %rsi
callq 0x8100
movq %rax, 0x158(%rsp)
jmp 0x3de37
movq 0x158(%rsp), %rdi
movq 0x5916a(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0x3de4d
jmp 0x3de68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0x3ebe6
jmp 0x3de6a
movq 0x220(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x2e0(%rsp), %rdi
callq 0x23440
movq %rax, %rcx
movq 0x150(%rsp), %rax
cmpq %rcx, %rax
jae 0x3e183
movq 0x220(%rsp), %rax
movq %rax, 0x230(%rsp)
movq 0x2e0(%rsp), %rdi
movq 0x220(%rsp), %rsi
callq 0x4c200
movslq 0x8(%rax), %rax
movq %rax, 0x248(%rsp)
movq 0x2e0(%rsp), %rdi
movq 0x220(%rsp), %rsi
callq 0x4c200
movl 0x8(%rax), %eax
movl %eax, 0x14c(%rsp)
movq 0x2e0(%rsp), %rdi
movq 0x220(%rsp), %rsi
callq 0x4c200
movq %rax, %rcx
movl 0x14c(%rsp), %eax
addl 0xc(%rcx), %eax
cltq
movq %rax, 0x240(%rsp)
movq 0x220(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x220(%rsp)
movq 0x220(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x2e0(%rsp), %rdi
callq 0x23440
movq 0x140(%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x14b(%rsp)
jae 0x3dfe6
movq 0x2e0(%rsp), %rdi
movq 0x220(%rsp), %rsi
callq 0x4c200
movslq 0x8(%rax), %rcx
xorl %eax, %eax
cmpq 0x248(%rsp), %rcx
movb %al, 0x14b(%rsp)
jne 0x3dfe6
movq 0x2e0(%rsp), %rdi
movq 0x220(%rsp), %rsi
callq 0x4c200
movl 0x8(%rax), %eax
movl %eax, 0x13c(%rsp)
movq 0x2e0(%rsp), %rdi
movq 0x220(%rsp), %rsi
callq 0x4c200
movq %rax, %rcx
movl 0x13c(%rsp), %eax
addl 0xc(%rcx), %eax
cltq
cmpq 0x240(%rsp), %rax
sete %al
movb %al, 0x14b(%rsp)
movb 0x14b(%rsp), %al
testb $0x1, %al
jne 0x3dff3
jmp 0x3e00c
movq 0x220(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x220(%rsp)
jmp 0x3df2b
movq 0x240(%rsp), %rax
cmpq 0x238(%rsp), %rax
jle 0x3e038
movq 0x220(%rsp), %rax
subq 0x230(%rsp), %rax
movq %rax, 0x228(%rsp)
jmp 0x3e058
movq 0x220(%rsp), %rax
subq 0x230(%rsp), %rax
addq 0x228(%rsp), %rax
movq %rax, 0x228(%rsp)
movq 0x240(%rsp), %rax
cmpq 0x238(%rsp), %rax
jle 0x3e07c
movq 0x228(%rsp), %rax
cmpq 0x2b0(%rsp), %rax
jbe 0x3e0a8
movq 0x228(%rsp), %rax
cmpq 0x2a0(%rsp), %rax
ja 0x3e10b
movq 0x240(%rsp), %rax
subq 0x248(%rsp), %rax
cmpq 0x2a8(%rsp), %rax
jl 0x3e10b
movq 0x230(%rsp), %rax
movq %rax, 0x218(%rsp)
movq 0x218(%rsp), %rax
cmpq 0x220(%rsp), %rax
jae 0x3e109
movq 0x2e0(%rsp), %rdi
movq 0x218(%rsp), %rsi
callq 0x4c200
movq %rax, %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c670
jmp 0x3e0f1
jmp 0x3e0f3
movq 0x218(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x218(%rsp)
jmp 0x3e0b8
jmp 0x3e16e
movq 0x230(%rsp), %rax
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
cmpq 0x220(%rsp), %rax
jae 0x3e16c
movq 0x2e0(%rsp), %rdi
movq 0x210(%rsp), %rsi
callq 0x4c200
movq %rax, %rsi
leaq 0x260(%rsp), %rdi
callq 0x4c670
jmp 0x3e154
jmp 0x3e156
movq 0x210(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x210(%rsp)
jmp 0x3e11b
jmp 0x3e16e
movq 0x240(%rsp), %rax
movq %rax, 0x238(%rsp)
jmp 0x3de6a
movq 0x2c0(%rsp), %rax
cmpl $0x5, 0x78(%rax)
jl 0x3e24b
movq 0x58e54(%rip), %rdi     # 0x96ff0
leaq 0x3fb87(%rip), %rsi     # 0x7dd2a
callq 0x8360
movq %rax, 0x130(%rsp)
jmp 0x3e1b2
leaq 0x278(%rsp), %rdi
callq 0x23440
movq 0x130(%rsp), %rdi
movq %rax, %rsi
callq 0x8100
movq %rax, 0x128(%rsp)
jmp 0x3e1d9
movq 0x128(%rsp), %rdi
movq 0x58dc8(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0x3e1ef
movq 0x58dfa(%rip), %rdi     # 0x96ff0
leaq 0x3fb3f(%rip), %rsi     # 0x7dd3c
callq 0x8360
movq %rax, 0x120(%rsp)
jmp 0x3e20c
leaq 0x260(%rsp), %rdi
callq 0x23440
movq 0x120(%rsp), %rdi
movq %rax, %rsi
callq 0x8100
movq %rax, 0x118(%rsp)
jmp 0x3e233
movq 0x118(%rsp), %rdi
movq 0x58d6e(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0x3e249
jmp 0x3e24b
leaq 0x278(%rsp), %rdi
movq %rdi, 0x110(%rsp)
callq 0x23310
movq 0x110(%rsp), %rdi
movq %rax, 0x208(%rsp)
callq 0x23100
movq %rax, 0x200(%rsp)
movq 0x208(%rsp), %rdi
movq 0x200(%rsp), %rsi
leaq -0x744(%rip), %rdx      # 0x3db50
callq 0x4c4d0
jmp 0x3e29b
movl $0x0, 0x1f4(%rsp)
movl $0x0, 0x1f8(%rsp)
movl $0x0, 0x1fc(%rsp)
movl 0x1fc(%rsp), %eax
movl %eax, 0x10c(%rsp)
leaq 0x278(%rsp), %rdi
callq 0x23440
movq %rax, %rcx
movl 0x10c(%rsp), %eax
cmpl %ecx, %eax
jge 0x3e8f1
movslq 0x1fc(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq (%rax), %rax
movq %rax, 0x100(%rsp)
movslq 0x1fc(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq %rax, %rcx
movq 0x100(%rsp), %rax
movslq 0x8(%rcx), %rcx
subq %rcx, %rax
movslq 0x2d8(%rsp), %rcx
addq %rcx, %rax
movslq 0x2d4(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x1e8(%rsp)
movl 0x1fc(%rsp), %eax
movl %eax, 0x1f4(%rsp)
movl 0x1fc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1f8(%rsp)
movl 0x1f8(%rsp), %eax
movl %eax, 0xf8(%rsp)
leaq 0x278(%rsp), %rdi
callq 0x23440
movl 0xf8(%rsp), %ecx
movl %eax, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0xff(%rsp)
jge 0x3e3f7
movslq 0x1f8(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq (%rax), %rax
movq %rax, 0xf0(%rsp)
movslq 0x1f8(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq %rax, %rcx
movq 0xf0(%rsp), %rax
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
cmpq 0x1e8(%rsp), %rax
setle %al
movb %al, 0xff(%rsp)
movb 0xff(%rsp), %al
testb $0x1, %al
jne 0x3e407
jmp 0x3e4d3
movslq 0x1f4(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movl 0xc(%rax), %eax
movl %eax, 0xec(%rsp)
movslq 0x1f8(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq %rax, %rcx
movl 0xec(%rsp), %eax
cmpl 0xc(%rcx), %eax
jge 0x3e4bd
movl 0x1f8(%rsp), %eax
movl %eax, 0x1f4(%rsp)
movslq 0x1f4(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq (%rax), %rax
movq %rax, 0xe0(%rsp)
movslq 0x1f4(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq %rax, %rcx
movq 0xe0(%rsp), %rax
movslq 0x8(%rcx), %rcx
subq %rcx, %rax
movslq 0x2d8(%rsp), %rcx
addq %rcx, %rax
movslq 0x2d4(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x1e8(%rsp)
movl 0x1f8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1f8(%rsp)
jmp 0x3e36d
movslq 0x1f4(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq (%rax), %rax
movq %rax, 0xd8(%rsp)
movslq 0x1f4(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq %rax, %rcx
movq 0xd8(%rsp), %rax
movslq 0x8(%rcx), %rcx
subq %rcx, %rax
movslq 0x2d4(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x1e0(%rsp)
movl 0x1fc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x1fc(%rsp)
movl 0x1fc(%rsp), %eax
movl %eax, 0x1dc(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x1fc(%rsp)
movb %al, 0xd7(%rsp)
jl 0x3e589
movslq 0x1fc(%rsp), %rsi
leaq 0x278(%rsp), %rdi
callq 0x4c200
movq (%rax), %rax
cmpq 0x1e0(%rsp), %rax
setge %al
movb %al, 0xd7(%rsp)
movb 0xd7(%rsp), %al
testb $0x1, %al
jne 0x3e596
jmp 0x3e5a9
movl 0x1fc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x1fc(%rsp)
jmp 0x3e54c
movq 0x2b8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x4c4b0
movq %rax, %rcx
movq 0xc8(%rsp), %rax
cmpq %rcx, %rax
je 0x3e5f5
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq 0x10(%rax), %rax
cmpq 0x1e0(%rsp), %rax
jge 0x3e785
movq 0x2c8(%rsp), %rax
movq %rax, 0xc0(%rsp)
movzbl 0x2df(%rsp), %esi
andl $0x1, %esi
leaq 0x1a0(%rsp), %rdi
callq 0x4c750
jmp 0x3e61f
movq 0xc0(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x4c720
jmp 0x3e636
leaq 0x1a0(%rsp), %rdi
callq 0x4c7a0
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq %rax, %rdi
movl 0x1fc(%rsp), %eax
incl %eax
movslq %eax, %rdx
movl 0x1f8(%rsp), %eax
decl %eax
movslq %eax, %rcx
leaq 0x278(%rsp), %rsi
callq 0x4c7d0
jmp 0x3e67a
movq 0x1e0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq 0xb0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x1e8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq 0xb8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq 0x2c0(%rsp), %rax
cmpl $0x5, 0x78(%rax)
jl 0x3e780
movq 0x5890b(%rip), %rdi     # 0x96ff0
leaq 0x3f665(%rip), %rsi     # 0x7dd51
callq 0x8360
movq %rax, 0xa8(%rsp)
jmp 0x3e6fb
movq 0xa8(%rsp), %rdi
movl 0x1f8(%rsp), %eax
movl 0x1fc(%rsp), %esi
notl %esi
addl %eax, %esi
callq 0x8710
movq %rax, 0xa0(%rsp)
jmp 0x3e724
movq 0xa0(%rsp), %rdi
leaq 0x3f93b(%rip), %rsi     # 0x7e06e
callq 0x8360
movq %rax, 0x98(%rsp)
jmp 0x3e742
movq 0x98(%rsp), %rdi
movq 0x5885f(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0x3e758
jmp 0x3e780
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x4c7a0
jmp 0x3ebe6
jmp 0x3e8de
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq %rax, %rdi
movl 0x1dc(%rsp), %eax
incl %eax
movslq %eax, %rdx
movl 0x1f8(%rsp), %eax
decl %eax
movslq %eax, %rcx
leaq 0x278(%rsp), %rsi
callq 0x4c7d0
jmp 0x3e7bc
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq %rax, %rdi
addq $0x8, %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x1efc0
movq %rax, 0x90(%rsp)
jmp 0x3e7e7
movq 0x90(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x80(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq 0x80(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq %rax, %rdi
addq $0x10, %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x1efc0
movq %rax, 0x88(%rsp)
jmp 0x3e83e
movq 0x88(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x78(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x4c6e0
movq 0x78(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq 0x2c0(%rsp), %rax
cmpl $0x5, 0x78(%rax)
jl 0x3e8dc
movq 0x58777(%rip), %rdi     # 0x96ff0
leaq 0x3f4e4(%rip), %rsi     # 0x7dd64
callq 0x8360
movq %rax, 0x70(%rsp)
jmp 0x3e88c
movq 0x70(%rsp), %rdi
movl 0x1f8(%rsp), %eax
movl 0x1dc(%rsp), %esi
notl %esi
addl %eax, %esi
callq 0x8710
movq %rax, 0x68(%rsp)
jmp 0x3e8af
movq 0x68(%rsp), %rdi
leaq 0x3f7b3(%rip), %rsi     # 0x7e06e
callq 0x8360
movq %rax, 0x60(%rsp)
jmp 0x3e8c7
movq 0x60(%rsp), %rdi
movq 0x586dd(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0x3e8da
jmp 0x3e8dc
jmp 0x3e8de
movl 0x1f8(%rsp), %eax
movl %eax, 0x1fc(%rsp)
jmp 0x3e2bc
movq 0x2c0(%rsp), %rax
cmpl $0x5, 0x78(%rax)
jl 0x3e95a
movq 0x2c8(%rsp), %rdi
callq 0x4c4b0
movq %rax, %rsi
movq 0x2b8(%rsp), %rax
subq %rax, %rsi
movq 0x586cf(%rip), %rdi     # 0x96ff0
callq 0x8100
movq %rax, 0x58(%rsp)
jmp 0x3e92d
movq 0x58(%rsp), %rdi
leaq 0x3f44a(%rip), %rsi     # 0x7dd83
callq 0x8360
movq %rax, 0x50(%rsp)
jmp 0x3e945
movq 0x50(%rsp), %rdi
movq 0x5865f(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0x3e958
jmp 0x3e95a
movl $0x0, 0x19c(%rsp)
movq 0x2b8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x4c4b0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x3eb77
leaq 0x260(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x23310
movq 0x40(%rsp), %rdi
movq %rax, 0x190(%rsp)
callq 0x23100
movq %rax, 0x188(%rsp)
movq 0x190(%rsp), %rdi
movq 0x188(%rsp), %rsi
leaq -0xe83(%rip), %rdx      # 0x3db50
callq 0x4c4d0
jmp 0x3e9da
movq $0x0, 0x180(%rsp)
movq 0x2b8(%rsp), %rax
movq %rax, 0x178(%rsp)
movq 0x180(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x260(%rsp), %rdi
callq 0x23440
movq 0x30(%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x3f(%rsp)
jae 0x3ea4f
movq 0x178(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x4c4b0
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x3ea5c
jmp 0x3eb75
movq 0x180(%rsp), %rsi
leaq 0x260(%rsp), %rdi
callq 0x4c200
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x2c8(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4c850
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq 0x8(%rcx), %rax
jge 0x3eab5
movq 0x180(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x180(%rsp)
jmp 0x3eb70
movq 0x2c8(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4c850
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x180(%rsp), %rsi
leaq 0x260(%rsp), %rdi
callq 0x4c200
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq (%rcx), %rax
jge 0x3eb0b
movq 0x178(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x178(%rsp)
jmp 0x3eb6e
movq 0x2c8(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4c850
movq %rax, 0x10(%rsp)
movq 0x180(%rsp), %rsi
leaq 0x260(%rsp), %rdi
callq 0x4c200
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x4c870
jmp 0x3eb49
movl 0x19c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x19c(%rsp)
movq 0x180(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x180(%rsp)
jmp 0x3eb70
jmp 0x3e9f6
jmp 0x3eb77
movq 0x2c0(%rsp), %rax
cmpl $0x5, 0x78(%rax)
jl 0x3ebca
movl 0x19c(%rsp), %esi
movq 0x5845d(%rip), %rdi     # 0x96ff0
callq 0x8710
movq %rax, 0x8(%rsp)
jmp 0x3eb9f
movq 0x8(%rsp), %rdi
leaq 0x3f1e7(%rip), %rsi     # 0x7dd92
callq 0x8360
movq %rax, (%rsp)
jmp 0x3ebb6
movq (%rsp), %rdi
movq 0x583ef(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0x3ebc8
jmp 0x3ebca
leaq 0x260(%rsp), %rdi
callq 0xdbc0
leaq 0x278(%rsp), %rdi
callq 0xdbc0
jmp 0x3ec02
leaq 0x260(%rsp), %rdi
callq 0xdbc0
leaq 0x278(%rsp), %rdi
callq 0xdbc0
jmp 0x3ec0a
addq $0x2e8, %rsp            # imm = 0x2E8
retq
movq 0x258(%rsp), %rdi
callq 0x8730
nopw (%rax,%rax)