// File: kulpreet[P]lightning-network-graph-analysis/src/include/algos.hpp
// Function: lncentrality::sort_and_print_art_points(std::vector<unsigned long, std::allocator<unsigned long>>&, boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, lncentrality::LitVertex, lncentrality::LitEdge, boost::no_property, boost::listS>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void sort_and_print_art_points(std::vector<Vertex> &art_points, LitGraph &g,
                               string &stem, string &outdir) {
  std::ofstream out;
  out.open(outdir + "/" + stem + ".all_ap.csv",
           std::fstream::out | std::fstream::trunc);

  out << "alias,degree,pub_key" << std::endl;
  std::sort(art_points.begin(), art_points.end(),
            compare_by_degree<LitGraph>(g));
  // print top art points
  std::for_each(art_points.begin(), art_points.end(), [&out, &g](Vertex &v) {
    out << "\"" << g[v].name << "\""
        << "," << degree(v, g) << "," << g[v].pub_key << std::endl;
  });

  out.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x220(%rbp), %rdi
callq 0xa760
movq -0x20(%rbp), %rsi
leaq 0x3f966(%rip), %rdx     # 0x4b078
leaq -0x280(%rbp), %rdi
callq 0xef20
jmp 0xb720
movq -0x18(%rbp), %rdx
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0xeed0
jmp 0xb739
leaq 0x3f96e(%rip), %rdx     # 0x4b0ae
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0xee80
jmp 0xb755
movl $0x10, %edi
movl $0x20, %esi
callq 0xefa0
movl %eax, -0x2dc(%rbp)
jmp 0xb76c
movl -0x2dc(%rbp), %edx
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xa210
jmp 0xb787
leaq -0x240(%rbp), %rdi
callq 0xa2b0
leaq -0x260(%rbp), %rdi
callq 0xa2b0
leaq -0x280(%rbp), %rdi
callq 0xa2b0
leaq 0x3f908(%rip), %rsi     # 0x4b0ba
leaq -0x220(%rbp), %rdi
callq 0xa410
movq %rax, -0x2e8(%rbp)
jmp 0xb7c7
movq -0x2e8(%rbp), %rdi
movq 0x6978b(%rip), %rsi     # 0x74f60
callq 0xa460
jmp 0xb7dc
movq -0x8(%rbp), %rdi
callq 0xf350
movq %rax, -0x298(%rbp)
movq -0x8(%rbp), %rdi
callq 0xf380
movq %rax, -0x2a0(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x2a8(%rbp), %rdi
callq 0xf3b0
jmp 0xb80e
movq -0x298(%rbp), %rdi
movq -0x2a0(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
callq 0xf300
jmp 0xb82a
movq -0x8(%rbp), %rdi
callq 0xf350
movq %rax, -0x2b0(%rbp)
movq -0x8(%rbp), %rdi
callq 0xf380
movq %rax, -0x2b8(%rbp)
leaq -0x220(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x2b0(%rbp), %rdi
movq -0x2b8(%rbp), %rsi
movq -0x2c8(%rbp), %rdx
movq -0x2c0(%rbp), %rcx
callq 0xb960
movq %rdx, -0x2f8(%rbp)
movq %rax, -0x2f0(%rbp)
jmp 0xb894
movq -0x2f8(%rbp), %rax
movq -0x2f0(%rbp), %rcx
movq %rcx, -0x2d8(%rbp)
movq %rax, -0x2d0(%rbp)
leaq -0x220(%rbp), %rdi
callq 0xa640
jmp 0xb8be
leaq -0x220(%rbp), %rdi
callq 0xa6a0
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0xb945
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0xb939
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0xb92d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0xa2b0
leaq -0x260(%rbp), %rdi
callq 0xa2b0
leaq -0x280(%rbp), %rdi
callq 0xa2b0
leaq -0x220(%rbp), %rdi
callq 0xa6a0
movq -0x288(%rbp), %rdi
callq 0xa7d0
nopl (%rax)