// File: 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
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x1c8(%rbp)
movq %rdi, %rax
movq %rax, -0x1c0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1b8(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x42c93
movl -0x14(%rbp), %eax
movl %eax, -0x1cc(%rbp)
jmp 0x42c9e
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x1cc(%rbp)
movl -0x1cc(%rbp), %eax
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
jle 0x42cbc
cmpl $0x14, -0xa4(%rbp)
jl 0x42d1e
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1d8(%rbp)
leaq 0x155bd(%rip), %rsi     # 0x58297
callq 0x42660
jmp 0x42ce1
movq -0x1d8(%rbp), %rdi
leaq 0x21e89(%rip), %rsi     # 0x64b78
leaq -0x25546(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x1d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
callq 0x31e0
jmp 0x43561
movq -0x1b8(%rbp), %rax
movsd (%rax), %xmm0
callq 0x43570
testb $0x1, %al
jne 0x42d49
movq -0x1b8(%rbp), %rax
movsd 0x8(%rax), %xmm0
callq 0x43570
testb $0x1, %al
jne 0x42d49
jmp 0x42dac
leaq -0xb5(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x34d0
movq -0x1c8(%rbp), %rdi
movq -0x1e0(%rbp), %rdx
leaq 0x157d5(%rip), %rsi     # 0x58546
callq 0x52fa0
jmp 0x42d78
leaq -0xb5(%rbp), %rdi
callq 0x3330
jmp 0x43551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xb5(%rbp), %rdi
callq 0x3330
jmp 0x43561
movq -0x1b8(%rbp), %rax
movsd (%rax), %xmm0
callq 0x435a0
testb $0x1, %al
jne 0x42dd7
movq -0x1b8(%rbp), %rax
movsd 0x8(%rax), %xmm0
callq 0x435a0
testb $0x1, %al
jne 0x42dd7
jmp 0x42e3a
leaq -0xb6(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x34d0
movq -0x1c8(%rbp), %rdi
movq -0x1e8(%rbp), %rdx
leaq 0x1574d(%rip), %rsi     # 0x5854c
callq 0x52fa0
jmp 0x42e06
leaq -0xb6(%rbp), %rdi
callq 0x3330
jmp 0x43551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xb6(%rbp), %rdi
callq 0x3330
jmp 0x43561
leaq -0x40(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x1ec(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x42e67
leaq 0x15576(%rip), %rax     # 0x583d4
movq %rax, -0x200(%rbp)
jmp 0x42e77
leaq 0x124f5(%rip), %rax     # 0x55363
movq %rax, -0x200(%rbp)
jmp 0x42e77
movl -0x1ec(%rbp), %edx
movq -0x1f8(%rbp), %rdi
movq -0x200(%rbp), %rcx
leaq 0x15428(%rip), %rsi     # 0x582ba
movb $0x0, %al
callq 0x3080
cmpl $0x20, %eax
jl 0x42f00
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x208(%rbp)
leaq 0x15406(%rip), %rsi     # 0x582c2
callq 0x42660
jmp 0x42ec3
movq -0x208(%rbp), %rdi
leaq 0x21ca7(%rip), %rsi     # 0x64b78
leaq -0x25728(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x208(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
callq 0x31e0
jmp 0x43561
movq -0x1b8(%rbp), %rax
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movsd (%rax), %xmm0
movaps 0x15196(%rip), %xmm1    # 0x580b0
pand %xmm1, %xmm0
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jl 0x42f8c
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x210(%rbp)
leaq 0x1537a(%rip), %rsi     # 0x582c2
callq 0x42660
jmp 0x42f4f
movq -0x210(%rbp), %rdi
leaq 0x21c1b(%rip), %rsi     # 0x64b78
leaq -0x257b4(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x210(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
callq 0x31e0
jmp 0x43561
movq -0x1b8(%rbp), %rax
leaq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movsd 0x8(%rax), %xmm0
movaps 0x15109(%rip), %xmm1    # 0x580b0
pand %xmm1, %xmm0
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jl 0x43019
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x218(%rbp)
leaq 0x152ed(%rip), %rsi     # 0x582c2
callq 0x42660
jmp 0x42fdc
movq -0x218(%rbp), %rdi
leaq 0x21b8e(%rip), %rsi     # 0x64b78
leaq -0x25841(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x218(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
callq 0x31e0
jmp 0x43561
leaq -0xa0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorps %xmm0, %xmm0
movb $0x1, %al
callq 0x3080
cmpl $0x20, %eax
jl 0x43095
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x220(%rbp)
leaq 0x15271(%rip), %rsi     # 0x582c2
callq 0x42660
jmp 0x43058
movq -0x220(%rbp), %rdi
leaq 0x21b12(%rip), %rsi     # 0x64b78
leaq -0x258bd(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x220(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
callq 0x31e0
jmp 0x43561
leaq -0x60(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3400
cmpl $0x0, %eax
je 0x432a4
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3400
cmpl $0x0, %eax
je 0x432a4
movq -0x1b8(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x120b5(%rip), %rcx     # 0x55195
leaq 0x15432(%rip), %rax     # 0x58519
cmovaq %rcx, %rax
movq %rax, -0x230(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x34d0
movq -0x230(%rbp), %rsi
movq -0x228(%rbp), %rdx
leaq -0x138(%rbp), %rdi
callq 0x52fa0
jmp 0x43121
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x53050
jmp 0x4313a
movq -0x1b8(%rbp), %rax
movsd 0x8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4315f
leaq 0x15191(%rip), %rax     # 0x582e7
movq %rax, -0x238(%rbp)
jmp 0x4316f
leaq 0x153b3(%rip), %rax     # 0x58519
movq %rax, -0x238(%rbp)
jmp 0x4316f
movq -0x238(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x53050
jmp 0x4318b
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x53050
jmp 0x431a4
movq -0x1c8(%rbp), %rdi
leaq 0x15137(%rip), %rdx     # 0x582e9
leaq -0xd8(%rbp), %rsi
callq 0x53050
jmp 0x431c0
leaq -0xd8(%rbp), %rdi
callq 0x31a0
leaq -0xf8(%rbp), %rdi
callq 0x31a0
leaq -0x118(%rbp), %rdi
callq 0x31a0
leaq -0x138(%rbp), %rdi
callq 0x31a0
leaq -0x139(%rbp), %rdi
callq 0x3330
jmp 0x43551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x43293
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x43287
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x4327b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x4326f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x31a0
leaq -0xf8(%rbp), %rdi
callq 0x31a0
leaq -0x118(%rbp), %rdi
callq 0x31a0
leaq -0x138(%rbp), %rdi
callq 0x31a0
leaq -0x139(%rbp), %rdi
callq 0x3330
jmp 0x43561
leaq -0x60(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3400
cmpl $0x0, %eax
je 0x433a9
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3400
cmpl $0x0, %eax
jne 0x433a9
movq -0x1b8(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x11ea6(%rip), %rcx     # 0x55195
leaq 0x15223(%rip), %rax     # 0x58519
cmovaq %rcx, %rax
movq %rax, -0x248(%rbp)
leaq -0x161(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x34d0
movq -0x248(%rbp), %rsi
movq -0x240(%rbp), %rdx
leaq -0x160(%rbp), %rdi
callq 0x52fa0
jmp 0x43330
movq -0x1c8(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x53050
jmp 0x43349
leaq -0x160(%rbp), %rdi
callq 0x31a0
leaq -0x161(%rbp), %rdi
callq 0x3330
jmp 0x43551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x43398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x31a0
leaq -0x161(%rbp), %rdi
callq 0x3330
jmp 0x43561
leaq -0x60(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3400
cmpl $0x0, %eax
jne 0x434f4
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3400
cmpl $0x0, %eax
je 0x434f4
movq -0x1b8(%rbp), %rax
movsd 0x8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
leaq 0x11da0(%rip), %rcx     # 0x55195
leaq 0x1511d(%rip), %rax     # 0x58519
cmovaq %rcx, %rax
movq %rax, -0x258(%rbp)
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x34d0
movq -0x258(%rbp), %rsi
movq -0x250(%rbp), %rdx
leaq -0x1a8(%rbp), %rdi
callq 0x52fa0
jmp 0x43436
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x53050
jmp 0x4344f
movq -0x1c8(%rbp), %rdi
leaq 0x14e8c(%rip), %rdx     # 0x582e9
leaq -0x188(%rbp), %rsi
callq 0x53050
jmp 0x4346b
leaq -0x188(%rbp), %rdi
callq 0x31a0
leaq -0x1a8(%rbp), %rdi
callq 0x31a0
leaq -0x1a9(%rbp), %rdi
callq 0x3330
jmp 0x43551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x434e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x434da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x31a0
leaq -0x1a8(%rbp), %rdi
callq 0x31a0
leaq -0x1a9(%rbp), %rdi
callq 0x3330
jmp 0x43561
leaq -0x1aa(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x34d0
movq -0x1c8(%rbp), %rdi
movq -0x260(%rbp), %rdx
leaq 0x11e7b(%rip), %rsi     # 0x55397
callq 0x52fa0
jmp 0x43523
leaq -0x1aa(%rbp), %rdi
callq 0x3330
jmp 0x43551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x1aa(%rbp), %rdi
callq 0x3330
jmp 0x43561
movq -0x1c0(%rbp), %rax
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x34c0
nopl (%rax)