// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/datastructure.c
// Function: shortest_path
double* shortest_path(Graphptr g, int start)
{
 int i, v, w;
 int intree[MAXV];
 double* distance, weight, dist;
 distance = safemalloc(g->nvertices * sizeof(double), "shortest_path", 3);
 for (i = 0; i < g->nvertices; i++)
  {
   intree[i] = BOOLEAN_FALSE;
   distance[i] = +LONG_MAX;
  }
 distance[start] = 0;
 v = start;
 g->parents[v] = -1;
 while (!intree[v])
  {
   intree[v] = BOOLEAN_TRUE;
   for (i = 0; i < g->degree[v]; i++)
    {
     w = g->edges[v][i].v;
     weight = g->edges[v][i].weight;
     if (distance[w] > distance[v] + weight)
      {
       distance[w] = distance[v] + weight;
       g->parents[w] = v;
      }
    }
   v = 0;
   dist = +LONG_MAX;
   for (i = 1; i < g->nvertices; i++)
     if (!intree[i] && dist > distance[i])
      {
       dist = distance[i];
       v = i;
      }
  }
 return distance;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xfa0, %rsp            # imm = 0xFA0
movl %esi, %ebp
movq %rdi, %rbx
movslq 0xf46280(%rdi), %rdi
shlq $0x3, %rdi
leaq 0x8c0f5(%rip), %rsi     # 0xa7839
movl $0x3, %edx
callq 0x3a0e1
movq %rax, %r14
movslq 0xf46280(%rbx), %r12
testq %r12, %r12
jle 0x1b82f
leaq (,%r12,4), %rdx
movq %rsp, %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x4050
leal 0x1(%r12), %eax
decq %r12
movq %r12, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %eax
shlq $0x4, %rax
movdqa 0x8acaa(%rip), %xmm1    # 0xa6440
movdqa 0x8acb2(%rip), %xmm2    # 0xa6450
pxor %xmm2, %xmm0
movabsq $0x43e0000000000000, %rcx # imm = 0x43E0000000000000
pcmpeqd %xmm3, %xmm3
movdqa 0x8acd8(%rip), %xmm4    # 0xa6490
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edx
notl %edx
testb $0x1, %dl
je 0x1b7ed
movq %rcx, (%r14,%r15)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1b800
movq %rcx, 0x8(%r14,%r15)
paddq %xmm4, %xmm1
addq $0x10, %r15
cmpq %r15, %rax
jne 0x1b7b8
movslq %ebp, %rcx
cmpl $0x0, (%rsp,%rcx,4)
movq $0x0, (%r14,%rcx,8)
movl $0xffffffff, 0xf452e0(%rbx,%rcx,4) # imm = 0xFFFFFFFF
jne 0x1b8f4
jmp 0x1b845
movslq %ebp, %rcx
movq $0x0, (%r14,%rcx,8)
movl $0xffffffff, 0xf452e0(%rbx,%rcx,4) # imm = 0xFFFFFFFF
leaq 0x8(%rbx), %rax
movsd 0x8aadf(%rip), %xmm0    # 0xa6330
movl $0x1, (%rsp,%rcx,4)
movl 0xf42400(%rbx,%rcx,4), %edx
testl %edx, %edx
jle 0x1b8ad
imulq $0x3e80, %rcx, %rsi     # imm = 0x3E80
addq %rax, %rsi
xorl %edi, %edi
movslq -0x8(%rsi), %r8
movsd (%rsi), %xmm1
movsd (%r14,%r8,8), %xmm2
addsd (%r14,%rcx,8), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x1b89e
movsd %xmm1, (%r14,%r8,8)
movl %ebp, 0xf452e0(%rbx,%r8,4)
movl 0xf42400(%rbx,%rcx,4), %edx
incq %rdi
movslq %edx, %r8
addq $0x10, %rsi
cmpq %r8, %rdi
jl 0x1b86f
movslq 0xf46280(%rbx), %rcx
xorl %ebp, %ebp
cmpq $0x2, %rcx
jl 0x1b8e7
xorl %ebp, %ebp
movl $0x1, %edx
movapd %xmm0, %xmm1
cmpl $0x0, (%rsp,%rdx,4)
jne 0x1b8df
movsd (%r14,%rdx,8), %xmm2
ucomisd %xmm2, %xmm1
jbe 0x1b8df
movl %edx, %ebp
movapd %xmm2, %xmm1
incq %rdx
cmpq %rdx, %rcx
jne 0x1b8c7
movslq %ebp, %rcx
cmpl $0x0, (%rsp,%rcx,4)
je 0x1b851
movq %r14, %rax
addq $0xfa0, %rsp            # imm = 0xFA0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq