// File: tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::GtxtFileI::sample(sampFiles::GtxtFileO&, unsigned long const&, bool const&)
void GtxtFileI::sample(GtxtFileO &out, const uint64_t &n, const bool &headSkip){
    if (n == 0) {
        cerr << "WARNING: zero rows requested. Nothing to be done." << endl;
        return;
    }
    // start by figuring out the number of rows in the file
    if (out._varFile.is_open()) {
        out._varFile.close();
    }

    uint64_t N = _numLines(); // Number of rows

    try {
        _varFile.open(_fileName.c_str(), ios::in);
		if (!_varFile.is_open()) {
			cerr << "ERROR: failed to open file " << _fileName << " for input" << endl;
			exit(2);
		}

    } catch (system_error &error) {
        cerr << "ERROR: cannot open text file " << _fileName << " for input: " << error.code().message() << flush;
        perror(" ");
        exit(1);
    }

    try {
        out._varFile.open(out._fileName.c_str(), ios::out | ios::trunc);
		if (!out._varFile.is_open()) {
			cerr << "ERROR: failed to open file " << out._fileName << " for output" << endl;
			exit(2);
		}

    } catch (system_error &error) {
        cerr << "ERROR: cannot open text file " << out._fileName << " for output: " << error.code().message() << flush;
        perror(" ");
        exit(1);
    }

    // Test for potential problems
    if (N < n) {
        cerr << "ERROR: requested a sample of " << n << " rows that is greater than the number of rows (" << N << ") in the input file." << endl;
        return;
    } else if (N == n) {
        cerr << "WARNING: sample size (" << n << ") the same as the number of rows (" << N << ") in the input file. Simply copying the file." << endl;
        char *buf;
        const size_t bufSize = BUF_SIZE;
        try {
            buf = new char[bufSize];
        } catch (bad_alloc&) {
            cerr << "ERROR: failed to allocate buffer" << endl;
            exit(4);
        }
        if (_head) {
            if (headSkip) {
                _varFile.ignore(numeric_limits<streamsize>::max(), '\n');
            } else {
                string header;
                getline(_varFile, header);
                out._varFile << header << endl;
            }
        }

        // Copy the file
        while (_varFile) {
            _varFile.read(buf, bufSize);
            out._varFile.write(buf, _varFile.gcount());
        }
        _varFile.close();
        out._varFile.close();
        delete [] buf;
        return;
    }

    // Passed all the tests, proceed to sampling
    string curLine;
    if (_head) {
        if (headSkip) {
            _varFile.ignore(numeric_limits<streamsize>::max(), '\n');
        } else {
            getline(_varFile, curLine);
            out._varFile << curLine << endl;
            curLine.erase();
        }
    }

    uint64_t nloc = n; // local copy of n
    uint64_t S;
    RanDraw *snpSamp;  // so that I can catch RanDraw constructor exceptions
    try {
        snpSamp = new RanDraw();
    } catch (string error) {
        cerr << "ERROR: " << error << endl;
        exit(5);
    }
    while (nloc) {
        try {
            S = snpSamp->vitter(nloc, N); // sample the number of SNPs to skip
        } catch (string error) {
            cerr << "ERROR: " << error << endl;
            exit(5);
        }
        N -= S + 1;
        while (S) { // skipping S lines in the HMP file
            _varFile.ignore(numeric_limits<streamsize>::max(), '\n');
            S--;
        }
        getline(_varFile, curLine);
        out._varFile << curLine << endl;
        nloc--;

    }
    _varFile.close();
    out._varFile.close();
    delete snpSamp;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x17387
movq 0x14c89(%rip), %rdi     # 0x2bff0
leaq 0xc887(%rip), %rsi      # 0x23bf5
callq 0x4310
movq %rax, %rdi
movq 0x14c33(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x17f66
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
testb $0x1, %al
jne 0x1739a
jmp 0x173a7
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
movq -0x150(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x150(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x158(%rbp)
addq $0x218, %rdi            # imm = 0x218
callq 0x4140
movq -0x158(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x42f0
jmp 0x173f2
movq -0x150(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
movb %al, -0x159(%rbp)
jmp 0x1740a
movb -0x159(%rbp), %al
testb $0x1, %al
jne 0x1757e
jmp 0x1741a
movq 0x14bcf(%rip), %rdi     # 0x2bff0
leaq 0xc110(%rip), %rsi      # 0x23538
callq 0x4310
movq %rax, -0x168(%rbp)
jmp 0x17436
movq -0x168(%rbp), %rdi
movq -0x150(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x170(%rbp)
jmp 0x17459
movq -0x170(%rbp), %rdi
leaq 0xc0ed(%rip), %rsi      # 0x23554
callq 0x4310
movq %rax, -0x178(%rbp)
jmp 0x17475
movq -0x178(%rbp), %rdi
movq 0x14b2d(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x1748a
movl $0x2, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x17f7b
movq -0x30(%rbp), %rdi
callq 0x4130
movq %rax, -0x40(%rbp)
movq 0x14b2c(%rip), %rdi     # 0x2bff0
leaq 0xc6d0(%rip), %rsi      # 0x23b9b
callq 0x4310
movq %rax, -0x180(%rbp)
jmp 0x174d9
movq -0x180(%rbp), %rdi
movq -0x150(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x188(%rbp)
jmp 0x174fc
movq -0x188(%rbp), %rdi
leaq 0xc4db(%rip), %rsi      # 0x239e5
callq 0x4310
movq %rax, -0x190(%rbp)
jmp 0x17518
movq -0x40(%rbp), %rdi
callq 0x1ee90
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x1eeb0
jmp 0x1752f
movq -0x190(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x42e0
movq %rax, -0x198(%rbp)
jmp 0x17548
movq -0x198(%rbp), %rdi
movq 0x14a72(%rip), %rsi     # 0x2bfc8
callq 0x4350
jmp 0x1755d
leaq -0x60(%rbp), %rdi
callq 0x46d8
leaq 0xc28d(%rip), %rdi      # 0x237fa
callq 0x42a0
jmp 0x17574
movl $0x1, %edi
callq 0x4400
jmp 0x175af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x175a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x175aa
jmp 0x17f7b
movq -0x10(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x1b0(%rbp)
addq $0x218, %rdi            # imm = 0x218
callq 0x4140
movq %rax, -0x1a8(%rbp)
movl $0x10, %edi
movl $0x20, %esi
callq 0x1ee70
movl %eax, -0x19c(%rbp)
jmp 0x175eb
movl -0x19c(%rbp), %edx
movq -0x1a8(%rbp), %rsi
movq -0x1b0(%rbp), %rdi
callq 0x42f0
jmp 0x17606
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x45e0
movb %al, -0x1b1(%rbp)
jmp 0x1761b
movb -0x1b1(%rbp), %al
testb $0x1, %al
jne 0x17792
jmp 0x1762b
movq 0x149be(%rip), %rdi     # 0x2bff0
leaq 0xbeff(%rip), %rsi      # 0x23538
callq 0x4310
movq %rax, -0x1c0(%rbp)
jmp 0x17647
movq -0x1c0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x1c8(%rbp)
jmp 0x17667
movq -0x1c8(%rbp), %rdi
leaq 0xc055(%rip), %rsi      # 0x236ca
callq 0x4310
movq %rax, -0x1d0(%rbp)
jmp 0x17683
movq -0x1d0(%rbp), %rdi
movq 0x1491f(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x17698
movl $0x2, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x17f7b
movq -0x30(%rbp), %rdi
callq 0x4130
movq %rax, -0x68(%rbp)
movq 0x1491e(%rip), %rdi     # 0x2bff0
leaq 0xc4c2(%rip), %rsi      # 0x23b9b
callq 0x4310
movq %rax, -0x1d8(%rbp)
jmp 0x176e7
movq -0x1d8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x218, %rsi            # imm = 0x218
callq 0x42e0
movq %rax, -0x1e0(%rbp)
jmp 0x17707
movq -0x1e0(%rbp), %rdi
leaq 0xbfc1(%rip), %rsi      # 0x236d6
callq 0x4310
movq %rax, -0x1e8(%rbp)
jmp 0x17723
movq -0x68(%rbp), %rdi
callq 0x1ee90
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x1eeb0
jmp 0x1773d
movq -0x1e8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x42e0
movq %rax, -0x1f0(%rbp)
jmp 0x17759
movq -0x1f0(%rbp), %rdi
movq 0x14861(%rip), %rsi     # 0x2bfc8
callq 0x4350
jmp 0x1776e
leaq -0x88(%rbp), %rdi
callq 0x46d8
leaq 0xc079(%rip), %rdi      # 0x237fa
callq 0x42a0
jmp 0x17788
movl $0x1, %edi
callq 0x4400
jmp 0x177c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x177ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x177c1
jmp 0x17f7b
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x17833
movq 0x14816(%rip), %rdi     # 0x2bff0
leaq 0xbdfd(%rip), %rsi      # 0x235de
callq 0x4310
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0xbdfd(%rip), %rsi      # 0x235fc
callq 0x4310
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0xbe12(%rip), %rsi      # 0x2362c
callq 0x4310
movq %rax, %rdi
movq 0x14787(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x17f66
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x17af1
movq 0x147a5(%rip), %rdi     # 0x2bff0
leaq 0xbdef(%rip), %rsi      # 0x23641
callq 0x4310
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0xbde8(%rip), %rsi      # 0x23658
callq 0x4310
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x40d0
movq %rax, %rdi
leaq 0xbdf0(%rip), %rsi      # 0x2367b
callq 0x4310
movq %rax, %rdi
movq 0x14716(%rip), %rsi     # 0x2bfb0
callq 0x4350
movq $0xa00000, -0x98(%rbp) # imm = 0xA00000
movl $0xa00000, %edi         # imm = 0xA00000
callq 0x4030
movq %rax, -0x1f8(%rbp)
jmp 0x178bd
movq -0x1f8(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x1794c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x3, %ecx
cmpl %ecx, %eax
jne 0x17f7b
movq -0x30(%rbp), %rdi
callq 0x4130
movq %rax, -0xa0(%rbp)
movq 0x146f0(%rip), %rdi     # 0x2bff0
leaq 0xbda2(%rip), %rsi      # 0x236a9
callq 0x4310
movq %rax, -0x200(%rbp)
jmp 0x17915
movq -0x200(%rbp), %rdi
movq 0x1468d(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x1792a
movl $0x4, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x4580
jmp 0x17947
jmp 0x17f7b
movq -0x150(%rbp), %rax
testb $0x1, 0x238(%rax)
je 0x17a24
movq -0x20(%rbp), %rax
testb $0x1, (%rax)
je 0x17999
movq -0x150(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x208(%rbp)
callq 0x1f390
movq -0x208(%rbp), %rdi
movq %rax, %rsi
movl $0xa, %edx
callq 0x41f0
jmp 0x17a22
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x44d0
movq -0x150(%rbp), %rdi
movq -0x210(%rbp), %rsi
addq $0x8, %rdi
callq 0x4080
jmp 0x179c5
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq -0xc0(%rbp), %rsi
callq 0x42e0
movq %rax, -0x218(%rbp)
jmp 0x179e2
movq -0x218(%rbp), %rdi
movq 0x145c0(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x179f7
leaq -0xc0(%rbp), %rdi
callq 0x46d8
jmp 0x17a22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x46d8
jmp 0x17f7b
jmp 0x17a24
jmp 0x17a26
movq -0x150(%rbp), %rax
movq %rax, %rdi
addq $0x8, %rdi
movq 0x8(%rax), %rax
addq -0x18(%rax), %rdi
callq 0x4440
testb $0x1, %al
jne 0x17a47
jmp 0x17aaf
movq -0x150(%rbp), %rdi
addq $0x8, %rdi
movq -0x90(%rbp), %rsi
movl $0xa00000, %edx         # imm = 0xA00000
callq 0x4450
movq -0x150(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x8, %rax
addq $0x10, %rax
movq %rax, -0x228(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x220(%rbp)
addq $0x8, %rdi
callq 0x46c0
movq -0x228(%rbp), %rdi
movq -0x220(%rbp), %rsi
movq %rax, %rdx
callq 0x44a0
jmp 0x17a26
movq -0x150(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
movq -0x90(%rbp), %rax
movq %rax, -0x230(%rbp)
cmpq $0x0, %rax
je 0x17aec
movq -0x230(%rbp), %rdi
callq 0x4480
jmp 0x17f66
jmp 0x17af3
leaq -0xe0(%rbp), %rdi
callq 0x44d0
movq -0x150(%rbp), %rax
testb $0x1, 0x238(%rax)
je 0x17bc4
movq -0x20(%rbp), %rax
testb $0x1, (%rax)
je 0x17b5c
movq -0x150(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x238(%rbp)
callq 0x1f390
movq -0x238(%rbp), %rdi
movq %rax, %rsi
movl $0xa, %edx
callq 0x41f0
jmp 0x17b49
jmp 0x17bc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x17f6f
movq -0x150(%rbp), %rdi
addq $0x8, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4080
jmp 0x17b75
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x42e0
movq %rax, -0x240(%rbp)
jmp 0x17b92
movq -0x240(%rbp), %rdi
movq 0x14410(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x17ba7
xorl %eax, %eax
movl %eax, %esi
leaq -0xe0(%rbp), %rdi
movq $-0x1, %rdx
callq 0x40c0
jmp 0x17bc0
jmp 0x17bc2
jmp 0x17bc4
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
movl $0x8, %edi
callq 0x4330
movq %rax, -0x248(%rbp)
jmp 0x17be5
movq -0x248(%rbp), %rdi
callq 0x22380
jmp 0x17bf3
movq -0x248(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x17ce9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x17c31
movq -0x248(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x8, %esi
callq 0x4340
movl -0x34(%rbp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x17f6f
movq -0x30(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x4430
movq %rax, %rsi
leaq -0x118(%rbp), %rdi
callq 0x4150
jmp 0x17c62
movq -0x250(%rbp), %rdi
callq 0x4130
movq 0x1437b(%rip), %rdi     # 0x2bff0
leaq 0xba91(%rip), %rsi      # 0x2370d
callq 0x4310
movq %rax, -0x258(%rbp)
jmp 0x17c8a
movq -0x258(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x42e0
movq %rax, -0x260(%rbp)
jmp 0x17ca6
movq -0x260(%rbp), %rdi
movq 0x142fc(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x17cbb
movl $0x5, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x17ce4
jmp 0x17f6f
jmp 0x17ceb
cmpq $0x0, -0xe8(%rbp)
je 0x17f08
movq -0xf8(%rbp), %rdi
movq -0xe8(%rbp), %xmm0
movaps 0xb791(%rip), %xmm2     # 0x234a0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0xb795(%rip), %xmm1     # 0x234b0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm3, %xmm0
movsd %xmm0, -0x120(%rbp)
movq -0x28(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x128(%rbp)
leaq -0x120(%rbp), %rsi
leaq -0x128(%rbp), %rdx
callq 0x227a0
movq %rax, -0x268(%rbp)
jmp 0x17d6e
movq -0x268(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x17e45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x17f6f
movq -0x30(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x4430
movq %rax, %rsi
leaq -0x148(%rbp), %rdi
callq 0x4150
jmp 0x17dbe
movq -0x270(%rbp), %rdi
callq 0x4130
movq 0x1421f(%rip), %rdi     # 0x2bff0
leaq 0xb935(%rip), %rsi      # 0x2370d
callq 0x4310
movq %rax, -0x278(%rbp)
jmp 0x17de6
movq -0x278(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x42e0
movq %rax, -0x280(%rbp)
jmp 0x17e02
movq -0x280(%rbp), %rdi
movq 0x141a0(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x17e17
movl $0x5, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x46d8
callq 0x4580
jmp 0x17e40
jmp 0x17f6f
movq -0xf0(%rbp), %rcx
addq $0x1, %rcx
movq -0x28(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0xf0(%rbp)
je 0x17ea6
movq -0x150(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x288(%rbp)
callq 0x1f390
movq -0x288(%rbp), %rdi
movq %rax, %rsi
movl $0xa, %edx
callq 0x41f0
jmp 0x17e92
movq -0xf0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xf0(%rbp)
jmp 0x17e5b
movq -0x150(%rbp), %rdi
addq $0x8, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4080
jmp 0x17ebf
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x42e0
movq %rax, -0x290(%rbp)
jmp 0x17edc
movq -0x290(%rbp), %rdi
movq 0x140c6(%rip), %rsi     # 0x2bfb0
callq 0x4350
jmp 0x17ef1
movq -0xe8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xe8(%rbp)
jmp 0x17ceb
movq -0x150(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
jmp 0x17f1a
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4060
jmp 0x17f29
movq -0xf8(%rbp), %rax
movq %rax, -0x298(%rbp)
cmpq $0x0, %rax
je 0x17f5a
movq -0x298(%rbp), %rdi
callq 0x1ef60
movq -0x298(%rbp), %rdi
movl $0x8, %esi
callq 0x4340
leaq -0xe0(%rbp), %rdi
callq 0x46d8
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
leaq -0xe0(%rbp), %rdi
callq 0x46d8
movq -0x30(%rbp), %rdi
callq 0x4610
movq %rax, %rdi
callq 0x82c0
nopl (%rax)