// File: /workspace/github_cpp_makefile_star2_O2/hanhwi[P]SimPoint/analysiscode/Simpoint.cpp
// Function: Simpoint::doClustering()
void Simpoint::doClustering() {
    loadData();
    applyWeights();
    sampleDataset();
    savePreClusteringData();

    // create vectors to save all the data that will be produced
    vector<int> labels(wholeDataset->numRows(), 0);
    Datapoint distsToCenters(wholeDataset->numRows());

    // binary search variables
    int search_k_max = options.max_k, search_k_min = 1,
        min_bic_ndx = 0, max_bic_ndx = 0;
    if (options.useBinarySearch) {
        Logger::log() << "  Searching for best clustering for k <= " 
            << search_k_max << endl;
        options.kValues.clear();
        options.kValues.push_back(search_k_min);
        options.kValues.push_back(search_k_max);
        options.kValues.push_back((search_k_max + search_k_min) / 2);
    } else {
        Logger::log() << "  Clustering for user-defined k-values\n"; 

        if (options.learnKFromFile) {
            // find out the k value from the clusters the user provided
            Dataset *tempCtrs = loadInitialCenters(0, 0);
            options.kValues.push_back(tempCtrs->numRows());
            delete tempCtrs;
        }
    }

    vector<Dataset *> initSeedInitialCenters(options.numInitSeeds),
                      initSeedFinalCenters(options.numInitSeeds);
    vector<double> initSeedBicScores(options.numInitSeeds);

    for (unsigned int runNumber = 0; runNumber < options.kValues.size(); runNumber++) {
        Logger::log() << endl
            << "--------------------------------------------------------------\n"
            << "Run number " << (runNumber+1) << " of ";
        if (options.useBinarySearch) {
            int maxRuns = (int)(log((double)options.max_k) / log(2.0) + 3);
            Logger::log() << "at most " << maxRuns;
        } else {
            Logger::log() << options.kValues.size();
        }
        Logger::log() << ", k = " << options.kValues[runNumber] << endl
            << "--------------------------------------------------------------\n";

        int bestInitSeedRun = 0;
        for (int initSeedRun = 0; initSeedRun < options.numInitSeeds; initSeedRun++) {
            Logger::log() 
                << "  --------------------------------------------------------------\n"
                << "  Initialization seed trial #" << (initSeedRun+1) << " of "
                << options.numInitSeeds << "; initialization seed = " 
                << options.randSeedKMeansInit << endl
                << "  --------------------------------------------------------------\n";

            initSeedInitialCenters[initSeedRun] = loadInitialCenters(runNumber, initSeedRun);
            initSeedFinalCenters[initSeedRun] =
                new Dataset(*initSeedInitialCenters[initSeedRun]);

            int iteration_limit = options.numKMeansIterations;
            if (options.useNoIterationLimit) { iteration_limit = INT_MAX; }
            KMeans::runKMeans(*sampledDataset, initSeedFinalCenters[initSeedRun], 
                    iteration_limit);

            // calculate and save the BIC score
            initSeedBicScores[initSeedRun] = KMeans::bicScore(*wholeDataset,
                    *initSeedFinalCenters[initSeedRun]);
            Logger::log() << "  BIC score: " << initSeedBicScores[initSeedRun] << endl;

            if (initSeedBicScores[initSeedRun] > initSeedBicScores[bestInitSeedRun]) {
                bestInitSeedRun = initSeedRun;
            }

            // report the distortions and variances
            KMeans::findLabelsAndDists(*wholeDataset,
                    *initSeedFinalCenters[initSeedRun], 
                    &labels, &distsToCenters);
            Datapoint clusterDistortions(initSeedFinalCenters[initSeedRun]->numRows());
            double dist = KMeans::distortion(*wholeDataset, labels,
                    *initSeedFinalCenters[initSeedRun], &clusterDistortions);
            Logger::log() << "  Distortion: " << dist << endl
                          << "  Distortions/cluster: ";
            for (unsigned int i = 0; i < clusterDistortions.size(); i++) {
                Logger::log() << clusterDistortions[i] << " ";
            }
            Logger::log() << endl;

            double degreesOfFreedom = wholeDataset->numRows() -
                                initSeedFinalCenters[initSeedRun]->numRows();
            Logger::log() << "  Variance: " << (dist/degreesOfFreedom) << endl 
                << "  Variances/cluster: ";
            for (unsigned int i = 0; i < clusterDistortions.size(); i++) {
                double weight = initSeedFinalCenters[initSeedRun]->getWeight(i)
                                * wholeDataset->numRows();
                if (weight > 1.0) {
                    Logger::log() << (clusterDistortions[i] / (weight - 1.0)) << " ";
                } else {
                    Logger::log() << 0 << " ";
                }
            }
            Logger::log() << endl;
            options.randSeedKMeansInit++;
        }

        Logger::log() << "  The best initialization seed trial was #" 
            << (bestInitSeedRun+1) << endl;

        initialCenters.push_back(initSeedInitialCenters[bestInitSeedRun]);
        finalCenters.push_back(initSeedFinalCenters[bestInitSeedRun]);
        bicScores.push_back(initSeedBicScores[bestInitSeedRun]);

        // free up the memory and reset the pointers for the next go-round
        for (int initSeedRun = 0; initSeedRun < options.numInitSeeds; initSeedRun++) {
            if (initSeedRun != bestInitSeedRun) {
                delete initSeedInitialCenters[initSeedRun];
                delete initSeedFinalCenters[initSeedRun];
            }
            initSeedInitialCenters[initSeedRun] = NULL;
            initSeedFinalCenters[initSeedRun] = NULL;
        }

        if (options.useBinarySearch) {
            if (bicScores[runNumber] > bicScores[max_bic_ndx]) max_bic_ndx = runNumber;
            if (bicScores[runNumber] < bicScores[min_bic_ndx]) min_bic_ndx = runNumber;

            double bic_range = (bicScores[max_bic_ndx] - bicScores[min_bic_ndx]);
            double bic_threshold = bicScores[min_bic_ndx] +
                bic_range * options.bicThreshold;
            int last_k = options.kValues[runNumber];

            if (runNumber >= 2) { // determine where we should search next
                int next_k = -1;
                bool searchUpper = (max_bic_ndx > min_bic_ndx) ?
                    (bicScores.back() < bic_threshold) : false;

                if (searchUpper) { // search in upper window
                    next_k = (last_k + search_k_max) / 2;
                    search_k_min = last_k;
                } else { // search in the lower window
                    next_k = (last_k + search_k_min) / 2;
                    search_k_max = last_k;
                }

                // the ending condition for binary search
                if ((search_k_max - search_k_min) > 1) {
                    options.kValues.push_back(next_k);
                }
            }
        }
    }

    savePostClusteringData();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
callq 0x885e
movq %rbx, %rdi
callq 0x9dda
movq %rbx, %rdi
callq 0x99dc
movq %rbx, %rdi
callq 0xa08a
movq (%rbx), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
pushq $0x18
popq %rbp
cqto
idivq %rbp
movl %eax, %esi
leaq 0xc8(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0xe0(%rsp), %rdi
leaq 0x50(%rsp), %rcx
callq 0xc326
movq (%rbx), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
cqto
idivq %rbp
leaq 0xc8(%rsp), %rdi
movl %eax, %esi
callq 0x589e
movl 0xc0(%rbx), %eax
movl %eax, (%rsp)
movl $0x1, 0x4(%rsp)
leaq 0x15d18(%rip), %r13     # 0x21318
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
cmpb $0x1, 0x88(%rbx)
jne 0xb688
leaq 0xa83e(%rip), %rsi      # 0x15e5a
callq 0x4290
movl (%rsp), %esi
movq %rax, %rdi
callq 0x4510
movq %rax, %rdi
callq 0x4180
leaq 0x90(%rbx), %r14
movq 0x90(%rbx), %rax
cmpq %rax, 0x98(%rbx)
je 0xb652
movq %rax, 0x98(%rbx)
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xc4a0
movq %rsp, %rsi
movq %r14, %rdi
callq 0xc4a0
movl 0x4(%rsp), %eax
addl (%rsp), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
leaq 0x50(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0xdeca
jmp 0xb6de
leaq 0xa7f5(%rip), %rsi      # 0x15e84
callq 0x4290
cmpb $0x1, 0x89(%rbx)
jne 0xb6de
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x9598
movq %rax, %r14
leaq 0x90(%rbx), %rdi
movq 0x8(%rax), %rax
subq (%r14), %rax
cqto
idivq %rbp
leaq 0x50(%rsp), %rsi
movl %eax, (%rsi)
callq 0xdeca
movq %r14, %rdi
callq 0x819a
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x42c0
movslq 0xc4(%rbx), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0xc4be
movslq 0xc4(%rbx), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0xc4be
movslq 0xc4(%rbx), %rsi
leaq 0x88(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x5e38
leaq 0x90(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0xb0(%rsp)
leaq 0x28(%rbx), %rax
movq %rax, 0xa8(%rsp)
leaq 0x40(%rbx), %rax
movq %rax, 0xa0(%rsp)
xorl %r15d, %r15d
leaq 0xa76a(%rip), %r14      # 0x15eca
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq %rbx, 0x78(%rsp)
movl %r15d, %r12d
movq 0x98(%rbx), %rax
subq 0x90(%rbx), %rax
sarq $0x2, %rax
cmpq %r12, %rax
jbe 0xbe49
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
callq 0x4180
movq %rax, %rdi
movq %r14, %rsi
callq 0x4290
movq %rax, %rdi
leaq 0xa6f1(%rip), %rsi      # 0x15eac
callq 0x4290
leal 0x1(%r12), %r15d
movq %rax, %rdi
movq %r15, %rsi
callq 0x41e0
movq %rax, %rdi
leaq 0xcd05(%rip), %rsi      # 0x184df
callq 0x4290
cmpb $0x1, 0x88(%rbx)
jne 0xb837
cvtsi2sdl 0xc0(%rbx), %xmm0
callq 0x4230
movsd %xmm0, 0x8(%rsp)
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
leaq 0xa6aa(%rip), %rsi      # 0x15eb8
callq 0x4290
movsd 0x8(%rsp), %xmm0
divsd 0x9b77(%rip), %xmm0     # 0x15398
addsd 0x9b77(%rip), %xmm0     # 0x153a0
cvttsd2si %xmm0, %esi
movq %rax, %rdi
callq 0x4510
jmp 0xb85a
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
movq 0x98(%rbx), %rsi
subq 0x90(%rbx), %rsi
sarq $0x2, %rsi
callq 0x41e0
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
leaq 0xa654(%rip), %rsi      # 0x15ec1
callq 0x4290
movq 0x68(%rsp), %rcx
movq (%rcx), %rcx
movl (%rcx,%r12,4), %esi
movq %rax, %rdi
callq 0x4510
movq %rax, %rdi
callq 0x4180
movq %rax, %rdi
movq %r14, %rsi
callq 0x4290
movq %r12, 0x70(%rsp)
movq %r15, 0xb8(%rsp)
xorl %r14d, %r14d
movq $0x0, 0x8(%rsp)
movslq 0xc4(%rbx), %rax
movl (%r13), %ecx
shrl $0x1f, %ecx
movq 0x8(%r13,%rcx,8), %rdi
movslq 0x8(%rsp), %r15
cmpq %rax, %r14
jge 0xbc79
leaq 0xa5ee(%rip), %rsi      # 0x15ec8
callq 0x4290
movq %rax, %rdi
leaq 0xa621(%rip), %rsi      # 0x15f0a
callq 0x4290
leaq 0x1(%r14), %rsi
movq %rax, %rdi
movq %rsi, 0xc0(%rsp)
callq 0x4510
movq %rax, %rdi
leaq 0xcbd3(%rip), %rsi      # 0x184df
callq 0x4290
movl 0xc4(%rbx), %esi
movq %rax, %rdi
callq 0x4510
movq %rax, %rdi
leaq 0xa5ff(%rip), %rsi      # 0x15f28
callq 0x4290
movl 0xa8(%rbx), %esi
movq %rax, %rdi
callq 0x4510
movq %rax, %rdi
callq 0x4180
movq %rax, %rdi
leaq 0xa57a(%rip), %rsi      # 0x15ec8
callq 0x4290
movq %rbx, %rdi
movq 0x70(%rsp), %rsi
movl %r14d, %edx
callq 0x9598
movq 0x50(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
pushq $0x30
popq %rdi
callq 0x42b0
movq %rax, %r12
movq 0x50(%rsp), %rax
movq (%rax,%r14,8), %rsi
movq %r12, %rdi
callq 0x626a
movq 0x20(%rsp), %rax
movq %r12, (%rax,%r14,8)
cmpb $0x0, 0x78(%rbx)
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
jne 0xb99f
movl 0x7c(%rbx), %edx
movq 0x8(%rbx), %rdi
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rsi
callq 0x792c
movq (%rbx), %rdi
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rsi
callq 0x7f7a
movq 0x88(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
leaq 0xa55e(%rip), %rsi      # 0x15f41
callq 0x4290
movq 0x88(%rsp), %rcx
movsd (%rcx,%r14,8), %xmm0
movq %rax, %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x4180
movq 0x88(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd (%rax,%r15,8), %xmm0
movq 0x8(%rsp), %rax
cmoval %r14d, %eax
movq %rax, 0x8(%rsp)
movq (%rbx), %rdi
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rsi
leaq 0xe0(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
callq 0x7c7e
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
cqto
idivq %rbp
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movl %eax, %esi
callq 0x589e
movq (%rbx), %rdi
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rdx
leaq 0xe0(%rsp), %rsi
movq %r15, %rcx
callq 0x7dd2
movsd %xmm0, 0x80(%rsp)
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
leaq 0xa4aa(%rip), %rsi      # 0x15f4f
callq 0x4290
movq %rax, %rdi
movsd 0x80(%rsp), %xmm0
callq 0x44d0
movq %rax, %rdi
callq 0x4180
movq %rax, %rdi
leaq 0xa491(%rip), %rsi      # 0x15f5e
callq 0x4290
xorl %r15d, %r15d
leaq 0xc6d8(%rip), %r12      # 0x181b4
movl %r15d, %r15d
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movl (%r13), %edx
shrl $0x1f, %edx
movq 0x8(%r13,%rdx,8), %rdi
cmpq %r15, %rcx
jbe 0xbb1c
movsd (%rax,%r15,8), %xmm0
callq 0x44d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x4290
incl %r15d
jmp 0xbadc
callq 0x4180
movq (%rbx), %rax
movq (%rax), %rbp
movq 0x8(%rax), %r15
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rax
movq (%rax), %rbx
movq 0x8(%rax), %r12
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
leaq 0xa428(%rip), %rsi      # 0x15f76
callq 0x4290
movq %rax, %rdi
subq %rbx, %r12
movq %r12, %rax
cqto
pushq $-0x18
popq %rcx
idivq %rcx
movq %rax, %rcx
subq %rbp, %r15
movq %r15, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
addl %ecx, %eax
cvtsi2sd %rax, %xmm1
movsd 0x80(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x44d0
movq %rax, %rdi
callq 0x4180
movq %rax, %rdi
leaq 0xa3e3(%rip), %rsi      # 0x15f83
callq 0x4290
xorl %r15d, %r15d
movq 0x78(%rsp), %rbx
pushq $0x18
popq %r12
leaq 0xc5fc(%rip), %rbp      # 0x181b4
movl %r15d, %r15d
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0xbc43
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rdx
movq (%rbx), %rsi
movq 0x8(%rsi), %rax
subq (%rsi), %rax
movq 0x18(%rdx), %rsi
cqto
idivq %r12
movl %eax, %eax
cvtsi2sd %rax, %xmm1
mulsd (%rsi,%r15,8), %xmm1
movl (%r13), %eax
shrl $0x1f, %eax
ucomisd 0x9647(%rip), %xmm1     # 0x15250
movq 0x8(%r13,%rax,8), %rdi
jbe 0xbc29
movsd (%rcx,%r15,8), %xmm0
addsd 0x978a(%rip), %xmm1     # 0x153a8
divsd %xmm1, %xmm0
callq 0x44d0
jmp 0xbc30
xorl %esi, %esi
callq 0x4510
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4290
incl %r15d
jmp 0xbbb8
movl (%r13), %eax
shrl $0x1f, %eax
movq 0x8(%r13,%rax,8), %rdi
callq 0x4180
movq 0x78(%rsp), %rbx
incl 0xa8(%rbx)
leaq 0x38(%rsp), %rdi
callq 0x5f0a
movq 0xc0(%rsp), %r14
pushq $0x18
popq %rbp
jmp 0xb8b2
leaq 0xa319(%rip), %rsi      # 0x15f99
callq 0x4290
movq 0x8(%rsp), %rcx
leal 0x1(%rcx), %esi
movq %rax, %rdi
callq 0x4510
movq %rax, %rdi
callq 0x4180
shlq $0x3, %r15
movq 0x50(%rsp), %rsi
addq %r15, %rsi
movq 0xb0(%rsp), %rdi
callq 0xc510
movq 0x20(%rsp), %rsi
addq %r15, %rsi
movq 0xa8(%rsp), %rdi
callq 0xc510
addq 0x88(%rsp), %r15
movq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0xc52e
movl 0x8(%rsp), %r15d
xorl %r12d, %r12d
movslq 0xc4(%rbx), %rax
cmpq %rax, %r12
jge 0xbd57
cmpq %r12, %r15
je 0xbd3e
movq 0x50(%rsp), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0xbd12
movq %r14, %rdi
callq 0x819a
movq %r14, %rdi
pushq $0x30
popq %rsi
callq 0x42c0
movq 0x20(%rsp), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0xbd33
movq %r14, %rdi
callq 0x819a
movq %r14, %rdi
pushq $0x30
popq %rsi
callq 0x42c0
movq 0x50(%rsp), %rax
andq $0x0, (%rax,%r12,8)
movq 0x20(%rsp), %rax
andq $0x0, (%rax,%r12,8)
incq %r12
jmp 0xbceb
cmpb $0x0, 0x88(%rbx)
leaq 0xa165(%rip), %r14      # 0x15eca
movq 0xb8(%rsp), %r15
je 0xb777
movq 0x40(%rbx), %rax
movq 0x70(%rsp), %rdx
movsd (%rax,%rdx,8), %xmm0
movq 0x18(%rsp), %rcx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
cmoval %edx, %ecx
movq %rcx, 0x18(%rsp)
movq 0x10(%rsp), %rcx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
ucomisd %xmm0, %xmm1
cmoval %edx, %ecx
movq %rcx, 0x10(%rsp)
cmpl $0x2, %edx
jb 0xb777
movq 0x90(%rbx), %rcx
movl (%rcx,%rdx,4), %ecx
movq 0x10(%rsp), %rdx
cmpl %edx, 0x18(%rsp)
jle 0xbe16
movslq 0x18(%rsp), %rdx
movsd (%rax,%rdx,8), %xmm0
movslq 0x10(%rsp), %rdx
movsd (%rax,%rdx,8), %xmm1
subsd %xmm1, %xmm0
mulsd 0xd8(%rbx), %xmm0
addsd %xmm1, %xmm0
movq 0x48(%rbx), %rax
ucomisd -0x8(%rax), %xmm0
jbe 0xbe16
movl (%rsp), %edi
leal (%rdi,%rcx), %eax
cltd
pushq $0x2
popq %rsi
idivl %esi
movl %eax, 0x38(%rsp)
movl %ecx, 0x4(%rsp)
movl %ecx, %esi
movl %edi, %ecx
jmp 0xbe2a
movl 0x4(%rsp), %esi
leal (%rsi,%rcx), %eax
cltd
pushq $0x2
popq %rdi
idivl %edi
movl %eax, 0x38(%rsp)
movl %ecx, (%rsp)
subl %esi, %ecx
cmpl $0x2, %ecx
jl 0xb777
movq 0x68(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0xc4a0
jmp 0xb777
movq %rbx, %rdi
callq 0xa98a
leaq 0x88(%rsp), %rdi
callq 0x5f0a
leaq 0x20(%rsp), %rdi
callq 0xcc3e
leaq 0x50(%rsp), %rdi
callq 0xcc3e
leaq 0xc8(%rsp), %rdi
callq 0x5f0a
leaq 0xe0(%rsp), %rdi
callq 0x8498
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbedc
jmp 0xbeb9
jmp 0xbeb9
jmp 0xbeb9
jmp 0xbedc
movq %rax, %rbx
jmp 0xbefd
movq %rax, %rbx
jmp 0xbf07
jmp 0xbeb9
movq %rax, %rbx
jmp 0xbf1e
movq %rax, %rbx
jmp 0xbf11
jmp 0xbedc
jmp 0xbedc
jmp 0xbedc
jmp 0xbedc
movq %rax, %rbx
pushq $0x30
popq %rsi
movq %r12, %rdi
callq 0x42c0
jmp 0xbef0
jmp 0xbee3
jmp 0xbee3
jmp 0xbedc
movq %rax, %rbx
jmp 0xbef0
jmp 0xbee3
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5f0a
leaq 0x88(%rsp), %rdi
callq 0x5f0a
leaq 0x20(%rsp), %rdi
callq 0xcc3e
leaq 0x50(%rsp), %rdi
callq 0xcc3e
leaq 0xc8(%rsp), %rdi
callq 0x5f0a
leaq 0xe0(%rsp), %rdi
callq 0x8498
movq %rbx, %rdi
callq 0x4530
nop