// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xfe0, %rsp            # imm = 0xFE0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movslq 0xf46280(%rax), %rdi
shlq $0x3, %rdi
leaq 0xbd8f0(%rip), %rsi     # 0xe4408
movl $0x3, %edx
callq 0x52d70
movq %rax, -0xfc8(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xf46280(%rcx), %eax
jge 0x26b71
movslq -0x10(%rbp), %rax
movl $0x0, -0xfc0(%rbp,%rax,4)
movq -0xfc8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsd 0xbc44f(%rip), %xmm0    # 0xe2fb0
movsd %xmm0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x26b30
movq -0xfc8(%rbp), %rax
movslq -0xc(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl $0xffffffff, 0xf452e0(%rax,%rcx,4) # imm = 0xFFFFFFFF
movslq -0x14(%rbp), %rax
cmpl $0x0, -0xfc0(%rbp,%rax,4)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x26bb7
jmp 0x26d2e
movslq -0x14(%rbp), %rax
movl $0x1, -0xfc0(%rbp,%rax,4)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl 0xf42400(%rcx,%rdx,4), %eax
jge 0x26ca9
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0x3e80, %rcx, %rcx     # imm = 0x3E80
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0x3e80, %rcx, %rcx     # imm = 0x3E80
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0xfd0(%rbp)
movq -0xfc8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0xfc8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
addsd -0xfd0(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x26c99
movq -0xfc8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0xfd0(%rbp), %xmm0
movq -0xfc8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x14(%rbp), %edx
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, 0xf452e0(%rax,%rcx,4)
jmp 0x26c9b
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x26bcd
movl $0x0, -0x14(%rbp)
movsd 0xbc2f8(%rip), %xmm0    # 0xe2fb0
movsd %xmm0, -0xfd8(%rbp)
movl $0x1, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xf46280(%rcx), %eax
jge 0x26d29
movslq -0x10(%rbp), %rax
cmpl $0x0, -0xfc0(%rbp,%rax,4)
jne 0x26d1c
movsd -0xfd8(%rbp), %xmm0
movq -0xfc8(%rbp), %rax
movslq -0x10(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x26d1c
movq -0xfc8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xfd8(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x26d1e
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x26cc7
jmp 0x26b9d
movq -0xfc8(%rbp), %rax
addq $0xfe0, %rsp            # imm = 0xFE0
popq %rbp
retq
nop