// File: /workspace/github_cpp_makefile_star2_O3/maramire[P]SP_PSO/main.cpp
// Function: main
int main(int argc, const char *argv[]) 
{


    /* Taking algorithm time performance! */
    auto t1 = chrono::high_resolution_clock::now(); 

    cout << "Start!"<<endl;
    
    /* Save items data */
    Item_vector items;

    /* Open Instance File */

    /* Define number of items to pack */
    int n_items = 0; 
    int strip_width = 0;
    int max_height = 0;

    string filepath = argv[1];
    cout << "-> Opening instances!"<<endl;
    openInstance(filepath, items, strip_width, max_height, n_items);

    
    unsigned int a = filepath.rfind('.');
    unsigned int b = filepath.rfind('/',a-1);
    string name = filepath.substr(b+1,a-b-1);
    
    

    cout << "-> Number of items: " << n_items << endl;
    cout << "-> Strip width: " << strip_width << endl;
    cout << "-> Upper bound computed: "  << max_height << endl;

    /* Swarm of particles */
    Swarm swarm;

    /* Initialize particles */
    for(int i=0; i<N_PARTICLES; i++){
        //unsigned seed = i+1;
        particle_init(n_items, swarm);

        /* Initialize strip */
        Strip s = {};
        s.height = max_height;
        s.width = strip_width;

        s.x_position = 0;
        s.y_position = 0;
    
        /* Evaluate each particle */
        HR(items,s,n_items,swarm[i]); 

        swarm[i].pbest = swarm[i].permutation;
        swarm[i].pbest_fitness = swarm[i].fitness;

    } 

    //showSwarm(swarm);

    /* Declare global best particle */

    Particle gbest;
    gbest.fitness = max_height;


    /* Select best position */
    sort(swarm.begin(), swarm.end(), compareByFitness);
    
    if (swarm[0].fitness < gbest.fitness)
    {
        gbest.fitness = swarm[0].fitness;
        gbest.permutation = swarm[0].permutation;
    }

    int iter = 0;
    float omega = 1.2;
    float c1 = 2.05;
    float c2 = 2.05;
    float omega_max = 1.2;
    float omega_min = 0.7;

    float velocity_max = (n_items)/2;
    float velocity_min = -(n_items)/2;
    float current_velocity = 0;


    random_device rd;
    mt19937 gen(rd());
    uniform_real_distribution<> dis(0, 1);//uniform distribution between 0 and 1

    while (iter<MAX_ITER)
    {

        iter++;
        //cout << gbest.fitness << endl;
        
        /* Update velocity and position with results */
        for (int p = 0; p < N_PARTICLES; p++)
        {
            vector<float> new_permutation(n_items);
            iota(begin(new_permutation), end(new_permutation), 1);

            for (int i = 0; i < swarm[p].permutation.size(); i++)
            {
            
                float r1 = dis(gen);
                float r2 = dis(gen);

                float pfactor = swarm[p].pbest[i] - swarm[p].permutation[i];
                float gfactor = gbest.permutation[i] - swarm[p].permutation[i];                

                current_velocity = omega*swarm[p].permutation[i] + r1*c1*pfactor + r2*c2*gfactor;

                if (current_velocity < velocity_min)
                {
                    current_velocity = velocity_min;

                }else if(current_velocity > velocity_max)
                {
                    current_velocity = velocity_max;
                }

                swarm[p].velocity[i] = current_velocity;
            
                new_permutation[i] = swarm[p].permutation[i] + swarm[p].velocity[i];
                
            }

            /* Discretize position */
            vector<float> assignments = new_permutation;
            sort(assignments.begin(),assignments.end());

            for (int i = 0; i < new_permutation.size(); i++)
            {
                for (int j = 0; j < assignments.size(); j++)
                {
                    if (new_permutation[j]==assignments[i])
                    {
                        swarm[p].permutation[i] = j+1;
                    }   
                }
            }

            /* Initialize strip */
            Strip s = {};
            s.height = max_height;
            s.width = strip_width;

            s.x_position = 0;
            s.y_position = 0;
        
            /* Evaluate particle */
            HR(items,s,n_items,swarm[p]); 

            if (swarm[p].fitness < swarm[p].pbest_fitness)
            {
                swarm[p].pbest = swarm[p].permutation;
                swarm[p].pbest_fitness = swarm[p].fitness;
            }
            
            if (swarm[p].pbest_fitness < gbest.fitness)
            {
                gbest.fitness = swarm[p].pbest_fitness;
                gbest.permutation = swarm[p].pbest;
            }

        }
        
        omega = (omega_max)-((omega_max-omega_min)/MAX_ITER)*iter;
    } 
    

    //showSwarm(swarm);
    //showRectangles(items);

    //showPermutation(gbest);

    Strip s = {};
    s.height = max_height;
    s.width = strip_width;

    s.x_position = 0;
    s.y_position = 0;

    HR(items,s,n_items,gbest); 
    cout << "-> Fitness of best solution: " << gbest.fitness << endl;
    
    //showRectangles(items);


    //cout << "-> End!" << endl;

    auto t2 = chrono::high_resolution_clock::now(); 
    chrono::duration<double> time_span = (t2 - t1);
    cout << "-> It took me " << time_span.count() << " seconds.";
    cout << endl;

/*     ofstream myfile;
    myfile.open ("Results/"+name+".csv", fstream::app);
    myfile << gbest.fitness << "," << time_span.count() << endl;
    myfile.close(); */


    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2898, %rsp           # imm = 0x2898
movq %rsi, %rbx
callq 0x2040
movq %rax, %r15
movq 0x6ed4(%rip), %r14      # 0x9fd8
leaq 0x4029(%rip), %rsi      # 0x7134
movl $0x6, %edx
movq %r14, %rdi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
movq $0x0, -0x90(%rbp)
xorl %eax, %eax
movl %eax, -0x44(%rbp)
movl %eax, -0x40(%rbp)
movl %eax, -0x3c(%rbp)
movq 0x8(%rbx), %rsi
leaq -0x158(%rbp), %rdi
leaq -0x1530(%rbp), %rdx
callq 0x419e
movq 0x6e5b(%rip), %rbx      # 0x9fd8
leaq 0x3fb7(%rip), %rsi      # 0x713b
movl $0x15, %edx
movq %rbx, %rdi
callq 0x21b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x6e29(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0x178(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rdi
callq 0x433e
leaq -0x188(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
leaq -0x44(%rbp), %r8
callq 0x244a
movq -0x188(%rbp), %rdi
cmpq %r14, %rdi
je 0x321e
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x2190
leaq -0x158(%rbp), %rbx
movq %rbx, %rdi
movl $0x2e, %esi
movq $-0x1, %rdx
callq 0x2280
movq %rax, %r14
leal -0x1(%rax), %edx
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x2280
leal 0x1(%rax), %edx
notl %eax
addl %eax, %r14d
leaq -0x1a8(%rbp), %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x21a0
movq %r15, -0x118(%rbp)
movq 0x6d64(%rip), %rdi      # 0x9fd8
leaq 0x3ed6(%rip), %rsi      # 0x7151
movl $0x14, %edx
callq 0x21b0
movl -0x44(%rbp), %r12d
movq 0x6d48(%rip), %rdi      # 0x9fd8
movl %r12d, %esi
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x6d0f(%rip), %rdi      # 0x9fd8
leaq 0x3e96(%rip), %rsi      # 0x7166
movl $0x10, %edx
callq 0x21b0
movl -0x40(%rbp), %esi
movq 0x6cf4(%rip), %rdi      # 0x9fd8
movl %esi, -0x30(%rbp)
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x6cbb(%rip), %rdi      # 0x9fd8
leaq 0x3e53(%rip), %rsi      # 0x7177
movl $0x19, %edx
callq 0x21b0
movl -0x3c(%rbp), %esi
movq 0x6ca0(%rip), %rdi      # 0x9fd8
movl %esi, -0x2c(%rbp)
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movslq %r12d, %rax
movq %rax, -0x128(%rbp)
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
xorl %r15d, %r15d
leaq -0xa0(%rbp), %r13
leaq -0x1530(%rbp), %rbx
movl %r12d, %edi
movq %r14, %rsi
callq 0x265f
movl -0x2c(%rbp), %eax
movl %eax, -0x1530(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x152c(%rbp)
movq $0x0, -0x1528(%rbp)
movq -0x60(%rbp), %rcx
addq %r15, %rcx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2c3e
movq -0x60(%rbp), %rsi
leaq (%rsi,%r15), %rdi
addq $0x20, %rdi
addq %r15, %rsi
callq 0x3e2a
movq -0x60(%rbp), %rax
movl 0x18(%rax,%r15), %ecx
movl %ecx, 0x38(%rax,%r15)
addq $0x58, %r15
cmpq $0xa50, %r15            # imm = 0xA50
jne 0x3398
xorps %xmm0, %xmm0
movaps %xmm0, -0x110(%rbp)
xorl %eax, %eax
movq %rax, -0x100(%rbp)
movaps %xmm0, -0xf0(%rbp)
movq %rax, -0xe0(%rbp)
movaps %xmm0, -0xd0(%rbp)
movq %rax, -0xc0(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0xf8(%rbp)
movq -0x60(%rbp), %r14
movq -0x58(%rbp), %rbx
cmpq %rbx, %r14
je 0x3499
movq %rbx, %rax
subq %r14, %rax
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x1037(%rip), %rcx     # 0x243b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x534c
leaq -0x1049(%rip), %rdx     # 0x243b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x549c
movq -0x60(%rbp), %r14
movl -0xf8(%rbp), %eax
movl 0x18(%r14), %ecx
cmpl %eax, %ecx
jge 0x34b3
leaq -0x110(%rbp), %rdi
movl %ecx, 0x18(%rdi)
movq %r14, %rsi
callq 0x3e2a
leaq -0x1530(%rbp), %rdi
callq 0x3b9e
leaq -0x1530(%rbp), %rdi
callq 0x21d0
movl %r12d, %ecx
shrl $0x1f, %ecx
addl %r12d, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0x34(%rbp)
negl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0x64(%rbp)
movl %eax, %eax
movq %rax, -0x28b8(%rbp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, -0x28b8(%rbp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x34fe
leaq -0x28b8(%rbp), %r13
movq $0x270, 0x1380(%r13) # imm = 0x270
movss 0x3b03(%rip), %xmm0     # 0x7040
xorl %eax, %eax
leaq -0x80(%rbp), %r12
leaq -0xb8(%rbp), %rbx
movss %xmm0, -0x38(%rbp)
incl %eax
movq %rax, -0x120(%rbp)
xorl %r14d, %r14d
movq %r12, %rdi
movq -0x128(%rbp), %rsi
movq %rbx, %rdx
callq 0x41dc
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
cmpq %rcx, %rax
je 0x3595
movl $0x1, %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss %xmm0, (%rax)
incl %edx
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x357f
movq -0x60(%rbp), %rax
movq %r14, -0x130(%rbp)
imulq $0x58, %r14, %r14
movq 0x8(%rax,%r14), %rcx
cmpq (%rax,%r14), %rcx
je 0x3699
xorl %r15d, %r15d
movq %r13, %rdi
callq 0x6255
movsd %xmm0, -0x138(%rbp)
movq %r13, %rdi
callq 0x6255
xorpd %xmm1, %xmm1
movsd -0x138(%rbp), %xmm2
addsd %xmm1, %xmm2
addsd %xmm1, %xmm0
cvtsd2ss %xmm2, %xmm2
movq -0x60(%rbp), %rcx
movq (%rcx,%r14), %rax
movq 0x20(%rcx,%r14), %rdx
movl (%rdx,%r15,4), %edx
movl (%rax,%r15,4), %esi
subl %esi, %edx
xorps %xmm3, %xmm3
cvtsi2ss %edx, %xmm3
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
movq -0x110(%rbp), %rdx
movl (%rdx,%r15,4), %edx
subl %esi, %edx
xorps %xmm4, %xmm4
cvtsi2ss %edx, %xmm4
xorps %xmm0, %xmm0
cvtsi2ss %esi, %xmm0
movss 0x3a16(%rip), %xmm5     # 0x7044
mulss %xmm5, %xmm2
mulss %xmm3, %xmm2
movss -0x38(%rbp), %xmm3
mulss %xmm0, %xmm3
addss %xmm2, %xmm3
mulss %xmm5, %xmm1
mulss %xmm4, %xmm1
addss %xmm3, %xmm1
movss -0x64(%rbp), %xmm2
ucomiss %xmm1, %xmm2
ja 0x3667
ucomiss -0x34(%rbp), %xmm1
movaps %xmm1, %xmm2
jbe 0x3667
movss -0x34(%rbp), %xmm2
addq %r14, %rcx
movq 0x40(%rcx), %rdx
movss %xmm2, (%rdx,%r15,4)
addss %xmm2, %xmm0
movq -0x80(%rbp), %rdx
movss %xmm0, (%rdx,%r15,4)
incq %r15
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
ja 0x35b6
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4272
movq %r12, %rbx
movq -0xb8(%rbp), %r15
movq -0xb0(%rbp), %r12
cmpq %r12, %r15
je 0x36e7
movq %r12, %rax
subq %r15, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x636f
movq %r15, %rdi
movq %r12, %rsi
callq 0x6459
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
subq %rax, %rcx
movq %rbx, %r12
leaq -0xb8(%rbp), %rbx
je 0x376a
sarq $0x2, %rcx
movq -0xb8(%rbp), %rdx
movq -0xb0(%rbp), %rsi
movq %rsi, %rdi
subq %rdx, %rdi
sarq $0x2, %rdi
cmpq $0x1, %rdi
adcq $0x0, %rdi
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %r8d, %r8d
cmpq %rdx, %rsi
je 0x3762
movss (%rdx,%r8,4), %xmm0
movq -0x60(%rbp), %r9
addq %r14, %r9
xorl %r10d, %r10d
movss (%rax,%r10,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x375a
jp 0x375a
movq (%r9), %r11
leal 0x1(%r10), %r15d
movl %r15d, (%r11,%r8,4)
incq %r10
cmpq %r10, %rdi
jne 0x3742
incq %r8
cmpq %rcx, %r8
jne 0x372d
movl -0x2c(%rbp), %eax
movl %eax, -0x168(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x164(%rbp)
movq $0x0, -0x160(%rbp)
movq -0x60(%rbp), %rcx
addq %r14, %rcx
leaq -0xa0(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x2c3e
movq -0x60(%rbp), %rsi
movl 0x38(%rsi,%r14), %eax
cmpl %eax, 0x18(%rsi,%r14)
jge 0x37cb
addq %r14, %rsi
leaq 0x20(%rsi), %rdi
callq 0x3e2a
movq -0x60(%rbp), %rsi
movl 0x18(%rsi,%r14), %eax
movl %eax, 0x38(%rsi,%r14)
cmpl -0xf8(%rbp), %eax
jge 0x37ec
movl %eax, -0xf8(%rbp)
addq %r14, %rsi
addq $0x20, %rsi
leaq -0x110(%rbp), %rdi
callq 0x3e2a
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x3807
movq -0xa8(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
movq -0x130(%rbp), %r14
je 0x3823
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
incq %r14
cmpq $0x1e, %r14
jne 0x355b
movq -0x120(%rbp), %rax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x3802(%rip), %xmm0     # 0x7048
addss 0x37f2(%rip), %xmm0     # 0x7040
movss %xmm0, -0x38(%rbp)
cmpl $0x2bc, %eax            # imm = 0x2BC
jne 0x354f
leaq -0x80(%rbp), %rsi
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
movl -0x30(%rbp), %eax
movl %eax, 0x4(%rsi)
movq $0x0, 0x8(%rsi)
leaq -0xa0(%rbp), %rdi
leaq -0x110(%rbp), %rcx
callq 0x2c3e
movq 0x6749(%rip), %rdi      # 0x9fd8
leaq 0x38fb(%rip), %rsi      # 0x7191
movl $0x1d, %edx
callq 0x21b0
movl -0xf8(%rbp), %esi
movq 0x672b(%rip), %rdi      # 0x9fd8
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
callq 0x2040
movq %rax, %rbx
movq 0x66ed(%rip), %rdi      # 0x9fd8
leaq 0x38bd(%rip), %rsi      # 0x71af
movl $0xe, %edx
callq 0x21b0
movq -0x118(%rbp), %rax
subq %rax, %rbx
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
divsd 0x3742(%rip), %xmm0     # 0x7058
movq 0x66bb(%rip), %rbx      # 0x9fd8
movq %rbx, %rdi
callq 0x2200
leaq 0x3892(%rip), %rsi      # 0x71be
movl $0x9, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x6681(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0x1530(%rbp), %rdi
callq 0x2160
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x398b
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x39a6
movq -0xe0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
movq -0x110(%rbp), %rdi
testq %rdi, %rdi
je 0x39c1
movq -0x100(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
leaq -0x60(%rbp), %rdi
callq 0x42f2
leaq -0x198(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39e9
movq -0x198(%rbp), %rsi
incq %rsi
callq 0x2190
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a08
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x2190
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x3a23
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
xorl %eax, %eax
addq $0x2898, %rsp           # imm = 0x2898
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b96
jmp 0x3a8e
jmp 0x3a69
jmp 0x3a6e
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r14, %rdi
je 0x3b54
movq -0x178(%rbp), %rsi
jmp 0x3b4c
movq %rax, %rbx
jmp 0x3b73
movq %rax, %rbx
jmp 0x3adb
movq %rax, %rbx
jmp 0x3b54
jmp 0x3a8e
jmp 0x3a8e
movq %rax, %rbx
jmp 0x3b35
jmp 0x3a84
movq %rax, %rbx
jmp 0x3b2c
jmp 0x3ab7
movq %rax, %rbx
jmp 0x3acf
jmp 0x3a95
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x3aba
movq -0xa8(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
jmp 0x3aba
jmp 0x3ab7
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x3acf
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
leaq -0x1530(%rbp), %rdi
callq 0x2160
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x3af6
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x3b11
movq -0xe0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
movq -0x110(%rbp), %rdi
testq %rdi, %rdi
je 0x3b2c
movq -0x100(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
leaq -0x60(%rbp), %rdi
callq 0x42f2
leaq -0x198(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b54
movq -0x198(%rbp), %rsi
incq %rsi
callq 0x2190
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b73
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x2190
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x3b8e
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x4330