// File: /workspace/github_cpp_makefile_star2_O2/VanAndelInstitute[P]intent/src/edlib.cpp
// Function: obtainAlignment(unsigned char const*, unsigned char const*, int, unsigned char const*, unsigned char const*, int, EqualityDefinition const&, int, int, unsigned char**, int*)
static int obtainAlignment(
        const unsigned char* const query, const unsigned char* const rQuery, const int queryLength,
        const unsigned char* const target, const unsigned char* const rTarget, const int targetLength,
        const EqualityDefinition& equalityDefinition, const int alphabetLength, const int bestScore,
        unsigned char** const alignment, int* const alignmentLength) {

    // Handle special case when one of sequences has length of 0.
    if (queryLength == 0 || targetLength == 0) {
        *alignmentLength = targetLength + queryLength;
        *alignment = static_cast<unsigned char*>(malloc((*alignmentLength) * sizeof(unsigned char)));
        for (int i = 0; i < *alignmentLength; i++) {
            (*alignment)[i] = queryLength == 0 ? EDLIB_EDOP_DELETE : EDLIB_EDOP_INSERT;
        }
        return EDLIB_STATUS_OK;
    }

    const int maxNumBlocks = ceilDiv(queryLength, WORD_SIZE);
    const int W = maxNumBlocks * WORD_SIZE - queryLength;
    int statusCode;

    // TODO: think about reducing number of memory allocations in alignment functions, probably
    // by sharing some memory that is allocated only once. That refers to: Peq, columns in Hirschberg,
    // and it could also be done for alignments - we could have one big array for alignment that would be
    // sparsely populated by each of steps in recursion, and at the end we would just consolidate those results.

    // If estimated memory consumption for traceback algorithm is smaller than 1MB use it,
    // otherwise use Hirschberg's algorithm. By running few tests I choose boundary of 1MB as optimal.
    long long alignmentDataSize = (2ll * sizeof(Word) + sizeof(int)) * maxNumBlocks * targetLength
        + 2ll * sizeof(int) * targetLength;
    if (alignmentDataSize < 1024 * 1024) {
        int score_, endLocation_;  // Used only to call function.
        AlignmentData* alignData = NULL;
        Word* Peq = buildPeq(alphabetLength, query, queryLength, equalityDefinition);
        myersCalcEditDistanceNW(Peq, W, maxNumBlocks,
                                queryLength,
                                target, targetLength,
                                bestScore,
                                &score_, &endLocation_, true, &alignData, -1);
        //assert(score_ == bestScore);
        //assert(endLocation_ == targetLength - 1);

        statusCode = obtainAlignmentTraceback(queryLength, targetLength,
                                              bestScore, alignData, alignment, alignmentLength);
        delete alignData;
        delete[] Peq;
    } else {
        statusCode = obtainAlignmentHirschberg(query, rQuery, queryLength,
                                               target, rTarget, targetLength,
                                               equalityDefinition, alphabetLength, bestScore,
                                               alignment, alignmentLength);
    }
    return statusCode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, %r13d
movq %rcx, %r9
movl %edx, %r12d
movq 0x100(%rsp), %r15
movq 0xf8(%rsp), %r14
testl %edx, %edx
setne %al
testl %r13d, %r13d
setne %cl
testb %cl, %al
jne 0x23a63
addl %r12d, %r13d
movl %r13d, (%r15)
movslq %r13d, %rdi
callq 0x6550
movq %rax, (%r14)
xorl %ebx, %ebx
cmpl $0x1, %r12d
movl $0x0, %eax
adcb $0x1, %al
xorl %ecx, %ecx
movslq %r13d, %rdx
cmpq %rdx, %rcx
jge 0x247c1
movq (%r14), %rdx
movb %al, (%rdx,%rcx)
incq %rcx
movl (%r15), %r13d
jmp 0x23a49
movq %rsi, %rbx
movq %rdi, %rsi
pushq $0x40
popq %r10
testb $0x3f, %r12b
je 0x23a80
movl %r12d, %eax
cltd
idivl %r10d
movl %eax, %ebp
incl %ebp
jmp 0x23a86
movl %r12d, %ebp
sarl $0x6, %ebp
movl 0xf0(%rsp), %r14d
movl 0xe8(%rsp), %edi
movq 0xe0(%rsp), %rcx
imull $0x14, %ebp, %eax
cltq
movslq %r13d, %rdx
addq $0x8, %rax
imulq %rdx, %rax
cmpq $0xfffff, %rax          # imm = 0xFFFFF
jg 0x23b25
movl %ebp, %ebx
shll $0x6, %ebx
subl %r12d, %ebx
leaq 0x58(%rsp), %rax
andq $0x0, (%rax)
movl %r12d, %edx
movq %r9, %r15
callq 0x22b6d
movq %rax, %rdi
leaq 0x48(%rsp), %rax
leaq 0x50(%rsp), %r10
movq %rdi, 0x20(%rsp)
movl %ebx, %esi
movl %ebp, %edx
movl %r12d, %ecx
movq %r15, %r8
movl %r13d, %r9d
pushq $-0x1
leaq 0x60(%rsp), %rbx
pushq %rbx
pushq $0x1
pushq %rax
pushq %r10
pushq %r14
callq 0x23217
addq $0x30, %rsp
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
testb $0x3f, %r12b
je 0x23b4b
movl %r12d, %eax
cltd
pushq $0x40
popq %rsi
idivl %esi
movl %eax, %ebx
incl %ebx
jmp 0x23b51
testb $0x3f, %r12b
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
je 0x24051
movl %r12d, %eax
cltd
idivl %r10d
movl %eax, %r15d
incl %r15d
jmp 0x24058
movl %r12d, %ebx
sarl $0x6, %ebx
movl %ebx, %ebp
shll $0x6, %ebp
subl %r12d, %ebp
leal -0x1(%r13), %r15d
leal (%r12,%r13), %eax
decl %eax
movslq %eax, %rdi
callq 0x6550
movq 0xf8(%rsp), %rcx
movq %rax, (%rcx)
movq 0x100(%rsp), %rax
andl $0x0, (%rax)
leal -0x1(%rbx), %r9d
movq 0x8(%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
movl %ebx, %edx
imull %r15d, %edx
addl %ebx, %edx
decl %edx
movslq %edx, %rdx
movq (%rax,%rdx,8), %r8
movq (%rcx,%rdx,8), %r10
cmpl $0x2, %r13d
movq %rbx, 0x18(%rsp)
jl 0x23bcd
movq 0x18(%rsi), %rdx
addl $-0x2, %r13d
cmpl (%rdx,%r13,4), %ebx
jle 0x23bcd
movq 0x20(%rsi), %rdx
cmpl (%rdx,%r13,4), %r9d
jle 0x246cc
xorl %r13d, %r13d
xorl %edx, %edx
xorl %edi, %edi
movl %ebp, %ecx
shlq %cl, %r8
movq %r8, (%rsp)
shlq %cl, %r10
movq %r10, 0x10(%rsp)
pushq $0x3f
popq %rax
movl %eax, %r11d
subl %ebp, %r11d
pushq $-0x1
popq %rax
movl %eax, %ebp
movl %eax, %r12d
movl %r13d, %r8d
movl %ebp, %ebx
movl %r9d, %ecx
shll $0x6, %ecx
leal (%rcx,%r11), %esi
testl %r15d, %r15d
sete %r13b
leal 0x1(%rcx,%r11), %ebp
cmovel %ebp, %ebx
movl %eax, %ecx
cmovel %esi, %ecx
orb %r8b, %r13b
cmpl $-0x1, %ebx
je 0x23c46
cmpl $-0x1, %ecx
jne 0x23cdc
cmpl $-0x1, %ebx
je 0x23cab
movq %rdx, %rax
sarq $0x3f, %rax
movq %rdi, %rcx
shrq $0x3f, %rcx
addl %eax, %ecx
addl %ebx, %ecx
jmp 0x23cdc
testb $0x1, %r13b
je 0x23c9f
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
leal -0x1(%r15), %r8d
imull 0x18(%rsp), %r8d
addl %r9d, %r8d
movslq %r8d, %r8
movl (%rax,%r8,4), %ebx
pushq $0x3f
popq %rax
subl %r11d, %eax
testl %eax, %eax
movl $0x0, %r8d
cmovlel %r8d, %eax
subl $0x1, %eax
jb 0x23c21
movq %rdx, %r8
sarq $0x3f, %r8
addl %r8d, %ebx
movq %rdi, %r8
shrq $0x3f, %r8
addl %ebx, %r8d
addq %rdx, %rdx
addq %rdi, %rdi
movl %r8d, %ebx
jmp 0x23c7b
pushq $-0x1
popq %r8
movl %r8d, %ebx
cmpl $-0x1, %eax
jne 0x23cdc
testl %r15d, %r15d
jle 0x23cd5
movq 0x8(%rsp), %rbx
movq 0x18(%rbx), %rcx
leal -0x1(%r15), %eax
cmpl (%rcx,%rax,4), %r9d
jle 0x23cd5
leal -0x1(%r9), %ecx
movq 0x20(%rbx), %r8
cmpl (%r8,%rax,4), %ecx
jle 0x24011
pushq $-0x1
popq %rax
movl %eax, %ebx
movl %eax, %ecx
cmpl $-0x1, %r12d
jne 0x23d0e
movq (%rsp), %r8
movq %r8, %rax
sarq $0x3f, %rax
movq 0x10(%rsp), %r10
movq %r10, %r12
shrq $0x3f, %r12
addl %eax, %r12d
addl %r14d, %r12d
addq %r8, %r8
movq %r8, (%rsp)
addq %r10, %r10
movq %r10, 0x10(%rsp)
cmpl $-0x1, %r12d
je 0x23d42
leal 0x1(%r12), %eax
cmpl %r14d, %eax
jne 0x23d42
testl %r11d, %r11d
je 0x23df3
decl %r11d
addq %rdx, %rdx
addq %rdi, %rdi
movb $0x1, %r10b
movl %ecx, %ebp
pushq $-0x1
popq %rsi
movl %esi, %eax
movl %r9d, %ebx
jmp 0x23fde
cmpl $-0x1, %ebx
je 0x23d9b
leal 0x1(%rbx), %eax
cmpl %r14d, %eax
jne 0x23d9b
testl %r15d, %r15d
je 0x245ff
leal -0x1(%r15), %r8d
cmpl $0x2, %r15d
jl 0x23e6b
movq 0x8(%rsp), %r10
movq 0x18(%r10), %rax
addl $-0x2, %r15d
cmpl (%rax,%r15,4), %r9d
jge 0x23f0a
xorl %r13d, %r13d
pushq $-0x1
popq %rsi
movb $0x2, %r10b
movl %esi, %ebp
movl %ecx, %eax
movq %rdx, (%rsp)
movq %rdi, 0x10(%rsp)
movl %ebx, %r12d
jmp 0x23fd8
cmpl $-0x1, %ecx
movq 0xf8(%rsp), %rbx
movq 0x100(%rsp), %r12
movq 0x8(%rsp), %r13
je 0x24784
xorl %eax, %eax
cmpl %r14d, %ecx
setne %al
leal (%rax,%rax,2), %ebp
testl %r15d, %r15d
je 0x24646
leal -0x1(%r15), %r8d
testl %r11d, %r11d
je 0x23e8f
decl %r11d
leaq (%rdx,%rdx), %rax
movq %rax, (%rsp)
leaq (%rdi,%rdi), %rax
movq %rax, 0x10(%rsp)
jmp 0x23ece
testl %r9d, %r9d
je 0x24684
leal -0x1(%r9), %ebx
movq 0x8(%rsp), %r14
movq (%r14), %rax
movq 0x8(%r14), %rsi
movl %r15d, %r8d
movq 0x18(%rsp), %r13
imull %r13d, %r8d
addl %r9d, %r8d
decl %r8d
movslq %r8d, %r8
movq (%rax,%r8,8), %r10
movq %r10, (%rsp)
movq (%rsi,%r8,8), %r8
movq %r8, 0x10(%rsp)
testl %r15d, %r15d
jle 0x23e53
movq 0x18(%r14), %r11
leal -0x1(%r15), %r8d
cmpl (%r11,%r8,4), %r9d
jle 0x23e53
movq 0x20(%r14), %r9
cmpl (%r9,%r8,4), %ebx
jle 0x2402d
xorl %r13d, %r13d
movb $0x1, %r10b
movl %ecx, %ebp
pushq $-0x1
popq %rsi
movl %esi, %eax
pushq $0x3f
popq %rcx
movl %ecx, %r11d
jmp 0x23fde
xorl %r15d, %r15d
testl %r8d, %r8d
je 0x23f3e
pushq $-0x1
popq %rsi
movl %esi, %ebp
movl %ecx, %eax
movq %rdx, (%rsp)
movq %rdi, 0x10(%rsp)
xorl %r13d, %r13d
jmp 0x23fa1
testl %r9d, %r9d
je 0x24750
movl %r8d, %eax
imull 0x18(%rsp), %eax
addl %r9d, %eax
decl %eax
movl %r9d, %esi
decl %esi
cltq
movq (%r13), %r9
movq 0x8(%r13), %r10
movq (%r9,%rax,8), %r9
movq %r9, (%rsp)
movq (%r10,%rax,8), %rax
movq %rax, 0x10(%rsp)
pushq $0x3f
popq %rax
movl %eax, %r11d
movl %esi, %r9d
cmpl $0x2, %r15d
jl 0x23ef0
movq 0x18(%r13), %rax
addl $-0x2, %r15d
cmpl (%rax,%r15,4), %r9d
jge 0x23f29
xorl %r13d, %r13d
pushq $-0x1
popq %rsi
movl %ebp, %r10d
jmp 0x23fd1
movl %ebp, %r10d
xorl %r15d, %r15d
testl %r8d, %r8d
je 0x23f54
pushq $-0x1
popq %rsi
movl %esi, %ebp
movl %esi, %eax
xorl %r13d, %r13d
jmp 0x23fd5
movq 0x20(%r10), %rax
cmpl (%rax,%r15,4), %r9d
jle 0x23f73
xorl %r13d, %r13d
pushq $-0x1
popq %rsi
movl %esi, %ebp
movl %ecx, %eax
movq %rdx, (%rsp)
movq %rdi, 0x10(%rsp)
jmp 0x23fa1
movl %ebp, %r10d
movq 0x20(%r13), %rax
cmpl (%rax,%r15,4), %r9d
jle 0x23faf
xorl %r13d, %r13d
jmp 0x23fce
movb $0x1, %r13b
movl %ecx, %eax
movq %rdx, (%rsp)
movq %rdi, 0x10(%rsp)
movl %ebx, %r12d
movl %r9d, %ebx
jmp 0x23faa
movl %r9d, %eax
shll $0x6, %eax
leal (%rax,%r11), %ebp
incl %ebp
movl %eax, %esi
addl %r11d, %esi
movb $0x1, %r13b
pushq $-0x1
popq %rax
movl %ecx, %r12d
jmp 0x23d3a
imull 0x18(%rsp), %r15d
addl %r9d, %r15d
movslq %r15d, %rax
movq (%r10), %rsi
movq 0x8(%r10), %r15
movq %rdx, (%rsp)
movq (%rsi,%rax,8), %rdx
movq %rdi, 0x10(%rsp)
movq (%r15,%rax,8), %rdi
movb $0x1, %r13b
pushq $-0x1
popq %rsi
movl %esi, %ebp
movl %ecx, %eax
movl %ebx, %r12d
movl %r9d, %ebx
movl %r8d, %r15d
movb $0x2, %r10b
jmp 0x23fde
imull 0x18(%rsp), %r15d
addl %r9d, %r15d
movslq %r15d, %rax
movq (%r13), %rdx
movq 0x8(%r13), %rsi
movq (%rdx,%rax,8), %rdx
movq (%rsi,%rax,8), %rdi
movb $0x1, %r13b
pushq $-0x1
popq %rsi
movl %esi, %ebp
movl %esi, %eax
movl %ecx, %r12d
movl %r9d, %ebx
movl %r8d, %r15d
movl %r12d, %r14d
movq 0xf8(%rsp), %rcx
movq (%rcx), %rcx
movq 0x100(%rsp), %r12
movslq (%r12), %r8
leal 0x1(%r8), %r9d
movl %r9d, (%r12)
movb %r10b, (%rcx,%r8)
movl %eax, %r12d
movl %esi, %eax
movl %ebx, %r9d
jmp 0x23bf6
movq 0x10(%rbx), %rcx
imull 0x18(%rsp), %eax
addl %r9d, %eax
cltq
movl -0x4(%rcx,%rax,4), %ecx
pushq $-0x1
popq %rax
movl %eax, %ebx
jmp 0x23cdc
imull %r13d, %r8d
addl %ebx, %r8d
movslq %r8d, %rdi
movq (%rax,%rdi,8), %rdx
movq (%rsi,%rdi,8), %rdi
movb $0x1, %r10b
movl %ecx, %ebp
pushq $-0x1
popq %rsi
movl %esi, %eax
movb $0x1, %r13b
jmp 0x23e60
movl %r12d, %r15d
sarl $0x6, %r15d
movl %r15d, (%rsp)
shll $0x6, %r15d
subl %r12d, %r15d
movq %rdi, %rbp
movq %rsi, 0xa0(%rsp)
movl %r12d, %edx
callq 0x22b6d
movq %rax, %r14
movq %rax, 0x20(%rsp)
movl %ebp, %edi
movq %rbx, 0x98(%rsp)
movq %rbx, %rsi
movl %r12d, %edx
movq 0xe0(%rsp), %rcx
callq 0x22b6d
movq %rax, 0x40(%rsp)
pushq $0x2
popq %rcx
movl %r13d, %eax
cltd
idivl %ecx
movl %r13d, %ebp
subl %eax, %ebp
leaq 0x58(%rsp), %rcx
andq $0x0, (%rcx)
movq %rcx, %r10
movq %rax, 0x70(%rsp)
decl %eax
leaq 0x68(%rsp), %rbx
leaq 0x6c(%rsp), %r11
movq %r14, %rdi
movl %r15d, %esi
movl (%rsp), %edx
movl %r12d, %ecx
movq 0x18(%rsp), %r8
movl %r13d, %r9d
pushq %rax
pushq %r10
pushq $0x0
pushq %rbx
pushq %r11
movl 0x118(%rsp), %ebx
pushq %rbx
callq 0x23217
addq $0x30, %rsp
movq %rbx, %r11
movl %eax, %ebx
leaq 0x50(%rsp), %rax
andq $0x0, (%rax)
movq %rbp, 0x38(%rsp)
leal -0x1(%rbp), %r10d
movq 0x40(%rsp), %r14
movq %r14, %rdi
movl %r15d, 0x28(%rsp)
movl %r15d, %esi
movl (%rsp), %edx
movq %r12, 0x8(%rsp)
movl %r12d, %ecx
movq 0x10(%rsp), %r8
movl %r13d, %r9d
pushq %r10
pushq %rax
pushq $0x0
leaq 0x80(%rsp), %rax
pushq %rax
leaq 0x8c(%rsp), %rax
pushq %rax
pushq %r11
callq 0x23217
addq $0x30, %rsp
movl %eax, %r13d
movq 0x20(%rsp), %rdi
callq 0x6500
movq %r14, %rdi
callq 0x6500
leaq 0x58(%rsp), %rax
movq (%rax), %r15
cmpl $0x1, %ebx
je 0x2423d
cmpl $0x1, %r13d
je 0x2423d
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
movq 0x18(%r15), %rax
movq 0x20(%r15), %rcx
movslq (%rax), %rbx
movslq (%rcx), %r14
movl %r14d, %eax
subl %ebx, %eax
shll $0x6, %eax
addl $0x40, %eax
movq %rax, 0x20(%rsp)
cltq
leaq (,%rax,4), %rdi
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x6030
movq %rax, %r13
movq %rax, %rbp
movq %rbx, %rcx
cmpq %r14, %rcx
jg 0x2427e
movq (%r15), %rdx
movq 0x8(%r15), %rsi
movq (%rdx,%rcx,8), %rdx
movq (%rsi,%rcx,8), %rsi
movq 0x10(%r15), %rdi
movl (%rdi,%rcx,4), %edi
movq %rcx, %r8
subq %rbx, %r8
shlq $0x8, %r8
movl $0xfc, %r9d
movq %r12, %r10
testq %r9, %r9
je 0x2422c
movl %edi, (%rbp,%r9)
movq %r10, %r11
andq %rdx, %r11
cmpq $0x1, %r11
adcl $-0x1, %edi
movq %r10, %r11
andq %rsi, %r11
cmpq $0x1, %r11
sbbl $-0x1, %edi
shrq %r10
addq $-0x4, %r9
jmp 0x241ff
movl %edi, (%r13,%r8)
incq %rcx
addq $0x100, %rbp            # imm = 0x100
jmp 0x241cd
testq %r15, %r15
je 0x24255
movq %r15, %rdi
callq 0x24b8c
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x63e0
movq 0x50(%rsp), %r14
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x247c1
movq %r14, %rdi
callq 0x24b8c
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x63e0
jmp 0x247c1
movq %rax, 0x90(%rsp)
movq %r13, 0x40(%rsp)
movl (%rsp), %eax
decl %eax
xorl %ecx, %ecx
cmpl %eax, %r14d
cmovel 0x28(%rsp), %ecx
movq %rcx, 0x30(%rsp)
movq 0x50(%rsp), %rbp
movq 0x18(%rbp), %rax
movq 0x20(%rbp), %rcx
movslq (%rax), %r13
movslq (%rcx), %r14
movl %r14d, %eax
subl %r13d, %eax
shll $0x6, %eax
addl $0x40, %eax
movq %rax, 0x88(%rsp)
cltq
leaq (,%rax,4), %rdi
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x6030
movq %r14, %r11
shlq $0x8, %r11
movq %r13, %rcx
shlq $0x8, %rcx
subq %rcx, %r11
addq %rax, %r11
movq %r14, %rcx
subq %r13, %rcx
jl 0x2435b
movq (%rbp), %rdx
movq 0x8(%rbp), %rsi
movq (%rdx,%r13,8), %rdx
movq (%rsi,%r13,8), %rsi
movq 0x10(%rbp), %rdi
movl (%rdi,%r13,4), %edi
shlq $0x8, %rcx
xorl %r8d, %r8d
movq %r12, %r9
cmpq $0x3f, %r8
je 0x24348
movl %edi, (%r11,%r8,4)
movq %r9, %r10
andq %rdx, %r10
cmpq $0x1, %r10
adcl $-0x1, %edi
movq %r9, %r10
andq %rsi, %r10
cmpq $0x1, %r10
sbbl $-0x1, %edi
shrq %r9
incq %r8
jmp 0x2431c
movl %edi, 0xfc(%rax,%rcx)
incq %r13
addq $-0x100, %r11
jmp 0x242f2
movq %rax, (%rsp)
movl %ebx, %r12d
shll $0x6, %r14d
movq 0x8(%rsp), %r13
subl %r14d, %r13d
leal -0x40(%r13), %r14d
movq %r14, 0x80(%rsp)
sarl $0x1f, %r14d
andl 0x28(%rsp), %r14d
testq %r15, %r15
je 0x24390
movq %r15, %rdi
callq 0x24b8c
shll $0x6, %r12d
movq 0x20(%rsp), %rax
subl 0x30(%rsp), %eax
movq %rax, 0x20(%rsp)
leal (%r14,%r13), %eax
addl $-0x40, %eax
movq %rax, 0x28(%rsp)
movslq %r14d, %r14
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x63e0
testq %rbp, %rbp
je 0x243c9
movq %rbp, %rdi
callq 0x24b8c
pushq $0x28
popq %rsi
movq %rbp, %rdi
callq 0x63e0
movq 0x28(%rsp), %r9
leal -0x1(%r9), %edx
movq 0x20(%rsp), %r13
leal (%r12,%r13), %eax
movl %eax, 0x30(%rsp)
leal -0x1(%r13,%r12), %esi
movq 0x88(%rsp), %rdi
movq 0x80(%rsp), %rax
leal (%rdi,%rax), %ecx
addl %eax, %edi
addl $-0x2, %edi
cmpl %edi, %esi
cmovll %esi, %edi
movslq %r12d, %r8
cmpl %edx, %r8d
cmovgl %r8d, %edx
movslq %edx, %rdx
movslq %edi, %r11
movslq %r9d, %r9
leal -0x1(%rdx), %esi
shlq $0x2, %r8
movq 0x90(%rsp), %rbp
subq %r8, %rbp
movq %r14, %rax
leaq (,%r14,4), %r8
shlq $0x2, %r9
subq %r9, %r8
movq (%rsp), %rdi
addq %rdi, %r8
addq $0x4, %r8
pushq $-0x1
popq %r14
movl %r14d, %r12d
movl %r14d, %r15d
movl 0xf0(%rsp), %r10d
movq 0x40(%rsp), %rdi
cmpq %r11, %rdx
jg 0x24489
movl (%rbp,%rdx,4), %r12d
movl (%r8,%rdx,4), %r15d
incq %rdx
leal (%r15,%r12), %r9d
incl %esi
cmpl %r10d, %r9d
jne 0x24465
movb $0x1, %bpl
movl %esi, %r14d
jmp 0x2448b
xorl %ebp, %ebp
testl %ebx, %ebx
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
jne 0x244c5
testb %bpl, %bpl
jne 0x244c5
cmpl $0x0, 0x28(%rsp)
jne 0x244c5
movl (%rdx,%rax,4), %r15d
movq 0x70(%rsp), %r12
leal (%r15,%r12), %edx
cmpl %r10d, %edx
pushq $-0x1
popq %rdx
cmovel %edx, %r14d
movzbl %bpl, %edx
pushq $0x1
popq %rbp
cmovnel %edx, %ebp
cmpl %esi, %ecx
jne 0x244f9
cmpl %esi, 0x30(%rsp)
jne 0x244f9
testb %bpl, %bpl
jne 0x244f9
movslq %r13d, %rax
movl -0x4(%rdi,%rax,4), %r12d
movq 0x38(%rsp), %r15
leal (%r12,%r15), %eax
leal -0x1(%rsi), %ecx
cmpl %r10d, %eax
cmovel %ecx, %r14d
movzbl %bpl, %eax
pushq $0x1
popq %rbp
cmovnel %eax, %ebp
callq 0x6500
movq (%rsp), %rdi
callq 0x6500
testb %bpl, %bpl
je 0x2467c
leal 0x1(%r14), %edx
movq 0x8(%rsp), %rcx
subl %edx, %ecx
leaq 0x48(%rsp), %rax
andq $0x0, (%rax)
movslq %ecx, %rcx
movq %rcx, (%rsp)
movq 0x98(%rsp), %rbx
leaq (%rbx,%rcx), %rsi
movslq 0x38(%rsp), %r8
addq 0x10(%rsp), %r8
subq $0x8, %rsp
leaq 0x6c(%rsp), %r10
movq 0xa8(%rsp), %rbp
movq %rbp, %rdi
movq %r14, 0x10(%rsp)
movq 0x20(%rsp), %r14
movq %r14, %rcx
movq 0x78(%rsp), %r13
movl %r13d, %r9d
pushq %r10
pushq %rax
pushq %r12
movl 0x108(%rsp), %eax
pushq %rax
movq 0x108(%rsp), %rax
pushq %rax
callq 0x239f0
addq $0x30, %rsp
movl %eax, %r12d
leaq 0x78(%rsp), %rax
andq $0x0, (%rax)
movslq 0x8(%rsp), %rcx
leaq (%rcx,%rbp), %rdi
incq %rdi
movslq %r13d, %rcx
addq %r14, %rcx
subq $0x8, %rsp
leaq 0x68(%rsp), %r10
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %r8
movq 0x40(%rsp), %r9
pushq %r10
pushq %rax
pushq %r15
movl 0x108(%rsp), %eax
pushq %rax
pushq 0x108(%rsp)
callq 0x239f0
addq $0x30, %rsp
orl %r12d, %eax
je 0x246e8
movq 0x48(%rsp), %rdi
callq 0x64b0
pushq $0x1
popq %rbx
movq 0x78(%rsp), %r14
jmp 0x24746
movq 0xf8(%rsp), %rbx
movq (%rbx), %rax
movq 0x100(%rsp), %r12
movslq (%r12), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r12)
movb $0x2, (%rax,%rcx)
xorl %eax, %eax
movq 0x8(%rsp), %r13
cmpl %esi, %eax
jg 0x24784
movq (%rbx), %rcx
movslq (%r12), %rdx
leal 0x1(%rdx), %edi
movl %edi, (%r12)
movb $0x1, (%rcx,%rdx)
incl %eax
jmp 0x24628
movq (%rbx), %rax
movslq (%r12), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r12)
movb %bpl, (%rax,%rcx)
xorl %eax, %eax
testl %esi, %esi
cmovgl %esi, %eax
subl $0x1, %eax
jb 0x24784
movq (%rbx), %rcx
movslq (%r12), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%r12)
movb $0x1, (%rcx,%rdx)
jmp 0x2465f
pushq $0x1
popq %rbx
jmp 0x247c1
movq 0xf8(%rsp), %rbx
movq (%rbx), %rax
movq 0x100(%rsp), %r12
movslq (%r12), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r12)
movb $0x1, (%rax,%rcx)
xorl %eax, %eax
movq 0x8(%rsp), %r13
cmpl %r15d, %eax
jg 0x24784
movq (%rbx), %rcx
movslq (%r12), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%r12)
movb $0x2, (%rcx,%rdx)
incl %eax
jmp 0x246ad
imull 0x18(%rsp), %r13d
addl %r9d, %r13d
movslq %r13d, %rsi
movq (%rax,%rsi,8), %rdx
movq (%rcx,%rsi,8), %rdi
movb $0x1, %r13b
jmp 0x23bd4
movslq 0x64(%rsp), %rbx
movslq 0x60(%rsp), %r15
leaq (%r15,%rbx), %rdi
movq 0x100(%rsp), %rax
movl %edi, (%rax)
callq 0x6550
movq %rax, %r12
movq 0xf8(%rsp), %rax
movq %r12, (%rax)
movq 0x48(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x6350
addq %rbx, %r12
movq 0x78(%rsp), %r14
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x6350
movq %r13, %rdi
callq 0x64b0
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x64b0
jmp 0x247c1
movq (%rbx), %rax
movslq (%r12), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r12)
movb %bpl, (%rax,%rcx)
xorl %eax, %eax
testl %r15d, %r15d
cmovgl %r15d, %eax
subl $0x1, %eax
jb 0x24784
movq (%rbx), %rcx
movslq (%r12), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%r12)
movb $0x2, (%rcx,%rdx)
jmp 0x2476b
movq (%rbx), %rdi
movslq (%r12), %rsi
callq 0x6640
movq %rax, (%rbx)
movslq (%r12), %rsi
addq %rax, %rsi
movq %rax, %rdi
callq 0x24ed0
movq %r13, %rdi
callq 0x24b8c
pushq $0x28
popq %rsi
movq %r13, %rdi
callq 0x63e0
movq 0x20(%rsp), %rdi
callq 0x6500
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq