// File: lioncedric[P]cimpressGridCoverage/src/squares.cc
// Function: solver(int*, int, int, int const*)
int solver(int * puzzle, const int width, int orientation, const int *const area) {
    int id;
    int nb_squares_used = 0;
    //code here was duplicated in order to gain performance
    if (orientation == 0) {
        int * ptrLineMin = puzzle + area[0] + area[1] * width;
        const int * ptrLineMax = puzzle + area[0] + area[3] * width;
        int row = area[1];

        for (int* ptrLine = ptrLineMin; ptrLine <= ptrLineMax; ptrLine += width, ++row) {
            int col = area[0];
            const int computed_line = row * width;
            const int * ptrColMax = ptrLine + area[2] - area[0];
            for (int* ptrCol = ptrLine; ptrCol <= ptrColMax; ++ptrCol, ++col) {

                if (*ptrCol == 1) {
                    id = computed_line + col;
                    ++nb_squares_used;
                    *ptrCol = id;
                    int size = 1;
                    while (true) {
                        bool stop = false;
                        int * ptrCol2 = ptrCol + size * width;
                        if (*(ptrCol2 + size) != 1)break;
                        for (int i = 0; i < size; ++i) {
                            if (*(ptrCol2 + i) != 1 || *(ptrCol + i * width + size) != 1) {
                                stop = true;
                                break;
                            }
                        }
                        if (stop) {
                            break;
                        }

                        for (int i = 0; i < size; ++i) {
                            *(ptrCol2 + i) = id;
                            *(ptrCol + i * width + size) = id;
                        }
                        *(ptrCol2 + size) = id;
                        ++size;
                    }
                }

            }

        }

    } else if (orientation == 1) {
        int * ptrLineMin = puzzle + area[2] + area[3] * width;
        const int * ptrLineMax = puzzle + area[2] + area[1] * width;
        int row = area[3];

        for (int* ptrLine = ptrLineMin; ptrLine >= ptrLineMax; ptrLine -= width, --row) {
            int col = area[2];
            const int computed_line = row * width;
            const int * ptrColMax = ptrLine + area[0] - area[2];
            for (int* ptrCol = ptrLine; ptrCol >= ptrColMax; --ptrCol, --col) {

                if (*ptrCol == 1) {
                    id = computed_line + col;
                    ++nb_squares_used;
                    *ptrCol = id;
                    int size = 1;
                    while (true) {
                        bool stop = false;
                        int * ptrCol2 = ptrCol - size * width;
                        if (*(ptrCol2 - size) != 1)break;
                        for (int i = 0; i < size; ++i) {
                            if (*(ptrCol2 - i) != 1 || *(ptrCol - i * width - size) != 1) {
                                stop = true;
                                break;
                            }
                        }
                        if (stop) {
                            break;
                        }

                        for (int i = 0; i < size; ++i) {
                            *(ptrCol2 - i) = id;
                            *(ptrCol - i * width - size) = id;
                        }
                        *(ptrCol2 - size) = id;
                        ++size;
                    }
                }

            }

        }
    } else if (orientation == 2) {
        int * ptrLineMin = puzzle + area[0] + area[3] * width;
        const int * ptrLineMax = puzzle + area[0] + area[1] * width;
        int row = area[3];

        for (int* ptrLine = ptrLineMin; ptrLine >= ptrLineMax; ptrLine -= width, --row) {
            int col = area[0];
            const int computed_line = row * width;
            const int * ptrColMax = ptrLine + area[2] - area[0];
            for (int* ptrCol = ptrLine; ptrCol <= ptrColMax; ++ptrCol, ++col) {

                if (*ptrCol == 1) {
                    id = computed_line + col;
                    ++nb_squares_used;
                    *ptrCol = id;
                    int size = 1;
                    while (true) {
                        bool stop = false;
                        int * ptrCol2 = ptrCol - size * width;
                        if (*(ptrCol2 + size) != 1)break;
                        for (int i = 0; i < size; ++i) {
                            if (*(ptrCol2 + i) != 1 || *(ptrCol - i * width + size) != 1) {
                                stop = true;
                                break;
                            }
                        }
                        if (stop) {
                            break;
                        }

                        for (int i = 0; i < size; ++i) {
                            *(ptrCol2 + i) = id;
                            *(ptrCol - i * width + size) = id;
                        }
                        *(ptrCol2 + size) = id;
                        ++size;
                    }
                }

            }

        }

    } else {
        int * ptrLineMin = puzzle + area[2] + area[1] * width;
        const int * ptrLineMax = puzzle + area[2] + area[3] * width;
        int row = area[1];

        for (int* ptrLine = ptrLineMin; ptrLine <= ptrLineMax; ptrLine += width, ++row) {
            int col = area[2];
            const int computed_line = row * width;
            const int * ptrColMax = ptrLine + area[0] - area[2];
            for (int* ptrCol = ptrLine; ptrCol >= ptrColMax; --ptrCol, --col) {

                if (*ptrCol == 1) {
                    id = computed_line + col;
                    ++nb_squares_used;
                    *ptrCol = id;
                    int size = 1;
                    while (true) {
                        bool stop = false;
                        int * ptrCol2 = ptrCol + size * width;
                        if (*(ptrCol2 - size) != 1)break;
                        for (int i = 0; i < size; ++i) {
                            if (*(ptrCol2 - i) != 1 || *(ptrCol + i * width - size) != 1) {
                                stop = true;
                                break;
                            }
                        }
                        if (stop) {
                            break;
                        }

                        for (int i = 0; i < size; ++i) {
                            *(ptrCol2 - i) = id;
                            *(ptrCol + i * width - size) = id;
                        }
                        *(ptrCol2 - size) = id;
                        ++size;
                    }
                }

            }

        }

    }


    return nb_squares_used;
}

