// File: 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
movq %rsp, %rbp
subq $0xb0, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x10, -0x20(%rbp)
jg 0x52361
cmpq $0x10, -0x28(%rbp)
jle 0x52489
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jle 0x523fc
movq -0x20(%rbp), %rdi
movl $0x10, %esi
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x52220
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x52320
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x52320
jmp 0x52484
movq -0x28(%rbp), %rdi
movl $0x10, %esi
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x52220
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x52320
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x52320
jmp 0x526b9
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
imulq 0x10(%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x18(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rdx
imulq 0x10(%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x526b7
movq -0x50(%rbp), %rax
movq -0x70(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq -0x70(%rbp), %rcx
movq -0x8(%rbp), %rdx
imulq 0x10(%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x526a4
movq -0x60(%rbp), %rax
movsd (%rax), %xmm0
movq 0x20(%rbp), %rdi
callq 0x3c730
testb $0x1, %al
jne 0x52551
jmp 0x52566
movq -0x58(%rbp), %rax
movsd (%rax), %xmm0
movq 0x20(%rbp), %rdi
callq 0x3c730
testb $0x1, %al
jne 0x52572
movq -0x30(%rbp), %rax
movb $0x1, (%rax)
jmp 0x52673
movq -0x60(%rbp), %rax
movsd (%rax), %xmm0
movaps 0x5b2f(%rip), %xmm1     # 0x580b0
pand %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movq 0x10(%rbp), %rax
movsd (%rax), %xmm0
ucomisd -0x68(%rbp), %xmm0
jbe 0x525a8
movq 0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x80(%rbp)
jmp 0x525b2
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x80(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x58(%rbp), %rax
movsd (%rax), %xmm0
movaps 0x5ae2(%rip), %xmm1     # 0x580b0
pand %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movq 0x10(%rbp), %rax
movsd (%rax), %xmm0
ucomisd -0x68(%rbp), %xmm0
jbe 0x525f8
movq 0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x88(%rbp)
jmp 0x52605
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x88(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x60(%rbp), %rax
movsd (%rax), %xmm0
movq -0x58(%rbp), %rax
subsd (%rax), %xmm0
movaps 0x5a84(%rip), %xmm1     # 0x580b0
pand %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movq 0x18(%rbp), %rax
movsd (%rax), %xmm0
ucomisd -0x68(%rbp), %xmm0
jbe 0x52656
movq 0x18(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0x52663
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
movq 0x18(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shlq $0x3, %rax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x5252c
jmp 0x526a6
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x524e7
jmp 0x526b9
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)