// File: /workspace/github_c_makefile_star2_O0/stonezwr[P]SpiKL-IP/main.C
// Function: CollectResultsFromNetwork(Network*)
void CollectResultsFromNetwork(Network array_network[]){
    int num_speeches = array_network[0].NumSpeech();
    int num_iters = array_network[0].NumIteration();
    vector<int> num_each_speech = array_network[0].NumEachSpeech();

    vector<int> r_correct(num_iters, 0);
    vector<int> r_wrong(num_iters, 0);
    vector<int> r_even(num_iters, 0);
    vector<vector<int> > r_correct_bd(num_iters, vector<int>(CLS, 0)); 

    for(int i = 0; i < NUM_THREADS; ++i)
        array_network[i].MergeReadoutResults(r_correct, r_wrong, r_even, r_correct_bd);

    auto max_rate_iter = max_element(r_correct.begin(),r_correct.end());
    int max_rate = *max_rate_iter;
    int max_ind = distance(r_correct.begin(), max_rate_iter);
    cout<<"Best performance achieved @"<<max_ind<<" = "<<max_rate<<"/"<<num_speeches<<" = "<<double(max_rate)*100/double(num_speeches)<<'%'<<endl;
    if(r_correct.size() >= 50)
        cout<<"Performance at 50th iteration = "<<double(r_correct[49])*100/double(num_speeches)<<'%'<<endl;
    if(r_correct.size() >= 100)
        cout<<"Performance at 100th iteration = "<<double(r_correct[99])*100/double(num_speeches)<<'%'<<endl;
    if(r_correct.size() >= 200)
        cout<<"Performance at 200th iteration = "<<double(r_correct[199])*100/double(num_speeches)<<'%'<<endl;
    if(r_correct.size() >= 300)
        cout<<"Performance at 300th iteration = "<<double(r_correct[299])*100/double(num_speeches)<<'%'<<endl;

    assert(num_each_speech.size() == r_correct_bd[max_ind].size());
    for(int i = 0; i < num_each_speech.size(); ++i){
        if(num_each_speech[i] != 0)
            cout<<"Performance for "<<i<<"th class = "<<r_correct_bd[max_ind][i]*100/double(num_each_speech[i])<<'%'<<endl;
    }
    PrintResultsToFile(r_correct, r_wrong, r_even, num_speeches);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2c930
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x33250
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x21300
movslq -0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
movl $0x0, -0x44(%rbp)
leaq -0x45(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x59c0
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rcx
leaq -0x40(%rbp), %rdi
leaq -0x44(%rbp), %rdx
callq 0x236a0
jmp 0x32243
leaq -0x45(%rbp), %rdi
callq 0x9670
movslq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
movl $0x0, -0x74(%rbp)
leaq -0x75(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x59c0
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rcx
leaq -0x70(%rbp), %rdi
leaq -0x74(%rbp), %rdx
callq 0x236a0
jmp 0x3228b
leaq -0x75(%rbp), %rdi
callq 0x9670
movslq -0x10(%rbp), %rax
movq %rax, -0x140(%rbp)
movl $0x0, -0x94(%rbp)
leaq -0x95(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x59c0
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rcx
leaq -0x90(%rbp), %rdi
leaq -0x94(%rbp), %rdx
callq 0x236a0
jmp 0x322df
leaq -0x95(%rbp), %rdi
callq 0x9670
movslq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
movl $0x0, -0xcc(%rbp)
leaq -0xcd(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x59c0
movq -0x148(%rbp), %rcx
leaq -0xc8(%rbp), %rdi
movl $0x1a, %esi
leaq -0xcc(%rbp), %rdx
callq 0x236a0
jmp 0x32334
leaq -0xce(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x23720
movq -0x150(%rbp), %rsi
movq -0x158(%rbp), %rcx
leaq -0xb0(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x23740
jmp 0x3236a
leaq -0xce(%rbp), %rdi
callq 0x237c0
leaq -0xc8(%rbp), %rdi
callq 0x9550
leaq -0xcd(%rbp), %rdi
callq 0x9670
movl $0x0, -0xd4(%rbp)
cmpl $0x5, -0xd4(%rbp)
jge 0x3249b
movq -0x8(%rbp), %rdi
movslq -0xd4(%rbp), %rax
imulq $0x2c8, %rax, %rax      # imm = 0x2C8
addq %rax, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq -0x90(%rbp), %rcx
leaq -0xb0(%rbp), %r8
callq 0x21e10
jmp 0x323d7
jmp 0x323d9
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x32398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x45(%rbp), %rdi
callq 0x9670
jmp 0x32afa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x75(%rbp), %rdi
callq 0x9670
jmp 0x32af1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x95(%rbp), %rdi
callq 0x9670
jmp 0x32ae8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3246d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xce(%rbp), %rdi
callq 0x237c0
leaq -0xc8(%rbp), %rdi
callq 0x9550
leaq -0xcd(%rbp), %rdi
callq 0x9670
jmp 0x32adc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x23900
jmp 0x32adc
leaq -0x40(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x56f0
movq -0x168(%rbp), %rdi
movq %rax, -0xe8(%rbp)
callq 0x57c0
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x33280
movq %rax, -0x160(%rbp)
jmp 0x324e1
movq -0x160(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5720
movl (%rax), %eax
movl %eax, -0xf4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x56f0
movq %rax, -0x100(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x332c0
movq %rax, -0x170(%rbp)
jmp 0x3253d
movq -0x170(%rbp), %rax
movl %eax, -0xf8(%rbp)
movq 0x1aa77(%rip), %rdi     # 0x4cfc8
leaq 0x47a3(%rip), %rsi      # 0x36cfb
callq 0x4360
movq %rax, -0x178(%rbp)
jmp 0x32566
movq -0x178(%rbp), %rdi
movl -0xf8(%rbp), %esi
callq 0x46c0
movq %rax, -0x180(%rbp)
jmp 0x32581
movq -0x180(%rbp), %rdi
leaq 0x47c7(%rip), %rsi      # 0x36d56
callq 0x4360
movq %rax, -0x188(%rbp)
jmp 0x3259d
movq -0x188(%rbp), %rdi
movl -0xf4(%rbp), %esi
callq 0x46c0
movq %rax, -0x190(%rbp)
jmp 0x325b8
movq -0x190(%rbp), %rdi
leaq 0x1d54(%rip), %rsi      # 0x3431a
callq 0x4360
movq %rax, -0x198(%rbp)
jmp 0x325d4
movq -0x198(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x46c0
movq %rax, -0x1a0(%rbp)
jmp 0x325ec
movq -0x1a0(%rbp), %rdi
leaq 0x475c(%rip), %rsi      # 0x36d56
callq 0x4360
movq %rax, -0x1a8(%rbp)
jmp 0x32608
movq -0x1a8(%rbp), %rdi
cvtsi2sdl -0xf4(%rbp), %xmm0
movsd 0x2cd1(%rip), %xmm1     # 0x352f0
mulsd %xmm1, %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4770
movq %rax, -0x1b0(%rbp)
jmp 0x3263a
movq -0x1b0(%rbp), %rdi
movl $0x25, %esi
callq 0x4420
movq %rax, -0x1b8(%rbp)
jmp 0x32654
movq -0x1b8(%rbp), %rdi
movq 0x1a956(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x32669
leaq -0x40(%rbp), %rdi
callq 0x5600
cmpq $0x32, %rax
jb 0x32705
movq 0x1a945(%rip), %rdi     # 0x4cfc8
leaq 0x468d(%rip), %rsi      # 0x36d17
callq 0x4360
movq %rax, -0x1c0(%rbp)
jmp 0x32698
leaq -0x40(%rbp), %rdi
movl $0x31, %esi
callq 0x5620
movq -0x1c0(%rbp), %rdi
cvtsi2sdl (%rax), %xmm0
movsd 0x2c37(%rip), %xmm1     # 0x352f0
mulsd %xmm1, %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4770
movq %rax, -0x1c8(%rbp)
jmp 0x326d4
movq -0x1c8(%rbp), %rdi
movl $0x25, %esi
callq 0x4420
movq %rax, -0x1d0(%rbp)
jmp 0x326ee
movq -0x1d0(%rbp), %rdi
movq 0x1a8bc(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x32703
jmp 0x32705
leaq -0x40(%rbp), %rdi
callq 0x5600
cmpq $0x64, %rax
jb 0x327a1
movq 0x1a8a9(%rip), %rdi     # 0x4cfc8
leaq 0x4612(%rip), %rsi      # 0x36d38
callq 0x4360
movq %rax, -0x1d8(%rbp)
jmp 0x32734
leaq -0x40(%rbp), %rdi
movl $0x63, %esi
callq 0x5620
movq -0x1d8(%rbp), %rdi
cvtsi2sdl (%rax), %xmm0
movsd 0x2b9b(%rip), %xmm1     # 0x352f0
mulsd %xmm1, %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4770
movq %rax, -0x1e0(%rbp)
jmp 0x32770
movq -0x1e0(%rbp), %rdi
movl $0x25, %esi
callq 0x4420
movq %rax, -0x1e8(%rbp)
jmp 0x3278a
movq -0x1e8(%rbp), %rdi
movq 0x1a820(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x3279f
jmp 0x327a1
leaq -0x40(%rbp), %rdi
callq 0x5600
cmpq $0xc8, %rax
jb 0x3283f
movq 0x1a80b(%rip), %rdi     # 0x4cfc8
leaq 0x4596(%rip), %rsi      # 0x36d5a
callq 0x4360
movq %rax, -0x1f0(%rbp)
jmp 0x327d2
leaq -0x40(%rbp), %rdi
movl $0xc7, %esi
callq 0x5620
movq -0x1f0(%rbp), %rdi
cvtsi2sdl (%rax), %xmm0
movsd 0x2afd(%rip), %xmm1     # 0x352f0
mulsd %xmm1, %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4770
movq %rax, -0x1f8(%rbp)
jmp 0x3280e
movq -0x1f8(%rbp), %rdi
movl $0x25, %esi
callq 0x4420
movq %rax, -0x200(%rbp)
jmp 0x32828
movq -0x200(%rbp), %rdi
movq 0x1a782(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x3283d
jmp 0x3283f
leaq -0x40(%rbp), %rdi
callq 0x5600
cmpq $0x12c, %rax            # imm = 0x12C
jb 0x328dd
movq 0x1a76d(%rip), %rdi     # 0x4cfc8
leaq 0x451a(%rip), %rsi      # 0x36d7c
callq 0x4360
movq %rax, -0x208(%rbp)
jmp 0x32870
leaq -0x40(%rbp), %rdi
movl $0x12b, %esi            # imm = 0x12B
callq 0x5620
movq -0x208(%rbp), %rdi
cvtsi2sdl (%rax), %xmm0
movsd 0x2a5f(%rip), %xmm1     # 0x352f0
mulsd %xmm1, %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x4770
movq %rax, -0x210(%rbp)
jmp 0x328ac
movq -0x210(%rbp), %rdi
movl $0x25, %esi
callq 0x4420
movq %rax, -0x218(%rbp)
jmp 0x328c6
movq -0x218(%rbp), %rdi
movq 0x1a6e4(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x328db
jmp 0x328dd
leaq -0x28(%rbp), %rdi
callq 0x5600
movq %rax, -0x220(%rbp)
movslq -0xf8(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x24720
movq %rax, %rdi
callq 0x5600
movq %rax, %rcx
movq -0x220(%rbp), %rax
cmpq %rcx, %rax
jne 0x32919
jmp 0x32938
leaq 0x447e(%rip), %rdi      # 0x36d9e
leaq 0x42f9(%rip), %rsi      # 0x36c20
movl $0x58, %edx
leaq 0x44a2(%rip), %rcx      # 0x36dd5
callq 0x4210
movl $0x0, -0x10c(%rbp)
movslq -0x10c(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5600
movq %rax, %rcx
movq -0x228(%rbp), %rax
cmpq %rcx, %rax
jae 0x32a87
movslq -0x10c(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x5620
cmpl $0x0, (%rax)
je 0x32a71
movq 0x1a63c(%rip), %rdi     # 0x4cfc8
leaq 0x446c(%rip), %rsi      # 0x36dff
callq 0x4360
movq %rax, -0x230(%rbp)
jmp 0x329a1
movq -0x230(%rbp), %rdi
movl -0x10c(%rbp), %esi
callq 0x46c0
movq %rax, -0x238(%rbp)
jmp 0x329bc
movq -0x238(%rbp), %rdi
leaq 0x4446(%rip), %rsi      # 0x36e10
callq 0x4360
movq %rax, -0x240(%rbp)
jmp 0x329d8
movslq -0xf8(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x24720
movq %rax, %rdi
movslq -0x10c(%rbp), %rsi
callq 0x5620
movl (%rax), %eax
imull $0x64, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x250(%rbp)
movslq -0x10c(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x5620
movsd -0x250(%rbp), %xmm0
movq -0x240(%rbp), %rdi
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x4770
movq %rax, -0x248(%rbp)
jmp 0x32a40
movq -0x248(%rbp), %rdi
movl $0x25, %esi
callq 0x4420
movq %rax, -0x258(%rbp)
jmp 0x32a5a
movq -0x258(%rbp), %rdi
movq 0x1a550(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x32a6f
jmp 0x32a71
jmp 0x32a73
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x32942
movl -0xc(%rbp), %ecx
leaq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x31e00
jmp 0x32aa0
leaq -0xb0(%rbp), %rdi
callq 0x23900
leaq -0x90(%rbp), %rdi
callq 0x9550
leaq -0x70(%rbp), %rdi
callq 0x9550
leaq -0x40(%rbp), %rdi
callq 0x9550
leaq -0x28(%rbp), %rdi
callq 0x9550
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x9550
leaq -0x70(%rbp), %rdi
callq 0x9550
leaq -0x40(%rbp), %rdi
callq 0x9550
leaq -0x28(%rbp), %rdi
callq 0x9550
movq -0x50(%rbp), %rdi
callq 0x46d0
nopl (%rax)