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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r13
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq 0x60(%rsp), %rdx
cmpq $0x11, %r14
jl 0x263c6
movq %r14, %rax
andq $0xf, %rax
je 0x26648
movq %rax, 0x18(%rsp)
movabsq $0x7ffffffffffffff0, %rax # imm = 0x7FFFFFFFFFFFFFF0
andq %rax, %r14
jmp 0x2667b
testq %r14, %r14
jle 0x266ec
movq 0x10(%rdi), %rax
movq %rax, %rcx
imulq %r15, %rcx
shlq $0x4, %rcx
addq 0x30(%rdi), %rcx
shlq $0x4, %r15
addq %rcx, %r15
leaq 0x1(%rax), %rcx
movq (%rdx), %rdx
shlq $0x4, %rax
xorl %esi, %esi
movdqa 0xfe22(%rip), %xmm0     # 0x36220
xorpd %xmm1, %xmm1
movdqa 0xfe16(%rip), %xmm2     # 0x36220
movsd 0xcdce(%rip), %xmm3     # 0x331e0
movq %r15, %rdi
xorl %r8d, %r8d
testq %r8, %r8
je 0x265a6
movq %r15, %r9
xorl %r10d, %r10d
movq (%r9,%rsi), %xmm4
movq %xmm4, %r11
movq %r11, %rbp
shrq $0x20, %rbp
cmpq $0x1, %rdx
cmovnel %r11d, %ebp
notl %ebp
testl $0x7ff00000, %ebp       # imm = 0x7FF00000
je 0x264ab
movq 0x8(%r9,%rsi), %xmm5
movq %xmm5, %r11
movq %r11, %rbp
shrq $0x20, %rbp
cmpq $0x1, %rdx
cmovnel %r11d, %ebp
notl %ebp
testl $0x7ff00000, %ebp       # imm = 0x7FF00000
je 0x264ab
movq (%rdi,%r10), %r11
movq %r11, %rbp
shrq $0x20, %rbp
cmpq $0x1, %rdx
cmovnel %r11d, %ebp
notl %ebp
testl $0x7ff00000, %ebp       # imm = 0x7FF00000
je 0x264ab
movq 0x8(%rdi,%r10), %r11
movq %r11, %rbp
shrq $0x20, %rbp
cmpq $0x1, %rdx
cmovnel %r11d, %ebp
notl %ebp
testl $0x7ff00000, %ebp       # imm = 0x7FF00000
jne 0x264c3
movb $0x1, (%rbx)
addq $0x10, %r10
addq %rax, %r9
cmpq %r10, %rsi
jne 0x26427
jmp 0x265a6
pand %xmm0, %xmm4
pand %xmm0, %xmm5
movdqa %xmm4, %xmm6
maxsd %xmm5, %xmm6
minsd %xmm5, %xmm4
ucomisd %xmm1, %xmm4
jne 0x264df
jnp 0x264f3
divsd %xmm6, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm3, %xmm4
sqrtsd %xmm4, %xmm4
mulsd %xmm4, %xmm6
movsd (%r12), %xmm4
maxsd %xmm6, %xmm4
movsd %xmm4, (%r12)
movdqu (%rdi,%r10), %xmm6
pand %xmm2, %xmm6
pshufd $0xee, %xmm6, %xmm7     # xmm7 = xmm6[2,3,2,3]
movdqa %xmm6, %xmm5
maxsd %xmm7, %xmm5
minsd %xmm7, %xmm6
ucomisd %xmm1, %xmm6
jne 0x26526
jnp 0x2653a
divsd %xmm5, %xmm6
mulsd %xmm6, %xmm6
addsd %xmm3, %xmm6
sqrtsd %xmm6, %xmm6
mulsd %xmm6, %xmm5
maxsd %xmm5, %xmm4
movsd %xmm4, (%r12)
movupd (%r9,%rsi), %xmm4
movupd (%rdi,%r10), %xmm5
movapd %xmm4, %xmm6
subpd %xmm5, %xmm6
addpd %xmm5, %xmm4
movsd %xmm6, %xmm4            # xmm4 = xmm6[0],xmm4[1]
andpd %xmm2, %xmm4
pshufd $0xee, %xmm4, %xmm6     # xmm6 = xmm4[2,3,2,3]
movapd %xmm4, %xmm5
maxsd %xmm6, %xmm5
minsd %xmm6, %xmm4
ucomisd %xmm1, %xmm4
jne 0x2657d
jnp 0x26591
divsd %xmm5, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm3, %xmm4
sqrtsd %xmm4, %xmm4
mulsd %xmm4, %xmm5
movsd (%r13), %xmm4
maxsd %xmm5, %xmm4
movsd %xmm4, (%r13)
jmp 0x264ae
movq %r8, %r9
imulq %rcx, %r9
shlq $0x4, %r9
movq (%r15,%r9), %xmm4
movq %xmm4, %r10
movq %r10, %r11
shrq $0x20, %r11
cmpq $0x1, %rdx
cmovnel %r10d, %r11d
notl %r11d
testl $0x7ff00000, %r11d      # imm = 0x7FF00000
je 0x265f7
movq 0x8(%r15,%r9), %r10
movq %r10, %r11
shrq $0x20, %r11
cmpq $0x1, %rdx
cmovnel %r10d, %r11d
notl %r11d
testl $0x7ff00000, %r11d      # imm = 0x7FF00000
jne 0x265fc
movb $0x1, (%rbx)
jmp 0x26630
addq %r15, %r9
addq $0x8, %r9
pand %xmm0, %xmm4
movsd (%r12), %xmm5
maxsd %xmm4, %xmm5
movsd %xmm5, (%r12)
movq (%r9), %xmm4
pand %xmm0, %xmm4
movsd (%r13), %xmm5
maxsd %xmm4, %xmm5
movsd %xmm5, (%r13)
incq %r8
addq $0x10, %rsi
addq %rax, %rdi
cmpq %r14, %r8
jne 0x26418
jmp 0x266ec
movq %r14, %rsi
shrq %rsi
subq %rsi, %r14
leaq 0xf(%r14), %rcx
testq %r14, %r14
cmovnsq %r14, %rcx
andq $-0x10, %rcx
movq %r14, %rax
subq %rcx, %rax
je 0x26676
movl $0x10, %ecx
subq %rax, %rcx
addq %rcx, %r14
subq %rcx, %rsi
movq %rsi, 0x18(%rsp)
movq %rdx, (%rsp)
movq %rdi, %rbp
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x2637a
leaq (%r14,%r15), %rsi
movq %rsi, 0x20(%rsp)
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq 0x18(%rsp), %rdx
movq %rbx, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x2637a
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq %r12, (%rsp)
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rdx
movq 0x18(%rsp), %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x320c1
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq