// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sg_trace_scan_avx2_256_32.c
// Function: parasail_sg_flags_trace_scan_profile_avx2_256_32
parasail_result_t* PNAME(
        const parasail_profile_t * const restrict profile,
        const char * const restrict s2, const int s2Len,
        const int open, const int gap,
        int s1_beg, int s1_end, int s2_beg, int s2_end)
{
    /* declare local variables */
    int32_t i = 0;
    int32_t j = 0;
    int32_t k = 0;
    int32_t s1Len = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
    int32_t offset = 0;
    int32_t position = 0;
    __m256i* restrict pvP = NULL;
    __m256i* restrict pvE = NULL;
    int32_t* restrict boundary = NULL;
    __m256i* restrict pvHt = NULL;
    __m256i* restrict pvH = NULL;
    __m256i* restrict pvGapper = NULL;
    __m256i vGapO;
    __m256i vGapE;
    int32_t NEG_LIMIT = 0;
    int32_t POS_LIMIT = 0;
    __m256i vZero;
    int32_t score = 0;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    __m256i vMaxH;
    __m256i vPosMask;
    __m256i vNegInfFront;
    __m256i vSegLenXgap;
    parasail_result_t *result = NULL;
    __m256i vTIns;
    __m256i vTDel;
    __m256i vTDiag;
    __m256i vTDiagE;
    __m256i vTInsE;
    __m256i vTDiagF;
    __m256i vTDelF;

    /* validate inputs */
    PARASAIL_CHECK_NULL(profile);
    PARASAIL_CHECK_NULL(profile->profile32.score);
    PARASAIL_CHECK_NULL(profile->matrix);
    PARASAIL_CHECK_GT0(profile->s1Len);
    PARASAIL_CHECK_NULL(s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);

    /* initialize stack variables */
    i = 0;
    j = 0;
    k = 0;
    s1Len = profile->s1Len;
    end_query = s1Len-1;
    end_ref = s2Len-1;
    matrix = profile->matrix;
    segWidth = 8; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    pvP = (__m256i*)profile->profile32.score;
    vGapO = _mm256_set1_epi32(open);
    vGapE = _mm256_set1_epi32(gap);
    NEG_LIMIT = (-open < matrix->min ? INT32_MIN + open : INT32_MIN - matrix->min) + 1;
    POS_LIMIT = INT32_MAX - matrix->max - 1;
    vZero = _mm256_setzero_si256();
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vPosMask = _mm256_cmpeq_epi32(_mm256_set1_epi32(position),
            _mm256_set_epi32(0,1,2,3,4,5,6,7));
    vNegInfFront = vZero;
    vNegInfFront = _mm256_insert_epi32_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm256_add_epi32(vNegInfFront,
            _mm256_slli_si256_rpl(_mm256_set1_epi32(-segLen*gap), 4));
    vTIns  = _mm256_set1_epi32(PARASAIL_INS);
    vTDel  = _mm256_set1_epi32(PARASAIL_DEL);
    vTDiag = _mm256_set1_epi32(PARASAIL_DIAG);
    vTDiagE= _mm256_set1_epi32(PARASAIL_DIAG_E);
    vTInsE = _mm256_set1_epi32(PARASAIL_INS_E);
    vTDiagF= _mm256_set1_epi32(PARASAIL_DIAG_F);
    vTDelF = _mm256_set1_epi32(PARASAIL_DEL_F);

    /* initialize result */
    result = parasail_result_new_trace(segLen, s2Len, 32, sizeof(__m256i));
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SG | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_8;
    result->flag |= s1_beg ? PARASAIL_FLAG_SG_S1_BEG : 0;
    result->flag |= s1_end ? PARASAIL_FLAG_SG_S1_END : 0;
    result->flag |= s2_beg ? PARASAIL_FLAG_SG_S2_BEG : 0;
    result->flag |= s2_end ? PARASAIL_FLAG_SG_S2_END : 0;

    /* initialize heap variables */
    pvE = parasail_memalign___m256i(32, segLen);
    boundary = parasail_memalign_int32_t(32, s2Len+1);
    pvHt= parasail_memalign___m256i(32, segLen);
    pvH = parasail_memalign___m256i(32, segLen);
    pvGapper = parasail_memalign___m256i(32, segLen);

    /* validate heap variables */
    if (!pvE) return NULL;
    if (!boundary) return NULL;
    if (!pvHt) return NULL;
    if (!pvH) return NULL;
    if (!pvGapper) return NULL;

    /* initialize H and E */
    {
        int32_t index = 0;
        for (i=0; i<segLen; ++i) {
            int32_t segNum = 0;
            __m256i_32_t h;
            __m256i_32_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = s1_beg ? 0 : (-open-gap*(segNum*segLen+i));
                h.v[segNum] = tmp < INT32_MIN ? INT32_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT32_MIN ? INT32_MIN : tmp;
            }
            _mm256_store_si256(&pvH[index], h.m);
            _mm256_store_si256(&pvE[index], e.m);
            ++index;
        }
    }

    /* initialize uppder boundary */
    {
        boundary[0] = 0;
        for (i=1; i<=s2Len; ++i) {
            int64_t tmp = s2_beg ? 0 : (-open-gap*(i-1));
            boundary[i] = tmp < INT32_MIN ? INT32_MIN : tmp;
        }
    }

    {
        __m256i vGapper = _mm256_sub_epi32(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm256_store_si256(pvGapper+i, vGapper);
            vGapper = _mm256_sub_epi32(vGapper, vGapE);
            /* long queries and/or large penalties will break the pseudo prefix scan */
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vGapper);
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m256i vE;
        __m256i vE_ext;
        __m256i vE_opn;
        __m256i vHt;
        __m256i vF;
        __m256i vF_ext;
        __m256i vF_opn;
        __m256i vH;
        __m256i vHp;
        __m256i *pvW;
        __m256i vW;
        __m256i case1;
        __m256i case2;
        __m256i vGapper;
        __m256i vT;
        __m256i vET;
        __m256i vFT;

        /* calculate E */
        /* calculate Ht */
        /* calculate F and H first pass */
        vHp = _mm256_load_si256(pvH+(segLen-1));
        vHp = _mm256_slli_si256_rpl(vHp, 4);
        vHp = _mm256_insert_epi32_rpl(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm256_sub_epi32(vNegLimit, pvGapper[0]);
        vF = vNegLimit;
        for (i=0; i<segLen; ++i) {
            vH = _mm256_load_si256(pvH+i);
            vE = _mm256_load_si256(pvE+i);
            vW = _mm256_load_si256(pvW+i);
            vGapper = _mm256_load_si256(pvGapper+i);
            vE_opn = _mm256_sub_epi32(vH, vGapO);
            vE_ext = _mm256_sub_epi32(vE, vGapE);
            case1 = _mm256_cmpgt_epi32(vE_opn, vE_ext);
            vET = _mm256_blendv_epi8(vTInsE, vTDiagE, case1);
            arr_store(result->trace->trace_table, vET, i, segLen, j);
            vE = _mm256_max_epi32(vE_opn, vE_ext);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vE);
            vGapper = _mm256_add_epi32(vHt, vGapper);
            vF = _mm256_max_epi32(vF, vGapper);
            vHp = _mm256_add_epi32(vHp, vW);
            vHt = _mm256_max_epi32(vE, vHp);
            _mm256_store_si256(pvE+i, vE);
            _mm256_store_si256(pvHt+i, vHt);
            _mm256_store_si256(pvH+i, vHp);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm256_slli_si256_rpl(vHt, 4);
        vHt = _mm256_insert_epi32_rpl(vHt, boundary[j+1], 0);
        vGapper = _mm256_load_si256(pvGapper);
        vGapper = _mm256_add_epi32(vHt, vGapper);
        vF = _mm256_max_epi32(vF, vGapper);
        for (i=0; i<segWidth-2; ++i) {
            __m256i vFt = _mm256_slli_si256_rpl(vF, 4);
            vFt = _mm256_add_epi32(vFt, vSegLenXgap);
            vF = _mm256_max_epi32(vF, vFt);
        }

        /* calculate final H */
        vF = _mm256_slli_si256_rpl(vF, 4);
        vF = _mm256_add_epi32(vF, vNegInfFront);
        vH = _mm256_max_epi32(vF, vHt);
        for (i=0; i<segLen; ++i) {
            vET = arr_load(result->trace->trace_table, i, segLen, j);
            vHp = _mm256_load_si256(pvH+i);
            vHt = _mm256_load_si256(pvHt+i);
            vF_opn = _mm256_sub_epi32(vH, vGapO);
            vF_ext = _mm256_sub_epi32(vF, vGapE);
            vF = _mm256_max_epi32(vF_opn, vF_ext);
            case1 = _mm256_cmpgt_epi32(vF_opn, vF_ext);
            vFT = _mm256_blendv_epi8(vTDelF, vTDiagF, case1);
            vH = _mm256_max_epi32(vHt, vF);
            case1 = _mm256_cmpeq_epi32(vH, vHp);
            case2 = _mm256_cmpeq_epi32(vH, vF);
            vT = _mm256_blendv_epi8(
                    _mm256_blendv_epi8(vTIns, vTDel, case2),
                    vTDiag, case1);
            vT = _mm256_or_si256(vT, vET);
            vT = _mm256_or_si256(vT, vFT);
            arr_store(result->trace->trace_table, vT, i, segLen, j);
            _mm256_store_si256(pvH+i, vH);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm256_max_epi32(vSaturationCheckMax, vH);
        }

        /* extract vector containing last value from column */
        {
            __m256i vCompare;
            vH = _mm256_load_si256(pvH + offset);
            vCompare = _mm256_and_si256(vPosMask, _mm256_cmpgt_epi32(vH, vMaxH));
            vMaxH = _mm256_max_epi32(vH, vMaxH);
            if (_mm256_movemask_epi8(vCompare)) {
                end_ref = j;
            }
        }
    } 

    /* max last value from all columns */
    if (s2_end)
    {
        for (k=0; k<position; ++k) {
            vMaxH = _mm256_slli_si256_rpl(vMaxH, 4);
        }
        score = (int32_t) _mm256_extract_epi32_rpl(vMaxH, 7);
        end_query = s1Len-1;
    }

    /* max of last column */
    if (s1_end)
    {
        /* Trace the alignment ending position on read. */
        int32_t *t = (int32_t*)pvH;
        int32_t column_len = segLen * segWidth;
        for (i = 0; i<column_len; ++i, ++t) {
            int32_t temp = i / segWidth + i % segWidth * segLen;
            if (temp >= s1Len) continue;
            if (*t > score) {
                score = *t;
                end_query = temp;
                end_ref = s2Len-1;
            }
            else if (*t == score && end_ref == s2Len-1 && temp < end_query) {
                end_query = temp;
            }
        }
    }

    if (!s1_end && !s2_end) {
        /* extract last value from the last column */
        {
            __m256i vH = _mm256_load_si256(pvH + offset);
            for (k=0; k<position; ++k) {
                vH = _mm256_slli_si256_rpl(vH, 4);
            }
            score = (int32_t) _mm256_extract_epi32_rpl (vH, 7);
            end_ref = s2Len - 1;
            end_query = s1Len - 1;
        }
    }

    if (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi32_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_cmpgt_epi32(vSaturationCheckMax, vPosLimit)))) {
        result->flag |= PARASAIL_FLAG_SATURATED;
        score = 0;
        end_query = 0;
        end_ref = 0;
    }

    result->score = score;
    result->end_query = end_query;
    result->end_ref = end_ref;

    parasail_free(pvGapper);
    parasail_free(pvH);
    parasail_free(pvHt);
    parasail_free(boundary);
    parasail_free(pvE);

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x140, %rsp            # imm = 0x140
movq %rsi, 0x68(%rsp)
testq %rdi, %rdi
je 0x549164
movq 0x48(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x549188
movq 0x10(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x5491ac
movl %edx, %r13d
movl 0x8(%rdi), %edx
testl %edx, %edx
jle 0x5491d0
cmpq $0x0, 0x68(%rsp)
je 0x5491f4
testl %r13d, %r13d
jle 0x549215
testl %ecx, %ecx
js 0x549236
testl %r8d, %r8d
js 0x549257
movl %r9d, %r12d
movl %r8d, 0x28(%rsp)
leal -0x1(%rdx), %eax
movq %rdx, 0x40(%rsp)
leaq 0x7(%rdx), %rdi
shrq $0x3, %rdi
movl %eax, 0x54(%rsp)
xorl %edx, %edx
divl %edi
movl %eax, 0x80(%rsp)
movl %edx, %r15d
movl %ecx, %esi
negl %esi
movq 0x60(%rsp), %rdx
movl 0x20(%rdx), %eax
movl $0x80000000, %r14d      # imm = 0x80000000
movl %ecx, 0x50(%rsp)
orl %r14d, %ecx
subl %eax, %r14d
movl %esi, 0xa0(%rsp)
cmpl %esi, %eax
cmovgl %ecx, %r14d
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rdx), %eax
movl %eax, 0xc0(%rsp)
pushq $0x20
popq %rcx
movq %rdi, 0x20(%rsp)
movl %r13d, %esi
movq %rcx, %rdx
callq 0x1abb59
testq %rax, %rax
je 0x548c02
movq %rax, %rbx
movl %r15d, 0x48(%rsp)
movl %r14d, 0x18(%rsp)
movl 0x20(%rbp), %edi
xorl %eax, %eax
testl %r12d, %r12d
setne %al
xorl %ecx, %ecx
cmpl $0x0, 0x10(%rbp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x18(%rbp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
movl %edi, 0x4c(%rsp)
testl %edi, %edi
setne %sil
shll $0xf, %esi
leal (%rcx,%rax,8), %eax
orl %edx, %eax
orl %esi, %eax
orl 0xc(%rbx), %eax
orl $0x8480402, %eax        # imm = 0x8480402
movl %eax, 0xc(%rbx)
pushq $0x20
popq %r14
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %r13, 0x58(%rsp)
callq 0x496aa4
movq %rax, %r15
leal 0x1(%r13), %esi
movq %r14, %rdi
movq %rsi, 0x70(%rsp)
callq 0x1ab783
movq %rax, 0x30(%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %r13
movq %r13, %rsi
callq 0x496aa4
movq %rax, %r14
pushq $0x20
popq %rdi
movq %r13, %rsi
callq 0x496aa4
movq %rax, %r13
pushq $0x20
popq %rdi
movq 0x20(%rsp), %rsi
callq 0x496aa4
testq %r15, %r15
sete %cl
cmpq $0x0, 0x30(%rsp)
sete %dl
orb %cl, %dl
testq %r14, %r14
sete %cl
testq %r13, %r13
sete %sil
orb %cl, %sil
orb %dl, %sil
testq %rax, %rax
sete %dl
xorl %ecx, %ecx
orb %sil, %dl
je 0x548c09
xorl %ebx, %ebx
jmp 0x54927f
movq 0x58(%rsp), %rdx
decl %edx
movl %edx, 0x1c(%rsp)
pushq $0x7
popq %rsi
subl 0x80(%rsp), %esi
movl 0x50(%rsp), %r8d
vmovd %r8d, %xmm0
vpbroadcastd %xmm0, %ymm3
movl 0x28(%rsp), %edi
vmovd %edi, %xmm0
vpbroadcastd %xmm0, %ymm4
movl 0x18(%rsp), %edx
incl %edx
movl %edx, 0x18(%rsp)
vmovd %edx, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovd 0xc0(%rsp), %xmm1
vpbroadcastd %xmm1, %ymm1
movl %esi, 0x3c(%rsp)
vmovd %esi, %xmm2
vpbroadcastd %xmm2, %ymm5
vpxor %xmm2, %xmm2, %xmm2
vmovdqa %ymm0, 0x80(%rsp)
vmovss %xmm0, %xmm2, %xmm0     # xmm0 = xmm0[0],xmm2[1,2,3]
movq 0x20(%rsp), %r10
movl %r10d, %edx
imull %edi, %edx
movl %edx, %esi
negl %esi
vmovd %esi, %xmm2
vpbroadcastd %xmm2, %ymm2
vpxor %xmm7, %xmm7, %xmm7
vpblendd $0x1, %ymm7, %ymm2, %ymm2 # ymm2 = ymm7[0],ymm2[1,2,3,4,5,6,7]
vmovaps %ymm0, 0xc0(%rsp)
vpaddd %ymm2, %ymm0, %ymm7
movl %r8d, %esi
movq $-0x80000000, %rdi      # imm = 0x80000000
movl 0xa0(%rsp), %r8d
cmpq %r10, %rcx
je 0x548d36
movl %r8d, %r9d
xorl %r10d, %r10d
cmpq $0x8, %r10
je 0x548d01
testl %r12d, %r12d
movl $0x0, %r11d
cmovel %r9d, %r11d
movslq %r11d, %r11
movl %r11d, 0x100(%rsp,%r10,4)
subq %rsi, %r11
cmpq $-0x7fffffff, %r11      # imm = 0x80000001
cmovlq %rdi, %r11
movl %r11d, 0xe0(%rsp,%r10,4)
incq %r10
subl %edx, %r9d
jmp 0x548cc5
movq %rcx, %r9
shlq $0x5, %r9
vmovaps 0x100(%rsp), %ymm2
vmovaps %ymm2, (%r13,%r9)
vmovdqa 0xe0(%rsp), %ymm2
vmovdqa %ymm2, (%r15,%r9)
incq %rcx
subl 0x28(%rsp), %r8d
movq 0x20(%rsp), %r10
jmp 0x548cba
movq 0x30(%rsp), %rcx
andl $0x0, (%rcx)
pushq $0x1
popq %rcx
movl 0x28(%rsp), %edi
movl 0xa0(%rsp), %r8d
movl 0x18(%rbp), %r9d
movq 0x70(%rsp), %r11
movq 0x30(%rsp), %rsi
cmpq %rcx, %r11
je 0x548d77
testl %r9d, %r9d
movl $0x0, %edx
cmovel %r8d, %edx
movl %edx, (%rsi,%rcx,4)
incq %rcx
subl %edi, %r8d
jmp 0x548d5b
vpxor %xmm2, %xmm2, %xmm2
vpsubd %ymm3, %ymm2, %ymm8
leal -0x1(%r10), %ecx
vmovdqa %ymm1, %ymm2
movl %ecx, %edx
testl %edx, %edx
js 0x548da5
movl %edx, %esi
shlq $0x5, %rsi
vmovdqa %ymm8, (%rax,%rsi)
vpsubd %ymm4, %ymm8, %ymm8
vpminsd %ymm8, %ymm2, %ymm2
decl %edx
jmp 0x548d89
vmovdqa %ymm1, 0xa0(%rsp)
movl %ecx, %r8d
shlq $0x5, %r8
addq %r13, %r8
movl 0x48(%rsp), %ecx
shlq $0x5, %rcx
addq %r13, %rcx
movq %rcx, 0x28(%rsp)
movl 0x58(%rsp), %r9d
shlq $0x5, %r10
xorl %r11d, %r11d
vpcmpeqd 0x82ac4(%rip), %ymm5, %ymm10 # 0x5cb8a0
xorl %ecx, %ecx
vmovdqa 0x80(%rsp), %ymm5
vmovdqa %ymm5, %ymm8
movl 0x1c(%rsp), %edi
cmpq %r9, %rcx
je 0x548ffc
vpmovsxbd 0x82a7f(%rip), %ymm0 # 0x5cb880
vpermd (%r8), %ymm0, %ymm11
movq 0x30(%rsp), %rdx
vmovd (%rdx,%rcx,4), %xmm12
vpblendd $0x1, %ymm12, %ymm11, %ymm13 # ymm13 = ymm12[0],ymm11[1,2,3,4,5,6,7]
movq 0x60(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0x68(%rsp), %rsi
movzbl (%rsi,%rcx), %r12d
movl (%rdx,%r12,4), %edx
imull 0x20(%rsp), %edx
movslq %edx, %rdx
shlq $0x5, %rdx
addq 0x78(%rsp), %rdx
vmovdqa 0x80(%rsp), %ymm11
vpsubd (%rax), %ymm11, %ymm12
xorl %r12d, %r12d
cmpq %r12, %r10
je 0x548eda
vpaddd (%rdx,%r12), %ymm13, %ymm13
vmovdqa (%r13,%r12), %ymm14
vmovdqa (%r15,%r12), %ymm15
vpsubd %ymm3, %ymm14, %ymm1
vpsubd %ymm4, %ymm15, %ymm15
vpcmpgtd %ymm15, %ymm1, %ymm6
vbroadcastss 0x82c60(%rip), %ymm0 # 0x5cbae0
vbroadcastss 0x848c3(%rip), %ymm9 # 0x5cd74c
vblendvps %ymm6, %ymm0, %ymm9, %ymm0
movq 0x10(%rbx), %rsi
movq (%rsi), %rsi
addq %r11, %rsi
vpaddd (%rax,%r12), %ymm12, %ymm6
vmovaps %ymm0, (%r12,%rsi)
vpmaxsd %ymm15, %ymm1, %ymm0
vpminsd %ymm0, %ymm2, %ymm2
vpmaxsd %ymm13, %ymm0, %ymm12
vmovdqa %ymm0, (%r15,%r12)
vmovdqa %ymm12, (%r14,%r12)
vpmaxsd %ymm6, %ymm11, %ymm11
vmovdqa %ymm13, (%r13,%r12)
addq $0x20, %r12
vmovdqa %ymm14, %ymm13
jmp 0x548e4e
vpmovsxbd 0x8299d(%rip), %ymm0 # 0x5cb880
vpermd %ymm12, %ymm0, %ymm0
leaq 0x1(%rcx), %rdx
movq 0x30(%rsp), %rsi
vmovd 0x4(%rsi,%rcx,4), %xmm1
vpblendd $0x1, %ymm1, %ymm0, %ymm12 # ymm12 = ymm1[0],ymm0[1,2,3,4,5,6,7]
vpaddd (%rax), %ymm12, %ymm0
vpmaxsd %ymm0, %ymm11, %ymm11
pushq $0x6
popq %r12
vperm2i128 $0x8, %ymm11, %ymm11, %ymm0 # ymm0 = zero,zero,ymm11[0,1]
vpalignr $0xc, %ymm0, %ymm11, %ymm13 # ymm13 = ymm0[12,13,14,15],ymm11[0,1,2,3,4,5,6,7,8,9,10,11],ymm0[28,29,30,31],ymm11[16,17,18,19,20,21,22,23,24,25,26,27]
subl $0x1, %r12d
jb 0x548f27
vpaddd %ymm7, %ymm13, %ymm0
vpmaxsd %ymm0, %ymm11, %ymm11
jmp 0x548f0a
vpaddd 0xc0(%rsp), %ymm13, %ymm11
vpmaxsd %ymm12, %ymm11, %ymm12
xorl %r12d, %r12d
cmpq %r12, %r10
je 0x548fd6
movq 0x10(%rbx), %rsi
movq (%rsi), %rsi
vmovdqa (%r14,%r12), %ymm0
vpsubd %ymm3, %ymm12, %ymm1
vpsubd %ymm4, %ymm11, %ymm6
vpmaxsd %ymm6, %ymm1, %ymm11
vpcmpgtd %ymm6, %ymm1, %ymm1
vbroadcastss 0x847e8(%rip), %ymm6 # 0x5cd750
vbroadcastss 0x847e3(%rip), %ymm9 # 0x5cd754
vblendvps %ymm1, %ymm6, %ymm9, %ymm1
vpmaxsd %ymm11, %ymm0, %ymm12
vpcmpeqd (%r13,%r12), %ymm12, %ymm6
vpcmpgtd %ymm11, %ymm0, %ymm0
vpbroadcastd 0x847c7(%rip), %ymm9 # 0x5cd758
vpaddd %ymm0, %ymm9, %ymm0
vbroadcastss 0x847be(%rip), %ymm9 # 0x5cd75c
vblendvps %ymm6, %ymm9, %ymm0, %ymm0
addq %r11, %rsi
vorps (%r12,%rsi), %ymm1, %ymm1
vorps %ymm0, %ymm1, %ymm0
vmovaps %ymm0, (%r12,%rsi)
vmovdqa %ymm12, (%r13,%r12)
vpminsd %ymm11, %ymm2, %ymm0
vpminsd %ymm12, %ymm0, %ymm2
vpmaxsd %ymm12, %ymm5, %ymm5
addq $0x20, %r12
jmp 0x548f38
movq 0x28(%rsp), %rsi
vmovdqa (%rsi), %ymm0
vpcmpgtd %ymm8, %ymm0, %ymm1
vpmaxsd %ymm8, %ymm0, %ymm8
vtestps %ymm10, %ymm1
cmovnel %ecx, %edi
addq %r10, %r11
movq %rdx, %rcx
jmp 0x548def
cmpl $0x0, 0x20(%rbp)
movl 0x54(%rsp), %r11d
movq 0x40(%rsp), %r10
movl 0x3c(%rsp), %esi
vmovdqa 0xa0(%rsp), %ymm1
je 0x54903d
xorl %ecx, %ecx
cmpl %esi, %ecx
jge 0x54902f
vperm2i128 $0x28, %ymm8, %ymm8, %ymm0 # ymm0 = zero,zero,ymm8[0,1]
vpalignr $0xc, %ymm0, %ymm8, %ymm8 # ymm8 = ymm0[12,13,14,15],ymm8[0,1,2,3,4,5,6,7,8,9,10,11],ymm0[28,29,30,31],ymm8[16,17,18,19,20,21,22,23,24,25,26,27]
incl %ecx
jmp 0x54901b
vextracti128 $0x1, %ymm8, %xmm0
vpextrd $0x3, %xmm0, 0x18(%rsp)
cmpl $0x0, 0x10(%rbp)
je 0x5490ba
movq 0x20(%rsp), %rdx
andl $0xfffffff, %edx        # imm = 0xFFFFFFF
shll $0x3, %edx
xorl %r8d, %r8d
movl %r11d, %ecx
cmpl %r8d, %edx
je 0x5490b4
movl %r8d, %esi
shrl $0x3, %esi
movl %r8d, %r9d
andl $0x7, %r9d
imull 0x20(%rsp), %r9d
addl %esi, %r9d
cmpl %r10d, %r9d
jge 0x5490af
movl (%r13,%r8,4), %r10d
movl 0x18(%rsp), %esi
cmpl %esi, %r10d
jle 0x549093
movl %r10d, 0x18(%rsp)
movl 0x1c(%rsp), %edi
movl %r9d, %ecx
jmp 0x5490aa
xorl %esi, %r10d
movl %edi, %esi
xorl 0x1c(%rsp), %esi
cmpl %ecx, %r9d
cmovgel %ecx, %r9d
orl %r10d, %esi
cmovel %r9d, %ecx
movq 0x40(%rsp), %r10
incq %r8
jmp 0x549057
movl 0x3c(%rsp), %esi
jmp 0x5490bd
movl %r11d, %ecx
movl 0x10(%rbp), %edx
orl %edx, 0x4c(%rsp)
jne 0x5490fa
movq 0x28(%rsp), %rcx
vmovaps (%rcx), %ymm3
xorl %ecx, %ecx
cmpl %esi, %ecx
jge 0x5490e5
vperm2f128 $0x28, %ymm3, %ymm3, %ymm0 # ymm0 = zero,zero,ymm3[0,1]
vpalignr $0xc, %ymm0, %ymm3, %ymm3 # ymm3 = ymm0[12,13,14,15],ymm3[0,1,2,3,4,5,6,7,8,9,10,11],ymm0[28,29,30,31],ymm3[16,17,18,19,20,21,22,23,24,25,26,27]
incl %ecx
jmp 0x5490d1
vextractf128 $0x1, %ymm3, %xmm0
vextractps $0x3, %xmm0, 0x18(%rsp)
movl 0x1c(%rsp), %edi
movl %r11d, %ecx
vmovdqa 0x80(%rsp), %ymm0
vpcmpgtd %ymm2, %ymm0, %ymm0
vpcmpgtd %ymm1, %ymm5, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestps %ymm0, %ymm0
je 0x549126
orb $0x40, 0xc(%rbx)
movl $0x0, 0x18(%rsp)
xorl %edi, %edi
xorl %ecx, %ecx
movl 0x18(%rsp), %edx
movl %edx, (%rbx)
movl %ecx, 0x4(%rbx)
movl %edi, 0x8(%rbx)
movq %rax, %rdi
vzeroupper
callq 0x1ab763
movq %r13, %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
movq 0x30(%rsp), %rdi
callq 0x1ab763
movq %r15, %rdi
callq 0x1ab763
jmp 0x54927f
movq 0x1f1e6d(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7de76(%rip), %rsi     # 0x5c6feb
leaq 0x8460d(%rip), %rdx     # 0x5cd789
leaq 0x5435a(%rip), %rcx     # 0x59d4dd
jmp 0x549276
movq 0x1f1e49(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7de52(%rip), %rsi     # 0x5c6feb
leaq 0x845e9(%rip), %rdx     # 0x5cd789
leaq 0x7e7ff(%rip), %rcx     # 0x5c79a6
jmp 0x549276
movq 0x1f1e25(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7de2e(%rip), %rsi     # 0x5c6feb
leaq 0x845c5(%rip), %rdx     # 0x5cd789
leaq 0x7e76e(%rip), %rcx     # 0x5c7939
jmp 0x549276
movq 0x1f1e01(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7e520(%rip), %rsi     # 0x5c7701
leaq 0x845a1(%rip), %rdx     # 0x5cd789
leaq 0x7e75a(%rip), %rcx     # 0x5c7949
jmp 0x549276
movq 0x1f1ddd(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7dde6(%rip), %rsi     # 0x5c6feb
leaq 0x8457d(%rip), %rdx     # 0x5cd789
leaq 0x7e4eb(%rip), %rcx     # 0x5c76fe
jmp 0x549276
movq 0x1f1dbc(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7e4db(%rip), %rsi     # 0x5c7701
leaq 0x8455c(%rip), %rdx     # 0x5cd789
leaq 0x7e4e1(%rip), %rcx     # 0x5c7715
jmp 0x549276
movq 0x1f1d9b(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7e4d4(%rip), %rsi     # 0x5c771b
leaq 0x8453b(%rip), %rdx     # 0x5cd789
leaq 0x7e4db(%rip), %rcx     # 0x5c7730
jmp 0x549276
movq 0x1f1d7a(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x7e4b3(%rip), %rsi     # 0x5c771b
leaq 0x8451a(%rip), %rdx     # 0x5cd789
leaq 0x7e4bf(%rip), %rcx     # 0x5c7735
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq