// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0xd8(%rdi)
movupd %xmm0, 0xc8(%rdi)
movl $0x48, %edi
callq 0x2160
movq %rax, %r15
leaq 0xa860(%rip), %rax      # 0x10c58
movq %rax, (%r15)
leaq 0xad9e(%rip), %rax      # 0x111a0
movq (%rax), %rax
movq %rax, 0x18(%r15)
movq %r15, %rdi
callq 0x4856
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x647f
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x647f
movq %rax, 0x28(%r15)
movq 0x20(%rax), %r12
movq (%r12), %rcx
testq %rcx, %rcx
je 0x6451
xorl %eax, %eax
movl $0x1, %edx
cmpq %r15, (%rcx)
movq 0x8(%rcx), %rsi
cmovel %edx, %eax
movq %rsi, %rcx
testq %rsi, %rsi
jne 0x643b
testl %eax, %eax
jne 0x647f
movl $0x10, %edi
callq 0x2160
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 0x407c
movq 0x38(%r14), %rdi
testq %rdi, %rdi
je 0x64c7
callq 0x4002
movl $0x40, %esi
movq %r14, %rdi
callq 0x2170
cmpb $0x1, 0xb8(%rbx)
jne 0x65dc
movw $0x0, 0x62(%rbx)
movl $0x30, %edi
callq 0x2160
movq %rax, 0x10(%rsp)
movl $0x38, %edi
callq 0x2160
movq %rax, 0x8(%rsp)
movsd 0xb0(%rbx), %xmm0
movsd %xmm0, 0x30(%rsp)
movl $0x28, %edi
callq 0x2160
movq %rax, %r12
movq 0xc0(%rbx), %rdx
leaq 0xac5a(%rip), %r15      # 0x11188
movq (%r15), %rbp
movq %rbp, (%rax)
leaq 0x1(%rbp), %r13
movq %r13, (%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
leaq 0xac4d(%rip), %rax      # 0x111a0
movq (%rax), %r14
testq %r14, %r14
movq %rdx, 0x28(%rsp)
je 0x6764
movq %r14, 0x8(%r12)
movupd %xmm0, 0x10(%r12)
movq $0x0, 0x20(%r12)
testq %rdx, %rdx
movq 0x8(%rsp), %rcx
je 0x677c
cmpq %r14, 0x18(%rdx)
jne 0x677c
movq %rdx, 0x10(%r12)
movq 0x30(%rdx), %rax
movq %rax, 0x20(%r12)
movl $0x18, %edi
callq 0x2160
movq %r12, 0x10(%rax)
movq 0x28(%rsp), %rcx
movq 0x40(%rcx), %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x65cc
movq %rax, (%rdx)
leaq 0xabd7(%rip), %rsi      # 0x111a0
movq (%rsi), %r14
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
jmp 0x6777
movl $0x38, %edi
callq 0x2160
movq %rax, %r14
movsd 0xb0(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x28, %edi
callq 0x2160
movq %rax, %r15
movq 0xc0(%rbx), %r12
leaq 0xab76(%rip), %rcx      # 0x11188
movq (%rcx), %r13
movq %r13, (%rax)
leaq 0x1(%r13), %rdx
movq %rdx, (%rcx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
leaq 0xab69(%rip), %rax      # 0x111a0
movq (%rax), %rbp
testq %rbp, %rbp
je 0x66b1
movq %rbp, 0x8(%r15)
movupd %xmm0, 0x10(%r15)
movq $0x0, 0x20(%r15)
testq %r12, %r12
je 0x66c1
cmpq %rbp, 0x18(%r12)
jne 0x66c1
movq %rdx, 0x10(%rsp)
movq %r12, 0x10(%r15)
movq 0x30(%r12), %rax
movq %rax, 0x20(%r15)
movl $0x18, %edi
callq 0x2160
movq %r15, 0x10(%rax)
movq 0x40(%r12), %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x6698
movq %rax, (%rdx)
leaq 0xab0b(%rip), %rsi      # 0x111a0
movq (%rsi), %rbp
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
leaq 0xaade(%rip), %rcx      # 0x11188
movq 0x10(%rsp), %rdx
jmp 0x66c1
movupd %xmm0, 0x10(%r15)
movq $0x0, 0x20(%r15)
xorl %ebp, %ebp
movl 0x8(%rbx), %eax
movq %rdx, (%r14)
addq $0x2, %r13
movq %r13, (%rcx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%r14)
movq $0x0, 0x18(%r14)
testq %rbp, %rbp
je 0x66ef
movq %r14, %rcx
addq $0x8, %rcx
movq %rbp, (%rcx)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%r14)
movq %r15, 0x28(%r14)
movl %eax, 0x30(%r14)
movq 0x28(%rbx), %r15
movl $0x38, %edi
callq 0x2160
leaq 0xaa90(%rip), %rcx      # 0x111a8
movq (%rcx), %rdx
movq %rdx, (%rax)
incq %rdx
movq %rdx, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
leaq 0x612(%rip), %rcx       # 0x6d44
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 $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rcx
movupd %xmm0, 0x10(%r12)
movq $0x0, 0x20(%r12)
xorl %r14d, %r14d
movq 0x8(%rsp), %rcx
movl 0x8(%rbx), %edx
movq %r13, (%rcx)
movq %rbp, 0x18(%rsp)
addq $0x2, %rbp
movq %rbp, (%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rcx)
movq $0x0, 0x18(%rcx)
testq %r14, %r14
je 0x67ae
movq %rcx, %rax
addq $0x8, %rax
movq %r14, (%rax)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x20(%rcx)
movq %r12, 0x28(%rcx)
movl %edx, 0x24(%rsp)
movl %edx, 0x30(%rcx)
movl $0x38, %edi
callq 0x2160
movq %rax, %r12
movl $0x28, %edi
callq 0x2160
movq %rax, %r13
movq 0x18(%rsp), %rdi
leaq 0x3(%rdi), %r15
movq %rbp, (%rax)
leaq 0xa997(%rip), %rdx      # 0x11188
movq %r15, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
testq %r14, %r14
je 0x6865
movq %r14, 0x8(%r13)
movupd %xmm0, 0x10(%r13)
movq $0x0, 0x20(%r13)
movq 0x28(%rsp), %rcx
testq %rcx, %rcx
je 0x6830
cmpq %r14, 0x18(%rcx)
je 0x6bce
movq %r15, (%r12)
movq 0x18(%rsp), %rdi
leaq 0x4(%rdi), %rax
leaq 0xa944(%rip), %rdx      # 0x11188
movq %rax, (%rdx)
movq %r12, %rcx
addq $0x8, %rcx
movupd %xmm0, 0x8(%r12)
movq $0x0, 0x18(%r12)
movq %r14, (%rcx)
xorl %ecx, %ecx
jmp 0x688b
movupd %xmm0, 0x10(%r13)
xorl %r14d, %r14d
movq %r14, 0x20(%r13)
movq %r15, (%r12)
leaq 0x4(%rdi), %rax
movq %rax, (%rdx)
movq %r14, 0x18(%r12)
movupd %xmm0, 0x8(%r12)
movb $0x1, %cl
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x20(%r12)
movq %r13, 0x28(%r12)
movl 0x24(%rsp), %esi
movl %esi, 0x30(%r12)
movq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %rsi, %rax
addq $0x5, %rdi
movq %rdi, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rsi)
movq $0x0, 0x18(%rsi)
testb %cl, %cl
jne 0x68de
movq 0x10(%rsp), %rax
addq $0x8, %rax
movq %r14, (%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq 0x28(%rbx), %r15
movl $0x38, %edi
movq %rax, %r14
callq 0x2160
leaq 0xa8a5(%rip), %rdx      # 0x111a8
movq (%rdx), %rcx
movq %rcx, (%rax)
incq %rcx
movq %rcx, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
leaq -0x41fd(%rip), %rcx     # 0x2722
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, 0x8(%rsp)
testq %rax, %rax
je 0x6977
movq 0xa669(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x696e
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0x6977
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
movl $0x40, %edi
callq 0x2160
movq %rax, %r15
movsd 0xb0(%rbx), %xmm0
mulsd 0x5a24(%rip), %xmm0     # 0xc3b8
movq %r14, 0x58(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x69c7
movq 0xa619(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x69be
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0x69c7
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
leaq 0x58(%rsp), %r14
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3c1e
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x69e7
callq 0x4002
movq %r15, 0x40(%rsp)
movl $0xe8, %edi
callq 0x2160
movq %rax, %r12
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x3c7a
movq 0xa0(%rbx), %r14
movq 0xa8(%rbx), %r15
testq %r15, %r15
je 0x6a30
movq 0xa5a8(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x6a2b
incl 0x8(%r15)
jmp 0x6a30
lock
incl 0x8(%r15)
movl $0x40, %edi
callq 0x2160
movq %rax, %r13
movsd 0xb0(%rbx), %xmm0
addsd 0x5973(%rip), %xmm0     # 0xc3c0
mulsd 0x5963(%rip), %xmm0     # 0xc3b8
movq %r14, 0x48(%rsp)
movq %r15, 0x50(%rsp)
testq %r15, %r15
je 0x6a7b
movq 0xa55d(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x6a76
incl 0x8(%r15)
jmp 0x6a7b
lock
incl 0x8(%r15)
leaq 0x48(%rsp), %r14
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3c1e
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x6a9b
callq 0x4002
movq %r13, 0x38(%rsp)
movl $0xe8, %edi
callq 0x2160
movq %rax, %r13
leaq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x3c7a
movl $0x30, %edi
callq 0x2160
movq %rax, %rbp
leaq 0xa6ba(%rip), %rcx      # 0x11188
movq (%rcx), %rax
movq %rax, (%rbp)
incq %rax
movq %rax, (%rcx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rbp)
movq $0x0, 0x18(%rbp)
leaq 0xa6ad(%rip), %rax      # 0x111a0
movq (%rax), %rax
testq %rax, %rax
je 0x6b05
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 0x2160
leaq 0xa686(%rip), %rdx      # 0x111a8
movq (%rdx), %rcx
movq %rcx, (%rax)
incq %rcx
movq %rcx, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
leaq -0x3c16(%rip), %rcx     # 0x2f28
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 0xa63a(%rip), %rax      # 0x111a0
movq %rbx, (%rax)
movl $0x60, %edi
callq 0x2160
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x500a
leaq 0xa618(%rip), %rax      # 0x111a0
movq %rbx, (%rax)
movl $0x60, %edi
callq 0x2160
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
callq 0x500a
testq %r15, %r15
je 0x6bb0
movq %r15, %rdi
callq 0x4002
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x6bbf
callq 0x4002
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, 0x10(%r13)
movq 0x30(%rcx), %rax
movq %rax, 0x20(%r13)
movl $0x18, %edi
movq %rcx, %rbp
callq 0x2160
movq 0x18(%rsp), %rdi
movq %r13, 0x10(%rax)
movq 0x40(%rbp), %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x6c0a
movq %rax, (%rdx)
leaq 0xa599(%rip), %rsi      # 0x111a0
movq (%rsi), %r14
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
movq %r15, (%r12)
leaq 0x4(%rdi), %rax
leaq 0xa564(%rip), %rdx      # 0x11188
movq %rax, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%r12)
movq $0x0, 0x18(%r12)
testq %r14, %r14
je 0x6c4c
movq %r12, %rcx
addq $0x8, %rcx
jmp 0x685e
movb $0x1, %cl
xorl %r14d, %r14d
jmp 0x688b
movq %rax, %rbx
movl $0x28, %esi
movq %r13, %rdi
callq 0x2170
jmp 0x6ccd
movq %rax, %rbx
movl $0x28, %esi
movq %r12, %rdi
callq 0x2170
jmp 0x6cda
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
callq 0x2170
jmp 0x6cee
jmp 0x6c8e
movq %rax, %rbx
movl $0x60, %esi
movq %r14, %rdi
jmp 0x6ca6
movq %rax, %rbx
movl $0xe8, %esi
movq %r13, %rdi
callq 0x2170
jmp 0x6d1c
jmp 0x6d19
jmp 0x6d19
movq %rax, %rbx
movl $0xe8, %esi
movq %r12, %rdi
callq 0x2170
jmp 0x6d29
jmp 0x6cc5
movq %rax, %rbx
jmp 0x6d29
movq %rax, %rbx
movl $0x38, %esi
movq %r12, %rdi
jmp 0x6ce4
movq %rax, %rbx
movl $0x38, %esi
movq 0x8(%rsp), %rdi
callq 0x2170
jmp 0x6cfb
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
jmp 0x6d12
movq %rax, %rbx
movl $0x30, %esi
movq 0x10(%rsp), %rdi
jmp 0x6d12
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
callq 0x2170
jmp 0x6d3b
movq %rax, %rbx
testq %r15, %r15
je 0x6d29
movq %r15, %rdi
callq 0x4002
cmpq $0x0, 0x8(%rsp)
je 0x6d3b
movq 0x8(%rsp), %rdi
callq 0x4002
movq %rbx, %rdi
callq 0x2280
nop