// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/object.c
// Function: createStringObjectFromLongDouble
robj *createStringObjectFromLongDouble(long double value, int humanfriendly) {
    char buf[256];
    int len;

    if (isinf(value)) {
        /* Libc in odd systems (Hi Solaris!) will format infinite in a
         * different way, so better to handle it in an explicit way. */
        if (value > 0) {
            memcpy(buf,"inf",3);
            len = 3;
        } else {
            memcpy(buf,"-inf",4);
            len = 4;
        }
    } else if (humanfriendly) {
        /* We use 17 digits precision since with 128 bit floats that precision
         * after rounding is able to represent most small decimal numbers in a
         * way that is "non surprising" for the user (that is, most small
         * decimal numbers will be represented in a way that when converted
         * back into a string are exactly the same as what the user typed.) */
        len = snprintf(buf,sizeof(buf),"%.17Lf", value);
        /* Now remove trailing zeroes after the '.' */
        if (strchr(buf,'.') != NULL) {
            char *p = buf+len-1;
            while(*p == '0') {
                p--;
                len--;
            }
            if (*p == '.') len--;
        }
    } else {
        len = snprintf(buf,sizeof(buf),"%.17Lg", value);
    }
    return createStringObject(buf,len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
fldt 0x10(%rbp)
fstpt -0x10(%rbp)
movl %edi, -0x14(%rbp)
fldt -0x10(%rbp)
fld %st(0)
fstpt -0x140(%rbp)
movswq -0x138(%rbp), %rax
fabs
shrq $0xf, %rax
movl %eax, %ecx
orl $0x1, %ecx
xorl %eax, %eax
flds 0xf2e0a(%rip)           # 0x13b614
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
cmovael %ecx, %eax
cmpl $0x0, %eax
je 0x48868
fldt -0x10(%rbp)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x4884d
jmp 0x48827
movw 0xf225d(%rip), %ax      # 0x13aa8b
movw %ax, -0x120(%rbp)
movb 0xf2252(%rip), %al      # 0x13aa8d
movb %al, -0x11e(%rbp)
movl $0x3, -0x124(%rbp)
jmp 0x48863
movl 0xf2237(%rip), %eax     # 0x13aa8a
movl %eax, -0x120(%rbp)
movl $0x4, -0x124(%rbp)
jmp 0x4894b
cmpl $0x0, -0x14(%rbp)
je 0x48921
leaq -0x120(%rbp), %rdi
fldt -0x10(%rbp)
movq %rsp, %rax
fstpt (%rax)
leaq 0xf2e00(%rip), %rdx     # 0x13b688
xorl %eax, %eax
movl $0x100, %esi            # imm = 0x100
callq 0x26120
movl %eax, -0x124(%rbp)
leaq -0x120(%rbp), %rdi
movl $0x2e, %esi
callq 0x267f0
cmpq $0x0, %rax
je 0x4891f
leaq -0x120(%rbp), %rax
movslq -0x124(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x488ff
movq -0x130(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x130(%rbp)
movl -0x124(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x488cd
movq -0x130(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x4891d
movl -0x124(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x4891f
jmp 0x48949
leaq -0x120(%rbp), %rdi
fldt -0x10(%rbp)
movq %rsp, %rax
fstpt (%rax)
leaq 0xf2d58(%rip), %rdx     # 0x13b68f
xorl %eax, %eax
movl $0x100, %esi            # imm = 0x100
callq 0x26120
movl %eax, -0x124(%rbp)
jmp 0x4894b
leaq -0x120(%rbp), %rdi
movslq -0x124(%rbp), %rsi
callq 0x486a0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)