// File: sebastienmeyer2[P]mst-clustering/src/node.cpp
// Function: silhouette(std::unordered_map<Node*, Node*, std::hash<Node*>, std::equal_to<Node*>, std::allocator<std::pair<Node* const, Node*>>>)
double silhouette(std::unordered_map<Node*, Node*> clusters)
{
    /*!
     * @brief Computes the silhouette of the clusters given in argument
     *
     * @param clusters A mapping between nodes and their representatives 
     * in clusters
     * 
     * @return The silhouette of these clusters
     */

    int n = clusters.size(); // number of nodes

	double silhouette = 0.0;

    // firstly, we compute the clusters in the reverse mode, that is, 
    // we take for each representative, all its members
    std::unordered_set<Node*> representatives;
    std::unordered_map<Node*, int> clusters_size;
    std::unordered_map<Node*, std::unordered_set<Node*> > members;
    std::unordered_set<Node*> nodes;

    for (auto kv : clusters) {
        Node* node = kv.first;
        Node* rep = kv.second;

        nodes.insert(node);

        representatives.insert(rep);
        if (clusters_size.find(rep) == clusters_size.end()) {
            clusters_size.insert(std::pair<Node*, int>(rep, 0));
        }
        clusters_size.at(rep) += 1;
        
        if (members.find(rep) == members.end()) {
            members.insert(std::pair<Node*, std::unordered_set<Node*> >(rep, std::unordered_set<Node*>()));
        }

        members.at(rep).insert(node);
    }

    int nb_clusters = representatives.size();

	// we compute a and b which are respectively the 
	// average distance to points of the same cluster 
	// and min of average distances to foreign clusters
    std::unordered_map<Node*, double> a;
    std::unordered_map<Node*, double> b;
    std::unordered_map<Node*, double> s;

    for (Node* node : nodes) {
        a.insert(std::pair<Node*, double>(node, 0.0));
        b.insert(std::pair<Node*, double>(node, 0.0));
        s.insert(std::pair<Node*, double>(node, 0.0));
    }

	for (Node* node : nodes){
        std::unordered_map<Node*, double> dist_to_clusters;
        for (Node* rep : representatives) {
            dist_to_clusters.insert(std::pair<Node*, double>(rep, 0.0));
        }

        for (Node* other_node : nodes) {
            if (other_node != node) {
                Node* other_node_cluster = clusters.at(other_node);

                dist_to_clusters.at(other_node_cluster) += std::sqrt(node->dist(other_node));
            }
        }

        double minDist = DBL_MAX;
        for (Node* rep : representatives) {
            dist_to_clusters.at(rep) /= clusters_size.at(rep);

            if (rep != clusters.at(node) && dist_to_clusters.at(rep) < minDist) {
                minDist = dist_to_clusters.at(rep);
            }
        }

        a.at(node) = dist_to_clusters.at(clusters.at(node));
        if (minDist < DBL_MAX) {
            b.at(node) = minDist;
        }
        s.at(node) = (b.at(node) - a.at(node)) / (std::max(a.at(node), b.at(node)));
	}

    for (Node* node : nodes) {
        silhouette += s.at(node);
    }
	silhouette /= n;

	return silhouette;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x640, %rsp            # imm = 0x640
movq %rdi, -0x4a0(%rbp)
movq %rdi, -0x8(%rbp)
callq 0x24770
movl %eax, -0xc(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xdbe0
leaq -0x88(%rbp), %rdi
callq 0x1bb20
leaq -0xc0(%rbp), %rdi
callq 0xd930
leaq -0xf8(%rbp), %rdi
callq 0xdbe0
movq -0x4a0(%rbp), %rdi
movq %rdi, -0x100(%rbp)
movq -0x100(%rbp), %rdi
callq 0x1bb40
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rdi
callq 0x1bb70
movq %rax, -0x110(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1bba0
testb $0x1, %al
jne 0x23993
jmp 0x23ce1
leaq -0x108(%rbp), %rdi
callq 0x1bbd0
movups (%rax), %xmm0
movaps %xmm0, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0xdd40
movb %dl, -0x4a9(%rbp)
movq %rax, -0x4a8(%rbp)
jmp 0x239e7
movb -0x4a9(%rbp), %al
movq -0x4a8(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movb %al, -0x148(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xdd40
movb %dl, -0x4b9(%rbp)
movq %rax, -0x4b8(%rbp)
jmp 0x23a20
movb -0x4b9(%rbp), %al
movq -0x4b8(%rbp), %rcx
movq %rcx, -0x160(%rbp)
movb %al, -0x158(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x1bc30
movq %rax, -0x4c8(%rbp)
jmp 0x23a56
movq -0x4c8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x1bc60
movq %rax, -0x170(%rbp)
leaq -0x168(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x24790
testb $0x1, %al
jne 0x23a90
jmp 0x23b0b
movl $0x0, -0x184(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x184(%rbp), %rdx
callq 0x1bd00
jmp 0x23ab6
leaq -0x88(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x1bcc0
movb %dl, -0x4d1(%rbp)
movq %rax, -0x4d0(%rbp)
jmp 0x23ad8
movb -0x4d1(%rbp), %al
movq -0x4d0(%rbp), %rcx
movq %rcx, -0x198(%rbp)
movb %al, -0x190(%rbp)
jmp 0x23b0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x2461f
leaq -0x88(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x1bc90
movq %rax, -0x4e0(%rbp)
jmp 0x23b27
movq -0x4e0(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
leaq -0xc0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xdb40
movq %rax, -0x4e8(%rbp)
jmp 0x23b50
movq -0x4e8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xdb70
movq %rax, -0x1a8(%rbp)
leaq -0x1a0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0xdb10
testb $0x1, %al
jne 0x23b8d
jmp 0x23c78
xorps %xmm0, %xmm0
movaps %xmm0, -0x200(%rbp)
movaps %xmm0, -0x210(%rbp)
movaps %xmm0, -0x220(%rbp)
movq $0x0, -0x1f0(%rbp)
leaq -0x220(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0xdbe0
movq -0x4f0(%rbp), %rdx
leaq -0x1e8(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xdc00
jmp 0x23bdf
leaq -0xc0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0xdba0
movb %dl, -0x4f9(%rbp)
movq %rax, -0x4f8(%rbp)
jmp 0x23c01
movb -0x4f9(%rbp), %al
movq -0x4f8(%rbp), %rcx
movq %rcx, -0x230(%rbp)
movb %al, -0x228(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0xdc40
leaq -0x220(%rbp), %rdi
callq 0xdc60
jmp 0x23c78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x23c67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0xdc40
leaq -0x220(%rbp), %rdi
callq 0xdc60
jmp 0x2461f
leaq -0xc0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xdc80
movq %rax, -0x508(%rbp)
jmp 0x23c94
movq -0x508(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0xdd40
movb %dl, -0x511(%rbp)
movq %rax, -0x510(%rbp)
jmp 0x23cb6
movb -0x511(%rbp), %al
movq -0x510(%rbp), %rcx
movq %rcx, -0x240(%rbp)
movb %al, -0x238(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x1bd30
jmp 0x23977
leaq -0x50(%rbp), %rdi
callq 0x24720
movl %eax, -0x244(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x247c0
leaq -0x2b8(%rbp), %rdi
callq 0x247c0
leaq -0x2f0(%rbp), %rdi
callq 0x247c0
leaq -0xf8(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rdi
callq 0x24690
movq %rax, -0x300(%rbp)
movq -0x2f8(%rbp), %rdi
callq 0xdd10
movq %rax, -0x308(%rbp)
leaq -0x300(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x246c0
testb $0x1, %al
jne 0x23d64
jmp 0x23ecb
leaq -0x300(%rbp), %rdi
callq 0x246f0
movq (%rax), %rax
movq %rax, -0x310(%rbp)
movq $0x0, -0x328(%rbp)
leaq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rsi
leaq -0x328(%rbp), %rdx
callq 0x24820
jmp 0x23da1
leaq -0x280(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x247e0
movb %dl, -0x521(%rbp)
movq %rax, -0x520(%rbp)
jmp 0x23dc3
movb -0x521(%rbp), %al
movq -0x520(%rbp), %rcx
movq %rcx, -0x338(%rbp)
movb %al, -0x330(%rbp)
movq $0x0, -0x350(%rbp)
leaq -0x348(%rbp), %rdi
leaq -0x310(%rbp), %rsi
leaq -0x350(%rbp), %rdx
callq 0x24820
jmp 0x23e04
leaq -0x2b8(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x247e0
movb %dl, -0x531(%rbp)
movq %rax, -0x530(%rbp)
jmp 0x23e26
movb -0x531(%rbp), %al
movq -0x530(%rbp), %rcx
movq %rcx, -0x360(%rbp)
movb %al, -0x358(%rbp)
movq $0x0, -0x378(%rbp)
leaq -0x370(%rbp), %rdi
leaq -0x310(%rbp), %rsi
leaq -0x378(%rbp), %rdx
callq 0x24820
jmp 0x23e67
leaq -0x2f0(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0x247e0
movb %dl, -0x541(%rbp)
movq %rax, -0x540(%rbp)
jmp 0x23e89
movb -0x541(%rbp), %al
movq -0x540(%rbp), %rcx
movq %rcx, -0x388(%rbp)
movb %al, -0x380(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x24740
jmp 0x23d48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0x245fb
leaq -0xf8(%rbp), %rax
movq %rax, -0x390(%rbp)
movq -0x390(%rbp), %rdi
callq 0x24690
movq %rax, -0x398(%rbp)
movq -0x390(%rbp), %rdi
callq 0xdd10
movq %rax, -0x3a0(%rbp)
leaq -0x398(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x246c0
testb $0x1, %al
jne 0x23f1b
jmp 0x244d7
leaq -0x398(%rbp), %rdi
callq 0x246f0
movq (%rax), %rax
movq %rax, -0x3a8(%rbp)
leaq -0x3e0(%rbp), %rdi
callq 0x247c0
leaq -0x50(%rbp), %rax
movq %rax, -0x3e8(%rbp)
movq -0x3e8(%rbp), %rdi
callq 0x24690
movq %rax, -0x3f0(%rbp)
movq -0x3e8(%rbp), %rdi
callq 0xdd10
movq %rax, -0x3f8(%rbp)
leaq -0x3f0(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x246c0
testb $0x1, %al
jne 0x23f8a
jmp 0x24037
leaq -0x3f0(%rbp), %rdi
callq 0x246f0
movq (%rax), %rax
movq %rax, -0x400(%rbp)
movq $0x0, -0x418(%rbp)
leaq -0x410(%rbp), %rdi
leaq -0x400(%rbp), %rsi
leaq -0x418(%rbp), %rdx
callq 0x24820
jmp 0x23fc7
leaq -0x3e0(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x247e0
movb %dl, -0x551(%rbp)
movq %rax, -0x550(%rbp)
jmp 0x23fe9
movb -0x551(%rbp), %al
movq -0x550(%rbp), %rcx
movq %rcx, -0x428(%rbp)
movb %al, -0x420(%rbp)
leaq -0x3f0(%rbp), %rdi
callq 0x24740
jmp 0x23f6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x138(%rbp)
movl %eax, -0x13c(%rbp)
leaq -0x3e0(%rbp), %rdi
callq 0x248f0
jmp 0x245fb
leaq -0xf8(%rbp), %rax
movq %rax, -0x430(%rbp)
movq -0x430(%rbp), %rdi
callq 0x24690
movq %rax, -0x438(%rbp)
movq -0x430(%rbp), %rdi
callq 0xdd10
movq %rax, -0x440(%rbp)
leaq -0x438(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0x246c0
testb $0x1, %al
jne 0x24087
jmp 0x24156
leaq -0x438(%rbp), %rdi
callq 0x246f0
movq (%rax), %rax
movq %rax, -0x448(%rbp)
movq -0x448(%rbp), %rax
cmpq -0x3a8(%rbp), %rax
je 0x24143
movq -0x4a0(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x24850
movq %rax, -0x560(%rbp)
jmp 0x240cd
movq -0x560(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x450(%rbp)
movq -0x3a8(%rbp), %rdi
movq -0x448(%rbp), %rsi
callq 0x23140
movsd %xmm0, -0x568(%rbp)
jmp 0x240fb
movsd -0x568(%rbp), %xmm0
callq 0xa5d0
movsd %xmm0, -0x578(%rbp)
leaq -0x3e0(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x24880
movq %rax, -0x570(%rbp)
jmp 0x2412c
movq -0x570(%rbp), %rax
movsd -0x578(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x24145
leaq -0x438(%rbp), %rdi
callq 0x24740
jmp 0x2406b
movsd 0x1363a(%rip), %xmm0    # 0x37798
movsd %xmm0, -0x458(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x460(%rbp)
movq -0x460(%rbp), %rdi
callq 0x24690
movq %rax, -0x468(%rbp)
movq -0x460(%rbp), %rdi
callq 0xdd10
movq %rax, -0x470(%rbp)
leaq -0x468(%rbp), %rdi
leaq -0x470(%rbp), %rsi
callq 0x246c0
testb $0x1, %al
jne 0x241b3
jmp 0x242e3
leaq -0x468(%rbp), %rdi
callq 0x246f0
movq (%rax), %rax
movq %rax, -0x478(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x1bc90
movq %rax, -0x580(%rbp)
jmp 0x241e5
movq -0x580(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x590(%rbp)
leaq -0x3e0(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x24880
movq %rax, -0x588(%rbp)
jmp 0x24214
movq -0x4a0(%rbp), %rdi
movq -0x588(%rbp), %rax
movsd -0x590(%rbp), %xmm1
movsd (%rax), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movq -0x478(%rbp), %rax
movq %rax, -0x5a0(%rbp)
leaq -0x3a8(%rbp), %rsi
callq 0x24850
movq %rax, -0x598(%rbp)
jmp 0x24259
movq -0x5a0(%rbp), %rax
movq -0x598(%rbp), %rcx
cmpq (%rcx), %rax
je 0x242d0
leaq -0x3e0(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x24880
movq %rax, -0x5a8(%rbp)
jmp 0x24288
movq -0x5a8(%rbp), %rax
movsd (%rax), %xmm1
movsd -0x458(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x242d0
leaq -0x3e0(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x24880
movq %rax, -0x5b0(%rbp)
jmp 0x242bd
movq -0x5b0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x458(%rbp)
jmp 0x242d2
leaq -0x468(%rbp), %rdi
callq 0x24740
jmp 0x24197
movq -0x4a0(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24850
movq %rax, -0x5b8(%rbp)
jmp 0x242ff
movq -0x5b8(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
callq 0x24880
movq %rax, -0x5c0(%rbp)
jmp 0x2431b
movq -0x5c0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x5d0(%rbp)
leaq -0x280(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24880
movq %rax, -0x5c8(%rbp)
jmp 0x2434a
movq -0x5c8(%rbp), %rax
movsd -0x5d0(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd 0x13433(%rip), %xmm0    # 0x37798
ucomisd -0x458(%rbp), %xmm0
jbe 0x243ae
movsd -0x458(%rbp), %xmm0
movsd %xmm0, -0x5e0(%rbp)
leaq -0x2b8(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24880
movq %rax, -0x5d8(%rbp)
jmp 0x2439b
movq -0x5d8(%rbp), %rax
movsd -0x5e0(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x2b8(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24880
movq %rax, -0x5e8(%rbp)
jmp 0x243ca
movq -0x5e8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x5f8(%rbp)
leaq -0x280(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24880
movq %rax, -0x5f0(%rbp)
jmp 0x243f9
movsd -0x5f8(%rbp), %xmm0
movq -0x5f0(%rbp), %rax
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x608(%rbp)
leaq -0x280(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24880
movq %rax, -0x600(%rbp)
jmp 0x24434
leaq -0x2b8(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24880
movq %rax, -0x610(%rbp)
jmp 0x24450
movq -0x610(%rbp), %rsi
movq -0x600(%rbp), %rdi
callq 0x248b0
movq %rax, -0x618(%rbp)
jmp 0x2446c
movsd -0x608(%rbp), %xmm0
movq -0x618(%rbp), %rax
movsd (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x628(%rbp)
leaq -0x2f0(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x24880
movq %rax, -0x620(%rbp)
jmp 0x244a7
movq -0x620(%rbp), %rax
movsd -0x628(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x3e0(%rbp), %rdi
callq 0x248f0
leaq -0x398(%rbp), %rdi
callq 0x24740
jmp 0x23eff
leaq -0xf8(%rbp), %rax
movq %rax, -0x480(%rbp)
movq -0x480(%rbp), %rdi
callq 0x24690
movq %rax, -0x488(%rbp)
movq -0x480(%rbp), %rdi
callq 0xdd10
movq %rax, -0x490(%rbp)
leaq -0x488(%rbp), %rdi
leaq -0x490(%rbp), %rsi
callq 0x246c0
testb $0x1, %al
jne 0x24524
jmp 0x24579
leaq -0x488(%rbp), %rdi
callq 0x246f0
movq (%rax), %rax
movq %rax, -0x498(%rbp)
leaq -0x2f0(%rbp), %rdi
leaq -0x498(%rbp), %rsi
callq 0x24880
movq %rax, -0x630(%rbp)
jmp 0x24556
movq -0x630(%rbp), %rax
movsd (%rax), %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x488(%rbp), %rdi
callq 0x24740
jmp 0x2450b
cvtsi2sdl -0xc(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x638(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0x248f0
leaq -0x2b8(%rbp), %rdi
callq 0x248f0
leaq -0x280(%rbp), %rdi
callq 0x248f0
leaq -0xf8(%rbp), %rdi
callq 0xdc60
leaq -0xc0(%rbp), %rdi
callq 0xddb0
leaq -0x88(%rbp), %rdi
callq 0x1be10
leaq -0x50(%rbp), %rdi
callq 0xdc60
movsd -0x638(%rbp), %xmm0
addq $0x640, %rsp            # imm = 0x640
popq %rbp
retq
leaq -0x2f0(%rbp), %rdi
callq 0x248f0
leaq -0x2b8(%rbp), %rdi
callq 0x248f0
leaq -0x280(%rbp), %rdi
callq 0x248f0
leaq -0xf8(%rbp), %rdi
callq 0xdc60
leaq -0xc0(%rbp), %rdi
callq 0xddb0
leaq -0x88(%rbp), %rdi
callq 0x1be10
leaq -0x50(%rbp), %rdi
callq 0xdc60
movq -0x138(%rbp), %rdi
callq 0xade0
nopl (%rax,%rax)