// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib_impl::is_symmetric_rec_off_stat(alglib_impl::x_matrix*, long, long, long, long, bool*, double*, double*, alglib_impl::ae_state*)
static void is_symmetric_rec_off_stat(x_matrix *a, ae_int_t offset0, ae_int_t offset1, ae_int_t len0, ae_int_t len1, ae_bool *nonfinite, double *mx, double *err, ae_state *_state)
{
    /* try to split problem into two smaller ones */
    if( len0>x_nb || len1>x_nb )
    {
        ae_int_t n1, n2;
        if( len0>len1 )
        {
            x_split_length(len0, x_nb, &n1, &n2);
            is_symmetric_rec_off_stat(a, offset0,    offset1, n1, len1, nonfinite, mx, err, _state);
            is_symmetric_rec_off_stat(a, offset0+n1, offset1, n2, len1, nonfinite, mx, err, _state);
        }
        else
        {
            x_split_length(len1, x_nb, &n1, &n2);
            is_symmetric_rec_off_stat(a, offset0, offset1,    len0, n1, nonfinite, mx, err, _state);
            is_symmetric_rec_off_stat(a, offset0, offset1+n1, len0, n2, nonfinite, mx, err, _state);
        }
        return;
    }
    else
    {
        /* base case */
        double *p1, *p2, *prow, *pcol;
        double v;
        ae_int_t i, j;

        p1 = (double*)(a->ptr)+offset0*a->stride+offset1;
        p2 = (double*)(a->ptr)+offset1*a->stride+offset0;
        for(i=0; i<len0; i++)
        {
            pcol = p2+i;
            prow = p1+i*a->stride;
            for(j=0; j<len1; j++)
            {
                if( !ae_isfinite(*pcol,_state) || !ae_isfinite(*prow,_state) )
                {
                    *nonfinite = ae_true;
                }
                else
                {
                    v = fabs(*pcol);
                    *mx =  *mx>v ? *mx : v;
                    v = fabs(*prow);
                    *mx =  *mx>v ? *mx : v;
                    v = fabs(*pcol-*prow);
                    *err = *err>v ? *err : v;
                }                
                pcol += a->stride;
                prow++;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq 0x70(%rsp), %r12
movq 0x68(%rsp), %rbp
movq 0x60(%rsp), %r13
cmpq $0x11, %rcx
setl %al
cmpq $0x11, %r8
setl %cl
testb %cl, %al
jne 0x2e6ec
movq %rdi, (%rsp)
movq %rsi, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x18(%rsp), %rdx
cmpq %r14, %r15
jle 0x2e7ed
movq %r15, %rdi
movq %rsi, %r15
callq 0x2e5da
movq (%r15), %r15
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
pushq %r12
pushq %rbp
pushq %r13
callq 0x2e635
addq $0x20, %rsp
addq 0x8(%rsp), %r15
leaq 0x18(%rsp), %rax
movq (%rax), %rcx
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
jmp 0x2e846
movq 0x10(%rdi), %rax
movq 0x30(%rdi), %rdi
movq %rax, %rcx
imulq %rsi, %rcx
leaq (%rdi,%rcx,8), %rcx
leaq (%rcx,%rdx,8), %rcx
imulq %rax, %rdx
leaq (%rdi,%rdx,8), %rdx
leaq (%rdx,%rsi,8), %rdx
xorl %esi, %esi
testq %r14, %r14
cmovleq %rsi, %r14
testq %r15, %r15
cmovleq %rsi, %r15
shlq $0x3, %rax
movdqa 0x4ae5(%rip), %xmm0     # 0x33210
cmpq %r15, %rsi
je 0x2e857
movq %rdx, %rdi
xorl %r8d, %r8d
cmpq %r8, %r14
je 0x2e7de
movq (%rdi), %xmm1
movq (%r12), %r9
movq %xmm1, %r10
movq %r10, %r11
shrq $0x20, %r11
cmpq $0x1, %r9
cmovnel %r10d, %r11d
notl %r11d
testl $0x7ff00000, %r11d      # imm = 0x7FF00000
je 0x2e78a
movq (%rcx,%r8,8), %r10
movq %r10, %r11
shrq $0x20, %r11
cmpq $0x1, %r9
cmovnel %r10d, %r11d
notl %r11d
testl $0x7ff00000, %r11d      # imm = 0x7FF00000
jne 0x2e78f
movb $0x1, (%rbx)
jmp 0x2e7d3
pand %xmm0, %xmm1
movsd (%r13), %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%r13)
movq (%rcx,%r8,8), %xmm1
pand %xmm0, %xmm1
maxsd %xmm1, %xmm2
movsd %xmm2, (%r13)
movsd (%rdi), %xmm1
subsd (%rcx,%r8,8), %xmm1
andpd %xmm0, %xmm1
movsd (%rbp), %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%rbp)
incq %r8
addq %rax, %rdi
jmp 0x2e73a
incq %rsi
addq %rax, %rcx
addq $0x8, %rdx
jmp 0x2e72b
movq %r14, %rdi
movq %rsi, %r14
callq 0x2e5da
movq (%r14), %r14
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
pushq %r12
pushq %rbp
pushq %r13
callq 0x2e635
addq $0x20, %rsp
addq 0x10(%rsp), %r14
leaq 0x18(%rsp), %rax
movq (%rax), %r8
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r9
pushq %r12
pushq %rbp
pushq %r13
callq 0x2e635
addq $0x20, %rsp
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq