// File: MiWitt[P]HLAbaits/main.cpp
// Function: tile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int)
map<string,string>  tile(string ID, string seq, int start, int end, int step_size = TILING_STEP_SIZE)
{
    map<string,string> mapRet;
    cerr << "tiling: " << setw(20) << right << ID << ", uncovered bases:" << setw(10) << right << end-start+1 << endl;
    while( (end-start)+1 < PROBE_SIZE)
    {
        if(rand() % 2 == 0)
        {
            if(start > 0)
                start--;
            if((end-start)+1 < PROBE_SIZE && end < seq.size()-1)
                end++;
        }
        else
        {
            if(end < seq.size()-1)
                end++;
            if((end-start)+1 < PROBE_SIZE && start > 0)
                start--;

        }
    }
    if((end-start)+1 == PROBE_SIZE)
    {
        ostringstream osr("");
        osr << ID << '_' << start << '_' << end;
        mapRet[osr.str()]=seq.substr(start,(end-start)+1);
    }
    else
    {
        if(rand() % 2 == 1)
        {
            ostringstream osr("");
            osr << ID << '_' << start << '_' << start+PROBE_SIZE-1;
            mapRet[osr.str()]=seq.substr(start,PROBE_SIZE);
            map<string,string> mapTmp = tile(ID,seq,start+step_size,end);
            mapRet.insert(mapTmp.begin(),mapTmp.end());
        }
        else
        {
            ostringstream osr("");
            osr << ID << '_' << (end-PROBE_SIZE)+1 << '_' << end;
            mapRet[osr.str()]=seq.substr((end-PROBE_SIZE)+1,PROBE_SIZE);
            map<string,string> mapTmp = tile(ID,seq,start,end-step_size);
            mapRet.insert(mapTmp.begin(),mapTmp.end());
        }
    }
    return mapRet;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x810, %rsp            # imm = 0x810
movq %rdx, -0x708(%rbp)
movq %rsi, -0x700(%rbp)
movq %rdi, -0x6f8(%rbp)
movq %rdi, %rax
movq %rax, -0x6f0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movb $0x0, -0x25(%rbp)
callq 0x6560
movq 0xdeff(%rip), %rdi      # 0x11ff0
leaq 0x7f43(%rip), %rsi      # 0xc03b
callq 0x32b0
movq %rax, -0x6e8(%rbp)
jmp 0x4106
movl $0x14, %edi
callq 0x6580
movl %eax, -0x70c(%rbp)
jmp 0x4118
movq -0x6e8(%rbp), %rdi
movl -0x70c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %esi
callq 0x3380
movq %rax, -0x718(%rbp)
jmp 0x4139
movq -0x718(%rbp), %rdi
leaq 0x2459(%rip), %rsi      # 0x65a0
callq 0x3120
movq %rax, -0x720(%rbp)
jmp 0x4155
movq -0x700(%rbp), %rsi
movq -0x720(%rbp), %rdi
callq 0x3290
movq %rax, -0x728(%rbp)
jmp 0x4171
movq -0x728(%rbp), %rdi
leaq 0x7ec5(%rip), %rsi      # 0xc044
callq 0x32b0
movq %rax, -0x730(%rbp)
jmp 0x418d
movl $0xa, %edi
callq 0x6580
movl %eax, -0x734(%rbp)
jmp 0x419f
movq -0x730(%rbp), %rdi
movl -0x734(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %esi
callq 0x3380
movq %rax, -0x740(%rbp)
jmp 0x41c0
movq -0x740(%rbp), %rdi
leaq 0x23d2(%rip), %rsi      # 0x65a0
callq 0x3120
movq %rax, -0x748(%rbp)
jmp 0x41dc
movq -0x748(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %eax
subl %eax, %esi
incl %esi
callq 0x3520
movq %rax, -0x750(%rbp)
jmp 0x41fb
movq -0x750(%rbp), %rdi
movq 0xdd9f(%rip), %rsi      # 0x11fa8
callq 0x3310
jmp 0x4210
jmp 0x4212
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl 0xe0d7(%rip), %eax      # 0x122f8
jge 0x42fb
callq 0x30e0
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x42a1
cmpl $0x0, -0x1c(%rbp)
jle 0x425b
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x425b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4b7a
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl 0xe08e(%rip), %eax      # 0x122f8
jge 0x429f
movq -0x708(%rbp), %rdi
movslq -0x20(%rbp), %rax
movq %rax, -0x758(%rbp)
callq 0x3210
movq %rax, %rcx
movq -0x758(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x429f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x42f6
movq -0x708(%rbp), %rdi
movslq -0x20(%rbp), %rax
movq %rax, -0x760(%rbp)
callq 0x3210
movq %rax, %rcx
movq -0x760(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x42d4
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl 0xe015(%rip), %eax      # 0x122f8
jge 0x42f4
cmpl $0x0, -0x1c(%rbp)
jle 0x42f4
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x42f6
jmp 0x4212
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl 0xdfee(%rip), %eax      # 0x122f8
jne 0x4504
leaq -0x1d9(%rbp), %rdi
movq %rdi, -0x768(%rbp)
callq 0x3540
movq -0x768(%rbp), %rdx
leaq 0x7cf5(%rip), %rsi      # 0xc026
leaq -0x1d8(%rbp), %rdi
callq 0x62c0
jmp 0x433f
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
movl $0x10, %edx
callq 0x3450
jmp 0x4359
leaq -0x1d8(%rbp), %rdi
callq 0x35d8
leaq -0x1d9(%rbp), %rdi
callq 0x3330
movq -0x700(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x3290
movq %rax, -0x770(%rbp)
jmp 0x438d
movq -0x770(%rbp), %rdi
movl $0x5f, %esi
callq 0x33a0
movq %rax, -0x778(%rbp)
jmp 0x43a7
movq -0x778(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x3520
movq %rax, -0x780(%rbp)
jmp 0x43bf
movq -0x780(%rbp), %rdi
movl $0x5f, %esi
callq 0x33a0
movq %rax, -0x788(%rbp)
jmp 0x43d9
movq -0x788(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x3520
jmp 0x43ea
movq -0x708(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
movl %edx, %ecx
movl -0x20(%rbp), %eax
subl %ecx, %eax
incl %eax
movslq %eax, %rcx
leaq -0x200(%rbp), %rdi
callq 0x32f0
jmp 0x440f
leaq -0x220(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x32e0
jmp 0x4424
movq -0x6f8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x65d0
movq %rax, -0x790(%rbp)
jmp 0x4440
movq -0x790(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x33c0
leaq -0x220(%rbp), %rdi
callq 0x35d8
leaq -0x200(%rbp), %rdi
callq 0x35d8
leaq -0x1b8(%rbp), %rdi
callq 0x30c0
jmp 0x4b54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x44a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x35d8
leaq -0x1d9(%rbp), %rdi
callq 0x3330
jmp 0x4b7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x44f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x44e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x35d8
leaq -0x200(%rbp), %rdi
callq 0x35d8
leaq -0x1b8(%rbp), %rdi
callq 0x30c0
jmp 0x4b7a
callq 0x30e0
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0x4835
leaq -0x3b9(%rbp), %rdi
movq %rdi, -0x798(%rbp)
callq 0x3540
movq -0x798(%rbp), %rdx
leaq 0x7aeb(%rip), %rsi      # 0xc026
leaq -0x3b8(%rbp), %rdi
callq 0x62c0
jmp 0x4549
leaq -0x398(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
movl $0x10, %edx
callq 0x3450
jmp 0x4563
leaq -0x3b8(%rbp), %rdi
callq 0x35d8
leaq -0x3b9(%rbp), %rdi
callq 0x3330
movq -0x700(%rbp), %rsi
leaq -0x398(%rbp), %rdi
callq 0x3290
movq %rax, -0x7a0(%rbp)
jmp 0x4597
movq -0x7a0(%rbp), %rdi
movl $0x5f, %esi
callq 0x33a0
movq %rax, -0x7a8(%rbp)
jmp 0x45b1
movq -0x7a8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x3520
movq %rax, -0x7b0(%rbp)
jmp 0x45c9
movq -0x7b0(%rbp), %rdi
movl $0x5f, %esi
callq 0x33a0
movq %rax, -0x7b8(%rbp)
jmp 0x45e3
movq -0x7b8(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl 0xdd05(%rip), %eax      # 0x122f8
movl %eax, %ecx
movl %edx, %eax
leal -0x1(%rax,%rcx), %esi
callq 0x3520
jmp 0x4602
movq -0x708(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
movslq 0xdce4(%rip), %rcx      # 0x122f8
leaq -0x3e0(%rbp), %rdi
callq 0x32f0
jmp 0x4622
leaq -0x400(%rbp), %rdi
leaq -0x398(%rbp), %rsi
callq 0x32e0
jmp 0x4637
movq -0x6f8(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x65d0
movq %rax, -0x7c0(%rbp)
jmp 0x4653
movq -0x7c0(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
movq %rsi, -0x7c8(%rbp)
callq 0x33c0
leaq -0x400(%rbp), %rdi
callq 0x35d8
movq -0x7c8(%rbp), %rdi
callq 0x35d8
movq -0x700(%rbp), %rsi
leaq -0x450(%rbp), %rdi
callq 0x3160
jmp 0x469a
movq -0x708(%rbp), %rsi
leaq -0x470(%rbp), %rdi
callq 0x3160
jmp 0x46af
movl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %eax
addl %eax, %ecx
movl -0x20(%rbp), %r8d
movl 0xdc3e(%rip), %r9d      # 0x12300
leaq -0x430(%rbp), %rdi
leaq -0x450(%rbp), %rsi
leaq -0x470(%rbp), %rdx
callq 0x40a0
jmp 0x46de
leaq -0x470(%rbp), %rdi
callq 0x35d8
leaq -0x450(%rbp), %rdi
callq 0x35d8
leaq -0x430(%rbp), %rdi
movq %rdi, -0x7d0(%rbp)
callq 0x66f0
movq -0x7d0(%rbp), %rdi
movq %rax, -0x478(%rbp)
callq 0x6720
movq -0x6f8(%rbp), %rdi
movq %rax, -0x480(%rbp)
movq -0x478(%rbp), %rsi
movq -0x480(%rbp), %rdx
callq 0x66b0
jmp 0x473f
leaq -0x430(%rbp), %rdi
callq 0x6750
leaq -0x398(%rbp), %rdi
callq 0x30c0
jmp 0x4b52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4782
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0x35d8
leaq -0x3b9(%rbp), %rdi
callq 0x3330
jmp 0x4b7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4824
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x47ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x35d8
leaq -0x3e0(%rbp), %rdi
callq 0x35d8
jmp 0x4824
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x47fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x35d8
leaq -0x450(%rbp), %rdi
callq 0x35d8
jmp 0x4824
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x6750
leaq -0x398(%rbp), %rdi
callq 0x30c0
jmp 0x4b7a
leaq -0x619(%rbp), %rdi
movq %rdi, -0x7d8(%rbp)
callq 0x3540
movq -0x7d8(%rbp), %rdx
leaq 0x77d0(%rip), %rsi      # 0xc026
leaq -0x618(%rbp), %rdi
callq 0x62c0
jmp 0x4864
leaq -0x5f8(%rbp), %rdi
leaq -0x618(%rbp), %rsi
movl $0x10, %edx
callq 0x3450
jmp 0x487e
leaq -0x618(%rbp), %rdi
callq 0x35d8
leaq -0x619(%rbp), %rdi
callq 0x3330
movq -0x700(%rbp), %rsi
leaq -0x5f8(%rbp), %rdi
callq 0x3290
movq %rax, -0x7e0(%rbp)
jmp 0x48b2
movq -0x7e0(%rbp), %rdi
movl $0x5f, %esi
callq 0x33a0
movq %rax, -0x7e8(%rbp)
jmp 0x48cc
movq -0x7e8(%rbp), %rdi
movl -0x20(%rbp), %esi
movl 0xda1c(%rip), %eax      # 0x122f8
subl %eax, %esi
incl %esi
callq 0x3520
movq %rax, -0x7f0(%rbp)
jmp 0x48ee
movq -0x7f0(%rbp), %rdi
movl $0x5f, %esi
callq 0x33a0
movq %rax, -0x7f8(%rbp)
jmp 0x4908
movq -0x7f8(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x3520
jmp 0x4919
movq -0x708(%rbp), %rsi
movl -0x20(%rbp), %eax
movslq 0xd9ce(%rip), %rcx      # 0x122f8
movl %ecx, %edx
subl %edx, %eax
incl %eax
movslq %eax, %rdx
leaq -0x640(%rbp), %rdi
callq 0x32f0
jmp 0x4941
leaq -0x660(%rbp), %rdi
leaq -0x5f8(%rbp), %rsi
callq 0x32e0
jmp 0x4956
movq -0x6f8(%rbp), %rdi
leaq -0x660(%rbp), %rsi
callq 0x65d0
movq %rax, -0x800(%rbp)
jmp 0x4972
movq -0x800(%rbp), %rdi
leaq -0x640(%rbp), %rsi
movq %rsi, -0x808(%rbp)
callq 0x33c0
leaq -0x660(%rbp), %rdi
callq 0x35d8
movq -0x808(%rbp), %rdi
callq 0x35d8
movq -0x700(%rbp), %rsi
leaq -0x6b0(%rbp), %rdi
callq 0x3160
jmp 0x49b9
movq -0x708(%rbp), %rsi
leaq -0x6d0(%rbp), %rdi
callq 0x3160
jmp 0x49ce
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
movl -0x24(%rbp), %eax
subl %eax, %r8d
movl 0xd91e(%rip), %r9d      # 0x12300
leaq -0x690(%rbp), %rdi
leaq -0x6b0(%rbp), %rsi
leaq -0x6d0(%rbp), %rdx
callq 0x40a0
jmp 0x49fe
leaq -0x6d0(%rbp), %rdi
callq 0x35d8
leaq -0x6b0(%rbp), %rdi
callq 0x35d8
leaq -0x690(%rbp), %rdi
movq %rdi, -0x810(%rbp)
callq 0x66f0
movq -0x810(%rbp), %rdi
movq %rax, -0x6d8(%rbp)
callq 0x6720
movq -0x6f8(%rbp), %rdi
movq %rax, -0x6e0(%rbp)
movq -0x6d8(%rbp), %rsi
movq -0x6e0(%rbp), %rdx
callq 0x66b0
jmp 0x4a5f
leaq -0x690(%rbp), %rdi
callq 0x6750
leaq -0x5f8(%rbp), %rdi
callq 0x30c0
jmp 0x4b52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4aa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x618(%rbp), %rdi
callq 0x35d8
leaq -0x619(%rbp), %rdi
callq 0x3330
jmp 0x4b7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4b44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4aea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x660(%rbp), %rdi
callq 0x35d8
leaq -0x640(%rbp), %rdi
callq 0x35d8
jmp 0x4b44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4b1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x6d0(%rbp), %rdi
callq 0x35d8
leaq -0x6b0(%rbp), %rdi
callq 0x35d8
jmp 0x4b44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x690(%rbp), %rdi
callq 0x6750
leaq -0x5f8(%rbp), %rdi
callq 0x30c0
jmp 0x4b7a
jmp 0x4b54
movb $0x1, -0x25(%rbp)
testb $0x1, -0x25(%rbp)
jne 0x4b6a
movq -0x6f8(%rbp), %rdi
callq 0x6750
movq -0x6f0(%rbp), %rax
addq $0x810, %rsp            # imm = 0x810
popq %rbp
retq
movq -0x6f8(%rbp), %rdi
callq 0x6750
movq -0x30(%rbp), %rdi
callq 0x3530
nop