// File: maramire[P]SP_PSO/parallel_main.cpp
// Function: particle_init(int, std::vector<Particle, std::allocator<Particle>>&)
void particle_init(int n_items, Swarm &swarm)
{
    Particle particle;

    random_device rd;  
    mt19937 g(rd());  



    /* Define Initial permutation (1,2,3,...n_items) */
    vector<int> permutation(n_items);
    iota(begin(permutation), end(permutation), 1);

    /* Shuffling permutation vector */
    shuffle(begin(permutation), end(permutation), g);

    particle.permutation = permutation;
    
    /* Define Initial velocity (0,0,0,...0) */
    vector<float> velocity(n_items,0);    
    particle.velocity = velocity;
    particle.fitness = 99999999;
    particle.pbest_fitness = 99999999;

    swarm.push_back(particle);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2830, %rsp           # imm = 0x2830
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4760
leaq -0x13f0(%rbp), %rdi
callq 0x4a50
jmp 0x2919
leaq -0x13f0(%rbp), %rdi
callq 0x4af0
movl %eax, -0x27ec(%rbp)
jmp 0x292d
movl -0x27ec(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq -0x2788(%rbp), %rdi
callq 0x4b10
jmp 0x2945
movslq -0x4(%rbp), %rax
movq %rax, -0x2800(%rbp)
leaq -0x27a1(%rbp), %rdi
movq %rdi, -0x27f8(%rbp)
callq 0x4b40
movq -0x2800(%rbp), %rsi
movq -0x27f8(%rbp), %rdx
leaq -0x27a0(%rbp), %rdi
callq 0x4b60
jmp 0x297f
leaq -0x27a1(%rbp), %rdi
callq 0x4bd0
leaq -0x27a0(%rbp), %rdi
callq 0x4c50
movq %rax, -0x2808(%rbp)
jmp 0x29a0
movq -0x2808(%rbp), %rax
movq %rax, -0x27b0(%rbp)
leaq -0x27a0(%rbp), %rdi
callq 0x4c80
movq %rax, -0x2810(%rbp)
jmp 0x29c3
movq -0x2810(%rbp), %rax
movq %rax, -0x27b8(%rbp)
movq -0x27b0(%rbp), %rdi
movq -0x27b8(%rbp), %rsi
movl $0x1, %edx
callq 0x4bf0
jmp 0x29eb
leaq -0x27a0(%rbp), %rdi
callq 0x4c50
movq %rax, -0x2818(%rbp)
jmp 0x2a00
movq -0x2818(%rbp), %rax
movq %rax, -0x27c0(%rbp)
leaq -0x27a0(%rbp), %rdi
callq 0x4c80
movq %rax, -0x2820(%rbp)
jmp 0x2a23
movq -0x2820(%rbp), %rax
movq %rax, -0x27c8(%rbp)
movq -0x27c0(%rbp), %rdi
movq -0x27c8(%rbp), %rsi
leaq -0x2788(%rbp), %rdx
callq 0x4cb0
jmp 0x2a4d
leaq -0x68(%rbp), %rdi
leaq -0x27a0(%rbp), %rsi
callq 0x4f20
jmp 0x2a5f
movslq -0x4(%rbp), %rax
movq %rax, -0x2830(%rbp)
movl $0x0, -0x27e4(%rbp)
leaq -0x27e5(%rbp), %rdi
movq %rdi, -0x2828(%rbp)
callq 0x5170
movq -0x2830(%rbp), %rsi
movq -0x2828(%rbp), %rcx
leaq -0x27e0(%rbp), %rdi
leaq -0x27e4(%rbp), %rdx
callq 0x5190
jmp 0x2aaa
leaq -0x27e5(%rbp), %rdi
callq 0x5210
leaq -0x28(%rbp), %rdi
leaq -0x27e0(%rbp), %rsi
callq 0x5230
jmp 0x2ac8
movl $0x5f5e0ff, -0x50(%rbp) # imm = 0x5F5E0FF
movl $0x5f5e0ff, -0x30(%rbp) # imm = 0x5F5E0FF
movq -0x10(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5480
jmp 0x2ae5
leaq -0x27e0(%rbp), %rdi
callq 0x54f0
leaq -0x27a0(%rbp), %rdi
callq 0x5550
leaq -0x13f0(%rbp), %rdi
callq 0x55b0
leaq -0x68(%rbp), %rdi
callq 0x47a0
addq $0x2830, %rsp           # imm = 0x2830
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13f8(%rbp)
movl %eax, -0x13fc(%rbp)
jmp 0x2bd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13f8(%rbp)
movl %eax, -0x13fc(%rbp)
jmp 0x2bc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13f8(%rbp)
movl %eax, -0x13fc(%rbp)
leaq -0x27a1(%rbp), %rdi
callq 0x4bd0
jmp 0x2bc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13f8(%rbp)
movl %eax, -0x13fc(%rbp)
jmp 0x2bb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13f8(%rbp)
movl %eax, -0x13fc(%rbp)
leaq -0x27e5(%rbp), %rdi
callq 0x5210
jmp 0x2bb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13f8(%rbp)
movl %eax, -0x13fc(%rbp)
leaq -0x27e0(%rbp), %rdi
callq 0x54f0
leaq -0x27a0(%rbp), %rdi
callq 0x5550
leaq -0x13f0(%rbp), %rdi
callq 0x55b0
leaq -0x68(%rbp), %rdi
callq 0x47a0
movq -0x13f8(%rbp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)