// Assembly:
subq $0xe0, %rsp
movq %rdi, 0xd8(%rsp)
movl %esi, 0xd4(%rsp)
movl %edx, 0xd0(%rsp)
movq %rcx, 0xc8(%rsp)
movl $0x0, 0xc0(%rsp)
cmpl $0x0, 0xd0(%rsp)
jne 0x1173c
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0x4(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xb8(%rsp)
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0xc(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xb0(%rsp)
movq 0xc8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xac(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
cmpq 0xb0(%rsp), %rax
ja 0x11737
movq 0xc8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x9c(%rsp)
movl 0xac(%rsp), %eax
imull 0xd4(%rsp), %eax
movl %eax, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x90(%rsp), %rax
ja 0x116fe
movq 0x88(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x116d2
movl 0x98(%rsp), %eax
addl 0x9c(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
movl 0xc4(%rsp), %ecx
movq 0x88(%rsp), %rax
movl %ecx, (%rax)
movl $0x1, 0x84(%rsp)
movb $0x0, 0x83(%rsp)
movq 0x88(%rsp), %rax
movl 0x84(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movslq 0x84(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x115c4
jmp 0x116d0
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
cmpl 0x84(%rsp), %eax
jge 0x1162e
movq 0x78(%rsp), %rax
movslq 0x74(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x11615
movq 0x88(%rsp), %rax
movl 0x74(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x84(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x1161f
movb $0x1, 0x83(%rsp)
jmp 0x1162e
jmp 0x11621
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x115cc
testb $0x1, 0x83(%rsp)
je 0x1163d
jmp 0x116d0
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
cmpl 0x84(%rsp), %eax
jge 0x116a3
movl 0xc4(%rsp), %edx
movq 0x78(%rsp), %rax
movslq 0x70(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc4(%rsp), %edx
movq 0x88(%rsp), %rax
movl 0x70(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x84(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x11645
movl 0xc4(%rsp), %edx
movq 0x78(%rsp), %rax
movslq 0x84(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x1157e
jmp 0x116d2
jmp 0x116d4
movq 0x88(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x88(%rsp)
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x11515
jmp 0x11700
movl 0xd4(%rsp), %ecx
movq 0xa0(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xa0(%rsp)
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x1148e
jmp 0x1201b
cmpl $0x1, 0xd0(%rsp)
jne 0x11a49
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0xc(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x68(%rsp)
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0x4(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq 0xc8(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0x5c(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x60(%rsp), %rax
jb 0x11a44
movq 0xc8(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x4c(%rsp)
movl 0x5c(%rsp), %eax
imull 0xd4(%rsp), %eax
movl %eax, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jb 0x11a12
movq 0x38(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x119f2
movl 0x48(%rsp), %eax
addl 0x4c(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
movl 0xc4(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, (%rax)
movl $0x1, 0x34(%rsp)
movb $0x0, 0x33(%rsp)
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movslq 0x34(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x118e2
jmp 0x119f0
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x1194f
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x11939
movq 0x38(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x34(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x11940
movb $0x1, 0x33(%rsp)
jmp 0x1194f
jmp 0x11942
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x118ea
testb $0x1, 0x33(%rsp)
je 0x1195b
jmp 0x119f0
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x119c7
movl 0xc4(%rsp), %edx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc4(%rsp), %edx
movq 0x38(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x34(%rsp), %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x11963
movl 0xc4(%rsp), %edx
movq 0x28(%rsp), %rax
movslq 0x34(%rsp), %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1189e
jmp 0x119f2
jmp 0x119f4
movq 0x38(%rsp), %rax
addq $-0x4, %rax
movq %rax, 0x38(%rsp)
movl 0x4c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x1184a
jmp 0x11a14
movl 0xd4(%rsp), %ecx
movq 0x50(%rsp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
movl 0x5c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x117dd
jmp 0x12019
cmpl $0x2, 0xd0(%rsp)
jne 0x11d2f
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0xc(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0x4(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0xc8(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
cmpq 0x10(%rsp), %rax
jb 0x11d2a
movq 0xc8(%rsp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rsp)
movl 0xc(%rsp), %eax
imull 0xd4(%rsp), %eax
movl %eax, -0x8(%rsp)
movq (%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rsp)
movq (%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
cmpq -0x10(%rsp), %rax
ja 0x11cfa
movq -0x18(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x11cda
movl -0x8(%rsp), %eax
addl -0x4(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
movl 0xc4(%rsp), %ecx
movq -0x18(%rsp), %rax
movl %ecx, (%rax)
movl $0x1, -0x1c(%rsp)
movb $0x0, -0x1d(%rsp)
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movslq -0x1c(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x11be3
jmp 0x11cd8
movl $0x0, -0x2c(%rsp)
movl -0x2c(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0x11c46
movq -0x28(%rsp), %rax
movslq -0x2c(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x11c30
movq -0x18(%rsp), %rax
movl -0x2c(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x1c(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x11c37
movb $0x1, -0x1d(%rsp)
jmp 0x11c46
jmp 0x11c39
movl -0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rsp)
jmp 0x11beb
testb $0x1, -0x1d(%rsp)
je 0x11c52
jmp 0x11cd8
movl $0x0, -0x30(%rsp)
movl -0x30(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0x11cb4
movl 0xc4(%rsp), %edx
movq -0x28(%rsp), %rax
movslq -0x30(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc4(%rsp), %edx
movq -0x18(%rsp), %rax
movl -0x30(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x1c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rsp)
jmp 0x11c5a
movl 0xc4(%rsp), %edx
movq -0x28(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x11ba4
jmp 0x11cda
jmp 0x11cdc
movq -0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, -0x18(%rsp)
movl -0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rsp)
jmp 0x11b50
jmp 0x11cfc
movl 0xd4(%rsp), %ecx
movq (%rsp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movl 0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x11ae7
jmp 0x12017
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0x4(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rsp)
movq 0xd8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movl 0xc(%rcx), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rsp)
movq 0xc8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x44(%rsp)
movq -0x38(%rsp), %rax
movq %rax, -0x50(%rsp)
movq -0x50(%rsp), %rax
cmpq -0x40(%rsp), %rax
ja 0x12015
movq 0xc8(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x54(%rsp)
movl -0x44(%rsp), %eax
imull 0xd4(%rsp), %eax
movl %eax, -0x58(%rsp)
movq -0x50(%rsp), %rax
movq 0xc8(%rsp), %rcx
movslq (%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0xc8(%rsp), %rcx
movslq 0x8(%rcx), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rsp)
movq -0x50(%rsp), %rax
movq %rax, -0x68(%rsp)
movq -0x68(%rsp), %rax
cmpq -0x60(%rsp), %rax
jb 0x11fe8
movq -0x68(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x11fc8
movl -0x58(%rsp), %eax
addl -0x54(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
movl 0xc4(%rsp), %ecx
movq -0x68(%rsp), %rax
movl %ecx, (%rax)
movl $0x1, -0x6c(%rsp)
movb $0x0, -0x6d(%rsp)
movq -0x68(%rsp), %rax
movl -0x6c(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rsp)
movq -0x78(%rsp), %rax
movslq -0x6c(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x11ec2
jmp 0x11fc6
movl $0x0, -0x7c(%rsp)
movl -0x7c(%rsp), %eax
cmpl -0x6c(%rsp), %eax
jge 0x11f2a
movq -0x78(%rsp), %rax
movslq -0x7c(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x11f14
movq -0x68(%rsp), %rax
movl -0x7c(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x6c(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x11f1b
movb $0x1, -0x6d(%rsp)
jmp 0x11f2a
jmp 0x11f1d
movl -0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rsp)
jmp 0x11eca
testb $0x1, -0x6d(%rsp)
je 0x11f36
jmp 0x11fc6
movl $0x0, -0x80(%rsp)
movl -0x80(%rsp), %eax
cmpl -0x6c(%rsp), %eax
jge 0x11f9d
movl 0xc4(%rsp), %edx
movq -0x78(%rsp), %rax
movslq -0x80(%rsp), %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc4(%rsp), %edx
movq -0x68(%rsp), %rax
movl -0x80(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x6c(%rsp), %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x80(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rsp)
jmp 0x11f3e
movl 0xc4(%rsp), %edx
movq -0x78(%rsp), %rax
movslq -0x6c(%rsp), %rsi
xorl %ecx, %ecx
subq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rsp)
jmp 0x11e83
jmp 0x11fc8
jmp 0x11fca
movq -0x68(%rsp), %rax
addq $-0x4, %rax
movq %rax, -0x68(%rsp)
movl -0x54(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rsp)
jmp 0x11e2f
jmp 0x11fea
movl 0xd4(%rsp), %ecx
movq -0x50(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rsp)
movl -0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rsp)
jmp 0x11dc2
jmp 0x12017
jmp 0x12019
jmp 0x1201b
movl 0xc0(%rsp), %eax
addq $0xe0, %rsp
retq
nopw (%rax,%rax)