LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/point.cpp
// Function: Point::read_points_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
std::vector<Point*> Point::read_points_from_file(std::string file_path, int d) 
{
    /*!
     * @brief Builds a vector of points from a file where data is correctly
     * formatted (double spaced with " ")
     * 
     * @param file_path the path to the file to get data from
     * @param d the dimension of the points
     * 
     * @return A vector of pointers to the created points
     */

    std::vector<Point*> points;

    std::ifstream is(file_path);
    assert(("No such file", is.is_open()));

    std::string line;

	// while not at the end of the file
	while(is.peek() != EOF)
	{
		// read new points
        Point* p = new Point();

		for(int m = 0; m < d; m++)
		{
			is >> p->coords[m];
		}

        points.push_back(p);

		// new line
		is.get();
	}
    points.pop_back(); // last line makes an empty point otherwise

    return points;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movl %edx, %r14d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x30(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3440
leaq 0xa8(%rsp), %rdi
callq 0x3080
testb %al, %al
je 0x3a58
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
shlq $0x3, %r14
leaq 0x30(%rsp), %r15
pushq $0x10
popq %r12
leaq 0x8(%rsp), %r13
movq %r15, %rdi
callq 0x30e0
cmpl $-0x1, %eax
je 0x3a2a
movq %r12, %rdi
callq 0x32b0
movq %rax, %rbp
movq %rax, %rdi
callq 0x3860
movq %rbp, 0x8(%rsp)
xorl %ebp, %ebp
cmpq %rbp, %r14
je 0x3a15
movq 0x8(%rsp), %rax
movq (%rax), %rsi
addq %rbp, %rsi
movq %r15, %rdi
callq 0x31c0
addq $0x8, %rbp
jmp 0x39f7
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3ab6
movq %r15, %rdi
callq 0x3320
jmp 0x39d0
addq $-0x8, 0x8(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x30(%rsp), %rdi
callq 0x30a0
movq %rbx, %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb5a5(%rip), %rdi      # 0xf004
leaq 0xb5bd(%rip), %rsi      # 0xf023
leaq 0xb5c4(%rip), %rcx      # 0xf031
pushq $0x56
popq %rdx
callq 0x31b0
movq %rax, %r14
jmp 0x3aa5
movq %rax, %r14
pushq $0x10
popq %rsi
movq %rbp, %rdi
callq 0x32c0
jmp 0x3a91
jmp 0x3a8e
jmp 0x3a8e
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x30(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3ade
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/graph.cpp
// Function: Graph::add_edge(Edge*)
void Graph::add_edge(Edge* e){
    /*!
     * @brief Ajoute l'arrête \p e au graphe
     * 
     * @param e L'arrête
     * 
     * @note Il n'est pas nécessaire d'ajouter les points de \p e au graphe; si ces derniers
     * n'est font pas déjà partie, ils seront ajoutés automatiquement.
     * 
     */

    this->add_node(e->p1);
    this->add_node(e->p2);

    std::unordered_set<Edge*>& adj_p1 = this->adjacency_lists.at(e->p1);
    adj_p1.insert(e);

    std::unordered_set<Edge*>& adj_p2 = this->adjacency_lists.at(e->p2);
    adj_p2.insert(e);

    this->all_edges.insert(e);

    e->id = this->edge_counter;
    this->edge_id_mapper.insert(std::pair<edge_id_t, Edge*>(this->edge_counter++, e));

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %rsi, (%r14)
movq (%rsi), %rsi
callq 0x4556
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x4556
movq %rbx, %rdi
movq %r15, %rsi
callq 0x62aa
movq %rax, %rdi
movq %r14, %rsi
callq 0x62c8
movq (%r14), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x62aa
movq %rax, %rdi
movq %r14, %rsi
callq 0x62c8
leaq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x62c8
movl 0xe4(%rbx), %eax
movq (%r14), %rcx
movl %eax, 0x18(%rcx)
leal 0x1(%rax), %edx
movl %edx, 0xe4(%rbx)
addq $0xa8, %rbx
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
movq %rcx, 0x8(%rsi)
movq %rbx, %rdi
callq 0x6574
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/graph.cpp
// Function: Graph::Graph(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Graph::Graph(std::string file_path) : Graph()
{
    /*!
     * @brief Builds a graph from scratch, with its nodes and edges contained in a file
     * 
     * @param file_path The path to the file 
     * 
     */
    build_from_ashiip(this, file_path);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3c58
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x33b0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3ce5
leaq 0x8(%rsp), %rdi
callq 0x3110
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3110
jmp 0x4340
movq %rax, %r14
movq %rbx, %rdi
callq 0x481a
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/graph.cpp
// Function: Graph::Graph(std::vector<Point*, std::allocator<Point*>>)
Graph::Graph(std::vector<Point*> points)
{
    /*!
     * @brief Builds a graph from scratch, with its nodes being points of a certain dimension
     * 
     * @param points A vector of points in memory 
     * 
     */

    int n = points.size();
    std::vector<Node*> nodes;

    for (int i = 0; i < n; i ++) {
        nodes.push_back(new Node(i, points[i]));
        this->add_node(nodes[i]);
    }

    for (int i = 0; i < n; i ++) {
        for (int j = i+1; j < n; j ++) {
            this->add_edge(new Edge(nodes[i], nodes[j]));
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
movq %rax, (%rdi)
pushq $0x1
popq %rdx
movq %rdx, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, 0x20(%rdi)
movups %xmm0, 0x28(%rdi)
leaq 0x38(%rdi), %rcx
movq %rcx, 0x28(%rsp)
leaq 0x68(%rdi), %rcx
movq %rcx, 0x38(%rdi)
movq %rdx, 0x40(%rdi)
movups %xmm0, 0x48(%rdi)
movl %eax, 0x58(%rdi)
movups %xmm0, 0x60(%rdi)
leaq 0x70(%rdi), %rcx
movq %rcx, 0x20(%rsp)
leaq 0xa0(%rdi), %rcx
movq %rcx, 0x70(%rdi)
movq %rdx, 0x78(%rdi)
movups %xmm0, 0x80(%rdi)
movl %eax, 0x90(%rdi)
movups %xmm0, 0x98(%rdi)
leaq 0xa8(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0xd8(%rdi), %rcx
movq %rcx, 0xa8(%rdi)
movq %rdx, 0x8(%rsp)
movq %rdx, 0xb0(%rdi)
movups %xmm0, 0xb8(%rdi)
movl %eax, 0xc8(%rdi)
movups %xmm0, 0xd0(%rdi)
movq 0x8(%rsi), %r13
subq (%rsi), %r13
shrq $0x3, %r13
leaq 0x40(%rsp), %r12
andq $0x0, 0x10(%r12)
movaps %xmm0, (%r12)
xorl %r14d, %r14d
testl %r13d, %r13d
movl $0x0, %eax
cmovgl %r13d, %eax
movq %rax, 0x10(%rsp)
cmpq %r14, 0x10(%rsp)
je 0x4486
pushq $0x18
popq %rdi
callq 0x32b0
movq %rax, %rbp
movq (%r15), %rax
movq (%rax,%r14,8), %rdx
movq %rbp, %rdi
movl %r14d, %esi
callq 0x846a
movq %rbp, 0x38(%rsp)
movq %r12, %rdi
leaq 0x38(%rsp), %rsi
callq 0x5dac
movq 0x40(%rsp), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x4556
incq %r14
jmp 0x443a
xorl %ebp, %ebp
pushq $0x20
popq %r14
cmpq 0x10(%rsp), %rbp
je 0x44e2
leaq 0x1(%rbp), %rax
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %r12
cmpl %r13d, %r12d
jge 0x44d6
movq %r14, %rdi
callq 0x32b0
movq %rax, %r15
movq 0x40(%rsp), %rax
movq (%rax,%rbp,8), %rsi
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
callq 0x380c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4250
incq %r12
jmp 0x44a1
incq 0x8(%rsp)
movq 0x30(%rsp), %rbp
jmp 0x448c
leaq 0x40(%rsp), %rdi
callq 0x5d78
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x18
popq %rsi
movq %rbp, %rdi
jmp 0x4513
jmp 0x451a
jmp 0x451a
movq %rax, %r14
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x32c0
jmp 0x451d
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x5d78
movq 0x18(%rsp), %rdi
callq 0x4c56
movq 0x20(%rsp), %rdi
callq 0x4bae
movq 0x28(%rsp), %rdi
callq 0x4cfe
movq %rbx, %rdi
callq 0x4da6
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/graph.cpp
// Function: Graph::add_node(Node*)
void Graph::add_node(Node* n){
    /*!
     * @brief Ajoute le noeud \p n au graphe
     * 
     * @param n Le noeud
     * 
     */


    if(this->has_node(n))
        return;

    this->adjacency_lists.insert(
        std::pair<Node*, std::unordered_set<Edge*> >(
                                                        n,
                                                        std::unordered_set<Edge*>()
                                                    )
                                );
    
    n->set_id(this->node_counter);
    this->node_id_mapper.insert(std::pair<node_id_t, Node*>(this->node_counter++, n));

    
    
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4630
testb %al, %al
jne 0x4606
leaq 0x38(%rsp), %rax
andq $0x0, -0x10(%rax)
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x48(%rsp), %r15
movq %rbx, -0x8(%r15)
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x4e64
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x5fa4
movq %r15, %rdi
callq 0x4cfe
leaq 0x8(%rsp), %rdi
callq 0x4cfe
movl 0xe0(%r14), %esi
movq %rbx, %rdi
callq 0x8f24
leaq 0x70(%r14), %rdi
movl 0xe0(%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xe0(%r14)
leaq 0x40(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, 0x8(%rsi)
callq 0x5226
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x4cfe
leaq 0x8(%rsp), %rdi
callq 0x4cfe
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/graph.cpp
// Function: Graph::get_nodes()
std::vector<Node*> Graph::get_nodes()
{
    /*!
     * @brief Renvoie tous les noeuds du graphe (pointeurs)
     * 
     * @return Un vecteur avec les noeuds du graphe
     * 
     */

    std::vector<Node*> nodes;
    for (auto kv : this->adjacency_lists) {
        nodes.push_back(kv.first);
    }

    return nodes;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
addq $0x10, %r14
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq (%r14), %r14
testq %r14, %r14
je 0x46b1
leaq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x4846
movq %rbx, %rdi
movq %r12, %rsi
callq 0x485a
movq %r15, %rdi
callq 0x4cfe
jmp 0x4688
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
jmp 0x46d0
movq %rax, %r14
movq %r15, %rdi
callq 0x4cfe
movq %rbx, %rdi
callq 0x5d78
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/graph.cpp
// Function: Graph::get_any_node()
Node* Graph::get_any_node()
{
    /*!
     * @brief Renvoie un sommet au hasard dans les sommets du graphe
     * 
     * @return Un noeud au hasard
     * 
     */

    std::vector<Node*> nodes = this->get_nodes();
    int n = this->get_number_of_nodes();

    std::random_device rd; 
    std::mt19937 gen(rd());
    std::uniform_int_distribution<> distrib(0, n-1);

    int idx = distrib(gen);

    return nodes[idx];
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x2738, %rsp           # imm = 0x2738
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x465e
movl 0x18(%rbx), %ebx
leaq 0x28(%rsp), %rdi
callq 0x4878
leaq 0x28(%rsp), %rdi
callq 0x33c0
movl %eax, %esi
leaq 0x13b0(%rsp), %rdi
callq 0x6970
decl %ebx
leaq 0x20(%rsp), %rdi
andl $0x0, (%rdi)
movl %ebx, 0x4(%rdi)
leaq 0x13b0(%rsp), %rsi
callq 0x48ce
cltq
leaq 0x8(%rsp), %rbx
movq (%rbx), %rcx
movq (%rcx,%rax,8), %r14
leaq 0x28(%rsp), %rdi
callq 0x48d6
movq %rbx, %rdi
callq 0x5d78
movq %r14, %rax
addq $0x2738, %rsp           # imm = 0x2738
popq %rbx
popq %r14
retq
jmp 0x4785
movq %rax, %rbx
jmp 0x4792
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x48d6
leaq 0x8(%rsp), %rdi
callq 0x5d78
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/node.cpp
// Function: Node::dist(Node*)
double Node::dist(Node* other)
{    
    /*!
     * @brief Returns the Euclidian distance between two Nodes
     * 
     * @param other The \p other Node to evaluate distance with
     * 
     * @return The Euclidian distance between this Node and the \p other Node
     * 
     */

    Point* p1_p = this->p;
    Point* p2_p = other->get_point();

    if (p1_p != NULL && p2_p != NULL) {
        if (p1_p->get_dim() == p2_p->get_dim()) {
            return p1_p->distance(p2_p);
        }
    }

    return 1; // arbitrary choice
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x8(%rdi), %rbx
movq 0x8(%rsi), %r14
testq %rbx, %rbx
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x84bf
movq %rbx, %rdi
callq 0x38b6
movl %eax, %ebp
movq %r14, %rdi
callq 0x38b6
cmpl %eax, %ebp
jne 0x84bf
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x391a
movsd 0x6bd1(%rip), %xmm0     # 0xf098
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/mst_algorithm.cpp
// Function: MSTAlgorithm::MSTAlgorithm(Graph*)
MSTAlgorithm::MSTAlgorithm(Graph* graph)
{
    /*!
     * @brief Constructor of a MST Algorithm
     * 
     * @param graph A pointer towards the graph of which we want to compute the MST
     * 
     */

    this->initial_graph = graph;
    this->mst_weight = 0.0;
    this->treated = false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd88f(%rip), %rax      # 0x16c88
movq %rax, (%rdi)
addq $0x10, %rdi
callq 0x3c58
movq %rbx, 0x8(%r14)
andq $0x0, 0xf8(%r14)
movb $0x0, 0x100(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/union_find.cpp
// Function: UnionFind::UnionFind(std::vector<Node*, std::allocator<Node*>>)
UnionFind::UnionFind(std::vector<Node*> nodes) 
{
    /*!
     * @brief Builds the Union-Find data structure from a vector
     * of nodes
     * 
     * @param nodes Nodes of the graph
     * 
     */

    this->num_classes = nodes.size();
    for(Node* n : nodes) {
        this->parent.insert(std::pair<Node*, Node*>(n, n));
        this->rank.insert(std::pair<Node*, int>(n, 1));
        this->representatives.insert(n);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
movq %rax, (%rdi)
pushq $0x1
popq %rax
movq %rax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x20(%rdi)
movups %xmm0, 0x28(%rdi)
leaq 0x38(%rdi), %r14
leaq 0x68(%rdi), %rdx
movq %rdx, 0x38(%rdi)
movq %rax, 0x40(%rdi)
movups %xmm0, 0x48(%rdi)
movl %ecx, 0x58(%rdi)
movups %xmm0, 0x60(%rdi)
leaq 0x70(%rdi), %r15
leaq 0xa0(%rdi), %rdx
movq %rdx, 0x70(%rdi)
movq %rax, 0x78(%rdi)
movups %xmm0, 0x80(%rdi)
movl %ecx, 0x90(%rdi)
movups %xmm0, 0x98(%rdi)
movq (%rsi), %rbp
movq 0x8(%rsi), %r13
movq %r13, %rax
subq %rbp, %rax
shrq $0x3, %rax
movl %eax, 0xa8(%rdi)
leaq 0x8(%rsp), %r12
cmpq %r13, %rbp
je 0xc163
movq (%rbp), %rax
movq %rax, (%rsp)
movq %rax, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9c76
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x8186
movq %r15, %rdi
movq %rsp, %rsi
callq 0x593a
addq $0x8, %rbp
jmp 0xc114
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc176
jmp 0xc176
movq %rax, %r12
movq %r15, %rdi
callq 0x4a48
movq %r14, %rdi
callq 0x7dd0
movq %rbx, %rdi
callq 0x7e78
movq %r12, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/union_find.cpp
// Function: UnionFind::get_parent(Node*)
Node* UnionFind::get_parent(Node* node) 
{
    /*!
     * @brief Returns the parent of \p node in the data structure, if it exists
     * 
     * @param node Node of which we want the parent
     * 
     * @return NULL if the node is not part of the data structure, otherwise 
     * its parent
     * 
     */

    if(this->parent.find(node) == this->parent.end()) {
        return NULL;
    }
    return this->parent.at(node);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x932e
testq %rax, %rax
je 0xc1e9
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x9310
movq (%rax), %rax
jmp 0xc1eb
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/union_find.cpp
// Function: UnionFind::get_rank(Node*)
int UnionFind::get_rank(Node* node)
{
    /*!
     * @brief Returns the rank of \p node in the data structure, if it exists
     * 
     * @param node Node of which we want the rank
     * 
     * @return 0 if the node is not part of the data structure, otherwise 
     * its rank
     * 
     */

    if(this->rank.find(node) == this->rank.end()) {
        return 0;
    }
    return this->rank.at(node);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
addq $0x38, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x80ec
testq %rax, %rax
je 0xc227
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x8168
movl (%rax), %eax
jmp 0xc229
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/union_find.cpp
// Function: UnionFind::Find(Node*)
Node* UnionFind::Find(Node* node)
{
    /*!
     * @brief For a \p node that belongs to the data structure, find its 
     * representative in the data structure using path compression
     * 
     * @param node Node of which we want the reprensentative
     * 
     * @return The representative of the initial node
     * 
     */

    assert(("This node is not part of the data structure", this->get_parent(node) != NULL));

    Node* parent = this->get_parent(node);

    if(node == parent) {
        return parent;
    }

    Node* r = this->Find(parent);
    this->parent[node] = r;
    return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
callq 0xc1ba
testq %rax, %rax
je 0xc2a6
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc1ba
movq %rax, %r14
cmpq %r15, %rax
je 0xc299
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc24a
movq %rax, %r14
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xc496
movq %r14, (%rax)
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x35e1(%rip), %rdi      # 0xf88e
leaq 0x362a(%rip), %rsi      # 0xf8de
leaq 0x3636(%rip), %rcx      # 0xf8f1
pushq $0x65
popq %rdx
callq 0x31b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/union_find.cpp
// Function: UnionFind::Union(Node*, Node*)
void UnionFind::Union(Node* n1, Node* n2)
{
    /*!
     * @brief For two nodes \p n1 and \p n2 of the data structure, computes 
     * the union of their two classes 
     * 
     * @param n1 First node 
     * @param n2 Second node
     * 
     */

    Node* rep1 = this->Find(n1);
    Node* rep2 = this->Find(n2);

    if(rep1 != rep2) {
        this->num_classes -= 1; // proceeding with Union

        int r1 = this->get_rank(rep1);
        int r2 = this->get_rank(rep2);

        if(r1 > r2) {
            this->parent[rep2] = rep1;
            this->representatives.erase(rep2);
        } else if(r2 > r1) {
            this->parent[rep1] = rep2;
            this->representatives.erase(rep1);
        } else { // arbitrary choice
            this->parent[rep1] = rep2;
            this->representatives.erase(rep1);
            this->rank[rep2] += 1;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rdi, %rbx
callq 0xc24a
movq %rax, %r14
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc24a
movq %rax, (%rsp)
cmpq %rax, %r14
je 0xc376
movq %rax, %r15
decl 0xa8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc1f2
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc1f2
cmpl %eax, %ebp
jle 0xc33e
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc496
movq %r14, (%rax)
addq $0x70, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc568
jmp 0xc376
movl %eax, %r12d
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc496
movq %r15, (%rax)
leaq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0xc568
cmpl %ebp, %r12d
jg 0xc376
addq $0x38, %rbx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xc66a
incl (%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::Cloud(int, int, int)
Cloud::Cloud(int _d, int _nmax, int _k)	
{
    /*!
     * @brief Builds an empty cloud
     * 
     * @param _d The dimension of the points
	 * @param _nmax The maximal number of points in this cloud
	 * @param _k The number of clusters to be drawn
     */

	d = _d;
	Point::d = _d;
	n = 0;
	k = _k;

	nmax = _nmax;

	points = new Point[nmax];
	centers = new Point[k];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, (%rdi)
leaq 0xab55(%rip), %rax      # 0x172a8
movl %esi, (%rax)
andl $0x0, 0x4(%rdi)
movl %ecx, %ebp
movl %ecx, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movslq %edx, %r12
movq %r12, %r13
shlq $0x4, %r13
leaq 0x8(%r13), %r14
testl %r12d, %r12d
pushq $-0x1
popq %rax
cmovsq %rax, %r14
movq %r14, %rdi
callq 0x3030
leaq 0x8(%rax), %r15
movq %rax, (%rsp)
movq %r12, (%rax)
testl %r12d, %r12d
je 0xc7b1
negq %r13
xorl %ebp, %ebp
movq %r15, %r12
movq %r12, %rdi
callq 0x3860
addq $-0x10, %rbp
addq $0x10, %r12
cmpq %rbp, %r13
jne 0xc799
movl 0x8(%rbx), %ebp
movq %r15, 0x10(%rbx)
movslq %ebp, %r12
movq %r12, %rbp
shlq $0x4, %rbp
leaq 0x8(%rbp), %r14
testl %r12d, %r12d
pushq $-0x1
popq %rax
cmovsq %rax, %r14
movq %r14, %rdi
callq 0x3030
leaq 0x8(%rax), %r15
movq %rax, (%rsp)
movq %r12, (%rax)
testl %r12d, %r12d
je 0xc803
negq %rbp
xorl %r13d, %r13d
movq %r15, %r12
movq %r12, %rdi
callq 0x3860
addq $-0x10, %r13
addq $0x10, %r12
cmpq %r13, %rbp
jne 0xc7ee
movq %r15, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
testq %r13, %r13
je 0xc85c
negq %r13
movq (%rsp), %r15
addq $-0x8, %r15
leaq (%r15,%r13), %rdi
callq 0x38a8
addq $-0x10, %r13
jne 0xc829
jmp 0xc85c
movq %rax, %rbx
testq %rbp, %rbp
je 0xc85c
negq %rbp
movq (%rsp), %r15
addq $-0x8, %r15
leaq (%r15,%rbp), %rdi
callq 0x38a8
addq $-0x10, %rbp
jne 0xc84d
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x3500
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::add_point(Point&, int)
void Cloud::add_point(Point &p, int label)
{
    /*!
     * @brief Adds a point in the cloud by copying its values
     * 
     * @param p The point to be added
	 * @param label A label to give to this point
     */

	assert(("Too much points!", n < nmax));
	assert(("No center to assign to this point!", label<k));

	for(int m = 0; m < d; m++)
	{
		points[n].coords[m] = p.coords[m];
	}

	points[n].label = label;

	n++;
}

// Assembly:
pushq %rbx
movslq 0x4(%rdi), %rax
cmpl 0xc(%rdi), %eax
jge 0xc96a
cmpl %edx, 0x8(%rdi)
jle 0xc983
movl (%rdi), %r8d
movq (%rsi), %r9
movq 0x10(%rdi), %rcx
movq %rax, %rsi
shlq $0x4, %rsi
leaq (%rcx,%rsi), %r10
xorl %r11d, %r11d
testl %r8d, %r8d
cmovlel %r11d, %r8d
cmpq %r11, %r8
je 0xc95f
movsd (%r9,%r11,8), %xmm0
movq (%r10), %rbx
movsd %xmm0, (%rbx,%r11,8)
incq %r11
jmp 0xc946
movl %edx, 0x8(%rcx,%rsi)
incl %eax
movl %eax, 0x4(%rdi)
popq %rbx
retq
leaq 0x2fa7(%rip), %rdi      # 0xf918
leaq 0x2fbf(%rip), %rsi      # 0xf937
leaq 0x2fc7(%rip), %rcx      # 0xf946
pushq $0x2b
jmp 0xc99a
leaq 0x2fe0(%rip), %rdi      # 0xf96a
leaq 0x2fa6(%rip), %rsi      # 0xf937
leaq 0x2fae(%rip), %rcx      # 0xf946
pushq $0x2c
popq %rdx
callq 0x31b0
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::intracluster_variance()
double Cloud::intracluster_variance()
{
    /*!
     * @brief Computes the intracluster variance in this cloud
     * 
     * @return The intracluster variance
     */

	double intraclusterVar = 0.0;
	for(int i = 0; i < this->n; i ++){
		intraclusterVar += points[i].distance(&(centers[points[i].label]));
	}
	if (n > 0) {
		intraclusterVar /= n;
	}

	return intraclusterVar;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorpd %xmm1, %xmm1
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jge 0xca41
movq 0x10(%rbx), %rdi
movslq 0x8(%rdi,%r14), %rsi
addq %r14, %rdi
shlq $0x4, %rsi
addq 0x18(%rbx), %rsi
movsd %xmm1, 0x8(%rsp)
callq 0x391a
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
incq %r15
addq $0x10, %r14
jmp 0xca06
testl %eax, %eax
jle 0xca4d
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::set_voronoi_labels()
int Cloud::set_voronoi_labels()
{
    /*!
     * @brief E-step in the kmeans algorithm
     */

	int changedLabels = 0;

	for (int i = 0; i < this->n; i ++){
		int pointLabel = points[i].label;
		int newLabel = points[i].label;
		double minDist = points[i].distance(&(centers[pointLabel]));

		for (int j = 0; j < this->k; j ++){
			double dist = points[i].distance(&(centers[j]));
			if (dist < minDist || (dist == minDist && j < newLabel)) {
				minDist = dist;
				newLabel = j;
			}
		}

		if (newLabel != pointLabel){
			points[i].label = newLabel;
			changedLabels += 1;
		}
	}
	
	return changedLabels;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %r15d, %r15d
movl $0x0, 0x4(%rsp)
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jge 0xcb2e
movq 0x10(%rbx), %rdi
movq %r15, 0x8(%rsp)
shlq $0x4, %r15
movslq 0x8(%rdi,%r15), %r12
addq %r15, %rdi
movq %r12, %rsi
shlq $0x4, %rsi
addq 0x18(%rbx), %rsi
callq 0x391a
movapd %xmm0, %xmm1
xorl %ebp, %ebp
xorl %r14d, %r14d
movl %r12d, %r13d
movslq 0x8(%rbx), %rax
cmpq %rax, %r14
jge 0xcb0f
movq 0x10(%rbx), %rdi
addq %r15, %rdi
movq 0x18(%rbx), %rsi
addq %rbp, %rsi
movsd %xmm1, 0x10(%rsp)
callq 0x391a
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0xcaff
ucomisd %xmm1, %xmm0
setnp %al
sete %cl
andb %al, %cl
movslq %r13d, %rax
cmpq %rax, %r14
setl %al
andb %cl, %al
cmpb $0x1, %al
jne 0xcb06
movl %r14d, %r13d
movapd %xmm0, %xmm1
incq %r14
addq $0x10, %rbp
jmp 0xcab6
cmpl %r12d, %r13d
je 0xcb21
movq 0x10(%rbx), %rax
movl %r13d, 0x8(%rax,%r15)
incl 0x4(%rsp)
movq 0x8(%rsp), %r15
incq %r15
jmp 0xca78
movl 0x4(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::kmeans()
void Cloud::kmeans()
{
	/*!
     * @brief Computes the kmeans algorithm on this cloud. It is possible 
	 * to select different initializations for the centers, within bounding 
	 * box, forgy, plusplus and random partition. 
     */

	std::cout << "\nComputing clustering using kmeans...";

	// init_bounding_box();
	init_forgy(); 
	// init_plusplus(); 
	// init_random_partition();

	// running Lloyd's heuristics
	int changesMade = 0;
	do {
		changesMade = set_voronoi_labels();
		set_centroid_centers();
	} while (changesMade > 0);
	
	std::cout << "[OK]" << std::endl;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xa28d(%rip), %rdi      # 0x16fb0
leaq 0x2c70(%rip), %rsi      # 0xf99a
callq 0x32a0
movq %rbx, %rdi
callq 0xcd6e
movq %rbx, %rdi
callq 0xca5c
movl %eax, %ebp
movq %rbx, %rdi
callq 0xcb42
testl %ebp, %ebp
jg 0xcd37
movq 0xa25c(%rip), %rdi      # 0x16fb0
leaq 0x2a08(%rip), %rsi      # 0xf763
callq 0x32a0
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3130
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::init_forgy()
void Cloud::init_forgy()
{
    /*!
     * @brief Initializes the centers of this cloud using Forgy method,
	 * that is it samples the centers uniformly from the data points
     */

	// we will pick points from our data 
	int* availablePoints = new int [this->n] ();
	for (int i = 0; i < this->n; i ++){
		availablePoints[i] = 1;
	}

	// we must know what we've chosen so far
	int* chosenPoints = new int [this->k] ();
	int leftCenters = this->k;

	while (leftCenters > 0){
		int randomPoint = rand() % this->n;

		if (availablePoints[randomPoint] > 0){
			availablePoints[randomPoint] = 0;
			chosenPoints[this->k - leftCenters] = randomPoint;
			leftCenters -= 1;
		}
	}

	// we just have to build our centers now!
	Point c;
	for (int i = 0; i < this->k; i ++){
		c.label = i;

		for (int j = 0; j < this->d; j ++){
			c.coords[j] = points[chosenPoints[i]].coords[j];
		}

		this->set_center(c, i);
	}

	delete[] availablePoints;
	availablePoints = NULL;
	delete[] chosenPoints;
	chosenPoints = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq 0x4(%rdi), %r13
leaq (,%r13,4), %r15
testq %r13, %r13
pushq $-0x1
popq %rbp
cmovsq %rbp, %r15
movq %r15, %rdi
callq 0x3030
movq %rax, %r14
xorl %r12d, %r12d
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3170
testl %r13d, %r13d
movl $0x0, %eax
cmovgl %r13d, %eax
cmpq %r12, %rax
je 0xcdce
movl $0x1, (%r14,%r12,4)
incq %r12
jmp 0xcdbc
movslq 0x8(%rbx), %r13
leaq (,%r13,4), %r12
testq %r13, %r13
cmovsq %rbp, %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3170
testl %r13d, %r13d
jle 0xce29
callq 0x30b0
cltd
idivl 0x4(%rbx)
movslq %edx, %rax
cmpl $0x0, (%r14,%rax,4)
jle 0xcdf9
andl $0x0, (%r14,%rax,4)
movslq 0x8(%rbx), %rcx
movslq %r13d, %rdx
subq %rdx, %rcx
movl %eax, (%r15,%rcx,4)
decl %r13d
jmp 0xcdf9
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3860
xorl %r13d, %r13d
movslq 0x8(%rbx), %rax
cmpq %rax, %r13
jge 0xce88
movl %r13d, 0x10(%rsp)
movslq (%rbx), %rax
movq 0x10(%rbx), %rcx
movq 0x8(%rsp), %rdx
xorl %esi, %esi
cmpq %rax, %rsi
jge 0xce75
movslq (%r15,%r13,4), %rdi
shlq $0x4, %rdi
movq (%rcx,%rdi), %rdi
movsd (%rdi,%rsi,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
jmp 0xce55
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0xc9c4
incq %r13
jmp 0xce39
movq %r14, %rdi
callq 0x3370
movq %r15, %rdi
callq 0x3370
leaq 0x8(%rsp), %rdi
callq 0x38a8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::init_bounding_box()
void Cloud::init_bounding_box()
{
    /*!
     * @brief Initializes the centers of this cloud by using a bounding box over 
	 * all the points
     */

	double* minBox = new double [this->d] ();
	double* maxBox = new double [this->d] ();
	for (int i = 0; i < this->d; i ++){
		minBox[i] = DBL_MAX;
		maxBox[i] = DBL_MIN;
	}

	for (int i = 0; i < this->n; i ++){
		for (int j = 0; j < this->d; j ++){
			if (points[i].coords[j] < minBox[j]){
				minBox[j] = points[i].coords[j];
			}
			if (points[i].coords[j] > maxBox[j]){
				maxBox[j] = points[i].coords[j];
			}
		}
	}

	Point center;
	for (int i = 0; i < this->k; i ++){
		center.label = i;

		for (int j = 0; j < this->d; j ++){
			double randomValue = (double)rand() / RAND_MAX;
			randomValue = minBox[j] + (randomValue * (maxBox[j] - minBox[j]));
			
			center.coords[j] = randomValue;
		}

		this->set_center(center, i);
	}

	delete[] minBox;
	minBox = NULL;
	delete[] maxBox;
	maxBox = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq (%rdi), %rbp
leaq (,%rbp,8), %rax
testq %rbp, %rbp
pushq $-0x1
popq %r12
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r14
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3170
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3170
testl %ebp, %ebp
movl $0x0, %eax
cmovgl %ebp, %eax
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
movabsq $0x10000000000000, %rdx # imm = 0x10000000000000
cmpq %r13, %rax
je 0xcf3c
movq %rcx, (%r14,%r13,8)
movq %rdx, (%r15,%r13,8)
incq %r13
jmp 0xcf2a
movl 0x4(%rbx), %ecx
movq 0x10(%rbx), %rdx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
cmpq %rcx, %rsi
je 0xcf94
movq %rsi, %rdi
shlq $0x4, %rdi
addq %rdx, %rdi
xorl %r8d, %r8d
cmpq %r8, %rax
je 0xcf8f
movq (%rdi), %r9
movsd (%r9,%r8,8), %xmm0
movsd (%r14,%r8,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xcf7c
movsd %xmm0, (%r14,%r8,8)
ucomisd (%r15,%r8,8), %xmm0
jbe 0xcf8a
movsd %xmm0, (%r15,%r8,8)
incq %r8
jmp 0xcf5c
incq %rsi
jmp 0xcf4a
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3860
xorl %r13d, %r13d
cmpl 0x8(%rbx), %r13d
jge 0xd004
movl %r13d, 0x10(%rsp)
xorl %ebp, %ebp
movslq (%rbx), %rax
cmpq %rax, %rbp
jge 0xcff1
callq 0x30b0
cvtsi2sd %eax, %xmm0
divsd 0x2946(%rip), %xmm0     # 0xf910
movsd (%r14,%rbp,8), %xmm1
movsd (%r15,%rbp,8), %xmm2
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movq 0x8(%rsp), %rax
movsd %xmm2, (%rax,%rbp,8)
incq %rbp
jmp 0xcfb1
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0xc9c4
incl %r13d
jmp 0xcfa4
movq %r14, %rdi
callq 0x3370
movq %r15, %rdi
callq 0x3370
leaq 0x8(%rsp), %rdi
callq 0x38a8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sebastienmeyer2[P]mst-clustering/src/kmeans.cpp
// Function: Cloud::init_random_partition()
void Cloud::init_random_partition()
{
    /*!
     * @brief Initializes the centers of this cloud using random partitions,
	 * ie builds centers as the centers of random partitions of the data points
     */

	// random labelization of data points
	int randomCenter = 0;
	for (int i = 0; i < this->n; i ++){
		randomCenter = rand() % this->k;
		points[i].label = randomCenter;
	}

	// centers will be centroids of this partition
	this->set_centroid_centers();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x8
popq %r14
xorl %r15d, %r15d
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jge 0xd2ce
callq 0x30b0
cltd
idivl 0x8(%rbx)
movq 0x10(%rbx), %rax
movl %edx, (%rax,%r14)
incq %r15
addq $0x10, %r14
jmp 0xd2ab
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xcb42
nop
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/PixelStencil.cpp
// Function: kallaballa::PixelPlanes::PixelPlanes(char*)
PixelPlanes::PixelPlanes(char* filename) : img(filename), width(img.width()), height(img.height()) {
	for (int h = 0; h < img.height(); h++) {
		for (int w = 0; w < img.width(); w++) {
			Color p = 0;
			p |= img(w, h, 0, 0) << 16;
			p |= img(w, h, 0, 1) << 8;
			p |= img(w, h, 0, 2);

			planes[p].push_back({w,h});
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x2c56c(%rip), %rax     # 0x2fc60
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x430a
movslq 0x8(%r14), %rax
movq %rax, 0x28(%r14)
movslq 0xc(%r14), %rcx
movq %rcx, 0x30(%r14)
leaq 0x40(%r14), %rdx
andl $0x0, 0x40(%r14)
andq $0x0, 0x48(%r14)
movq %rdx, 0x50(%r14)
movq %rdx, 0x58(%r14)
andq $0x0, 0x60(%r14)
leaq 0x38(%r14), %r15
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
movslq %ecx, %rcx
cmpq %rcx, %rbp
jge 0x37ee
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0x37e2
andl $0x0, 0xc(%rsp)
movq 0x20(%r14), %rcx
movl %eax, %eax
movl 0xc(%r14), %edx
movl 0x10(%r14), %esi
movq %rbp, %rdi
imulq %rax, %rdi
addq %rcx, %rdi
movzbl (%r12,%rdi), %edi
shll $0x10, %edi
movl %edi, 0xc(%rsp)
imulq %rdx, %rsi
leaq (%rsi,%rbp), %rdx
imulq %rax, %rdx
addq %rcx, %rdx
movzbl (%r12,%rdx), %edx
shll $0x8, %edx
orl %edi, %edx
movl %edx, 0xc(%rsp)
leaq (,%rsi,2), %rsi
addq %rbp, %rsi
imulq %rax, %rsi
addq %rcx, %rsi
movzbl (%r12,%rsi), %eax
orl %edx, %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x431e
movl %r12d, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
movq %rax, %rdi
movq %r13, %rsi
callq 0x201e2
incq %r12
movl (%rbx), %eax
jmp 0x3748
incq %rbp
movl 0xc(%r14), %ecx
jmp 0x3739
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x37ff
movq %rax, %r14
movq %r15, %rdi
callq 0x457e
movq %rbx, %rdi
callq 0x436c
movq %r14, %rdi
callq 0x3500
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/PixelStencil.cpp
// Function: kallaballa::SVGStencil::writePixel(unsigned long, unsigned long)
void SVGStencil::writePixel(size_t x, size_t y) {
	this->ofs << "<rect" << std::endl;
	this->ofs << "width=\"" << pixelWidthPix << "\"" << std::endl;
	this->ofs << "height=\"" << pixelWidthPix << "\"" << std::endl;
	this->ofs << "x=\"" << boardMarginPix + pixelWidthPix * x + pixelMarginPix * x << "\"" << std::endl;
	this->ofs << "y=\"" << boardMarginPix + pixelWidthPix * y + pixelMarginPix * y << "\"" << std::endl;
	this->ofs << "id=\"" << pixelID++ << "\"" << std::endl;
	this->ofs << "style=\"fill:none;stroke:#ff0000;stroke-width:0.09;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none\" />" << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
leaq 0x1e524(%rip), %rsi     # 0x222db
movq %rbx, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3100
leaq 0x1e4e1(%rip), %rsi     # 0x222af
movq %rbx, %rdi
callq 0x3290
movq 0x230(%r14), %rsi
movq %rax, %rdi
callq 0x31a0
leaq 0x20023(%rip), %r15     # 0x23e0f
movq %rax, %rdi
movq %r15, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3100
leaq 0x1e4b1(%rip), %rsi     # 0x222b7
movq %rbx, %rdi
callq 0x3290
movq 0x230(%r14), %rsi
movq %rax, %rdi
callq 0x31a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3100
leaq 0x1e55f(%rip), %rsi     # 0x22396
movq %rbx, %rdi
callq 0x3290
movq 0x238(%r14), %rsi
addq 0x230(%r14), %rsi
imulq %r13, %rsi
addq 0x240(%r14), %rsi
movq %rax, %rdi
callq 0x31a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3100
leaq 0x1e522(%rip), %rsi     # 0x2239c
movq %rbx, %rdi
callq 0x3290
movq 0x238(%r14), %rsi
addq 0x230(%r14), %rsi
imulq %r12, %rsi
addq 0x240(%r14), %rsi
movq %rax, %rdi
callq 0x31a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3100
leaq 0x1e528(%rip), %rsi     # 0x223e5
movq %rbx, %rdi
callq 0x3290
movq 0x258(%r14), %rsi
leaq 0x1(%rsi), %rcx
movq %rcx, 0x258(%r14)
movq %rax, %rdi
callq 0x31a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3290
movq %rax, %rdi
callq 0x3100
leaq 0x1e3fc(%rip), %rsi     # 0x222f5
movq %rbx, %rdi
callq 0x3290
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3100
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: std::pair<KDTree::_Iterator<kallaballa::NamedColor, kallaballa::NamedColor const&, kallaballa::NamedColor const*>, double> KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::find_nearest<kallaballa::NamedColor>(kallaballa::NamedColor const&) const
std::pair<const_iterator, distance_type>
      find_nearest (SearchVal const& __val) const
      {
	if (_M_get_root())
	  {
	    std::pair<const _Node<_Val>*,
	      std::pair<size_type, typename _Acc::result_type> >
	      best = _S_node_nearest (__K, 0, __val,
				      _M_get_root(), &_M_header, _M_get_root(),
				      std::sqrt(_S_accumulate_node_distance
				      (__K, _M_dist, _M_acc, _M_get_root()->_M_value, __val)),
				      _M_cmp, _M_acc, _M_dist,
				      always_true<value_type>());
	    return std::pair<const_iterator, distance_type>
	      (best.first, best.second.second);
	  }
	  return std::pair<const_iterator, distance_type>(end(), 0);
      }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x442f
movq %rdx, %r12
leaq 0x10(%r14), %rax
movq %rax, (%rsp)
leaq 0x39(%r14), %rbp
leaq 0x30(%r14), %rdx
leaq 0x18(%r15), %rcx
pushq $0x3
popq %rdi
movq %rbp, %rsi
movq %rdx, 0x8(%rsp)
movq %r12, %r8
callq 0x208f8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x4438
sqrtsd %xmm0, %xmm0
jmp 0x443d
addq $0x10, %r14
xorps %xmm0, %xmm0
jmp 0x4474
callq 0x3200
addq $0x38, %r14
leaq 0x10(%rsp), %r13
pushq $0x3
popq %rsi
movq %r13, %rdi
xorl %edx, %edx
movq %r12, %rcx
movq %r15, %r8
movq (%rsp), %r9
pushq %rbp
pushq 0x10(%rsp)
pushq %r14
pushq %r15
callq 0x203f5
addq $0x20, %rsp
movq (%r13), %r14
movsd 0x10(%r13), %xmm0
movq %r14, (%rbx)
movsd %xmm0, 0x8(%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::clear()
void
      clear()
      {
        _M_erase_subtree(_M_get_root());
        _M_set_leftmost(&_M_header);
        _M_set_rightmost(&_M_header);
        _M_set_root(NULL);
        _M_count = 0;
      }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
callq 0x46d4
leaq 0x10(%rbx), %rax
movq %rax, 0x18(%rbx)
movq %rax, 0x20(%rbx)
andq $0x0, 0x8(%rbx)
andq $0x0, 0x28(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_erase_subtree(KDTree::_Node<kallaballa::NamedColor>*)
void
      _M_erase_subtree(_Link_type __n)
      {
        while (__n)
          {
            _M_erase_subtree(_S_right(__n));
            _Link_type __t = _S_left(__n);
            _M_delete_node(__n);
            __n = __t;
          }
      }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %r14, %r14
je 0x4704
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x46d4
movq 0x8(%r14), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x470a
movq %r15, %r14
jmp 0x46df
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::medcon_path(char const*, bool)
inline const char* medcon_path(const char *const user_path=0, const bool reinit_path=false) {
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_path,0,1024);
        bool path_found = false;
        std::FILE *file = 0;
#if cimg_OS==2
        const char *const pf_path = programfiles_path();
        if (!path_found) {
          std::strcpy(st_path,".\\medcon.exe");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) {
          cimg_snprintf(st_path,sizeof(st_path),"%s\\XMedCon\\bin\\medcon.bat",pf_path);
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) {
          cimg_snprintf(st_path,sizeof(st_path),"%s\\XMedCon\\bin\\medcon.exe",pf_path);
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"medcon.exe");
#else
        if (!path_found) {
          std::strcpy(st_path,"./medcon");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"medcon");
#endif
        winformat_string(st_path);
      }
      return st_path;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x760c
movq 0x28d2e(%rip), %rdi     # 0x30328
testq %rdi, %rdi
je 0x7604
callq 0x3370
andq $0x0, 0x28d1c(%rip)     # 0x30328
movq 0x28d15(%rip), %r14     # 0x30328
testq %rbx, %rbx
je 0x7652
testq %r14, %r14
jne 0x7631
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %r14
movq %rax, 0x28cf7(%rip)     # 0x30328
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3120
jmp 0x76be
testq %r14, %r14
jne 0x76be
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %rbx
movq %rax, 0x28cbd(%rip)     # 0x30328
leaq 0x9(%rax), %rdi
movl $0x3f7, %edx            # imm = 0x3F7
xorl %esi, %esi
callq 0x3150
movabsq $0x6e6f6364656d2f2e, %rax # imm = 0x6E6F6364656D2F2E
movq %rax, (%rbx)
movb $0x0, 0x8(%rbx)
leaq 0x1b003(%rip), %rsi     # 0x22696
movq %rbx, %rdi
callq 0x3340
testq %rax, %rax
je 0x76aa
movq %rax, %rdi
callq 0x7982
jmp 0x76be
movq 0x28c77(%rip), %rax     # 0x30328
movl $0x6e6f63, 0x3(%rax)    # imm = 0x6E6F63
movl $0x6364656d, (%rax)     # imm = 0x6364656D
movq 0x28c63(%rip), %rax     # 0x30328
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::filenamerand()
inline const char* filenamerand() {
      static char randomid[9] = { 0,0,0,0,0,0,0,0,0 };
      cimg::srand();
      for (unsigned int k = 0; k<8; ++k) {
        const int v = (int)std::rand()%3;
        randomid[k] = (char)(v==0?('0'+(std::rand()%10)):(v==1?('a'+(std::rand()%26)):('A'+(std::rand()%26))));
      }
      return randomid;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x7b39
xorl %r14d, %r14d
pushq $0x3
popq %rbp
pushq $0x30
popq %r15
pushq $0xa
popq %r12
leaq 0x28851(%rip), %r13     # 0x30338
cmpq $0x8, %r14
je 0x7b23
callq 0x3080
cltd
idivl %ebp
movl %edx, %ebx
callq 0x3080
movl %r12d, %esi
movl %r15d, %ecx
testl %ebx, %ebx
je 0x7b15
pushq $0x1a
popq %rsi
cmpl $0x1, %ebx
jne 0x7b12
pushq $0x61
jmp 0x7b14
pushq $0x41
popq %rcx
cltd
idivl %esi
addl %ecx, %edx
movb %dl, (%r14,%r13)
incq %r14
jmp 0x7ae7
leaq 0x2880e(%rip), %rax     # 0x30338
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq