Pprof listing
havlak1
Total: 5758 samples

main.DFS

/home/rsc/g/benchgraffiti/havlak/havlak1.go
Total:   225   2296 (flat / cumulative samples)
  235               	return false
  236               }
  237               
  238               // DFS - Depth-First-Search and node numbering.
  239               //
  240      3      3 func DFS(currentNode *BasicBlock, nodes []*UnionFindNode, number map[*BasicBlock]int, last []int, current int) int {           1      1 		0000000000401675: mov    %fs:0xfffffffffffffff0,%rcx
                    		000000000040167e: cmp    (%rcx),%rsp
                    		0000000000401681: ja     40168d <main.DFS+0x18>
                    		0000000000401683: mov    $0x40,%eax
                    		0000000000401688: callq  4046cd <runtime.morestack01>
           2      2 		000000000040168d: sub    $0x70,%rsp
                    		0000000000401691: mov    0xa8(%rsp),%eax

  241     18     19 	nodes[current].Init(currentNode, current)                    		0000000000401698: movslq %eax,%rbx
                    		000000000040169b: cmp    0x88(%rsp),%ebx
                    		00000000004016a2: jb     4016a9 <main.DFS+0x34>
                    		00000000004016a4: callq  41219a <runtime.panicindex>
                    		00000000004016a9: mov    0x80(%rsp),%rbp
                    		00000000004016b1: mov    0x0(%rbp,%rbx,8),%r8
          17     17 		00000000004016b6: mov    %r8,(%rsp)
           1      1 		00000000004016ba: mov    0x78(%rsp),%rbx
                    		00000000004016bf: mov    %rbx,0x8(%rsp)
                    		00000000004016c4: mov    %eax,0x10(%rsp)
                  1 		00000000004016c8: callq  401497 <main.*UnionFindNode·Init>

  242           166 	number[currentNode] = current                    		00000000004016cd: mov    0x90(%rsp),%rbx
                    		00000000004016d5: mov    %rbx,(%rsp)
                    		00000000004016d9: mov    0x78(%rsp),%rbx
                    		00000000004016de: mov    %rbx,0x8(%rsp)
                    		00000000004016e3: mov    0xa8(%rsp),%ebx
                    		00000000004016ea: mov    %ebx,0x10(%rsp)
                166 		00000000004016ee: callq  4089b2 <runtime.mapassign1>

  243               
  244      2      2 	lastid := current           2      2 		00000000004016f3: mov    0xa8(%rsp),%ebx
                    		00000000004016fa: mov    %ebx,0x4c(%rsp)

  245    167    167 	for _, target := range currentNode.OutEdges {                    		00000000004016fe: mov    0x78(%rsp),%rbx
                    		0000000000401703: add    $0x18,%rbx
                    		0000000000401707: mov    (%rbx),%rbp
          39     39 		000000000040170a: mov    %rbp,0x58(%rsp)
           2      2 		000000000040170f: mov    0x8(%rbx),%ebp
           3      3 		0000000000401712: mov    %ebp,0x60(%rsp)
                    		0000000000401716: mov    0xc(%rbx),%ebp
                    		0000000000401719: mov    %ebp,0x64(%rsp)
           1      1 		000000000040171d: xor    %eax,%eax
                    		000000000040171f: mov    0x60(%rsp),%ebx
                    		0000000000401723: mov    %ebx,0x48(%rsp)
                    		0000000000401727: lea    0x58(%rsp),%rbx
                    		000000000040172c: mov    (%rbx),%rcx
                    		000000000040172f: mov    0x48(%rsp),%ebp
                    		0000000000401733: cmp    %ebp,%eax
                    		0000000000401735: jge    401807 <main.DFS+0x192>
                    		000000000040173b: mov    %eax,0x44(%rsp)
                    		000000000040173f: mov    (%rcx),%rax
         117    117 		0000000000401742: mov    %rcx,%rbx
           4      4 		0000000000401745: add    $0x8,%rbx
                    		0000000000401749: mov    %rbx,0x68(%rsp)
                    		00000000004017f9: inc    %eax
                    		00000000004017fb: mov    0x48(%rsp),%ebp
           1      1 		00000000004017ff: cmp    %ebp,%eax
                    		0000000000401801: jl     40173b <main.DFS+0xc6>

  246     17    508 		if number[target] == unvisited {                    		000000000040174e: mov    0x90(%rsp),%rbp
           6      6 		0000000000401756: mov    %rbp,(%rsp)
                    		000000000040175a: mov    %rax,0x50(%rsp)
                    		000000000040175f: mov    %rax,0x8(%rsp)
           1    492 		0000000000401764: callq  408494 <runtime.mapaccess1>
           4      4 		0000000000401769: mov    0x68(%rsp),%rcx
           1      1 		000000000040176e: mov    0x44(%rsp),%eax
                    		0000000000401772: mov    0x10(%rsp),%ebx
           5      5 		0000000000401776: cmp    $0xffffffffffffffff,%ebx
                    		0000000000401779: jne    4017f9 <main.DFS+0x184>

  247     10   1157 			lastid = DFS(target, nodes, number, last, lastid+1)                    		000000000040177b: mov    0x50(%rsp),%rbx
                    		0000000000401780: mov    %rbx,(%rsp)
                    		0000000000401784: lea    0x8(%rsp),%rbx
                    		0000000000401789: mov    0x80(%rsp),%rbp
                    		0000000000401791: mov    %rbp,(%rbx)
                    		0000000000401794: mov    0x88(%rsp),%ebp
                    		000000000040179b: mov    %ebp,0x8(%rbx)
                    		000000000040179e: mov    0x8c(%rsp),%ebp
                    		00000000004017a5: mov    %ebp,0xc(%rbx)
                    		00000000004017a8: mov    0x90(%rsp),%rbx
                    		00000000004017b0: mov    %rbx,0x18(%rsp)
                    		00000000004017b5: lea    0x20(%rsp),%rbx
                    		00000000004017ba: mov    0x98(%rsp),%rbp
                    		00000000004017c2: mov    %rbp,(%rbx)
           1      1 		00000000004017c5: mov    0xa0(%rsp),%ebp
                    		00000000004017cc: mov    %ebp,0x8(%rbx)
                    		00000000004017cf: mov    0xa4(%rsp),%ebp
                    		00000000004017d6: mov    %ebp,0xc(%rbx)
                    		00000000004017d9: mov    0x4c(%rsp),%ebx
                    		00000000004017dd: inc    %ebx
                    		00000000004017df: mov    %ebx,0x30(%rsp)
               1147 		00000000004017e3: callq  401675 <main.DFS>
           2      2 		00000000004017e8: mov    0x68(%rsp),%rcx
           7      7 		00000000004017ed: mov    0x44(%rsp),%eax
                    		00000000004017f1: mov    0x38(%rsp),%ebx
                    		00000000004017f5: mov    %ebx,0x4c(%rsp)

  248               		}
  249               	}
  250      7    273 	last[number[currentNode]] = lastid                    		0000000000401807: mov    0x90(%rsp),%rbx
                    		000000000040180f: mov    %rbx,(%rsp)
           1      1 		0000000000401813: mov    0x78(%rsp),%rbx
                    		0000000000401818: mov    %rbx,0x8(%rsp)
                266 		000000000040181d: callq  408494 <runtime.mapaccess1>
           1      1 		0000000000401822: mov    0x4c(%rsp),%ecx
           1      1 		0000000000401826: mov    0x10(%rsp),%eax
                    		000000000040182a: movslq %eax,%rbx
           1      1 		000000000040182d: cmp    0xa0(%rsp),%ebx
           1      1 		0000000000401834: jb     40183b <main.DFS+0x1c6>
                    		0000000000401836: callq  41219a <runtime.panicindex>
           1      1 		000000000040183b: mov    0x98(%rsp),%rbp
           1      1 		0000000000401843: mov    %ecx,0x0(%rbp,%rbx,4)

  251      1      1 	return lastid           1      1 		0000000000401847: mov    %ecx,0xb0(%rsp)
                    		000000000040184e: add    $0x70,%rsp
                    		0000000000401852: retq   

  252               }
  253               
  254               // FindLoops
  255               //
  256               // Find loops and build loop forest using Havlak's algorithm, which