// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib_impl::_ialglib_mcopyblock_complex(long, long, alglib_impl::ae_complex const*, long, long, double*)
void _ialglib_mcopyblock_complex(ae_int_t m, ae_int_t n, const ae_complex *a, ae_int_t op, ae_int_t stride, double *b)
{
    ae_int_t i, j;
    const ae_complex *psrc;
    double *pdst;
    if( op==0 )
    {
        for(i=0,psrc=a; i<m; i++,a+=stride,b+=alglib_twice_c_block,psrc=a)
            for(j=0,pdst=b; j<n; j++,pdst+=2,psrc++)
            {
                pdst[0] = psrc->x;
                pdst[1] = psrc->y;
            }
    }
    if( op==1 )
    {
        for(i=0,psrc=a; i<m; i++,a+=stride,b+=2,psrc=a)
            for(j=0,pdst=b; j<n; j++,pdst+=alglib_twice_c_block,psrc++)
            {
                pdst[0] = psrc->x;
                pdst[1] = psrc->y;
            }
    }
    if( op==2 )
    {
        for(i=0,psrc=a; i<m; i++,a+=stride,b+=2,psrc=a)
            for(j=0,pdst=b; j<n; j++,pdst+=alglib_twice_c_block,psrc++)
            {
                pdst[0] = psrc->x;
                pdst[1] = -psrc->y;
            }
    }
    if( op==3 )
    {
        for(i=0,psrc=a; i<m; i++,a+=stride,b+=alglib_twice_c_block,psrc=a)
            for(j=0,pdst=b; j<n; j++,pdst+=2,psrc++)
            {
                pdst[0] = psrc->x;
                pdst[1] = -psrc->y;
            }
    }
}

// Assembly:
pushq %r14
pushq %rbx
testq %rcx, %rcx
setne %al
testq %rdi, %rdi
setle %r10b
orb %al, %r10b
jne 0x2f3d2
movq %r8, %rax
shlq $0x4, %rax
xorl %r10d, %r10d
testq %rsi, %rsi
jle 0x2f3c0
movq %rsi, %r11
xorl %ebx, %ebx
movsd (%rdx,%rbx), %xmm0
movsd %xmm0, (%r9,%rbx)
movsd 0x8(%rdx,%rbx), %xmm0
movsd %xmm0, 0x8(%r9,%rbx)
addq $0x10, %rbx
decq %r11
jne 0x2f39f
incq %r10
addq %rax, %rdx
addq $0x180, %r9             # imm = 0x180
cmpq %rdi, %r10
jne 0x2f395
testq %rdi, %rdi
setle %al
cmpq $0x1, %rcx
setne %r10b
orb %al, %r10b
jne 0x2f42f
xorl %eax, %eax
movq %r8, %r10
shlq $0x4, %r10
testq %rsi, %rsi
jle 0x2f420
movq %rsi, %r11
movq %r9, %rbx
movq %rdx, %r14
movsd (%r14), %xmm0
movsd %xmm0, (%rbx)
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x8(%rbx)
addq $0x180, %rbx            # imm = 0x180
addq $0x10, %r14
decq %r11
jne 0x2f3fc
incq %rax
addq %r10, %rdx
addq $0x10, %r9
cmpq %rdi, %rax
jne 0x2f3ee
testq %rdi, %rdi
setle %al
cmpq $0x2, %rcx
setne %r10b
orb %al, %r10b
jne 0x2f495
xorl %eax, %eax
movaps 0x3d65(%rip), %xmm0     # 0x331b0
movq %r8, %r10
shlq $0x4, %r10
testq %rsi, %rsi
jle 0x2f486
movq %rsi, %r11
movq %r9, %rbx
movq %rdx, %r14
movsd (%r14), %xmm1
movsd %xmm1, (%rbx)
movsd 0x8(%r14), %xmm1
xorps %xmm0, %xmm1
movlps %xmm1, 0x8(%rbx)
addq $0x180, %rbx            # imm = 0x180
addq $0x10, %r14
decq %r11
jne 0x2f460
incq %rax
addq %r10, %rdx
addq $0x10, %r9
cmpq %rdi, %rax
jne 0x2f452
testq %rdi, %rdi
setle %al
cmpq $0x3, %rcx
setne %cl
orb %al, %cl
jne 0x2f4f5
shlq $0x4, %r8
xorl %eax, %eax
movaps 0x3cfd(%rip), %xmm0     # 0x331b0
testq %rsi, %rsi
jle 0x2f4e3
movq %rsi, %rcx
xorl %r10d, %r10d
movsd (%rdx,%r10), %xmm1
movsd %xmm1, (%r9,%r10)
movsd 0x8(%rdx,%r10), %xmm1
xorps %xmm0, %xmm1
movlps %xmm1, 0x8(%r9,%r10)
addq $0x10, %r10
decq %rcx
jne 0x2f4be
incq %rax
addq $0x180, %r9             # imm = 0x180
addq %r8, %rdx
cmpq %rdi, %rax
jne 0x2f4b3
popq %rbx
popq %r14
retq