// File: /workspace/github_cpp_makefile_star2_O1/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 $0x18, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x50(%rsp), %r13
cmpq $0x10, %r15
jg 0x32aee
cmpq $0x11, %r14
jl 0x32c1e
cmpq %r14, %r15
jg 0x32b7f
cmpq $0x11, %r14
jge 0x32b01
xorl %ebp, %ebp
jmp 0x32b47
movq %r14, %rbp
andq $0xf, %rbp
je 0x32b19
movabsq $0x7ffffffffffffff0, %rax # imm = 0x7FFFFFFFFFFFFFF0
andq %rax, %r14
jmp 0x32b47
movq %r14, %rbp
shrq %rbp
subq %rbp, %r14
leaq 0xf(%r14), %rcx
testq %r14, %r14
cmovnsq %r14, %rcx
andq $-0x10, %rcx
movq %r14, %rax
subq %rcx, %rax
je 0x32b47
movl $0x10, %ecx
subq %rax, %rcx
addq %rcx, %r14
subq %rcx, %rbp
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq %r13
callq 0x32ab5
addq $0x20, %rsp
addq %r14, %r12
movq %rbp, %r14
jmp 0x32ade
cmpq $0x11, %r15
jge 0x32b8f
movq $0x0, (%rsp)
jmp 0x32bdd
movq %r15, %rcx
andq $0xf, %rcx
je 0x32bab
movabsq $0x7ffffffffffffff0, %rax # imm = 0x7FFFFFFFFFFFFFF0
andq %rax, %r15
movq %rcx, (%rsp)
jmp 0x32bdd
movq %r15, %rdx
shrq %rdx
subq %rdx, %r15
leaq 0xf(%r15), %rcx
testq %r15, %r15
cmovnsq %r15, %rcx
andq $-0x10, %rcx
movq %r15, %rax
subq %rcx, %rax
je 0x32bd9
movl $0x10, %ecx
subq %rax, %rcx
addq %rcx, %r15
subq %rcx, %rdx
movq %rdx, (%rsp)
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rbp
movq %rbp, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq %r13
callq 0x32ab5
addq $0x20, %rsp
addq %r15, %rbp
movq %rbp, 0x8(%rsp)
movq (%rsp), %r15
jmp 0x32ade
testq %r15, %r15
jle 0x32d30
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rax
movq 0x30(%rcx), %rdx
movq %rax, %rcx
movq 0x8(%rsp), %rsi
imulq %rsi, %rcx
leaq (%rdx,%rcx,8), %rcx
leaq (%rcx,%r12,8), %rcx
imulq %rax, %r12
leaq (%rdx,%r12,8), %rdx
leaq (%rdx,%rsi,8), %rdx
shlq $0x3, %rax
xorl %esi, %esi
movdqa 0x443e(%rip), %xmm0     # 0x370a0
testq %r14, %r14
movq 0x58(%rsp), %r12
jle 0x32d1d
movq 0x60(%rsp), %rdi
movq (%rdi), %rdi
movq %rdx, %r8
xorl %r9d, %r9d
movq (%r8), %xmm1
movq %xmm1, %r10
movq %r10, %r11
shrq $0x20, %r11
cmpq $0x1, %rdi
cmovnel %r10d, %r11d
notl %r11d
testl $0x7ff00000, %r11d      # imm = 0x7FF00000
je 0x32cc2
movq (%rcx,%r9,8), %r10
movq %r10, %r11
shrq $0x20, %r11
cmpq $0x1, %rdi
cmovnel %r10d, %r11d
notl %r11d
testl $0x7ff00000, %r11d      # imm = 0x7FF00000
jne 0x32cc7
movb $0x1, (%rbx)
jmp 0x32d0e
pand %xmm0, %xmm1
movsd (%r13), %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%r13)
movq (%rcx,%r9,8), %xmm1
pand %xmm0, %xmm1
maxsd %xmm1, %xmm2
movsd %xmm2, (%r13)
movsd (%r8), %xmm1
subsd (%rcx,%r9,8), %xmm1
andpd %xmm0, %xmm1
movsd (%r12), %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%r12)
incq %r9
addq %rax, %r8
cmpq %r9, %r14
jne 0x32c7e
incq %rsi
addq $0x8, %rdx
addq %rax, %rcx
cmpq %r15, %rsi
jne 0x32c62
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq