// File: kiudee[P]VAHD-Projekt/Supervisor.cpp
// Function: Supervisor::Init(NumObj*)
Action Supervisor::Init(NumObj *num)
{
    total = num->num;
    count = 0;
    printcount = 0;


    std::ofstream *tmpfilestream = new std::ofstream("data.csv");
    csvFile = std::shared_ptr<std::ofstream>(tmpfilestream);

    InitObj *tempObj;
    for (int i = 1; i <= num->num; i++) {
        std::shared_ptr<std::ofstream> tmpfile(csvFile);
        tempObj = new InitObj(h(i), true, tmpfile);
        auto subject = new Node((Object* &) tempObj);
        Subjects.push_back((Subject *) subject);
        _create((Subject *) this, (Subject *) subject);
    }

    delete num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rcx
movl 0x20(%rcx), %ecx
movl %ecx, 0x64(%rax)
movl $0x0, 0x60(%rax)
movl $0x0, 0xf8(%rax)
movl $0x200, %edi            # imm = 0x200
callq 0x31c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x88(%rbp)
leaq 0x13a25(%rip), %rsi     # 0x1701c
movl $0x10, %edx
callq 0x3210
jmp 0x3603
movq -0x88(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x54e0
movq -0x90(%rbp), %rdi
addq $0x98, %rdi
leaq -0x38(%rbp), %rsi
callq 0x5510
leaq -0x38(%rbp), %rdi
callq 0x5540
movl $0x1, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jg 0x37f3
movq -0x90(%rbp), %rsi
addq $0x98, %rsi
leaq -0x58(%rbp), %rdi
callq 0x5560
movl $0x40, %edi
callq 0x31c0
movq %rax, -0x98(%rbp)
jmp 0x367c
movb $0x1, -0x69(%rbp)
movl -0x44(%rbp), %edi
callq 0xdcf0
movsd %xmm0, -0xa0(%rbp)
jmp 0x3692
leaq -0x68(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x5560
movq -0x98(%rbp), %rdi
movsd -0xa0(%rbp), %xmm0
movq -0xa8(%rbp), %rdx
movl $0x1, %esi
callq 0x5590
jmp 0x36c8
movq -0x98(%rbp), %rax
movb $0x0, -0x69(%rbp)
movq %rax, -0x40(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5540
movl $0xe8, %edi
callq 0x31c0
movq %rax, -0xb0(%rbp)
jmp 0x36f3
movq -0xb0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5600
jmp 0x3705
movq -0x90(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0xe0, %rdi
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rsi
callq 0x56f0
jmp 0x3731
movq -0x90(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %rsi, %rdi
callq 0x5720
jmp 0x3746
leaq -0x58(%rbp), %rdi
callq 0x5540
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x3642
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x200, %esi            # imm = 0x200
callq 0x31d0
jmp 0x381e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x37e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x37b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5540
testb $0x1, -0x69(%rbp)
jne 0x37b8
jmp 0x37c9
movq -0x98(%rbp), %rdi
movl $0x40, %esi
callq 0x31d0
jmp 0x37e8
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0xe8, %esi
callq 0x31d0
leaq -0x58(%rbp), %rdi
callq 0x5540
jmp 0x381e
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
je 0x3815
movq -0xb8(%rbp), %rdi
movl $0x28, %esi
callq 0x31d0
addq $0xc0, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3330
nopw (%rax,%rax)