// File: /workspace/github_cpp_makefile_star2_O3/LiGaCu[P]Distributed_System_to_Compute_the_Shortest_Path/serverC.cpp
// Function: searchpath(std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char>>&, int, int, int*, float*)
void searchpath(std::istringstream &tokenStream,int srcVtxid,int dstVtxid, int *path, float *mindistan)
{
    std::string line;
    int lspacepos, rspacepos, fstdgt, secdgt;
    float distan;

    float dist[maxnode_num];
    int prev[maxnode_num];
    float distans[maxnode_num][maxnode_num];
    int node_num = 0, link_num = 0;

    int indextable[maxnode_num];
    int firstidx, secondidx, srcidx = maxnode_num, dstidx = maxnode_num;

    for(int i=1; i<maxnode_num; i++)
        for(int j=1; j<maxnode_num; j++)
            distans[i][j] = inf_dis;
    
    for(int i=1; i<maxnode_num; i++)
        indextable[i] = defaultidx;

    while ( getline (tokenStream,line) )
    {
        lspacepos = line.find(" ");
        rspacepos = line.find(" ",lspacepos+1);
        if(lspacepos != -1 && rspacepos != -1)
        {
            link_num++;
            fstdgt = atoi(line.substr(0,lspacepos).c_str());
            secdgt = atoi(line.substr(lspacepos+1,rspacepos-lspacepos-1).c_str());
            distan = atof(line.substr(rspacepos+1).c_str());

            for(int i=1;i<maxnode_num;i++)
            {
                if(indextable[i] == fstdgt)
                {
                    firstidx = i;
                    break;
                }
                else if(indextable[i] == defaultidx)
                {
                    indextable[i] = fstdgt;
                    firstidx = i;
                    node_num++;
                    break;
                }
            }
            for(int i=1;i<maxnode_num;i++)
            {
                if(indextable[i] == secdgt)
                {
                    secondidx = i;
                    break;
                }
                else if(indextable[i] == defaultidx)
                {
                    indextable[i] = secdgt;
                    secondidx = i;
                    node_num++;
                    break;
                }
            }
            if (distans[firstidx][secondidx] > distan)
            {
                distans[firstidx][secondidx] = distan;
                distans[secondidx][firstidx] = distan;
            }
        }
    }

    for(int i=1; i<maxnode_num; i++)
        dist[i] = inf_dis;

    for(int i=1;i<maxnode_num;i++)
    {
        if(indextable[i] == srcVtxid) {
            srcidx = i; 
            break;
        }
    }
    for(int i=1;i<maxnode_num;i++)
    {
        if(indextable[i] == dstVtxid) {
            dstidx = i;
            break;
        }
    }

    Dijkstra(node_num, srcidx, dist, prev, distans);
    *mindistan = dist[dstidx];
    recoverPath(prev, srcidx, dstidx, indextable, path);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %r8, 0x90(%rsp)
movq %rcx, 0x98(%rsp)
movl %edx, 0x1c(%rsp)
movl %esi, 0x18(%rsp)
movq %rdi, %r12
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0x1, %eax
leaq 0x15c(%rsp), %rcx
movdqa 0x151d(%rip), %xmm3     # 0x4010
movdqa 0x1525(%rip), %xmm4     # 0x4020
pshufd $0xf5, 0x153c(%rip), %xmm0 # xmm0 = mem[1,1,3,3]
movdqa %xmm0, 0x20(%rsp)
xorl %edx, %edx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm4, %xmm1
pxor 0x150a(%rip), %xmm1     # 0x4030
movdqa 0x1512(%rip), %xmm2     # 0x4040
pcmpgtd %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pcmpeqd 0x20(%rsp), %xmm1
pand %xmm2, %xmm1
movd %xmm1, %esi
testb $0x1, %sil
je 0x2b53
movl $0x4cbebc20, -0xc(%rcx,%rdx,4) # imm = 0x4CBEBC20
pextrw $0x4, %xmm1, %esi
testb $0x1, %sil
je 0x2b66
movl $0x4cbebc20, -0x8(%rcx,%rdx,4) # imm = 0x4CBEBC20
por %xmm3, %xmm0
pxor 0x14be(%rip), %xmm0     # 0x4030
movdqa 0x14c6(%rip), %xmm1     # 0x4040
pcmpgtd %xmm0, %xmm1
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pcmpeqd 0x20(%rsp), %xmm0
pand %xmm1, %xmm0
pextrw $0x0, %xmm0, %esi
testb $0x1, %sil
je 0x2ba0
movl $0x4cbebc20, -0x4(%rcx,%rdx,4) # imm = 0x4CBEBC20
pextrw $0x4, %xmm0, %esi
testb $0x1, %sil
je 0x2bb2
movl $0x4cbebc20, (%rcx,%rdx,4) # imm = 0x4CBEBC20
addq $0x4, %rdx
cmpq $0xc, %rdx
jne 0x2b0c
incq %rax
addq $0x2c, %rcx
cmpq $0xb, %rax
jne 0x2b0a
xorl %eax, %eax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm4, %xmm1
pxor 0x1443(%rip), %xmm1     # 0x4030
movdqa 0x144b(%rip), %xmm2     # 0x4040
pcmpgtd %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pcmpeqd 0x20(%rsp), %xmm1
pand %xmm2, %xmm1
movd %xmm1, %ecx
testb $0x1, %cl
je 0x2c19
movl $0xc, 0x54(%rsp,%rax,4)
pextrw $0x4, %xmm1, %ecx
testb $0x1, %cl
je 0x2c2b
movl $0xc, 0x58(%rsp,%rax,4)
por %xmm3, %xmm0
pxor 0x13f9(%rip), %xmm0     # 0x4030
movdqa 0x1401(%rip), %xmm1     # 0x4040
pcmpgtd %xmm0, %xmm1
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pcmpeqd 0x20(%rsp), %xmm0
pand %xmm1, %xmm0
pextrw $0x0, %xmm0, %ecx
testb $0x1, %cl
je 0x2c64
movl $0xc, 0x5c(%rsp,%rax,4)
pextrw $0x4, %xmm0, %ecx
testb $0x1, %cl
je 0x2c76
movl $0xc, 0x60(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0xc, %rax
jne 0x2bd3
movq $0x0, (%rsp)
leaq 0xa0(%rsp), %rbx
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2ec6
movl $0x1, %ecx
movq %rbx, %rdi
leaq 0x14bc(%rip), %r15      # 0x4194
movq %r15, %rsi
xorl %edx, %edx
callq 0x21d0
movq %rax, %r14
movq %rax, %r13
shlq $0x20, %r13
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%rax,%r13), %rbp
sarq $0x20, %rbp
movl $0x1, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x21d0
cmpl $-0x1, %r14d
je 0x2c94
movq %rax, %r15
movl %r15d, %eax
cmpl $-0x1, %eax
je 0x2c94
sarq $0x20, %r13
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x20e0
movq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x2190
movl %eax, 0x14(%rsp)
leaq 0x40(%rsp), %rax
cmpq %rax, %r13
je 0x2d6b
movq 0x40(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x20d0
notl %r14d
addl %r15d, %r14d
movslq %r14d, %rcx
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x20e0
movq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x2190
movl %eax, %ebp
leaq 0x40(%rsp), %rax
cmpq %rax, %r14
je 0x2dad
movq 0x40(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x20d0
shlq $0x20, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
sarq $0x20, %r15
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq $-0x1, %rcx
callq 0x20e0
movq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x2110
leaq 0x40(%rsp), %rax
cmpq %rax, %r14
je 0x2e12
movq 0x40(%rsp), %rsi
incq %rsi
movq %r14, %rdi
movq %xmm0, 0x88(%rsp)
callq 0x20d0
movq 0x88(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movl $0x1, %eax
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %esi
movl 0x50(%rsp,%rax,4), %ecx
cmpl %esi, %ecx
je 0x2e49
cmpl $0xc, %ecx
je 0x2e3b
incq %rax
cmpq $0xb, %rax
jne 0x2e23
jmp 0x2e4b
movl %esi, 0x50(%rsp,%rax,4)
movq (%rsp), %rcx
incl %ecx
movq %rcx, (%rsp)
movl %eax, %edx
movl $0x1, %eax
movl 0x50(%rsp,%rax,4), %ecx
cmpl %ebp, %ecx
je 0x2e7a
cmpl $0xc, %ecx
je 0x2e6c
incq %rax
cmpq $0xb, %rax
jne 0x2e50
movl 0xc(%rsp), %ecx
jmp 0x2e7c
movl %ebp, 0x50(%rsp,%rax,4)
movq (%rsp), %rcx
incl %ecx
movq %rcx, (%rsp)
movl %eax, %ecx
movl %edx, 0x10(%rsp)
movslq %edx, %rax
movl %ecx, 0xc(%rsp)
movslq %ecx, %rcx
imulq $0x2c, %rax, %rdx
addq %rsp, %rdx
addq $0x120, %rdx            # imm = 0x120
movss (%rdx,%rcx,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2c94
leaq (%rdx,%rcx,4), %rdx
movss %xmm0, (%rdx)
imulq $0x2c, %rcx, %rcx
addq %rsp, %rcx
addq $0x120, %rcx            # imm = 0x120
movss %xmm0, (%rcx,%rax,4)
jmp 0x2c94
xorl %eax, %eax
movdqa 0x1140(%rip), %xmm3     # 0x4010
movdqa 0x1148(%rip), %xmm4     # 0x4020
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm4, %xmm1
pxor 0x113e(%rip), %xmm1     # 0x4030
movdqa 0x1146(%rip), %xmm2     # 0x4040
pcmpgtd %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pcmpeqd 0x20(%rsp), %xmm1
pand %xmm2, %xmm1
movd %xmm1, %ecx
testb $0x1, %cl
je 0x2f21
movl $0x4cbebc20, 0xc4(%rsp,%rax,4) # imm = 0x4CBEBC20
pextrw $0x4, %xmm1, %ecx
testb $0x1, %cl
je 0x2f36
movl $0x4cbebc20, 0xc8(%rsp,%rax,4) # imm = 0x4CBEBC20
por %xmm3, %xmm0
pxor 0x10ee(%rip), %xmm0     # 0x4030
movdqa 0x10f6(%rip), %xmm1     # 0x4040
pcmpgtd %xmm0, %xmm1
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pcmpeqd 0x20(%rsp), %xmm0
pand %xmm1, %xmm0
pextrw $0x0, %xmm0, %ecx
testb $0x1, %cl
je 0x2f72
movl $0x4cbebc20, 0xcc(%rsp,%rax,4) # imm = 0x4CBEBC20
pextrw $0x4, %xmm0, %ecx
testb $0x1, %cl
je 0x2f87
movl $0x4cbebc20, 0xd0(%rsp,%rax,4) # imm = 0x4CBEBC20
addq $0x4, %rax
cmpq $0xc, %rax
jne 0x2ed8
movl $0x1, %ebx
movl 0x1c(%rsp), %eax
movl 0x18(%rsp), %ecx
cmpl %ecx, 0x50(%rsp,%rbx,4)
je 0x2fb6
incq %rbx
cmpq $0xb, %rbx
jne 0x2fa2
movl $0xb, %ebx
movl $0x1, %r14d
cmpl %eax, 0x50(%rsp,%r14,4)
je 0x2fd2
incq %r14
cmpq $0xb, %r14
jne 0x2fbc
movl $0xb, %r14d
leaq 0xc0(%rsp), %rdx
leaq 0xf0(%rsp), %r15
leaq 0x120(%rsp), %r8
movq (%rsp), %rdi
movl %ebx, %esi
movq %r15, %rcx
callq 0x3097
movl %r14d, %eax
movss 0xc0(%rsp,%rax,4), %xmm0
movq 0x90(%rsp), %rax
movss %xmm0, (%rax)
leaq 0x50(%rsp), %rcx
movq %r15, %rdi
movl %ebx, %esi
movl %r14d, %edx
movq 0x98(%rsp), %r8
callq 0x31a6
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x304f
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x20d0
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3067
jmp 0x3067
jmp 0x3067
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x308f
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x20d0
movq %rbx, %rdi
callq 0x21e0