// File: /workspace/github_cpp_makefile_star2_O3/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 $0xb8, %rsp
movl %edx, %ebp
movq 0x110(%rsp), %r14
testl %edx, %edx
setne %al
testl %r9d, %r9d
setne %dl
testb %dl, %al
jne 0x2c04c
addl %ebp, %r9d
movl %r9d, (%r14)
movslq %r9d, %rbx
movq %rbx, %rdi
callq 0x6530
movq 0x108(%rsp), %rsi
movq %rax, (%rsi)
testl %ebx, %ebx
jle 0x2d1e9
xorl %ebx, %ebx
cmpl $0x1, %ebp
movl $0x0, %eax
adcb $0x1, %al
xorl %ecx, %ecx
movq (%rsi), %rdx
movb %al, (%rdx,%rcx)
incq %rcx
movslq (%r14), %rdx
cmpq %rdx, %rcx
jl 0x2c036
jmp 0x2d1eb
movq %rsi, %r13
movq %rdi, %r12
movl 0x100(%rsp), %eax
movq %rax, 0x10(%rsp)
movq 0xf0(%rsp), %r15
testb $0x3f, %bpl
movq %rbp, 0x28(%rsp)
movq %rcx, 0x58(%rsp)
movq %r9, 0x40(%rsp)
je 0x2c0bd
leal 0x3f(%rbp), %eax
testl %ebp, %ebp
cmovnsl %ebp, %eax
sarl $0x6, %eax
leal 0x4(,%rax,4), %edx
movl %eax, %esi
incl %esi
leal (%rdx,%rdx,4), %eax
cltq
movslq %r9d, %rdx
addq $0x8, %rax
imulq %rdx, %rax
movl %esi, 0x8(%rsp)
movl %esi, %edx
shll $0x6, %edx
subl %ebp, %edx
movl %edx, 0x38(%rsp)
cmpq $0xfffff, %rax          # imm = 0xFFFFF
jle 0x2c0f7
jmp 0x2c241
movl %ebp, %eax
sarl $0x6, %eax
movl %eax, 0x8(%rsp)
movl %ebp, %eax
sarl $0x4, %eax
leal (%rax,%rax,4), %eax
cltq
movslq %r9d, %rdx
addq $0x8, %rax
imulq %rdx, %rax
movl $0x0, 0x38(%rsp)
cmpq $0x100000, %rax         # imm = 0x100000
jge 0x2c241
movl $0x0, 0x38(%rsp)
movq $0x0, 0x78(%rsp)
movl 0xf8(%rsp), %eax
movq %rax, %rbx
incl %eax
imull 0x8(%rsp), %eax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x6030
testl %ebx, %ebx
js 0x2c1ce
movslq 0x28(%rsp), %rbx
movl 0x8(%rsp), %ecx
xorl %esi, %esi
xorl %edx, %edx
cmpl $0x0, 0x8(%rsp)
jle 0x2c1ba
movl %esi, %r8d
imull 0x8(%rsp), %r8d
movzbl %dl, %edi
leaq (%rax,%r8,8), %r8
movl $0x3f, %r9d
xorl %r10d, %r10d
movq $-0x1, %r11
movl 0xf8(%rsp), %r14d
cmpl %r14d, %esi
jae 0x2c1aa
movq %r10, %r14
shlq $0x6, %r14
movq %r9, %r13
xorl %r11d, %r11d
addq %r11, %r11
cmpq %rbx, %r13
jge 0x2c19a
movzbl (%r12,%r13), %ebp
shll $0x8, %ebp
addq %r15, %rbp
cmpb $0x1, (%rdi,%rbp)
jne 0x2c19e
orq $0x1, %r11
leaq -0x1(%r13), %rbp
cmpq %r14, %r13
movq %rbp, %r13
ja 0x2c181
movq %r11, (%r8,%r10,8)
incq %r10
addq $0x40, %r9
cmpq %rcx, %r10
jne 0x2c160
incb %dl
movzbl %dl, %esi
movl 0xf8(%rsp), %edi
cmpl %edi, %esi
jle 0x2c140
movq %rax, %rdi
leaq 0x78(%rsp), %rbx
leaq 0x68(%rsp), %rax
leaq 0x70(%rsp), %r10
movq %rdi, 0x48(%rsp)
movl 0x38(%rsp), %esi
movl 0x8(%rsp), %edx
movq 0x28(%rsp), %r14
movl %r14d, %ecx
movq 0x58(%rsp), %r8
movq 0x40(%rsp), %r9
pushq $-0x1
pushq %rbx
pushq $0x1
pushq %rax
pushq %r10
movl 0x128(%rsp), %eax
pushq %rax
callq 0x2b598
addq $0x30, %rsp
movq (%rbx), %rax
movq %rax, 0x30(%rsp)
testb $0x3f, %r14b
je 0x2c341
leal 0x3f(%r14), %r12d
testl %r14d, %r14d
cmovnsl %r14d, %r12d
sarl $0x6, %r12d
incl %r12d
jmp 0x2c348
movq %r8, 0x48(%rsp)
movl 0xf8(%rsp), %eax
movq %rax, %rbx
leal 0x1(%rax), %ecx
movl 0x8(%rsp), %eax
movq %rcx, 0x10(%rsp)
imull %ecx, %eax
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x6030
movq %rax, 0x20(%rsp)
movslq %ebp, %r14
testl %ebx, %ebx
js 0x2c322
movl 0x8(%rsp), %eax
xorl %edx, %edx
xorl %ecx, %ecx
cmpl $0x0, 0x8(%rsp)
jle 0x2c30e
movl %edx, %edi
imull 0x8(%rsp), %edi
movzbl %cl, %esi
movq 0x20(%rsp), %r8
leaq (%r8,%rdi,8), %rdi
movl $0x3f, %r8d
xorl %r9d, %r9d
movq $-0x1, %r10
movl 0xf8(%rsp), %r11d
cmpl %r11d, %edx
jae 0x2c2fe
movq %r9, %r11
shlq $0x6, %r11
movq %r8, %rbp
xorl %r10d, %r10d
addq %r10, %r10
cmpq %r14, %rbp
jge 0x2c2ee
movzbl (%r12,%rbp), %ebx
shll $0x8, %ebx
addq %r15, %rbx
cmpb $0x1, (%rsi,%rbx)
jne 0x2c2f2
orq $0x1, %r10
leaq -0x1(%rbp), %rbx
cmpq %r11, %rbp
movq %rbx, %rbp
ja 0x2c2d5
movq %r10, (%rdi,%r9,8)
incq %r9
addq $0x40, %r8
cmpq %rax, %r9
jne 0x2c2b4
incb %cl
movzbl %cl, %edx
movl 0xf8(%rsp), %esi
cmpl %esi, %edx
jle 0x2c291
movq 0x28(%rsp), %rax
testb $0x3f, %al
je 0x2c8ba
leal 0x3f(%rax), %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
sarl $0x6, %ebx
incl %ebx
jmp 0x2c8bf
movl %r14d, %r12d
sarl $0x6, %r12d
movq 0x110(%rsp), %rbx
movq %r14, %rax
movl %r12d, %ebp
shll $0x6, %ebp
subl %eax, %ebp
movq 0x40(%rsp), %r15
leal -0x1(%r15), %r14d
addl %r15d, %eax
decl %eax
movslq %eax, %rdi
callq 0x6530
movq 0x108(%rsp), %rcx
movq %rax, (%rcx)
movl $0x0, (%rbx)
movq %r15, %r8
leal -0x1(%r12), %r15d
movq 0x30(%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
movl %r12d, %edx
imull %r14d, %edx
addl %r12d, %edx
decl %edx
movslq %edx, %rdx
movq (%rax,%rdx,8), %rdi
movq (%rcx,%rdx,8), %r9
cmpl $0x2, %r8d
movq %r12, 0x28(%rsp)
jl 0x2c3d4
movq 0x18(%rsi), %rdx
addl $-0x2, %r8d
cmpl (%rdx,%r8,4), %r12d
jle 0x2c3d4
movq 0x20(%rsi), %rdx
cmpl (%rdx,%r8,4), %r15d
jle 0x2d0b5
xorl %r10d, %r10d
xorl %ebx, %ebx
xorl %r8d, %r8d
movl %ebp, %ecx
shlq %cl, %rdi
movq %rdi, 0x20(%rsp)
shlq %cl, %r9
movq %r9, 0x18(%rsp)
movl $0x3f, %eax
subl %ebp, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %r10d, %r13d
movl %ecx, %edx
movl %r15d, %edi
shll $0x6, %edi
leal (%rdi,%rax), %ebp
testl %r14d, %r14d
sete %r10b
leal 0x1(%rdi,%rax), %r12d
cmovel %r12d, %edx
movl %esi, %r11d
cmovel %ebp, %r11d
orb %r13b, %r10b
cmpl $-0x1, %edx
movq %rax, 0x8(%rsp)
je 0x2c447
cmpl $-0x1, %r11d
je 0x2c4a2
movq 0x10(%rsp), %r13
jmp 0x2c506
testb $0x1, %r10b
je 0x2c4c2
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rdx
movq 0x8(%rsp), %rax
leal -0x1(%r14), %esi
imull 0x28(%rsp), %esi
addl %r15d, %esi
movslq %esi, %rsi
movl (%rdx,%rsi,4), %r13d
movl $0x3f, %edx
subl %eax, %edx
testl %edx, %edx
jle 0x2c790
leal -0x3f(%rax), %esi
movq %rbx, %rax
sarq $0x3f, %rax
movq %r8, %rdx
shrq $0x3f, %rdx
addl %r13d, %edx
addl %eax, %edx
addq %rbx, %rbx
addq %r8, %r8
movl %edx, %r13d
incl %esi
jne 0x2c480
jmp 0x2c437
cmpl $-0x1, %edx
movq 0x10(%rsp), %r13
je 0x2c4d1
movq %rbx, %rax
sarq $0x3f, %rax
movq %r8, %r11
shrq $0x3f, %r11
addl %eax, %r11d
addl %edx, %r11d
jmp 0x2c506
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $-0x1, %esi
movq 0x10(%rsp), %r13
jne 0x2c506
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
testl %r14d, %r14d
jle 0x2c500
movq 0x30(%rsp), %rcx
movq 0x18(%rcx), %rax
leal -0x1(%r14), %esi
cmpl (%rax,%rsi,4), %r15d
jle 0x2c500
leal -0x1(%r15), %eax
movq 0x20(%rcx), %r11
cmpl (%r11,%rsi,4), %eax
jle 0x2c87d
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r9d
jne 0x2c540
movq 0x20(%rsp), %rsi
movq %rsi, %rax
sarq $0x3f, %rax
movl %r12d, %ecx
movq 0x18(%rsp), %r12
movq %r12, %r9
shrq $0x3f, %r9
addl %eax, %r9d
addl %r13d, %r9d
addq %rsi, %rsi
movq %rsi, 0x20(%rsp)
addq %r12, %r12
movq %r12, 0x18(%rsp)
movl %ecx, %r12d
cmpl $-0x1, %r9d
je 0x2c581
leal 0x1(%r9), %eax
cmpl %r13d, %eax
jne 0x2c581
movq 0x8(%rsp), %rax
testl %eax, %eax
je 0x2c63e
decl %eax
movq %rax, 0x8(%rsp)
addq %rbx, %rbx
addq %r8, %r8
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movb $0x1, %r13b
movl %r11d, %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %r15d, %edx
jmp 0x2c842
cmpl $-0x1, %edx
je 0x2c5e8
leal 0x1(%rdx), %eax
cmpl %r13d, %eax
jne 0x2c5e8
testl %r14d, %r14d
je 0x2ce5a
leal -0x1(%r14), %esi
cmpl $0x2, %r14d
jl 0x2c6d4
movq 0x30(%rsp), %r10
movq 0x18(%r10), %rax
addl $-0x2, %r14d
movb $0x2, %r13b
cmpl (%rax,%r14,4), %r15d
jl 0x2c5c9
movq 0x20(%r10), %rax
cmpl (%rax,%r14,4), %r15d
jle 0x2c7d2
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r10d, %r10d
movl %r11d, %edi
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
jmp 0x2c807
cmpl $-0x1, %r11d
movq 0x108(%rsp), %r9
je 0x2d17b
xorl %eax, %eax
cmpl %r13d, %r11d
setne %al
leal (%rax,%rax,2), %r13d
testl %r14d, %r14d
je 0x2ceab
leal -0x1(%r14), %esi
movq 0x8(%rsp), %rax
testl %eax, %eax
movq 0x30(%rsp), %r10
je 0x2c701
decl %eax
leaq (%rbx,%rbx), %rdx
movq %rdx, 0x20(%rsp)
leaq (%r8,%r8), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x2c73e
testl %r15d, %r15d
je 0x2cf54
leal -0x1(%r15), %edx
movq 0x30(%rsp), %rbp
movq (%rbp), %rsi
movq 0x8(%rbp), %r12
movl %r14d, %eax
imull 0x28(%rsp), %eax
addl %r15d, %eax
decl %eax
cltq
movq (%rsi,%rax,8), %rdi
movq %rdi, 0x20(%rsp)
movq (%r12,%rax,8), %rax
movq %rax, 0x18(%rsp)
movl $0x3f, %eax
movq %rax, 0x8(%rsp)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movb $0x1, %r13b
testl %r14d, %r14d
jle 0x2c6c4
movq 0x18(%rbp), %rax
leal -0x1(%r14), %r10d
cmpl (%rax,%r10,4), %r15d
jle 0x2c6c4
movq 0x20(%rbp), %rax
cmpl (%rax,%r10,4), %edx
movq 0x110(%rsp), %r15
jle 0x2c896
xorl %r10d, %r10d
movl %r11d, %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x2c84a
xorl %r10d, %r10d
movl %r11d, %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x2c842
movb $0x2, %r13b
xorl %r14d, %r14d
testl %esi, %esi
je 0x2c798
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %r11d, %edi
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
xorl %r10d, %r10d
jmp 0x2c807
testl %r15d, %r15d
je 0x2d143
movl %esi, %eax
imull 0x28(%rsp), %eax
addl %r15d, %eax
decl %eax
movl %r15d, %edx
decl %edx
cltq
movq (%r10), %rcx
movq 0x8(%r10), %rdi
movq (%rcx,%rax,8), %rcx
movq %rcx, 0x20(%rsp)
movq (%rdi,%rax,8), %rax
movq %rax, 0x18(%rsp)
movl $0x3f, %eax
movl %edx, %r15d
movq %rax, 0x8(%rsp)
cmpl $0x2, %r14d
jl 0x2c772
movq 0x18(%r10), %rax
addl $-0x2, %r14d
cmpl (%rax,%r14,4), %r15d
jl 0x2c765
movq 0x20(%r10), %rax
cmpl (%rax,%r14,4), %r15d
jle 0x2c80c
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r10d, %r10d
jmp 0x2c82f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
testl %esi, %esi
je 0x2c7b3
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r10d, %r10d
jmp 0x2c839
movl %r13d, %edx
jmp 0x2c437
movl %r12d, %ecx
movb $0x1, %r10b
movl %r11d, %edi
movq %rbx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl %edx, %r9d
jmp 0x2c579
movl %r15d, %eax
shll $0x6, %eax
movq 0x8(%rsp), %rdx
leal (%rax,%rdx), %ecx
incl %ecx
movl %eax, %ebp
addl %edx, %ebp
movb $0x1, %r10b
movl %r11d, %r9d
jmp 0x2c579
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
imull 0x28(%rsp), %r14d
addl %r15d, %r14d
movslq %r14d, %rax
movq (%r10), %rdi
movq 0x8(%r10), %r10
movq %rbx, 0x20(%rsp)
movq (%rdi,%rax,8), %rbx
movq %r8, 0x18(%rsp)
movq (%r10,%rax,8), %r8
movb $0x1, %r10b
movl %r11d, %edi
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %edx, %r9d
jmp 0x2c83c
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
imull 0x28(%rsp), %r14d
addl %r15d, %r14d
movslq %r14d, %rax
movq (%r10), %rdx
movq 0x8(%r10), %rdi
movq (%rdx,%rax,8), %rbx
movq (%rdi,%rax,8), %r8
movb $0x1, %r10b
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %r11d, %r9d
movl %r15d, %edx
movl %esi, %r14d
movq 0x110(%rsp), %r15
movl %r9d, %r12d
movq %r12, 0x10(%rsp)
movq 0x108(%rsp), %rax
movq (%rax), %rax
movslq (%r15), %rsi
leal 0x1(%rsi), %r11d
movl %r11d, (%r15)
movb %r13b, (%rax,%rsi)
movl %edi, %r9d
movl %ebp, %esi
movl %edx, %r15d
movq 0x8(%rsp), %rax
jmp 0x2c405
movq 0x10(%rcx), %rax
imull 0x28(%rsp), %esi
addl %r15d, %esi
movslq %esi, %rsi
movl -0x4(%rax,%rsi,4), %r11d
jmp 0x2c506
imull 0x28(%rsp), %r10d
addl %edx, %r10d
movslq %r10d, %rax
movq (%rsi,%rax,8), %rbx
movq (%r12,%rax,8), %r8
movb $0x1, %r13b
movl %r11d, %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movb $0x1, %r10b
jmp 0x2c84a
movl %eax, %ebx
sarl $0x6, %ebx
movq 0x10(%rsp), %rcx
imull %ebx, %ecx
leaq (,%rcx,8), %rax
testl %ecx, %ecx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x6030
movq %rax, 0x18(%rsp)
movl 0xf8(%rsp), %eax
testl %eax, %eax
js 0x2c991
movl %ebx, %eax
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebx, 0x10(%rsp)
testl %ebx, %ebx
jle 0x2c979
movl %edx, %edi
imull 0x10(%rsp), %edi
movzbl %cl, %esi
movq 0x18(%rsp), %r8
leaq (%r8,%rdi,8), %rdi
movl $0x3f, %ebp
xorl %r9d, %r9d
movq $-0x1, %r10
movl 0xf8(%rsp), %r8d
cmpl %r8d, %edx
jae 0x2c969
movq %r9, %r11
shlq $0x6, %r11
movq %rbp, %r8
xorl %r10d, %r10d
addq %r10, %r10
cmpq %r14, %r8
jge 0x2c959
movzbl (%r13,%r8), %ebx
shll $0x8, %ebx
addq %r15, %rbx
cmpb $0x1, (%rsi,%rbx)
jne 0x2c95d
orq $0x1, %r10
leaq -0x1(%r8), %rbx
cmpq %r11, %r8
movq %rbx, %r8
ja 0x2c93f
movq %r10, (%rdi,%r9,8)
incq %r9
addq $0x40, %rbp
cmpq %rax, %r9
jne 0x2c91e
incb %cl
movzbl %cl, %edx
movl 0xf8(%rsp), %esi
cmpl %esi, %edx
movl 0x10(%rsp), %ebx
jle 0x2c8ff
movq 0x40(%rsp), %rbx
movl %ebx, %eax
shrl $0x1f, %eax
addl %ebx, %eax
sarl %eax
movl %ebx, %ebp
subl %eax, %ebp
xorl %edx, %edx
leaq 0x78(%rsp), %rcx
movq %rdx, (%rcx)
movq %rcx, %r10
movq %rax, 0xa0(%rsp)
decl %eax
leaq 0x90(%rsp), %r11
movq 0x20(%rsp), %rdi
movl 0x38(%rsp), %esi
movl 0x8(%rsp), %edx
movq 0x28(%rsp), %r14
movl %r14d, %ecx
movq 0x58(%rsp), %r8
movl %ebx, %r9d
pushq %rax
pushq %r10
movl $0x0, %eax
pushq %rax
pushq %r11
leaq 0xb4(%rsp), %rax
pushq %rax
movl 0x128(%rsp), %eax
pushq %rax
callq 0x2b598
addq $0x30, %rsp
movl %eax, 0x10(%rsp)
leaq 0x70(%rsp), %rax
xorl %r11d, %r11d
movq %r11, (%rax)
movq %rbp, 0x60(%rsp)
leal -0x1(%rbp), %r10d
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movl 0x38(%rsp), %esi
movl 0x8(%rsp), %edx
movl %r14d, %ecx
movq 0x48(%rsp), %r8
movl %ebx, %r9d
pushq %r10
pushq %rax
pushq %r11
leaq 0xa8(%rsp), %rax
pushq %rax
leaq 0xb4(%rsp), %rax
pushq %rax
movl 0x128(%rsp), %eax
pushq %rax
callq 0x2b598
addq $0x30, %rsp
movl %eax, %r14d
movq 0x20(%rsp), %rdi
callq 0x64f0
movq %rbp, %rdi
callq 0x64f0
leaq 0x78(%rsp), %rax
movq (%rax), %rbx
cmpl $0x1, 0x10(%rsp)
je 0x2ce13
cmpl $0x1, %r14d
je 0x2ce13
movq 0x18(%rbx), %rax
movq %rbx, 0x50(%rsp)
movq 0x20(%rbx), %rcx
movslq (%rax), %rbx
movl (%rcx), %r14d
movl %r14d, %eax
subl %ebx, %eax
shll $0x6, %eax
addl $0x40, %eax
movq %rax, 0x40(%rsp)
cltq
leaq (,%rax,4), %rdi
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x6030
movq %rbx, 0x10(%rsp)
movq %r14, 0x30(%rsp)
cmpl %ebx, %r14d
movq %rax, 0x20(%rsp)
jl 0x2cb79
movq 0x50(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rsi
movq 0x30(%rsp), %rcx
leal 0x1(%rcx), %edi
movq %rax, %r8
movq 0x10(%rsp), %r9
movq 0x18(%rsp), %rax
movq (%rax,%r9,8), %r10
movq (%rdx,%r9,8), %rbp
movl (%rsi,%r9,4), %r11d
movq %r9, %r14
subq 0x10(%rsp), %r14
shlq $0x8, %r14
movl $0x3f, %eax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movl %r11d, (%r8,%rax,4)
movq %rcx, %rbx
andq %r10, %rbx
cmpq $0x1, %rbx
adcl $-0x1, %r11d
movq %rcx, %rbx
andq %rbp, %rbx
cmpq $0x1, %rbx
sbbl $-0x1, %r11d
shrq %rcx
decq %rax
jne 0x2cb39
movq 0x20(%rsp), %rax
movl %r11d, (%rax,%r14)
incq %r9
addq $0x100, %r8             # imm = 0x100
cmpl %r9d, %edi
jne 0x2cb0d
movl 0x8(%rsp), %eax
decl %eax
xorl %ecx, %ecx
cmpl %eax, 0x30(%rsp)
cmovel 0x38(%rsp), %ecx
movl %ecx, 0x84(%rsp)
movq 0x70(%rsp), %rcx
movq 0x18(%rcx), %rax
movq %rcx, 0x98(%rsp)
movq 0x20(%rcx), %rcx
movslq (%rax), %r14
movslq (%rcx), %rbx
movl %ebx, %eax
subl %r14d, %eax
shll $0x6, %eax
addl $0x40, %eax
movq %rax, 0xb0(%rsp)
cltq
leaq (,%rax,4), %rdi
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x6030
movq %rax, 0x8(%rsp)
movq %rbx, %rdx
cmpl %r14d, %ebx
jl 0x2cc96
movq 0x98(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x10(%rax), %rsi
movq %rdx, %r8
leal 0x1(%rdx), %edi
shlq $0x8, %r8
movq %r14, %rax
shlq $0x8, %rax
subq %rax, %r8
addq 0x8(%rsp), %r8
movq 0x18(%rsp), %rax
movq (%rax,%r14,8), %r9
movq 0x30(%rsp), %rax
movq (%rax,%r14,8), %r11
movl (%rsi,%r14,4), %r10d
movq %rdx, %rbp
subq %r14, %rbp
shlq $0x8, %rbp
xorl %eax, %eax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movl %r10d, (%r8,%rax,4)
movq %rcx, %rbx
andq %r9, %rbx
cmpq $0x1, %rbx
adcl $-0x1, %r10d
movq %rcx, %rbx
andq %r11, %rbx
cmpq $0x1, %rbx
sbbl $-0x1, %r10d
shrq %rcx
incq %rax
cmpq $0x3f, %rax
jne 0x2cc4e
movq 0x8(%rsp), %rax
movl %r10d, 0xfc(%rax,%rbp)
incq %r14
addq $-0x100, %r8
cmpl %r14d, %edi
jne 0x2cc22
shll $0x6, %edx
movq 0x28(%rsp), %rbp
subl %edx, %ebp
leal -0x40(%rbp), %r14d
movq %r14, 0x30(%rsp)
sarl $0x1f, %r14d
andl 0x38(%rsp), %r14d
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2cccb
movq 0x50(%rsp), %rdi
callq 0x2db20
movq 0x50(%rsp), %rdi
movq 0x10(%rsp), %rax
movl %eax, %ebx
shll $0x6, %ebx
movq 0x40(%rsp), %rax
subl 0x84(%rsp), %eax
movq %rax, 0x40(%rsp)
leal (%r14,%rbp), %eax
addl $-0x40, %eax
movq %rax, 0x18(%rsp)
movl $0x28, %esi
callq 0x63c0
movq 0x98(%rsp), %rbp
testq %rbp, %rbp
je 0x2cd11
movq %rbp, %rdi
callq 0x2db20
movslq %r14d, %rax
movq %rax, 0x38(%rsp)
movl $0x28, %esi
movq %rbp, %rdi
callq 0x63c0
movq 0x18(%rsp), %rax
leal -0x1(%rax), %ecx
movq %rbx, %r11
cmpl %ecx, %r11d
movl %ecx, %edx
cmovgl %r11d, %edx
movq 0x40(%rsp), %rbx
leal -0x1(%rbx,%r11), %esi
movq 0xb0(%rsp), %r9
movq 0x30(%rsp), %rax
addl %r9d, %eax
addl $-0x2, %eax
cmpl %eax, %esi
cmovll %esi, %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
cmpl %eax, %edx
movq 0x20(%rsp), %r8
jg 0x2cdd3
cmpl %ecx, %r11d
cmovgl %r11d, %ecx
movslq %r11d, %rdx
movslq %ecx, %r14
movslq 0x18(%rsp), %rsi
shlq $0x2, %rdx
movq %r8, %rcx
subq %rdx, %rcx
subl %r14d, %eax
incl %eax
movq 0x38(%rsp), %rdx
leaq (,%rdx,4), %rdx
shlq $0x2, %rsi
subq %rsi, %rdx
movq 0x8(%rsp), %rsi
addq %rsi, %rdx
addq $0x4, %rdx
movl (%rcx,%r14,4), %ebp
movl (%rdx,%r14,4), %r10d
leal (%r10,%rbp), %esi
movl 0x100(%rsp), %edi
cmpl %edi, %esi
je 0x2cfa0
incq %r14
decl %eax
jne 0x2cdb1
addl 0x30(%rsp), %r9d
movq 0x10(%rsp), %rax
orl 0x18(%rsp), %eax
jne 0x2ceef
movq 0x8(%rsp), %rax
movq 0x38(%rsp), %rcx
movl (%rax,%rcx,4), %r10d
movq 0xa0(%rsp), %rbp
leal (%r10,%rbp), %eax
movl 0x100(%rsp), %ecx
cmpl %ecx, %eax
sete %dil
jmp 0x2cef1
testq %rbx, %rbx
je 0x2ce2d
movq %rbx, %rdi
callq 0x2db20
movl $0x28, %esi
movq %rbx, %rdi
callq 0x63c0
movq 0x70(%rsp), %r14
movl $0x1, %ebx
testq %r14, %r14
je 0x2d1eb
movq %r14, %rdi
callq 0x2db20
movl $0x28, %esi
movq %r14, %rdi
callq 0x63c0
jmp 0x2d1eb
movq 0x108(%rsp), %r9
movq (%r9), %rax
movq 0x110(%rsp), %r8
movslq (%r8), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%r8)
movb $0x2, (%rax,%rdx)
testl %ebp, %ebp
js 0x2d17b
movq 0x8(%rsp), %rax
addl %edi, %eax
incl %eax
movq (%r9), %rcx
movq 0x110(%rsp), %rdi
movslq (%rdi), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%rdi)
movb $0x1, (%rcx,%rdx)
decl %eax
jne 0x2ce8b
jmp 0x2d17b
movq (%r9), %rax
movq 0x110(%rsp), %r8
movslq (%r8), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%r8)
movb %r13b, (%rax,%rdx)
testl %ebp, %ebp
jle 0x2d17b
addl 0x8(%rsp), %edi
movq (%r9), %rax
movq 0x110(%rsp), %rsi
movslq (%rsi), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rsi)
movb $0x1, (%rax,%rcx)
decl %edi
jne 0x2cecf
jmp 0x2d17b
xorl %edi, %edi
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
cmpl %eax, %r9d
jne 0x2cf4b
addl %ebx, %r11d
cmpl %eax, %r11d
jne 0x2cf4b
testb %dil, %dil
jne 0x2cf4b
movslq %ebx, %rax
movl -0x4(%r8,%rax,4), %ebp
movq 0x60(%rsp), %rsi
leal (%rsi,%rbp), %eax
movq 0x28(%rsp), %rcx
decl %ecx
movl 0x100(%rsp), %edx
cmpl %edx, %eax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmovel %ecx, %r14d
movzbl %dil, %eax
movl $0x1, %ebx
cmovnel %eax, %ebx
movq %rsi, 0x10(%rsp)
jmp 0x2cfa7
movq %r10, 0x10(%rsp)
movl %edi, %ebx
jmp 0x2cfa7
movq 0x108(%rsp), %r9
movq (%r9), %rax
movq 0x110(%rsp), %rsi
movslq (%rsi), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rsi)
movb $0x1, (%rax,%rcx)
testl %r14d, %r14d
js 0x2d17b
incl %r14d
movq (%r9), %rax
movq 0x110(%rsp), %rsi
movslq (%rsi), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rsi)
movb $0x2, (%rax,%rcx)
decl %r14d
jne 0x2cf7f
jmp 0x2d17b
movq %r10, 0x10(%rsp)
movb $0x1, %bl
movq %r8, %rdi
callq 0x64f0
movq 0x8(%rsp), %rdi
callq 0x64f0
testb %bl, %bl
je 0x2d0ab
leal 0x1(%r14), %edx
movq 0x28(%rsp), %rcx
subl %edx, %ecx
xorl %esi, %esi
leaq 0x68(%rsp), %rax
movq %rsi, (%rax)
movslq %ecx, %rcx
movq %rcx, 0x8(%rsp)
leaq (%rcx,%r13), %rsi
movslq 0x60(%rsp), %r8
addq 0x48(%rsp), %r8
subq $0x8, %rsp
leaq 0x94(%rsp), %r10
movq %r12, %rdi
movq 0x60(%rsp), %rcx
movq 0xa8(%rsp), %rbx
movl %ebx, %r9d
pushq %r10
pushq %rax
pushq %rbp
movl 0x118(%rsp), %ebp
pushq %rbp
pushq %r15
callq 0x2bfda
addq $0x30, %rsp
movl %eax, 0x20(%rsp)
leaq 0xa8(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, (%rax)
movslq %r14d, %rcx
leaq (%rcx,%r12), %rdi
incq %rdi
movslq %ebx, %rcx
addq 0x58(%rsp), %rcx
subq $0x8, %rsp
leaq 0x90(%rsp), %r10
movq %r13, %rsi
movq 0x10(%rsp), %rdx
movq 0x50(%rsp), %r8
movq 0x68(%rsp), %r9
pushq %r10
pushq %rax
pushq 0x28(%rsp)
pushq %rbp
pushq %r15
callq 0x2bfda
addq $0x30, %rsp
orl 0x20(%rsp), %eax
je 0x2d0d1
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x2d08b
callq 0x64b0
movq 0xa8(%rsp), %rdi
movl $0x1, %ebx
testq %rdi, %rdi
je 0x2d1eb
callq 0x64b0
jmp 0x2d1eb
movl $0x1, %ebx
jmp 0x2d1eb
imull 0x28(%rsp), %r8d
addl %r15d, %r8d
movslq %r8d, %rdx
movq (%rax,%rdx,8), %rbx
movq (%rcx,%rdx,8), %r8
movb $0x1, %r10b
jmp 0x2c3dc
movslq 0x8c(%rsp), %r14
movslq 0x88(%rsp), %r15
leaq (%r15,%r14), %rdi
movq 0x110(%rsp), %rax
movl %edi, (%rax)
callq 0x6530
movq %rax, %r12
movq 0x108(%rsp), %rax
movq %r12, (%rax)
movq 0x68(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x6310
addq %r14, %r12
movq 0xa8(%rsp), %r14
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x6310
movq %r13, %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x64b0
jmp 0x2d1e9
movq (%r9), %rax
movq 0x110(%rsp), %rsi
movslq (%rsi), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rsi)
movb %r13b, (%rax,%rcx)
testl %r14d, %r14d
jle 0x2d17b
movq (%r9), %rax
movq 0x110(%rsp), %rsi
movslq (%rsi), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rsi)
movb $0x2, (%rax,%rcx)
decl %r14d
jne 0x2d15f
movq (%r9), %rdi
movq 0x110(%rsp), %r14
movslq (%r14), %rsi
movq %r9, %rbx
callq 0x6610
movq %rax, (%rbx)
movslq (%r14), %rcx
testq %rcx, %rcx
je 0x2d1c5
addq %rax, %rcx
decq %rcx
cmpq %rax, %rcx
jbe 0x2d1c5
incq %rax
movb -0x1(%rax), %dl
movb (%rcx), %sil
movb %sil, -0x1(%rax)
movb %dl, (%rcx)
decq %rcx
leaq 0x1(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x2d1aa
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x2db20
movl $0x28, %esi
movq %rbx, %rdi
callq 0x63c0
movq 0x48(%rsp), %rdi
callq 0x64f0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq