// File: kingufl[P]Rmapper/graph_traverse.cpp
// Function: DFS(int, int, int, int)
void DFS(int source, int thisnode, int thislvl, int toplvl){


    if(nodestatus[thisnode]==source){
        if(longestpath.size()<thispath.size()){
            longestcontig=thiscontig;
            longestpath=thispath;
        }
        return;
    }

    thispath.push_back(thisnode);
    thiscontig.push_back(nodefrag[thisnode][kmersize-1]);
    nodestatus[thisnode]=source;

    int iterationcontigsize=thiscontig.size();

    if(graphf[thisnode].size()==1){
        DFS(source,graphf[thisnode][0],thislvl+1,toplvl);
    }
    else{
            for(int ii=kmersize;ii<nodefrag[thisnode].size();ii++){
                thiscontig.push_back(nodefrag[thisnode][ii]);
            }

            longestcontig=thiscontig;
            longestpath=thispath;
    }

//    for(int nextnode: graphf[thisnode]){
//
//
//
//        thispath.resize(thislvl);
//        thiscontig.resize(iterationcontigsize);
//
//    }

//    if(longestpath.size()<thispath.size()){
//
//
//    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x11c11(%rip), %rdi     # 0x14290
callq 0x54f0
movl (%rax), %eax
cmpl -0x4(%rbp), %eax
jne 0x26de
leaq 0x11be6(%rip), %rdi     # 0x14278
callq 0x5510
movq %rax, -0x20(%rbp)
leaq 0x11b8e(%rip), %rdi     # 0x14230
callq 0x5510
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x26d9
leaq 0x11ba6(%rip), %rdi     # 0x14260
leaq 0x11b87(%rip), %rsi     # 0x14248
callq 0x5530
leaq 0x11bab(%rip), %rdi     # 0x14278
leaq 0x11b5c(%rip), %rsi     # 0x14230
callq 0x5530
jmp 0x2834
leaq 0x11b4b(%rip), %rdi     # 0x14230
leaq -0x8(%rbp), %rsi
callq 0x5780
movslq -0x8(%rbp), %rsi
leaq 0x11b07(%rip), %rdi     # 0x14200
callq 0x57f0
movq %rax, %rdi
movl 0x11ba1(%rip), %eax     # 0x142a8
subl $0x1, %eax
movslq %eax, %rsi
callq 0x54f0
movq %rax, %rsi
leaq 0x11b2c(%rip), %rdi     # 0x14248
callq 0x5780
movl -0x4(%rbp), %eax
movl %eax, -0x24(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x11b5e(%rip), %rdi     # 0x14290
callq 0x54f0
movl -0x24(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x11b05(%rip), %rdi     # 0x14248
callq 0x5510
movl %eax, -0x14(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x11a72(%rip), %rdi     # 0x141c8
callq 0x57f0
movq %rax, %rdi
callq 0x5510
cmpq $0x1, %rax
jne 0x27a3
movl -0x4(%rbp), %eax
movl %eax, -0x28(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x11a4e(%rip), %rdi     # 0x141c8
callq 0x57f0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x54f0
movl -0x28(%rbp), %edi
movl (%rax), %esi
movl -0xc(%rbp), %edx
addl $0x1, %edx
movl -0x10(%rbp), %ecx
callq 0x2660
jmp 0x2834
movl 0x11aff(%rip), %eax     # 0x142a8
movl %eax, -0x18(%rbp)
movslq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x11a41(%rip), %rdi     # 0x14200
callq 0x57f0
movq %rax, %rdi
callq 0x5510
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0x280e
movslq -0x8(%rbp), %rsi
leaq 0x11a1d(%rip), %rdi     # 0x14200
callq 0x57f0
movq %rax, %rdi
movslq -0x18(%rbp), %rsi
callq 0x54f0
movq %rax, %rsi
leaq 0x11a4a(%rip), %rdi     # 0x14248
callq 0x5780
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x27ac
leaq 0x11a4b(%rip), %rdi     # 0x14260
leaq 0x11a2c(%rip), %rsi     # 0x14248
callq 0x5530
leaq 0x11a50(%rip), %rdi     # 0x14278
leaq 0x11a01(%rip), %rsi     # 0x14230
callq 0x5530
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)