// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/datastructure.c
// Function: minimum_spanning_tree_prim
Graphptr minimum_spanning_tree_prim(Graphptr g)
{
 int i, v, w;
 int intree[MAXV];
 double distance[MAXV], weight, dist;
 int parent[MAXV];
 Graphptr mst = graph(g->nvertices);
 for (i = 0; i < g->nvertices; i++)
  {
   intree[i] = BOOLEAN_FALSE;
   distance[i] = +LONG_MAX;
   parent[i] = -1;
  }
 distance[0] = 0;
 v = 0;
 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] > weight && !intree[w])
      {
       distance[w] = weight;
       parent[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;
      }
  }
 for (i = 1; i < g->nvertices; i++)
   if (parent[i] != -1)
    {
     graph_insert_edge(mst, parent[i], i, 1);
     graph_insert_edge(mst, i, parent[i], 1);
    }
 return mst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3ec0, %rsp           # imm = 0x3EC0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0xf46280(%rax), %edi
callq 0x26570
movq %rax, -0x3eb8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xf46280(%rcx), %eax
jge 0x268e9
movslq -0xc(%rbp), %rax
movl $0x0, -0xfc0(%rbp,%rax,4)
movslq -0xc(%rbp), %rax
movsd 0xbc6ea(%rip), %xmm0    # 0xe2fb0
movsd %xmm0, -0x2f00(%rbp,%rax,8)
movslq -0xc(%rbp), %rax
movl $0xffffffff, -0x3eb0(%rbp,%rax,4) # imm = 0xFFFFFFFF
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2689c
xorps %xmm0, %xmm0
movsd %xmm0, -0x2f00(%rbp)
movl $0x0, -0x10(%rbp)
movslq -0x10(%rbp), %rax
cmpl $0x0, -0xfc0(%rbp,%rax,4)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x26915
jmp 0x26a66
movslq -0x10(%rbp), %rax
movl $0x1, -0xfc0(%rbp,%rax,4)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movslq -0x10(%rbp), %rdx
cmpl 0xf42400(%rcx,%rdx,4), %eax
jge 0x269e7
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
imulq $0x3e80, %rcx, %rcx     # imm = 0x3E80
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
imulq $0x3e80, %rcx, %rcx     # imm = 0x3E80
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x2f08(%rbp)
movslq -0x14(%rbp), %rax
movsd -0x2f00(%rbp,%rax,8), %xmm0
ucomisd -0x2f08(%rbp), %xmm0
jbe 0x269d7
movslq -0x14(%rbp), %rax
cmpl $0x0, -0xfc0(%rbp,%rax,4)
jne 0x269d7
movsd -0x2f08(%rbp), %xmm0
movslq -0x14(%rbp), %rax
movsd %xmm0, -0x2f00(%rbp,%rax,8)
movl -0x10(%rbp), %ecx
movslq -0x14(%rbp), %rax
movl %ecx, -0x3eb0(%rbp,%rax,4)
jmp 0x269d9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2692b
movl $0x0, -0x10(%rbp)
movsd 0xbc5ba(%rip), %xmm0    # 0xe2fb0
movsd %xmm0, -0x2f10(%rbp)
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xf46280(%rcx), %eax
jge 0x26a61
movslq -0xc(%rbp), %rax
cmpl $0x0, -0xfc0(%rbp,%rax,4)
jne 0x26a54
movsd -0x2f10(%rbp), %xmm0
movslq -0xc(%rbp), %rax
ucomisd -0x2f00(%rbp,%rax,8), %xmm0
jbe 0x26a54
movslq -0xc(%rbp), %rax
movsd -0x2f00(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x2f10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x26a56
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x26a05
jmp 0x268fb
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xf46280(%rcx), %eax
jge 0x26adb
movslq -0xc(%rbp), %rax
cmpl $-0x1, -0x3eb0(%rbp,%rax,4)
je 0x26ace
movq -0x3eb8(%rbp), %rdi
movslq -0xc(%rbp), %rax
movl -0x3eb0(%rbp,%rax,4), %esi
movl -0xc(%rbp), %edx
movsd 0xbb571(%rip), %xmm0    # 0xe2018
callq 0x266d0
movq -0x3eb8(%rbp), %rdi
movl -0xc(%rbp), %esi
movslq -0xc(%rbp), %rax
movl -0x3eb0(%rbp,%rax,4), %edx
movsd 0xbb54f(%rip), %xmm0    # 0xe2018
callq 0x266d0
jmp 0x26ad0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x26a6d
movq -0x3eb8(%rbp), %rax
addq $0x3ec0, %rsp           # imm = 0x3EC0
popq %rbp
retq
nopl (%rax,%rax)