// File: Luthaf[P]zeopp/networkstorage.cc
// Function: fracSubstituteAtoms_Maciek(ATOM_NETWORK&, ATOM_NETWORK&, bool, double, int, int&, double&, bool)
bool fracSubstituteAtoms_Maciek(ATOM_NETWORK &origNet, ATOM_NETWORK &newNet,
                                bool substituteSeed, double frac, int randSeed,
                                int &numSubstitutions, double &fracSub, bool radial){
    int numAtoms = origNet.numAtoms;
    double max_bond_length = 1.95;
    
    if(frac > 0.50){
        cerr << "Fractional atomic network substitution failed because the fraction "
        "can not exceed 0.5" << "\n";
        return false;
    }
    if(frac < 0.0){
        cerr << "Fractional atomic network substitution failed because of invalid "
        "negative fraction " << frac << "\n";
        return false;
    }
    
    vector< vector<int> > bonds = vector< vector<int> >(numAtoms, vector<int>());
    for(int i = 0; i < numAtoms; i++){
        ATOM atom_one = origNet.atoms[i];
        for(int j = i + 1; j < numAtoms; j++){
            ATOM atom_two = origNet.atoms[j];
            if(origNet.calcDistance(atom_one, atom_two) < max_bond_length){
                if(atom_one.type.compare(atom_two.type) == 0){
                    cerr << "Fractional atomic network substitution aborted because atoms of "
                    "same type are bonded to one another" << "\n" << "Occurred for type "
                    << atom_one.type << " between atoms " << i << " and " << j << "\n";
                    return false;
                }
                bonds[i].push_back(j);
                bonds[j].push_back(i);
            }
        }
    }
    
    int numSi = 0;
    
    for(int i = 0; i < numAtoms; i++){
        if(origNet.atoms[i].type.compare("Si") == 0){
            if(bonds[i].size() != 4){
                cerr << "Fractional atomic network substitution aborted because Si atom "
                "bonded to " << bonds[i].size() << " other atoms instead of 4" << "\n"
                << "Occurred for atom " << i << "\n";
                return false;
            }
            numSi++;
        }
        else if(origNet.atoms[i].type.compare("O") == 0){
            if(bonds[i].size() != 2){
                cerr << "Fractional atomic network substitution aborted because O atom "
                "bonded to " << bonds[i].size() << " other atoms instead of 2" << "\n"
                << "Occurred for atom " << i << "\n";
                return false;
            }
        }
        else{
            cerr << "Fractional atomic network substitution aborted because atom type "
            "other than Si or O detected" << "\n"
            << "Occurred for atom " << i << "\n";
            return false;
        }
    } // analysis of the input structure completed
    
    // save IDs of Si atoms in SiatomsIDs vector
    vector <int> SiatomsIDs;
    for(int i = 0; i < numAtoms; i++){
        if(origNet.atoms[i].type.compare("Si") == 0){
            SiatomsIDs.push_back(i);
        }
    }
    
    
    int totalSubs = nearestInt(frac*numSi); // How many substituions to actually perform
    fracSub = (1.0*totalSubs)/numSi;        // Store the actual substitution fraction
    
    srand(randSeed); // Seed random number generator
    
    // Record all Si atoms (each of them can be substituted)
    vector<pair<int, int> > subIDs;
    for(int i = 0; i < numSi; i++){
        subIDs.push_back(pair<int,int> (rand(), i));
    }
    
    sort(subIDs.begin(), subIDs.end(), comparePairs); // Sort the pairs by their random values
    
    vector<bool> atomSubs = vector<bool>(numAtoms, false); // Whether atom has been substituted
    
    // Change atoms that should be substituted
    for(numSubstitutions = 0; numSubstitutions < totalSubs; numSubstitutions++){
        atomSubs[SiatomsIDs[subIDs[numSubstitutions].second]]=true;
    } // now atomsSubs points all Si atoms substituted in the intial step
    
    
    // Verify if the random distribution of Al atoms satisfy the condition not to have two neighboring Al atoms (Lowenstein's rule)
    // Fix if neccessary
    int counter=0;
    int problematicAl=-1;
    
    int max_try=10000; // number of swaps when trying to find a configuration satisfying Lowenstein's rule
    
    do{
        problematicAl=-1;
        // Step 1: identify atom with problems
        for(int i = 0; i < numAtoms; i++){
            if(origNet.atoms[i].type.compare("Si") == 0 &&atomSubs[i]==true)
            {
                // find list of 4 neighboring Si/Al atoms
                vector <int> nlist;
                for(int j=0;j<4;j++)
                {
                    if(bonds[bonds[i][j]][0]==i) {nlist.push_back(bonds[bonds[i][j]][1]);} else {nlist.push_back(bonds[bonds[i][j]][0]);};
                }
                
                if(atomSubs[nlist[0]]||atomSubs[nlist[1]]||atomSubs[nlist[2]]||atomSubs[nlist[3]]) // if any of neighbors is Al, move Al from position i
                {
                    problematicAl=i; // Al atom i needs to be this shifted;
                    break;
                }
            }
        }
        
        // Step 2: identify a suitable place for Al atom
        int suitableSi=-1;
        if(problematicAl>-1)
        {
            
            for(int i = 0; i < numAtoms; i++){
                if(origNet.atoms[i].type.compare("Si") == 0 && atomSubs[i]==false)
                {
                    // find list of 4 neighboring Si/Al atoms
                    vector <int> nlist;
                    for(int j=0;j<4;j++)
                    {
                        if(bonds[bonds[i][j]][0]==i) {
                            nlist.push_back(bonds[bonds[i][j]][1]);
                        } else {
                            nlist.push_back(bonds[bonds[i][j]][0]);
                        };
                    }
                    
                    if(!atomSubs[nlist[0]] && !atomSubs[nlist[1]] && 
                       !atomSubs[nlist[2]]&&!atomSubs[nlist[3]]) // if all of neighbors are Si, position i can be used
                    {
                        suitableSi=i; // Si atom i can be replaced with Al;
                        break;
                    }
                }
            }
        } // end of Step 2
        
        // Step 3: Swap 1 & 2
        if(problematicAl>-1&&suitableSi>-1)
        {
            atomSubs[problematicAl]=false;
            atomSubs[suitableSi]=true;
        }else{
            
            if(problematicAl>-1) 
            {
                cerr << "Cannot fix a random Al distribution by swapping Al atoms" << "\n";
                return false;
            }
        }
        // Step 4: increase counter
        counter++;
    }while(problematicAl>-1&&counter<max_try*numSi);
    
    
    if(counter==(max_try*numSi))
    {
        cerr << "Could not fix the initial Al distribution in " << max_try*numSi << "steps\n";
        return false;
    }
    
    
    
    // Now update the original structure according to the generate distribution of Al atoms
    
    // Copy original information
    origNet.copy(&newNet);
    
    
    // Change atoms that should be substituted
    for(int i = 0; i < numAtoms; i++){
        if(atomSubs[i]){
            newNet.atoms[i].type   = "Al";
            newNet.atoms[i].radius = lookupRadius("Al", radial);
        }
    }
    
    
    
    // Change Oxygen type if O atom connected to Al
    for(int i=0; i < numAtoms; i++){
        if(origNet.atoms[i].type.compare("O") == 0)
        {
            if(newNet.atoms[(bonds[i].at(0))].type.compare("Al") == 0 || newNet.atoms[(bonds[i].at(1))].type.compare("Al") == 0)
            {
                newNet.atoms[i].type   = "O_Al";
            };
        };  
    };
    
    
    // Successful substitution
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x650, %rsp            # imm = 0x650
movb 0x10(%rbp), %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %dl
movb %dl, -0x19(%rbp)
movsd %xmm0, -0x28(%rbp)
movl %ecx, -0x2c(%rbp)
movq %r8, -0x38(%rbp)
movq %r9, -0x40(%rbp)
andb $0x1, %al
movb %al, -0x41(%rbp)
movq -0x10(%rbp), %rax
movl 0x110(%rax), %eax
movl %eax, -0x48(%rbp)
movsd 0x159bba(%rip), %xmm0   # 0x1f7880
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd 0x1543a0(%rip), %xmm1   # 0x1f2078
ucomisd %xmm1, %xmm0
jbe 0x9dd09
movq 0x1d530b(%rip), %rdi    # 0x272ff0
leaq 0x15a1fa(%rip), %rsi    # 0x1f7ee6
callq 0x5540
movq %rax, %rdi
leaq 0x15b92a(%rip), %rsi    # 0x1f9625
callq 0x5540
movb $0x0, -0x1(%rbp)
jmp 0x9f49a
xorps %xmm0, %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x9dd4b
movq 0x1d52d6(%rip), %rdi    # 0x272ff0
leaq 0x15a21b(%rip), %rsi    # 0x1f7f3c
callq 0x5540
movq %rax, %rdi
movsd -0x28(%rbp), %xmm0
callq 0x5980
movq %rax, %rdi
leaq 0x15b8e8(%rip), %rsi    # 0x1f9625
callq 0x5540
movb $0x0, -0x1(%rbp)
jmp 0x9f49a
movslq -0x48(%rbp), %rax
movq %rax, -0x3e8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movq $0x0, -0x70(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
callq 0xd0d0
leaq -0x81(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x12b40
movq -0x3e8(%rbp), %rsi
movq -0x3e0(%rbp), %rdx
movq -0x3d8(%rbp), %rcx
leaq -0x68(%rbp), %rdi
callq 0xaedd0
jmp 0x9dda8
leaq -0x81(%rbp), %rdi
callq 0x13770
leaq -0x80(%rbp), %rdi
callq 0xec80
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9e0f2
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x98(%rbp), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0x130(%rbp), %rdi
callq 0xf0d0
jmp 0x9ddfe
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9e0a5
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x134(%rbp), %rsi
callq 0xfcc0
movq %rax, %rsi
leaq -0x1d0(%rbp), %rdi
callq 0xf0d0
jmp 0x9de44
movq -0x10(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x1d0(%rbp), %rdx
callq 0x979b0
movsd %xmm0, -0x3f0(%rbp)
jmp 0x9de65
movsd -0x3f0(%rbp), %xmm1
movsd -0x50(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9e06d
leaq -0xf0(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x5050
movl %eax, -0x3f4(%rbp)
jmp 0x9de97
movl -0x3f4(%rbp), %eax
cmpl $0x0, %eax
jne 0x9e029
movq 0x1d5143(%rip), %rdi    # 0x272ff0
leaq 0x15a0dc(%rip), %rsi    # 0x1f7f90
callq 0x5540
movq %rax, -0x400(%rbp)
jmp 0x9dec2
movq -0x400(%rbp), %rdi
leaq 0x15b755(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x408(%rbp)
jmp 0x9dede
movq -0x408(%rbp), %rdi
leaq 0x159d08(%rip), %rsi    # 0x1f7bf4
callq 0x5540
movq %rax, -0x410(%rbp)
jmp 0x9defa
movq -0x410(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x5480
movq %rax, -0x418(%rbp)
jmp 0x9df16
movq -0x418(%rbp), %rdi
leaq 0x159ce3(%rip), %rsi    # 0x1f7c07
callq 0x5540
movq %rax, -0x420(%rbp)
jmp 0x9df32
movq -0x420(%rbp), %rdi
movl -0x98(%rbp), %esi
callq 0x58d0
movq %rax, -0x428(%rbp)
jmp 0x9df4d
movq -0x428(%rbp), %rdi
leaq 0x15d4d1(%rip), %rsi    # 0x1fb42c
callq 0x5540
movq %rax, -0x430(%rbp)
jmp 0x9df69
movq -0x430(%rbp), %rdi
movl -0x134(%rbp), %esi
callq 0x58d0
movq %rax, -0x438(%rbp)
jmp 0x9df84
movq -0x438(%rbp), %rdi
leaq 0x15b693(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x9df99
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1d4(%rbp)
jmp 0x9e077
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x81(%rbp), %rdi
callq 0x13770
leaq -0x80(%rbp), %rdi
callq 0xec80
jmp 0x9f4a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x9f48f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x9e0e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0xf200
jmp 0x9e0e1
movslq -0x98(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
leaq -0x134(%rbp), %rsi
callq 0xd1b0
jmp 0x9e04a
movslq -0x134(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0xd1b0
jmp 0x9e06b
jmp 0x9e06d
movl $0x0, -0x1d4(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0xf200
movl -0x1d4(%rbp), %eax
testl %eax, %eax
jne 0x9e0af
jmp 0x9e08f
jmp 0x9e091
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x9de0d
movl $0x0, -0x1d4(%rbp)
leaq -0x130(%rbp), %rdi
callq 0xf200
movl -0x1d4(%rbp), %eax
testl %eax, %eax
jne 0x9f484
jmp 0x9e0cb
jmp 0x9e0cd
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x9ddc7
leaq -0x130(%rbp), %rdi
callq 0xf200
jmp 0x9f48f
movl $0x0, -0x1d8(%rbp)
movl $0x0, -0x1dc(%rbp)
movl -0x1dc(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9e44d
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x1dc(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x15465c(%rip), %rsi    # 0x1f2796
callq 0x51b0
cmpl $0x0, %eax
jne 0x9e261
movslq -0x1dc(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
callq 0x10090
cmpq $0x4, %rax
je 0x9e24d
movq 0x1d4e7f(%rip), %rdi    # 0x272ff0
leaq 0x159e7c(%rip), %rsi    # 0x1f7ff4
callq 0x5540
movq %rax, -0x440(%rbp)
jmp 0x9e186
movslq -0x1dc(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
callq 0x10090
movq -0x440(%rbp), %rdi
movq %rax, %rsi
callq 0x5160
movq %rax, -0x448(%rbp)
jmp 0x9e1b6
movq -0x448(%rbp), %rdi
leaq 0x159a92(%rip), %rsi    # 0x1f7c56
callq 0x5540
movq %rax, -0x450(%rbp)
jmp 0x9e1d2
movq -0x450(%rbp), %rdi
leaq 0x15b445(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x458(%rbp)
jmp 0x9e1ee
movq -0x458(%rbp), %rdi
leaq 0x159a74(%rip), %rsi    # 0x1f7c70
callq 0x5540
movq %rax, -0x460(%rbp)
jmp 0x9e20a
movq -0x460(%rbp), %rdi
movl -0x1dc(%rbp), %esi
callq 0x58d0
movq %rax, -0x468(%rbp)
jmp 0x9e225
movq -0x468(%rbp), %rdi
leaq 0x15b3f2(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x9e23a
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1d4(%rbp)
jmp 0x9f484
movl -0x1d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d8(%rbp)
jmp 0x9e437
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x1dc(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x154505(%rip), %rsi    # 0x1f278b
callq 0x51b0
cmpl $0x0, %eax
jne 0x9e39e
movslq -0x1dc(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
callq 0x10090
cmpq $0x2, %rax
je 0x9e399
movq 0x1d4d33(%rip), %rdi    # 0x272ff0
leaq 0x159d7a(%rip), %rsi    # 0x1f803e
callq 0x5540
movq %rax, -0x470(%rbp)
jmp 0x9e2d2
movslq -0x1dc(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
callq 0x10090
movq -0x470(%rbp), %rdi
movq %rax, %rsi
callq 0x5160
movq %rax, -0x478(%rbp)
jmp 0x9e302
movq -0x478(%rbp), %rdi
leaq 0x1599b1(%rip), %rsi    # 0x1f7cc1
callq 0x5540
movq %rax, -0x480(%rbp)
jmp 0x9e31e
movq -0x480(%rbp), %rdi
leaq 0x15b2f9(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x488(%rbp)
jmp 0x9e33a
movq -0x488(%rbp), %rdi
leaq 0x159928(%rip), %rsi    # 0x1f7c70
callq 0x5540
movq %rax, -0x490(%rbp)
jmp 0x9e356
movq -0x490(%rbp), %rdi
movl -0x1dc(%rbp), %esi
callq 0x58d0
movq %rax, -0x498(%rbp)
jmp 0x9e371
movq -0x498(%rbp), %rdi
leaq 0x15b2a6(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x9e386
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1d4(%rbp)
jmp 0x9f484
jmp 0x9e435
movq 0x1d4c4b(%rip), %rdi    # 0x272ff0
leaq 0x159cdb(%rip), %rsi    # 0x1f8087
callq 0x5540
movq %rax, -0x4a0(%rbp)
jmp 0x9e3ba
movq -0x4a0(%rbp), %rdi
leaq 0x15b25d(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x4a8(%rbp)
jmp 0x9e3d6
movq -0x4a8(%rbp), %rdi
leaq 0x15988c(%rip), %rsi    # 0x1f7c70
callq 0x5540
movq %rax, -0x4b0(%rbp)
jmp 0x9e3f2
movq -0x4b0(%rbp), %rdi
movl -0x1dc(%rbp), %esi
callq 0x58d0
movq %rax, -0x4b8(%rbp)
jmp 0x9e40d
movq -0x4b8(%rbp), %rdi
leaq 0x15b20a(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x9e422
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1d4(%rbp)
jmp 0x9f484
jmp 0x9e437
jmp 0x9e439
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x9e106
leaq -0x1f8(%rbp), %rdi
callq 0xd0d0
movl $0x0, -0x1fc(%rbp)
movl -0x1fc(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9e4de
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x1fc(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x154303(%rip), %rsi    # 0x1f2796
callq 0x51b0
cmpl $0x0, %eax
jne 0x9e4cb
leaq -0x1f8(%rbp), %rdi
leaq -0x1fc(%rbp), %rsi
callq 0xd1b0
jmp 0x9e4b2
jmp 0x9e4cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x9f476
jmp 0x9e4cd
movl -0x1fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1fc(%rbp)
jmp 0x9e463
movsd -0x28(%rbp), %xmm0
cvtsi2sdl -0x1d8(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x9dc50
movl %eax, -0x4bc(%rbp)
jmp 0x9e4fc
movl -0x4bc(%rbp), %eax
movl %eax, -0x200(%rbp)
cvtsi2sdl -0x200(%rbp), %xmm1
movsd 0x153b38(%rip), %xmm0   # 0x1f2050
mulsd %xmm1, %xmm0
cvtsi2sdl -0x1d8(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x2c(%rbp), %edi
callq 0x5510
leaq -0x218(%rbp), %rdi
callq 0x10280
movl $0x0, -0x21c(%rbp)
movl -0x21c(%rbp), %eax
cmpl -0x1d8(%rbp), %eax
jge 0x9e5c2
callq 0x5190
movl %eax, -0x228(%rbp)
leaq -0x224(%rbp), %rdi
leaq -0x228(%rbp), %rsi
leaq -0x21c(%rbp), %rdx
callq 0xaf060
jmp 0x9e583
leaq -0x218(%rbp), %rdi
leaq -0x224(%rbp), %rsi
callq 0x10370
jmp 0x9e598
jmp 0x9e59a
movl -0x21c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x21c(%rbp)
jmp 0x9e54e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x9f46a
leaq -0x218(%rbp), %rdi
movq %rdi, -0x4c8(%rbp)
callq 0x2b960
movq -0x4c8(%rbp), %rdi
movq %rax, -0x230(%rbp)
callq 0x2b7b0
movq %rax, -0x238(%rbp)
movq -0x230(%rbp), %rdi
movq -0x238(%rbp), %rsi
leaq -0x2184(%rip), %rdx     # 0x9c480
callq 0xaf090
jmp 0x9e60b
movslq -0x48(%rbp), %rax
movq %rax, -0x4d8(%rbp)
movb $0x0, -0x261(%rbp)
leaq -0x262(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x64b50
movq -0x4d8(%rbp), %rsi
movq -0x4d0(%rbp), %rcx
leaq -0x260(%rbp), %rdi
leaq -0x261(%rbp), %rdx
callq 0x64b70
jmp 0x9e653
leaq -0x262(%rbp), %rdi
callq 0x64bf0
movq -0x38(%rbp), %rax
movl $0x0, (%rax)
movq -0x38(%rbp), %rax
movl (%rax), %eax
cmpl -0x200(%rbp), %eax
jge 0x9e734
movq -0x38(%rbp), %rax
movslq (%rax), %rsi
leaq -0x218(%rbp), %rdi
callq 0x10440
movslq 0x4(%rax), %rsi
leaq -0x1f8(%rbp), %rdi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x4e8(%rbp)
movq %rax, -0x4e0(%rbp)
jmp 0x9e6bd
movq -0x4e8(%rbp), %rax
movq -0x4e0(%rbp), %rcx
movq %rcx, -0x278(%rbp)
movq %rax, -0x270(%rbp)
leaq -0x278(%rbp), %rdi
movl $0x1, %esi
callq 0x10040
movq -0x38(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x9e669
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x262(%rbp), %rdi
callq 0x64bf0
jmp 0x9f46a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x9f45e
movl $0x0, -0x27c(%rbp)
movl $0xffffffff, -0x280(%rbp) # imm = 0xFFFFFFFF
movl $0x2710, -0x284(%rbp)   # imm = 0x2710
movl $0xffffffff, -0x280(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x288(%rbp)
movl -0x288(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9eb59
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x288(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x153ffc(%rip), %rsi    # 0x1f2796
callq 0x51b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x4e9(%rbp)
jne 0x9e80a
movslq -0x288(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x500(%rbp)
movq %rax, -0x4f8(%rbp)
jmp 0x9e7d1
movq -0x500(%rbp), %rax
movq -0x4f8(%rbp), %rcx
movq %rcx, -0x298(%rbp)
movq %rax, -0x290(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
sete %al
movb %al, -0x4e9(%rbp)
movb -0x4e9(%rbp), %al
testb $0x1, %al
jne 0x9e819
jmp 0x9eb43
leaq -0x2b0(%rbp), %rdi
callq 0xd0d0
movl $0x0, -0x2b4(%rbp)
cmpl $0x4, -0x2b4(%rbp)
jge 0x9e95f
movslq -0x288(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
movslq -0x2b4(%rbp), %rsi
callq 0xed60
movslq (%rax), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xed60
movl (%rax), %eax
cmpl -0x288(%rbp), %eax
jne 0x9e8f5
movslq -0x288(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x508(%rbp)
callq 0x10890
movq %rax, %rdi
movslq -0x2b4(%rbp), %rsi
callq 0xed60
movq -0x508(%rbp), %rdi
movslq (%rax), %rsi
callq 0x10890
movq %rax, %rdi
movl $0x1, %esi
callq 0xed60
movq %rax, %rsi
leaq -0x2b0(%rbp), %rdi
callq 0xd1b0
jmp 0x9e8d0
jmp 0x9e949
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0xec80
jmp 0x9f45e
movslq -0x288(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x510(%rbp)
callq 0x10890
movq %rax, %rdi
movslq -0x2b4(%rbp), %rsi
callq 0xed60
movq -0x510(%rbp), %rdi
movslq (%rax), %rsi
callq 0x10890
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xed60
movq %rax, %rsi
leaq -0x2b0(%rbp), %rdi
callq 0xd1b0
jmp 0x9e947
jmp 0x9e949
jmp 0x9e94b
movl -0x2b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b4(%rbp)
jmp 0x9e82f
xorl %eax, %eax
movl %eax, %esi
leaq -0x2b0(%rbp), %rdi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x520(%rbp)
movq %rax, -0x518(%rbp)
jmp 0x9e98e
movq -0x520(%rbp), %rax
movq -0x518(%rbp), %rcx
movq %rcx, -0x2c8(%rbp)
movq %rax, -0x2c0(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x101a0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x521(%rbp)
jne 0x9eaf9
leaq -0x2b0(%rbp), %rdi
movl $0x1, %esi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x538(%rbp)
movq %rax, -0x530(%rbp)
jmp 0x9e9f9
movq -0x538(%rbp), %rax
movq -0x530(%rbp), %rcx
movq %rcx, -0x2d8(%rbp)
movq %rax, -0x2d0(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x101a0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x521(%rbp)
jne 0x9eaf9
leaq -0x2b0(%rbp), %rdi
movl $0x2, %esi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x548(%rbp)
movq %rax, -0x540(%rbp)
jmp 0x9ea64
movq -0x548(%rbp), %rax
movq -0x540(%rbp), %rcx
movq %rcx, -0x2e8(%rbp)
movq %rax, -0x2e0(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x101a0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x521(%rbp)
jne 0x9eaf9
leaq -0x2b0(%rbp), %rdi
movl $0x3, %esi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x558(%rbp)
movq %rax, -0x550(%rbp)
jmp 0x9eacb
movq -0x558(%rbp), %rax
movq -0x550(%rbp), %rcx
movq %rcx, -0x2f8(%rbp)
movq %rax, -0x2f0(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x101a0
movb %al, -0x521(%rbp)
movb -0x521(%rbp), %al
testb $0x1, %al
jne 0x9eb05
jmp 0x9eb1d
movl -0x288(%rbp), %eax
movl %eax, -0x280(%rbp)
movl $0x16, -0x1d4(%rbp)
jmp 0x9eb27
movl $0x0, -0x1d4(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0xec80
movl -0x1d4(%rbp), %eax
testl %eax, %eax
je 0x9eb41
jmp 0x9eb3f
jmp 0x9eb59
jmp 0x9eb43
jmp 0x9eb45
movl -0x288(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x288(%rbp)
jmp 0x9e766
movl $0xffffffff, -0x2fc(%rbp) # imm = 0xFFFFFFFF
cmpl $-0x1, -0x280(%rbp)
jle 0x9ef71
movl $0x0, -0x300(%rbp)
movl -0x300(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9ef6f
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x300(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x153be8(%rip), %rsi    # 0x1f2796
callq 0x51b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x559(%rbp)
jne 0x9ec1e
movslq -0x300(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x570(%rbp)
movq %rax, -0x568(%rbp)
jmp 0x9ebe5
movq -0x570(%rbp), %rax
movq -0x568(%rbp), %rcx
movq %rcx, -0x310(%rbp)
movq %rax, -0x308(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x559(%rbp)
movb -0x559(%rbp), %al
testb $0x1, %al
jne 0x9ec2d
jmp 0x9ef59
leaq -0x328(%rbp), %rdi
callq 0xd0d0
movl $0x0, -0x32c(%rbp)
cmpl $0x4, -0x32c(%rbp)
jge 0x9ed73
movslq -0x300(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
movslq -0x32c(%rbp), %rsi
callq 0xed60
movslq (%rax), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xed60
movl (%rax), %eax
cmpl -0x300(%rbp), %eax
jne 0x9ed09
movslq -0x300(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x578(%rbp)
callq 0x10890
movq %rax, %rdi
movslq -0x32c(%rbp), %rsi
callq 0xed60
movq -0x578(%rbp), %rdi
movslq (%rax), %rsi
callq 0x10890
movq %rax, %rdi
movl $0x1, %esi
callq 0xed60
movq %rax, %rsi
leaq -0x328(%rbp), %rdi
callq 0xd1b0
jmp 0x9ece4
jmp 0x9ed5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x328(%rbp), %rdi
callq 0xec80
jmp 0x9f45e
movslq -0x300(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x10890
movq %rax, %rdi
movslq -0x32c(%rbp), %rsi
callq 0xed60
movq -0x580(%rbp), %rdi
movslq (%rax), %rsi
callq 0x10890
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xed60
movq %rax, %rsi
leaq -0x328(%rbp), %rdi
callq 0xd1b0
jmp 0x9ed5b
jmp 0x9ed5d
jmp 0x9ed5f
movl -0x32c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x32c(%rbp)
jmp 0x9ec43
xorl %eax, %eax
movl %eax, %esi
leaq -0x328(%rbp), %rdi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x590(%rbp)
movq %rax, -0x588(%rbp)
jmp 0x9eda2
movq -0x590(%rbp), %rax
movq -0x588(%rbp), %rcx
movq %rcx, -0x340(%rbp)
movq %rax, -0x338(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x101a0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x591(%rbp)
jne 0x9ef0f
leaq -0x328(%rbp), %rdi
movl $0x1, %esi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x5a8(%rbp)
movq %rax, -0x5a0(%rbp)
jmp 0x9ee0d
movq -0x5a8(%rbp), %rax
movq -0x5a0(%rbp), %rcx
movq %rcx, -0x350(%rbp)
movq %rax, -0x348(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x101a0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x591(%rbp)
jne 0x9ef0f
leaq -0x328(%rbp), %rdi
movl $0x2, %esi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x5b8(%rbp)
movq %rax, -0x5b0(%rbp)
jmp 0x9ee78
movq -0x5b8(%rbp), %rax
movq -0x5b0(%rbp), %rcx
movq %rcx, -0x360(%rbp)
movq %rax, -0x358(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x101a0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x591(%rbp)
jne 0x9ef0f
leaq -0x328(%rbp), %rdi
movl $0x3, %esi
callq 0xed60
movslq (%rax), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x5c8(%rbp)
movq %rax, -0x5c0(%rbp)
jmp 0x9eedf
movq -0x5c8(%rbp), %rax
movq -0x5c0(%rbp), %rcx
movq %rcx, -0x370(%rbp)
movq %rax, -0x368(%rbp)
leaq -0x370(%rbp), %rdi
callq 0x101a0
xorb $-0x1, %al
movb %al, -0x591(%rbp)
movb -0x591(%rbp), %al
testb $0x1, %al
jne 0x9ef1b
jmp 0x9ef33
movl -0x300(%rbp), %eax
movl %eax, -0x2fc(%rbp)
movl $0x1c, -0x1d4(%rbp)
jmp 0x9ef3d
movl $0x0, -0x1d4(%rbp)
leaq -0x328(%rbp), %rdi
callq 0xec80
movl -0x1d4(%rbp), %eax
testl %eax, %eax
je 0x9ef57
jmp 0x9ef55
jmp 0x9ef6f
jmp 0x9ef59
jmp 0x9ef5b
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
jmp 0x9eb7a
jmp 0x9ef71
cmpl $-0x1, -0x280(%rbp)
jle 0x9f02a
cmpl $-0x1, -0x2fc(%rbp)
jle 0x9f02a
movslq -0x280(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x5d8(%rbp)
movq %rax, -0x5d0(%rbp)
jmp 0x9efae
movq -0x5d8(%rbp), %rax
movq -0x5d0(%rbp), %rcx
movq %rcx, -0x380(%rbp)
movq %rax, -0x378(%rbp)
leaq -0x380(%rbp), %rdi
xorl %esi, %esi
callq 0x10040
movslq -0x2fc(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x5e8(%rbp)
movq %rax, -0x5e0(%rbp)
jmp 0x9effb
movq -0x5e8(%rbp), %rax
movq -0x5e0(%rbp), %rcx
movq %rcx, -0x390(%rbp)
movq %rax, -0x388(%rbp)
leaq -0x390(%rbp), %rdi
movl $0x1, %esi
callq 0x10040
jmp 0x9f079
cmpl $-0x1, -0x280(%rbp)
jle 0x9f077
movq 0x1d3fb6(%rip), %rdi    # 0x272ff0
leaq 0x159210(%rip), %rsi    # 0x1f8251
callq 0x5540
movq %rax, -0x5f0(%rbp)
jmp 0x9f04f
movq -0x5f0(%rbp), %rdi
leaq 0x15a5c8(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x9f064
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1d4(%rbp)
jmp 0x9f438
jmp 0x9f079
movl -0x27c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27c(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x280(%rbp)
movb %al, -0x5f1(%rbp)
jle 0x9f0b7
movl -0x27c(%rbp), %eax
movl -0x284(%rbp), %ecx
imull -0x1d8(%rbp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x5f1(%rbp)
movb -0x5f1(%rbp), %al
testb $0x1, %al
jne 0x9e752
movl -0x27c(%rbp), %eax
movl -0x284(%rbp), %ecx
imull -0x1d8(%rbp), %ecx
cmpl %ecx, %eax
jne 0x9f144
movq 0x1d3f0d(%rip), %rdi    # 0x272ff0
leaq 0x1591a0(%rip), %rsi    # 0x1f828a
callq 0x5540
movq %rax, -0x600(%rbp)
jmp 0x9f0f8
movq -0x600(%rbp), %rdi
movl -0x284(%rbp), %esi
movl -0x1d8(%rbp), %eax
imull %eax, %esi
callq 0x58d0
movq %rax, -0x608(%rbp)
jmp 0x9f11c
movq -0x608(%rbp), %rdi
leaq 0x15918e(%rip), %rsi    # 0x1f82b8
callq 0x5540
jmp 0x9f131
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1d4(%rbp)
jmp 0x9f438
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x96980
jmp 0x9f153
movl $0x0, -0x394(%rbp)
movl -0x394(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9f2cf
movslq -0x394(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x29990
movq %rdx, -0x618(%rbp)
movq %rax, -0x610(%rbp)
jmp 0x9f18f
movq -0x618(%rbp), %rax
movq -0x610(%rbp), %rcx
movq %rcx, -0x3a8(%rbp)
movq %rax, -0x3a0(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x101a0
testb $0x1, %al
jne 0x9f1c0
jmp 0x9f2b9
movq -0x18(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x394(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x159069(%rip), %rsi    # 0x1f824e
callq 0x5710
jmp 0x9f1ec
leaq -0x3c9(%rbp), %rdi
movq %rdi, -0x620(%rbp)
callq 0x5900
movq -0x620(%rbp), %rdx
leaq 0x159041(%rip), %rsi    # 0x1f824e
leaq -0x3c8(%rbp), %rdi
callq 0x47530
jmp 0x9f21b
movzbl -0x41(%rbp), %esi
andl $0x1, %esi
leaq -0x3c8(%rbp), %rdi
callq 0x466e0
movsd %xmm0, -0x628(%rbp)
jmp 0x9f238
movq -0x18(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x394(%rbp), %rsi
callq 0xfcc0
movsd -0x628(%rbp), %xmm0
movsd %xmm0, 0x30(%rax)
leaq -0x3c8(%rbp), %rdi
callq 0x5300
leaq -0x3c9(%rbp), %rdi
callq 0x55d0
jmp 0x9f2b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x9f2a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x3c8(%rbp), %rdi
callq 0x5300
leaq -0x3c9(%rbp), %rdi
callq 0x55d0
jmp 0x9f45e
jmp 0x9f2bb
movl -0x394(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x394(%rbp)
jmp 0x9f15d
movl $0x0, -0x3d0(%rbp)
movl -0x3d0(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9f42a
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x3d0(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x15347e(%rip), %rsi    # 0x1f278b
callq 0x51b0
cmpl $0x0, %eax
jne 0x9f414
movq -0x18(%rbp), %rax
addq $0x2f0, %rax            # imm = 0x2F0
movq %rax, -0x638(%rbp)
movslq -0x3d0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x101d0
movq %rax, -0x630(%rbp)
jmp 0x9f351
movq -0x638(%rbp), %rdi
movq -0x630(%rbp), %rax
movslq (%rax), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x158ed9(%rip), %rsi    # 0x1f824e
callq 0x51b0
cmpl $0x0, %eax
je 0x9f3e4
movq -0x18(%rbp), %rax
addq $0x2f0, %rax            # imm = 0x2F0
movq %rax, -0x648(%rbp)
movslq -0x3d0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10890
movq %rax, %rdi
movl $0x1, %esi
callq 0x101d0
movq %rax, -0x640(%rbp)
jmp 0x9f3b6
movq -0x648(%rbp), %rdi
movq -0x640(%rbp), %rax
movslq (%rax), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x158e74(%rip), %rsi    # 0x1f824e
callq 0x51b0
cmpl $0x0, %eax
jne 0x9f412
movq -0x18(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x3d0(%rbp), %rsi
callq 0xfcc0
movq %rax, %rdi
addq $0x40, %rdi
leaq 0x158e43(%rip), %rsi    # 0x1f824c
callq 0x5710
jmp 0x9f410
jmp 0x9f412
jmp 0x9f414
jmp 0x9f416
movl -0x3d0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3d0(%rbp)
jmp 0x9f2d9
movb $0x1, -0x1(%rbp)
movl $0x1, -0x1d4(%rbp)
leaq -0x260(%rbp), %rdi
callq 0xf9b0
leaq -0x218(%rbp), %rdi
callq 0x10460
leaq -0x1f8(%rbp), %rdi
callq 0xec80
jmp 0x9f484
leaq -0x260(%rbp), %rdi
callq 0xf9b0
leaq -0x218(%rbp), %rdi
callq 0x10460
leaq -0x1f8(%rbp), %rdi
callq 0xec80
jmp 0x9f48f
leaq -0x68(%rbp), %rdi
callq 0x108b0
jmp 0x9f49a
leaq -0x68(%rbp), %rdi
callq 0x108b0
jmp 0x9f4a8
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x650, %rsp            # imm = 0x650
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)