// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq %rdx, %r12
movq %rdi, 0x18(%rsp)
movq 0x68(%rsp), %rbp
movq 0x60(%rsp), %r15
cmpq $0x11, %rcx
setge 0x8(%rsp)
setl %al
cmpq $0x11, %r8
setl %cl
testb %cl, %al
jne 0x31faf
movq %rsi, 0x10(%rsp)
movq %r13, %rbp
movq %r12, %r13
movq %rbp, 0x20(%rsp)
movq %r13, %r12
cmpq %r14, %rbp
jg 0x31ef2
cmpq $0x11, %r14
jge 0x31e59
movq %r14, %r13
xorl %r14d, %r14d
jmp 0x31ea5
movq %r14, %rax
andq $0xf, %rax
je 0x31e71
movabsq $0x7ffffffffffffff0, %rcx # imm = 0x7FFFFFFFFFFFFFF0
andq %rcx, %r14
jmp 0x31e9f
movq %r14, %rax
shrq %rax
subq %rax, %r14
leaq 0xf(%r14), %rdx
testq %r14, %r14
cmovnsq %r14, %rdx
andq $-0x10, %rdx
movq %r14, %rcx
subq %rdx, %rcx
je 0x31e9f
movl $0x10, %edx
subq %rcx, %rdx
addq %rdx, %r14
subq %rdx, %rax
movq %r14, %r13
movq %rax, %r14
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %r12, %rdx
movq 0x28(%rsp), %rbp
movq %rbp, %rcx
movq %r13, %r8
movq %rbx, %r9
pushq 0x78(%rsp)
pushq 0x78(%rsp)
pushq %r15
callq 0x31deb
addq $0x20, %rsp
addq %r12, %r13
cmpq $0x11, %r14
setge %al
orb 0x8(%rsp), %al
testb $0x1, %al
jne 0x31e3f
jmp 0x31f9f
cmpq $0x11, %rbp
jge 0x31f00
movq %rbp, %rcx
xorl %r13d, %r13d
jmp 0x31f49
movq %rbp, %r13
andq $0xf, %r13
je 0x31f18
movabsq $0x7ffffffffffffff0, %rcx # imm = 0x7FFFFFFFFFFFFFF0
andq %rcx, %rbp
jmp 0x31f46
movq %rbp, %r13
shrq %r13
subq %r13, %rbp
leaq 0xf(%rbp), %rdx
testq %rbp, %rbp
cmovnsq %rbp, %rdx
andq $-0x10, %rdx
movq %rbp, %rcx
subq %rdx, %rcx
je 0x31f46
movl $0x10, %edx
subq %rcx, %rdx
addq %rdx, %rbp
subq %rdx, %r13
movq %rbp, %rcx
movq %rcx, 0x8(%rsp)
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %r12, %rdx
movq %r14, %r8
movq %rbx, %r9
pushq 0x78(%rsp)
movq 0x78(%rsp), %rbp
pushq %rbp
pushq %r15
callq 0x31deb
movq 0x28(%rsp), %rsi
addq $0x20, %rsp
addq 0x10(%rsp), %rsi
cmpq $0x11, %r13
setge 0x8(%rsp)
jge 0x31e2f
cmpq $0x10, %r14
jg 0x31e2f
jmp 0x31faf
movq 0x10(%rsp), %rsi
movq %r13, %r12
movq %rbp, %r13
movq 0x68(%rsp), %rbp
testq %r13, %r13
jle 0x320b2
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rax
movq 0x30(%rcx), %rdx
movq %rax, %rcx
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 0x4232(%rip), %xmm0     # 0x36220
testq %r14, %r14
jle 0x3209f
movq 0x70(%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 0x32049
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 0x3204e
movb $0x1, (%rbx)
jmp 0x32090
pand %xmm0, %xmm1
movsd (%r15), %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%r15)
movq (%rcx,%r9,8), %xmm1
pand %xmm0, %xmm1
maxsd %xmm1, %xmm2
movsd %xmm2, (%r15)
movsd (%r8), %xmm1
subsd (%rcx,%r9,8), %xmm1
andpd %xmm0, %xmm1
movsd (%rbp), %xmm2
maxsd %xmm1, %xmm2
movsd %xmm2, (%rbp)
incq %r9
addq %rax, %r8
cmpq %r9, %r14
jne 0x32005
incq %rsi
addq $0x8, %rdx
addq %rax, %rcx
cmpq %r13, %rsi
jne 0x31fee
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq