// File: kiudee[P]VAHD-Projekt/Node.cpp
// Function: Node::BuildWeakConnectedComponent(NumObj*)
Action Node::BuildWeakConnectedComponent(NumObj *numo)
{

    IdObj *tempido;

    if (numo->num == 0) {
        //envelope left neighbor
        //TO DO check if left is existing before delegating. maybe this is not necessary because if the left is not exisiting, we would not come so far. otherwise the link to left might be broken.
        if (left != NULL) {
            tempido = new IdObj(left->num, extractIdentity(left->out), left->debugID);
            delete left;
            leftstable = false;

            //link to v.0
            left = new NodeRelay(num / 2, new Identity(node0->out), node0->debugID);
            //delegate old left neighbor to node0
            left->out->call(Node::BuildList, tempido);
        } else {
            leftstable = false;

            //link to v.0
            left = new NodeRelay(num / 2, new Identity(node0->out), node0->debugID);
        }

    } else if (numo->num == 1) {
        if (right != NULL) {
            tempido = new IdObj(right->num, extractIdentity(right->out), right->debugID);
            delete right;
            rightstable = false;

            right = new NodeRelay((1 + num) / 2, new Identity(node1->out), node1->debugID);
            right->out->call(Node::BuildList, tempido);
        } else {
            rightstable = false;

            right = new NodeRelay((1 + num) / 2, new Identity(node1->out), node1->debugID);
        }
    }
    delete numo;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x14fa3
movq -0x50(%rbp), %rax
cmpq $0x0, 0xc8(%rax)
je 0x14eb2
movl $0x38, %edi
callq 0x31c0
movq -0x50(%rbp), %rsi
movq %rax, -0x68(%rbp)
movq 0xc8(%rsi), %rdx
movsd 0x20(%rdx), %xmm0
movsd %xmm0, -0x60(%rbp)
addq $0x28, %rdx
movq %rsi, %rdi
callq 0x155f0
movq %rax, -0x58(%rbp)
jmp 0x14ce0
movq -0x58(%rbp), %rsi
movsd -0x60(%rbp), %xmm0
movq -0x68(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xc8(%rax), %rax
movl 0x30(%rax), %edx
callq 0x15520
jmp 0x14d02
movq -0x50(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq 0xc8(%rax), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x14d2d
movq -0x70(%rbp), %rdi
movl $0x38, %esi
callq 0x31d0
movq -0x50(%rbp), %rax
movb $0x0, 0x60(%rax)
movl $0x38, %edi
callq 0x31c0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0x88(%rbp)
movsd 0xb0(%rax), %xmm0
movsd 0x26a3(%rip), %xmm1     # 0x17400
mulsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movl $0x28, %edi
callq 0x31c0
movq %rax, -0x78(%rbp)
jmp 0x14d76
movq -0x78(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xd8(%rax), %rax
movq 0x28(%rax), %rsi
callq 0x153e0
jmp 0x14d90
movq -0x78(%rbp), %rsi
movsd -0x80(%rbp), %xmm0
movq -0x88(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xd8(%rax), %rax
movl 0x30(%rax), %edx
callq 0x15ce0
jmp 0x14db5
movq -0x50(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0xc8(%rax)
movq 0xc8(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x98(%rbp)
movl $0x38, %edi
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x90(%rbp)
leaq -0x53d7(%rip), %rax     # 0xfa20
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x5ae0
jmp 0x14e16
movq -0x90(%rbp), %rdx
movq -0x50(%rbp), %rsi
movq -0x98(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x14f9e
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x14e7a
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x28, %esi
callq 0x31d0
movq -0x88(%rbp), %rdi
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
movq -0x50(%rbp), %rax
movb $0x0, 0x60(%rax)
movl $0x38, %edi
callq 0x31c0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0xb0(%rbp)
movsd 0xb0(%rax), %xmm0
movsd 0x251e(%rip), %xmm1     # 0x17400
mulsd %xmm1, %xmm0
movsd %xmm0, -0xa8(%rbp)
movl $0x28, %edi
callq 0x31c0
movq %rax, -0xa0(%rbp)
jmp 0x14f01
movq -0xa0(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xd8(%rax), %rax
movq 0x28(%rax), %rsi
callq 0x153e0
jmp 0x14f1e
movq -0xa0(%rbp), %rsi
movsd -0xa8(%rbp), %xmm0
movq -0xb0(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xd8(%rax), %rax
movl 0x30(%rax), %edx
callq 0x15ce0
jmp 0x14f49
movq -0x50(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, 0xc8(%rax)
jmp 0x14f9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x14f88
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x28, %esi
callq 0x31d0
movq -0xb0(%rbp), %rdi
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
jmp 0x152ff
movq -0x10(%rbp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x152fd
movq -0x50(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x15206
movl $0x38, %edi
callq 0x31c0
movq -0x50(%rbp), %rsi
movq %rax, -0xc8(%rbp)
movq 0xd0(%rsi), %rdx
movsd 0x20(%rdx), %xmm0
movsd %xmm0, -0xc0(%rbp)
addq $0x28, %rdx
movq %rsi, %rdi
callq 0x155f0
movq %rax, -0xb8(%rbp)
jmp 0x15001
movq -0xb8(%rbp), %rsi
movsd -0xc0(%rbp), %xmm0
movq -0xc8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xd0(%rax), %rax
movl 0x30(%rax), %edx
callq 0x15520
jmp 0x1502c
movq -0x50(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq 0xd0(%rax), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, %rax
je 0x15060
movq -0xd0(%rbp), %rdi
movl $0x38, %esi
callq 0x31d0
movq -0x50(%rbp), %rax
movb $0x0, 0x61(%rax)
movl $0x38, %edi
callq 0x31c0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movsd 0xb0(%rax), %xmm0
movsd 0x2378(%rip), %xmm1     # 0x17408
addsd %xmm1, %xmm0
movsd 0x2364(%rip), %xmm1     # 0x17400
mulsd %xmm1, %xmm0
movsd %xmm0, -0xe0(%rbp)
movl $0x28, %edi
callq 0x31c0
movq %rax, -0xd8(%rbp)
jmp 0x150bb
movq -0xd8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xe0(%rax), %rax
movq 0x28(%rax), %rsi
callq 0x153e0
jmp 0x150d8
movq -0xd8(%rbp), %rsi
movsd -0xe0(%rbp), %xmm0
movq -0xe8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xe0(%rax), %rax
movl 0x30(%rax), %edx
callq 0x15ce0
jmp 0x15103
movq -0x50(%rbp), %rax
movq -0xe8(%rbp), %rcx
movq %rcx, 0xd0(%rax)
movq 0xd0(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0xf8(%rbp)
movl $0x38, %edi
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
leaq -0x5725(%rip), %rax     # 0xfa20
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x5ae0
jmp 0x15164
movq -0xf0(%rbp), %rdx
movq -0x50(%rbp), %rsi
movq -0xf8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x152fb
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x151ce
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x28, %esi
callq 0x31d0
movq -0xe8(%rbp), %rdi
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
movq -0x50(%rbp), %rax
movb $0x0, 0x61(%rax)
movl $0x38, %edi
callq 0x31c0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0x110(%rbp)
movsd 0xb0(%rax), %xmm0
movsd 0x21d2(%rip), %xmm1     # 0x17408
addsd %xmm1, %xmm0
movsd 0x21be(%rip), %xmm1     # 0x17400
mulsd %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
movl $0x28, %edi
callq 0x31c0
movq %rax, -0x100(%rbp)
jmp 0x15261
movq -0x100(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xe0(%rax), %rax
movq 0x28(%rax), %rsi
callq 0x153e0
jmp 0x1527e
movq -0x100(%rbp), %rsi
movsd -0x108(%rbp), %xmm0
movq -0x110(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0xe0(%rax), %rax
movl 0x30(%rax), %edx
callq 0x15ce0
jmp 0x152a9
movq -0x50(%rbp), %rax
movq -0x110(%rbp), %rcx
movq %rcx, 0xd0(%rax)
jmp 0x152fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x152e8
movq -0x100(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x28, %esi
callq 0x31d0
movq -0x110(%rbp), %rdi
movl $0x38, %esi
callq 0x31d0
jmp 0x1532a
jmp 0x152fd
jmp 0x152ff
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
cmpq $0x0, %rax
je 0x15321
movq -0x118(%rbp), %rdi
movl $0x28, %esi
callq 0x31d0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3330
nopw %cs:(%rax,%rax)
nopl (%rax)