// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib::complex::tostring[abi:cxx11](int) const
std::string alglib::complex::tostring(int _dps) const
{
    char mask[32];
    char buf_x[32];
    char buf_y[32];
    char buf_zero[32];
    int dps = _dps>=0 ? _dps : -_dps;
    if( dps<=0 || dps>=20 )
        throw ap_error("complex::tostring(): incorrect dps");

    // handle IEEE special quantities
    if( fp_isnan(x) || fp_isnan(y) )
        return "NAN";
    if( fp_isinf(x) || fp_isinf(y) )
        return "INF";

    // generate mask
    if( sprintf(mask, "%%.%d%s", dps, _dps>=0 ? "f" : "e")>=(int)sizeof(mask) )
        throw ap_error("complex::tostring(): buffer overflow");

    // print |x|, |y| and zero with same mask and compare
    if( sprintf(buf_x, mask, (double)(fabs(x)))>=(int)sizeof(buf_x) )
        throw ap_error("complex::tostring(): buffer overflow");
    if( sprintf(buf_y, mask, (double)(fabs(y)))>=(int)sizeof(buf_y) )
        throw ap_error("complex::tostring(): buffer overflow");
    if( sprintf(buf_zero, mask, (double)0)>=(int)sizeof(buf_zero) )
        throw ap_error("complex::tostring(): buffer overflow");

    // different zero/nonzero patterns
    if( strcmp(buf_x,buf_zero)!=0 && strcmp(buf_y,buf_zero)!=0 )
        return std::string(x>0 ? "" : "-")+buf_x+(y>0 ? "+" : "-")+buf_y+"i";
    if( strcmp(buf_x,buf_zero)!=0 && strcmp(buf_y,buf_zero)==0 )
        return std::string(x>0 ? "" : "-")+buf_x;
    if( strcmp(buf_x,buf_zero)==0 && strcmp(buf_y,buf_zero)!=0 )
        return std::string(y>0 ? "" : "-")+buf_y+"i";
    return std::string("0");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %edx, %ebp
negl %ebp
cmovsl %edx, %ebp
jae 0x272d2
cmpl $0x14, %ebp
jae 0x272d2
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movsd (%rsi), %xmm0
movsd %xmm0, 0x58(%rsp)
callq 0x273fb
testb %al, %al
jne 0x26ffa
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x50(%rsp)
callq 0x273fb
testb %al, %al
je 0x2701f
leaq 0xcc31(%rip), %rsi      # 0x33c32
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x2ee42
movq %rbx, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movsd 0x58(%rsp), %xmm0
callq 0x27407
testb %al, %al
jne 0x2703d
movsd 0x50(%rsp), %xmm0
callq 0x27407
testb %al, %al
je 0x27046
leaq 0xcbf4(%rip), %rsi      # 0x33c38
jmp 0x27001
testl %r15d, %r15d
leaq 0xca70(%rip), %rax      # 0x33ac0
leaq 0x933c(%rip), %rcx      # 0x30393
cmovnsq %rax, %rcx
leaq 0xc944(%rip), %rsi      # 0x339a6
leaq 0xc0(%rsp), %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3070
cmpl $0x20, %eax
jge 0x27302
movsd (%r14), %xmm0
andpd 0xc187(%rip), %xmm0     # 0x33210
leaq 0xa0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movb $0x1, %al
callq 0x3070
cmpl $0x20, %eax
jge 0x2731e
movsd 0x8(%r14), %xmm0
andpd 0xc159(%rip), %xmm0     # 0x33210
leaq 0x80(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movb $0x1, %al
callq 0x3070
cmpl $0x20, %eax
jge 0x2733a
leaq 0x100(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
xorpd %xmm0, %xmm0
movb $0x1, %al
callq 0x3070
cmpl $0x20, %eax
jge 0x27356
leaq 0xa0(%rsp), %rdi
leaq 0x100(%rsp), %r15
movq %r15, %rsi
callq 0x3310
movl %eax, %ebp
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x3310
testl %ebp, %ebp
je 0x27201
testl %eax, %eax
je 0x27274
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x9038(%rip), %rsi      # 0x30181
leaq 0xcab5(%rip), %r15      # 0x33c05
cmovbeq %r15, %rsi
leaq 0xe0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2ee42
leaq 0x60(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x2ee7d
movsd 0x8(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0xc83e(%rip), %rax      # 0x339d3
cmovaq %rax, %r15
leaq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %r15, %rdx
callq 0x2ee7d
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x2ee7d
leaq 0xc80c(%rip), %rdx      # 0x339d5
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x2ee7d
leaq 0x10(%rsp), %rdi
callq 0x3100
leaq 0x30(%rsp), %rdi
callq 0x3100
leaq 0x60(%rsp), %rdi
callq 0x3100
leaq 0xe0(%rsp), %rdi
jmp 0x272bc
testl %eax, %eax
je 0x272c6
movsd 0x8(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x8f63(%rip), %rax      # 0x30181
leaq 0xc9e0(%rip), %rsi      # 0x33c05
cmovaq %rax, %rsi
leaq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2ee42
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x2ee7d
leaq 0xc77f(%rip), %rdx      # 0x339d5
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x2ee7d
leaq 0x10(%rsp), %rdi
callq 0x3100
leaq 0x30(%rsp), %rdi
jmp 0x272bc
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x8ef9(%rip), %rax      # 0x30181
leaq 0xc976(%rip), %rsi      # 0x33c05
cmovaq %rax, %rsi
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2ee42
leaq 0x10(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
movq %rbx, %rdi
callq 0x2ee7d
leaq 0x10(%rsp), %rdi
callq 0x3100
jmp 0x2700e
leaq 0x90fa(%rip), %rsi      # 0x303c7
jmp 0x27001
pushq $0x20
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0xc69f(%rip), %rsi      # 0x33983
movq %rax, %rdi
callq 0x26d2a
leaq 0x1988d(%rip), %rsi     # 0x40b80
leaq -0x14be2(%rip), %rdx    # 0x12718
movq %r14, %rdi
callq 0x33b0
pushq $0x20
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0xc69a(%rip), %rsi      # 0x339ae
movq %rax, %rdi
callq 0x26d2a
jmp 0x272ec
pushq $0x20
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0xc67e(%rip), %rsi      # 0x339ae
movq %rax, %rdi
callq 0x26d2a
jmp 0x272ec
pushq $0x20
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0xc662(%rip), %rsi      # 0x339ae
movq %rax, %rdi
callq 0x26d2a
jmp 0x272ec
pushq $0x20
popq %rdi
callq 0x3130
movq %rax, %r14
leaq 0xc646(%rip), %rsi      # 0x339ae
movq %rax, %rdi
callq 0x26d2a
jmp 0x272ec
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3100
jmp 0x27391
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x273d4
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x273d4
jmp 0x273db
jmp 0x273db
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3100
jmp 0x273ae
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3100
jmp 0x273bd
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3100
jmp 0x273cc
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x3100
jmp 0x273f3
movq %rax, %rbx
jmp 0x273f3
jmp 0x273e8
jmp 0x273e8
jmp 0x273e8
jmp 0x273e8
movq %rax, %rbx
movq %r14, %rdi
callq 0x3190
movq %rbx, %rdi
callq 0x33e0