// File: /workspace/github_cpp_makefile_star2_O3/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 0x295b0
cmpl $0x14, %edx
jae 0x295b0
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %r8
movq 0x1a287(%rip), %rcx     # 0x432d0
movq %r8, %rsi
shrq $0x20, %rsi
cmpq $0x1, %rcx
movq %r8, %rdi
cmoveq %rsi, %rdi
movl %edi, %r9d
notl %r9d
testl $0x7ff00000, %r9d       # imm = 0x7FF00000
jne 0x2908b
cmpq $0x1, %rcx
movl %r8d, %r9d
cmovneq %rsi, %r9
testl $0xfffff, %edi          # imm = 0xFFFFF
setne %r10b
testq %r9, %r9
setne %r9b
orb %r10b, %r9b
jne 0x290d0
movq 0x8(%r14), %r11
movq %r11, %r9
shrq $0x20, %r9
cmpq $0x1, %rcx
movq %r11, %r10
cmoveq %r9, %r10
movl %r10d, %ebp
notl %ebp
testl $0x7ff00000, %ebp       # imm = 0x7FF00000
jne 0x290e7
cmpq $0x1, %rcx
movl %r11d, %r15d
cmovneq %r9, %r15
testl $0xfffff, %r10d         # imm = 0xFFFFF
sete %bpl
testq %r15, %r15
sete %r15b
testb %bpl, %r15b
jne 0x290e7
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xdbc0(%rip), %rsi      # 0x36c9e
leaq 0xdbbc(%rip), %rdx      # 0x36ca1
jmp 0x29137
cmpq $0x1, %rcx
movl %r8d, %r8d
cmoveq %r8, %rsi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorq $0x7ff00000, %rdi       # imm = 0x7FF00000
orq %rsi, %rdi
je 0x29122
cmpq $0x1, %rcx
movl %r11d, %ecx
cmoveq %rcx, %r9
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
xorq $0x7ff00000, %r10       # imm = 0x7FF00000
orq %r9, %r10
jne 0x29154
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0xdb74(%rip), %rsi      # 0x36ca4
leaq 0xdb70(%rip), %rdx      # 0x36ca7
movq %rbx, %rdi
callq 0x3290e
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 0xd9cf(%rip), %rax      # 0x36b2c
leaq 0xa22f(%rip), %rcx      # 0x33393
cmovnsq %rax, %rcx
leaq 0xd8a3(%rip), %rsi      # 0x36a12
leaq 0xc0(%rsp), %rdi
xorl %eax, %eax
callq 0x3080
cmpl $0x20, %eax
jge 0x295e2
movsd (%r14), %xmm0
andpd 0xd08c(%rip), %xmm0     # 0x36220
leaq 0xa0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jge 0x29600
movsd 0x8(%r14), %xmm0
andpd 0xd05e(%rip), %xmm0     # 0x36220
leaq 0x80(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jge 0x2961e
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
xorpd %xmm0, %xmm0
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jge 0x2963c
leaq 0xa0(%rsp), %rdi
leaq 0xe0(%rsp), %r15
movq %r15, %rsi
callq 0x3340
movl %eax, %ebp
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
testl %ebp, %ebp
je 0x292bb
testl %eax, %eax
je 0x2933d
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm1, %xmm0
setbe %dl
leaq 0xda18(%rip), %r15      # 0x36c71
leaq 0x9f21(%rip), %rsi      # 0x33181
cmovbeq %r15, %rsi
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x3290e
leaq 0x60(%rsp), %rdi
leaq 0xa0(%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 0x2939f
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x293a9
testl %eax, %eax
je 0x2952e
movsd 0x8(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm1, %xmm0
setbe %dl
leaq 0xd994(%rip), %rax      # 0x36c71
leaq 0x9e9d(%rip), %rsi      # 0x33181
cmovbeq %rax, %rsi
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3290e
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 0x29548
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x29551
movsd (%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm1, %xmm0
setbe %dl
leaq 0xd91b(%rip), %rax      # 0x36c71
leaq 0x9e24(%rip), %rsi      # 0x33181
cmovbeq %rax, %rsi
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x3290e
movq %rsp, %rsi
leaq 0xa0(%rsp), %rdx
movq %rbx, %rdi
callq 0x32867
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2913f
movq 0x10(%rsp), %rsi
jmp 0x295a3
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 0xd665(%rip), %rax      # 0x36a3f
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 0x2940d
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x29416
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 0x29465
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2946e
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 0xd5b2(%rip), %rsi      # 0x36a41
callq 0x3470
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x294b6
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x294be
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 0x294eb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x29502
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x29519
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x2913f
movq 0x70(%rsp), %rsi
jmp 0x295a3
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x9e8b(%rip), %rsi      # 0x333c7
leaq 0x9e85(%rip), %rdx      # 0x333c8
jmp 0x29137
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 0xd4cf(%rip), %rdx      # 0x36a41
movq %rbx, %rdi
callq 0x32867
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x29590
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2913f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x2913f
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd42b(%rip), %rsi      # 0x369ef
movq %rax, %rdi
callq 0x28d64
leaq 0x195ad(%rip), %rsi     # 0x42b80
leaq -0x16318(%rip), %rdx    # 0x132c2
movq %r14, %rdi
callq 0x33f0
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd424(%rip), %rsi      # 0x36a1a
movq %rax, %rdi
callq 0x28d64
jmp 0x295cc
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd406(%rip), %rsi      # 0x36a1a
movq %rax, %rdi
callq 0x28d64
jmp 0x295cc
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd3e8(%rip), %rsi      # 0x36a1a
movq %rax, %rdi
callq 0x28d64
jmp 0x295cc
movl $0x20, %edi
callq 0x3140
movq %rax, %r14
leaq 0xd3ca(%rip), %rsi      # 0x36a1a
movq %rax, %rdi
callq 0x28d64
jmp 0x295cc
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x29695
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x29695
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x29735
movq 0x10(%rsp), %rsi
jmp 0x29713
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x29735
movq 0x30(%rsp), %rsi
jmp 0x29713
jmp 0x2971d
jmp 0x2971d
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x296cc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x296cc
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x296e8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x296e8
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x29704
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x29704
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x29735
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x29735
movq %rax, %rbx
jmp 0x29735
jmp 0x2972a
jmp 0x2972a
jmp 0x2972a
jmp 0x2972a
movq %rax, %rbx
movq %r14, %rdi
callq 0x31c0
movq %rbx, %rdi
callq 0x3420