// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edx, %eax
negl %edx
cmovsl %eax, %edx
jae 0x29f29
cmpl $0x14, %edx
jae 0x29f29
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %xmm0
movq 0x1a95a(%rip), %rcx     # 0x442d0
movq %xmm0, %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
cmpq $0x1, %rcx
movl %edi, %r8d
cmovnel %esi, %r8d
movl %r8d, %r9d
notl %r9d
testl $0x7ff00000, %r9d       # imm = 0x7FF00000
jne 0x299be
cmpq $0x1, %rcx
movl %esi, %r9d
cmovneq %rdi, %r9
testl $0xfffff, %r8d          # imm = 0xFFFFF
setne %r8b
testq %r9, %r9
setne %r9b
orb %r8b, %r9b
jne 0x29a0c
movq 0x8(%r14), %xmm0
movq %xmm0, %r8
movq %r8, %r9
shrq $0x20, %r9
cmpq $0x1, %rcx
movl %r9d, %r10d
cmovnel %r8d, %r10d
movl %r10d, %r11d
notl %r11d
testl $0x7ff00000, %r11d      # imm = 0x7FF00000
jne 0x29a23
cmpq $0x1, %rcx
movl %r8d, %r11d
cmovneq %r9, %r11
testl $0xfffff, %r10d         # imm = 0xFFFFF
sete %r10b
testq %r11, %r11
sete %r11b
testb %r10b, %r11b
jne 0x29a23
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xe0a8(%rip), %rsi      # 0x37ac2
leaq 0xe0a4(%rip), %rdx      # 0x37ac5
jmp 0x29a7b
cmpq $0x1, %rcx
movl %esi, %r10d
cmoveq %rdi, %rsi
cmovneq %rdi, %r10
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorq $0x7ff00000, %rsi       # imm = 0x7FF00000
orq %r10, %rsi
je 0x29a66
cmpq $0x1, %rcx
movl %r8d, %ecx
cmoveq %r9, %r8
cmovneq %r9, %rcx
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorq $0x7ff00000, %r8        # imm = 0x7FF00000
orq %rcx, %r8
jne 0x29a98
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xe054(%rip), %rsi      # 0x37ac8
leaq 0xe050(%rip), %rdx      # 0x37acb
movq %rbx, %rdi
callq 0x33574
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
leaq 0xdeaf(%rip), %rax      # 0x37950
leaq 0xa8cb(%rip), %rcx      # 0x34373
cmovnsq %rax, %rcx
leaq 0xdd83(%rip), %rsi      # 0x37836
leaq 0xe0(%rsp), %rdi
xorl %eax, %eax
callq 0x3080
cmpl $0x20, %eax
jge 0x29f5b
movq (%r14), %xmm0
pand 0xd5c8(%rip), %xmm0     # 0x370a0
leaq 0xc0(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jge 0x29f79
movq 0x8(%r14), %xmm0
pand 0xd59a(%rip), %xmm0     # 0x370a0
leaq 0x80(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jge 0x29f97
leaq 0xa0(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
pxor %xmm0, %xmm0
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jge 0x29fb5
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3340
testl %eax, %eax
je 0x29c26
movl %eax, %ebp
leaq 0x80(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3340
testl %eax, %eax
je 0x29bfd
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm1, %xmm0
setbe %dl
leaq 0xdefa(%rip), %r15      # 0x37a95
leaq 0xa5df(%rip), %rsi      # 0x34181
cmovbeq %r15, %rsi
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x33574
leaq 0x60(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x3470
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x29cd3
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x29cdd
testl %ebp, %ebp
je 0x29c26
leaq 0x80(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3340
testl %eax, %eax
je 0x29eca
testl %ebp, %ebp
jne 0x29cb9
leaq 0x80(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3340
testl %eax, %eax
je 0x29cb9
movsd 0x8(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm1, %xmm0
setbe %dl
leaq 0xde3c(%rip), %rax      # 0x37a95
leaq 0xa521(%rip), %rsi      # 0x34181
cmovbeq %rax, %rsi
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x33574
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x3470
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x29e62
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x29e6b
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xa6e0(%rip), %rsi      # 0x343a7
leaq 0xa6da(%rip), %rdx      # 0x343a8
jmp 0x29a7b
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movsd 0x8(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0xdb55(%rip), %rax      # 0x37863
cmovaq %rax, %r15
movq %r15, %rsi
callq 0x3470
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x29d41
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x29d4a
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x80(%rsp), %rsi
callq 0x3470
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x29d99
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x29da2
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xdaa2(%rip), %rsi      # 0x37865
callq 0x3470
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x29dea
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x29df2
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x29e1f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x29e36
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x29e4d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x29a83
movq 0x70(%rsp), %rsi
jmp 0x29ebd
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd9d9(%rip), %rdx      # 0x37865
movq %rbx, %rdi
callq 0x334d3
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x29eaa
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x29a83
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x29a83
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm1, %xmm0
setbe %dl
leaq 0xdbb2(%rip), %rax      # 0x37a95
leaq 0xa297(%rip), %rsi      # 0x34181
cmovbeq %rax, %rsi
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x33574
movq %rsp, %rsi
leaq 0xc0(%rsp), %rdx
movq %rbx, %rdi
callq 0x334d3
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x29a83
movq 0x10(%rsp), %rsi
jmp 0x29ebd
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd8d6(%rip), %rsi      # 0x37813
movq %rax, %rdi
callq 0x2966e
leaq 0x19c34(%rip), %rsi     # 0x43b80
leaq -0x166cf(%rip), %rdx    # 0x13884
movq %r14, %rdi
callq 0x33f0
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd8cf(%rip), %rsi      # 0x3783e
movq %rax, %rdi
callq 0x2966e
jmp 0x29f45
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd8b1(%rip), %rsi      # 0x3783e
movq %rax, %rdi
callq 0x2966e
jmp 0x29f45
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd893(%rip), %rsi      # 0x3783e
movq %rax, %rdi
callq 0x2966e
jmp 0x29f45
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd875(%rip), %rsi      # 0x3783e
movq %rax, %rdi
callq 0x2966e
jmp 0x29f45
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2a0b1
movq 0x10(%rsp), %rsi
jmp 0x2a08f
jmp 0x2a099
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2a013
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x2a013
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a0b1
movq 0x30(%rsp), %rsi
jmp 0x2a08f
jmp 0x2a099
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2a048
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x2a048
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a064
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x2a064
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x2a080
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x2a080
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x2a0b1
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x2a0b1
movq %rax, %rbx
jmp 0x2a0b1
jmp 0x2a0a6
jmp 0x2a0a6
jmp 0x2a0a6
jmp 0x2a0a6
movq %rax, %rbx
movq %r14, %rdi
callq 0x31c0
movq %rbx, %rdi
callq 0x3420