// File: /workspace/github_cpp_makefile_star2_O1/kiudee[P]VAHD-Projekt/Node.cpp
// Function: Node::Init(InitObj*)
Action Node::Init(InitObj *init)
{
    // Initialize pointers and relays
    left = NULL;
    right = NULL;
    node0 = NULL;
    node1 = NULL;
    in = new Relay;

    // Unpack initstructor object:
    num = init->num;
    isReal = init->isReal;
    csvFile = init->csvFile;
    delete init;

    if (isReal) {
        node0left = node1left = false;
        //std::cout << num << " initialized\n";
        // connect to supervisor:
        IdPair *idp = new IdPair(new IdObj(num, new Identity(in), _debugID),
                                 new IdObj(num, new Identity(in), _debugID));
        parent->call(Supervisor::SetLink, idp);

        // create virtual nodes:

        std::shared_ptr<std::ofstream> tmpfile0(csvFile);
        InitObj *n0 = new InitObj(num / 2, false, tmpfile0);
        auto tmpnode0 = (Subject *) new Node((Object* &) n0);

        std::shared_ptr<std::ofstream> tmpfile1(csvFile);
        InitObj *n1 = new InitObj((1 + num) / 2, false, tmpfile1);
        auto tmpnode1 = (Subject *) new Node((Object* &) n1);
        NodePair *np = new NodePair(tmpnode0, tmpnode1);
        parent->call(Supervisor::AddVirtuals, np);
        _create((Subject *) this, (Subject *) tmpnode0);
        _create((Subject *) this, (Subject *) tmpnode1);
    } else {
        //std::cout << "virtual node init: " << num << "\n";
        IdObj *tempid = new IdObj(num, new Identity(in), _debugID);
        parent->call(Node::ConnectChild, tempid);
    }

    //std::cout << num << "\t" << _debugID << "\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0xd8(%rdi)
movupd %xmm0, 0xc8(%rdi)
movl $0x48, %edi
callq 0x3160
movq %rax, %r15
leaq 0xa730(%rip), %rax      # 0x11c20
movq %rax, (%r15)
leaq 0xaca6(%rip), %rax      # 0x121a0
movq (%rax), %rax
movq %rax, 0x18(%r15)
movq %r15, %rdi
callq 0x58ce
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x7577
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x7577
movq %rax, 0x28(%r15)
movq 0x20(%rax), %r12
movq (%r12), %rcx
testq %rcx, %rcx
je 0x7549
xorl %eax, %eax
movl $0x1, %edx
cmpq %r15, (%rcx)
movq 0x8(%rcx), %rsi
cmovel %edx, %eax
movq %rsi, %rcx
testq %rsi, %rsi
jne 0x7533
testl %eax, %eax
jne 0x7577
movl $0x10, %edi
callq 0x3160
movq %r15, (%rax)
movq $0x0, 0x8(%rax)
movq 0x8(%r12), %rcx
xorl %edx, %edx
testq %rcx, %rcx
setne %dl
cmoveq %r12, %rcx
movq %rax, 0x8(%rcx)
movq %rax, (%r12,%rdx,8)
movq %r15, 0xc0(%rbx)
movsd 0x28(%r14), %xmm0
movsd %xmm0, 0xb0(%rbx)
movb 0x20(%r14), %al
movb %al, 0xb8(%rbx)
movq 0x30(%r14), %rax
movq %rax, 0xa0(%rbx)
leaq 0xa8(%rbx), %rdi
leaq 0x38(%r14), %rsi
callq 0x50b4
testq %r14, %r14
je 0x75d1
movq 0x38(%r14), %rdi
testq %rdi, %rdi
je 0x75c4
callq 0x503a
movl $0x40, %esi
movq %r14, %rdi
callq 0x3170
cmpb $0x1, 0xb8(%rbx)
jne 0x7908
movw $0x0, 0x62(%rbx)
movl $0x30, %edi
callq 0x3160
movq %rax, (%rsp)
movl $0x38, %edi
callq 0x3160
movq %rax, 0x10(%rsp)
movsd 0xb0(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movl $0x28, %edi
callq 0x3160
movq %rax, %r12
movq 0xc0(%rbx), %r14
leaq 0xab5e(%rip), %rax      # 0x12188
movq (%rax), %rbp
movq %rbp, (%r12)
leaq 0x1(%rbp), %r13
movq %r13, (%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%r12)
movq $0x0, 0x18(%r12)
leaq 0xab4d(%rip), %rax      # 0x121a0
movq (%rax), %rax
testq %rax, %rax
je 0x7665
movq %r12, %rcx
addq $0x8, %rcx
movq %rax, (%rcx)
testq %rax, %rax
sete %cl
testq %r14, %r14
sete %dl
orb %cl, %dl
movupd %xmm0, 0x10(%r12)
movq $0x0, 0x20(%r12)
jne 0x76ca
cmpq %rax, 0x18(%r14)
jne 0x76ca
movq %r14, 0x10(%r12)
movq 0x30(%r14), %rax
movq %rax, 0x20(%r12)
movl $0x18, %edi
callq 0x3160
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %r12, 0x10(%rax)
movq 0x40(%r14), %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x76bf
movq %rax, (%rdx)
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
movq %r14, 0x20(%rsp)
movl 0x8(%rbx), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rcx
movq %r13, (%rcx)
leaq 0x2(%rbp), %r15
leaq 0xaa9f(%rip), %rax      # 0x12188
movq %r15, (%rax)
movupd %xmm0, 0x8(%rcx)
movq $0x0, 0x18(%rcx)
leaq 0xaaa0(%rip), %rax      # 0x121a0
movq (%rax), %r14
testq %r14, %r14
je 0x7712
movq %rcx, %rax
addq $0x8, %rax
movq %r14, (%rax)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x20(%rcx)
movq %r12, 0x28(%rcx)
movl 0xc(%rsp), %eax
movl %eax, 0x30(%rcx)
movl $0x38, %edi
callq 0x3160
movq %rax, %r12
movl $0x28, %edi
callq 0x3160
movq %rax, %r13
leaq 0x3(%rbp), %rdx
movq %r15, (%rax)
leaq 0xaa38(%rip), %rax      # 0x12188
movq %rdx, (%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%r13)
movq $0x0, 0x18(%r13)
testq %r14, %r14
je 0x7774
movq %r13, %rax
addq $0x8, %rax
movq %r14, (%rax)
testq %r14, %r14
sete %al
movq 0x20(%rsp), %r15
testq %r15, %r15
sete %cl
orb %al, %cl
movupd %xmm0, 0x10(%r13)
movq $0x0, 0x20(%r13)
jne 0x77e0
cmpq %r14, 0x18(%r15)
jne 0x77e0
movq %rdx, %r14
movq %r15, 0x10(%r13)
movq 0x30(%r15), %rax
movq %rax, 0x20(%r13)
movl $0x18, %edi
callq 0x3160
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %r13, 0x10(%rax)
movq 0x40(%r15), %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x77d2
movq %rax, (%rdx)
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
movq %r14, %rdx
movq %rdx, (%r12)
leaq 0x4(%rbp), %rcx
leaq 0xa999(%rip), %rax      # 0x12188
movq %rcx, (%rax)
movupd %xmm0, 0x8(%r12)
movq $0x0, 0x18(%r12)
leaq 0xa997(%rip), %rax      # 0x121a0
movq (%rax), %rax
testq %rax, %rax
je 0x781b
movq %r12, %rdx
addq $0x8, %rdx
movq %rax, (%rdx)
addq $0x5, %rbp
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x20(%r12)
movq %r13, 0x28(%r12)
movl 0xc(%rsp), %edx
movl %edx, 0x30(%r12)
movq (%rsp), %rdx
movq %rcx, (%rdx)
leaq 0xa940(%rip), %rcx      # 0x12188
movq %rbp, (%rcx)
movq %rdx, %rcx
movupd %xmm0, 0x8(%rdx)
movq $0x0, 0x18(%rdx)
testq %rax, %rax
je 0x786f
movq (%rsp), %rcx
addq $0x8, %rcx
movq %rax, (%rcx)
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rcx)
movq %r12, 0x28(%rcx)
movq 0x28(%rbx), %r15
movl $0x38, %edi
movq %rcx, %r14
callq 0x3160
leaq 0xa914(%rip), %rdx      # 0x121a8
movq (%rdx), %rcx
movq %rcx, (%rax)
incq %rcx
movq %rcx, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
leaq -0x417e(%rip), %rcx     # 0x3732
movq %rcx, 0x18(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movq %r14, 0x28(%rax)
movq %rcx, 0x30(%rax)
movq (%r15), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq *0x8(%rcx)
movq 0xa0(%rbx), %r14
movq 0xa8(%rbx), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x7a8f
movq 0xa6d5(%rip), %rax      # 0x11fc8
cmpb $0x0, (%rax)
je 0x7a87
movq (%rsp), %rax
incl 0x8(%rax)
jmp 0x7a8f
movl $0x38, %edi
callq 0x3160
movq %rax, %r14
movsd 0xb0(%rbx), %xmm0
movsd %xmm0, (%rsp)
movl $0x28, %edi
callq 0x3160
movq %rax, %r15
movq 0xc0(%rbx), %r12
leaq 0xa84b(%rip), %rsi      # 0x12188
movq (%rsi), %r13
movq %r13, (%rax)
leaq 0x1(%r13), %rbp
movq %rbp, (%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
leaq 0xa83e(%rip), %rax      # 0x121a0
movq (%rax), %rax
testq %rax, %rax
je 0x7974
movq %r15, %rcx
addq $0x8, %rcx
movq %rax, (%rcx)
testq %rax, %rax
sete %cl
testq %r12, %r12
sete %dl
orb %cl, %dl
movupd %xmm0, 0x10(%r15)
movq $0x0, 0x20(%r15)
jne 0x79df
cmpq %rax, 0x18(%r12)
jne 0x79df
movq %r12, 0x10(%r15)
movq 0x30(%r12), %rax
movq %rax, 0x20(%r15)
movl $0x18, %edi
callq 0x3160
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %r15, 0x10(%rax)
movq 0x40(%r12), %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x79cd
movq %rax, (%rdx)
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
leaq 0xa7a9(%rip), %rsi      # 0x12188
movl 0x8(%rbx), %eax
movq %rbp, (%r14)
addq $0x2, %r13
movq %r13, (%rsi)
movupd %xmm0, 0x8(%r14)
movq $0x0, 0x18(%r14)
leaq 0xa79f(%rip), %rcx      # 0x121a0
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x7a13
movq %r14, %rdx
addq $0x8, %rdx
movq %rcx, (%rdx)
movsd (%rsp), %xmm0
movsd %xmm0, 0x20(%r14)
movq %r15, 0x28(%r14)
movl %eax, 0x30(%r14)
movq 0x28(%rbx), %r15
movl $0x38, %edi
callq 0x3160
leaq 0xa76d(%rip), %rcx      # 0x121a8
movq (%rcx), %rdx
movq %rdx, (%rax)
incq %rdx
movq %rdx, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
leaq 0x377(%rip), %rcx       # 0x7dcc
movq %rcx, 0x18(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movq %r14, 0x28(%rax)
movq %rcx, 0x30(%rax)
movq (%r15), %rcx
movq 0x8(%rcx), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rcx
movq (%rsp), %rax
lock
incl 0x8(%rax)
movl $0x40, %edi
callq 0x3160
movq %rax, %r15
movsd 0xb0(%rbx), %xmm0
mulsd 0x590c(%rip), %xmm0     # 0xd3b8
movq %r14, 0x48(%rsp)
movq (%rsp), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x7adc
movq 0xa502(%rip), %rax      # 0x11fc8
cmpb $0x0, (%rax)
je 0x7ad4
movq (%rsp), %rax
incl 0x8(%rax)
jmp 0x7adc
movq (%rsp), %rax
lock
incl 0x8(%rax)
leaq 0x48(%rsp), %r14
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4c46
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x7afc
callq 0x503a
movq %r15, 0x30(%rsp)
movl $0xe8, %edi
callq 0x3160
movq %rax, %r12
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x4ca0
movq 0xa0(%rbx), %r14
movq 0xa8(%rbx), %r15
testq %r15, %r15
je 0x7b45
movq 0xa493(%rip), %rax      # 0x11fc8
cmpb $0x0, (%rax)
je 0x7b40
incl 0x8(%r15)
jmp 0x7b45
lock
incl 0x8(%r15)
movl $0x40, %edi
callq 0x3160
movq %rax, %r13
movsd 0xb0(%rbx), %xmm0
addsd 0x585e(%rip), %xmm0     # 0xd3c0
mulsd 0x584e(%rip), %xmm0     # 0xd3b8
movq %r14, 0x38(%rsp)
movq %r15, 0x40(%rsp)
testq %r15, %r15
je 0x7b90
movq 0xa448(%rip), %rax      # 0x11fc8
cmpb $0x0, (%rax)
je 0x7b8b
incl 0x8(%r15)
jmp 0x7b90
lock
incl 0x8(%r15)
leaq 0x38(%rsp), %r14
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4c46
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x7bb0
callq 0x503a
movq %r13, 0x28(%rsp)
movl $0xe8, %edi
callq 0x3160
movq %rax, %r13
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x4ca0
movl $0x30, %edi
callq 0x3160
movq %rax, %rbp
leaq 0xa5a5(%rip), %rcx      # 0x12188
movq (%rcx), %rax
movq %rax, (%rbp)
incq %rax
movq %rax, (%rcx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rbp)
movq $0x0, 0x18(%rbp)
leaq 0xa598(%rip), %rax      # 0x121a0
movq (%rax), %rax
testq %rax, %rax
je 0x7c1a
movq %rbp, %rcx
addq $0x8, %rcx
movq %rax, (%rcx)
movq %r12, 0x20(%rbp)
movq %r13, 0x28(%rbp)
movq 0x28(%rbx), %r14
movl $0x38, %edi
callq 0x3160
leaq 0xa571(%rip), %rdx      # 0x121a8
movq (%rdx), %rcx
movq %rcx, (%rax)
incq %rcx
movq %rcx, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
leaq -0x3d1d(%rip), %rcx     # 0x3f36
movq %rcx, 0x18(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movq %rbp, 0x28(%rax)
movq %rcx, 0x30(%rax)
movq (%r14), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq *0x8(%rcx)
leaq 0xa525(%rip), %rax      # 0x121a0
movq %rbx, (%rax)
movl $0x60, %edi
callq 0x3160
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x60d2
leaq 0xa503(%rip), %rax      # 0x121a0
movq %rbx, (%rax)
movl $0x60, %edi
callq 0x3160
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
callq 0x60d2
testq %r15, %r15
je 0x7cc5
movq %r15, %rdi
callq 0x503a
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7cd3
callq 0x503a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
movq %r13, %rdi
callq 0x3170
jmp 0x7d59
movq %rax, %rbx
movl $0x28, %esi
movq %r12, %rdi
callq 0x3170
jmp 0x7d66
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
callq 0x3170
jmp 0x7d7a
jmp 0x7d1a
movq %rax, %rbx
movl $0x60, %esi
movq %r14, %rdi
jmp 0x7d32
movq %rax, %rbx
movl $0xe8, %esi
movq %r13, %rdi
callq 0x3170
jmp 0x7da7
jmp 0x7da4
jmp 0x7da4
movq %rax, %rbx
movl $0xe8, %esi
movq %r12, %rdi
callq 0x3170
jmp 0x7db4
jmp 0x7d51
movq %rax, %rbx
jmp 0x7db4
movq %rax, %rbx
movl $0x38, %esi
movq %r12, %rdi
jmp 0x7d70
movq %rax, %rbx
movl $0x38, %esi
movq 0x10(%rsp), %rdi
callq 0x3170
jmp 0x7d87
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
jmp 0x7d9d
movq %rax, %rbx
movl $0x30, %esi
movq (%rsp), %rdi
jmp 0x7d9d
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
callq 0x3170
jmp 0x7dc4
movq %rax, %rbx
testq %r15, %r15
je 0x7db4
movq %r15, %rdi
callq 0x503a
cmpq $0x0, (%rsp)
je 0x7dc4
movq (%rsp), %rdi
callq 0x503a
movq %rbx, %rdi
callq 0x3280