// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: sdsCatPriceRequest
sds sdsCatPriceRequest(sds s, sds symbol, ydata *yd, int flags) {
    if (yd == NULL) {
        s = sdscatprintf(s,
            (flags & STONKY_SHORT) ? "Can't find data for '%s'" :
                                     "%s: no data avaiable",
        symbol);
        return s;
    }

    /* Select the emoji according to the price change. */
    double change = strtod(yd->regchange,NULL);
    const char *emoji = priceChangeToEmoji(change);

    if (flags & STONKY_VERY_SHORT) {
        s = sdscatprintf(s,
            "%s[%s](https://google.com/search?q=%s+stock) %s%s",
            emoji,
            yd->symbol,
            yd->symbol,
            (yd->regchange && yd->regchange[0] == '-') ? "" : "+",
            yd->regchange);
    } else if (flags & STONKY_SHORT) {
        s = sdscatprintf(s,
            "%s[%s](https://google.com/search?q=%s+stock): %.02f%s (%s%s)",
            emoji,
            yd->symbol,
            yd->symbol,
            yd->reg,
            yd->csym,
            (yd->regchange && yd->regchange[0] == '-') ? "" : "+",
            yd->regchange);
    } else {
        s = sdscatprintf(s,
            "%s%s ([%s](https://google.com/search?q=%s+stock)) "
            "price is %.02f%s (%s%s)",
            emoji,
            yd->name,
            yd->symbol,
            yd->symbol,
            yd->reg,
            yd->csym,
            (yd->regchange && yd->regchange[0] == '-') ? "" : "+",
            yd->regchange);
    }
    if (DebugMode >= 2) {
        printf("%s pretime:%d regtime:%d posttime:%d\n",
            yd->symbol,
            (int)yd->pretime, (int)yd->regtime, (int)yd->posttime);
    }

    /* Add premarket / afterhours info. */
    if (!(flags & STONKY_VERY_SHORT)) {
        if (yd->pretime > yd->regtime) {
            s = sdscatprintf(s," | %s: %.02f%s (%s%s)",
                (flags & STONKY_SHORT) ? "pre" : "pre-market",
                yd->pre, yd->csym, yd->prechange[0] == '-' ? "" : "+",
                yd->prechange);
        } else if (yd->posttime > yd->regtime) {
            s = sdscatprintf(s," | %s: %.02f%s (%s%s)",
                (flags & STONKY_SHORT) ? "post" : "after-hours",
                yd->post, yd->csym, yd->postchange[0] == '-' ? "" : "+",
                yd->postchange);
        }
    }
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x9ca1
movq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x21c0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
movsd 0x4a86(%rip), %xmm3     # 0xe6a0
movapd %xmm0, %xmm4
cmpnltpd %xmm3, %xmm4
andpd %xmm2, %xmm4
movd %xmm4, %eax
andl $0x1, %eax
ucomisd %xmm1, %xmm0
movl $0x2, %ecx
cmovbl %eax, %ecx
ucomisd 0x4a66(%rip), %xmm0     # 0xe6a8
movl $0x3, %eax
cmovbel %ecx, %eax
leaq 0xb12f(%rip), %rcx      # 0x14d80
movq (%rcx,%rax,8), %rdx
testb $0x2, %bpl
jne 0x9cce
testb $0x1, %bpl
jne 0x9cf3
movq 0x8(%rbx), %r8
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rbx), %xmm0
movq 0x10(%rbx), %rcx
movq 0x70(%rbx), %r10
movq 0x58(%rbx), %r11
testq %r11, %r11
je 0x9d47
cmpb $0x2d, (%r11)
leaq 0x60d4(%rip), %rax      # 0xfd65
leaq 0x56d4(%rip), %r15      # 0xf36c
cmoveq %rax, %r15
jmp 0x9d4e
movq %rsi, %rdx
testb $0x1, %bpl
leaq 0x5676(%rip), %rax      # 0xf325
leaq 0x5656(%rip), %rsi      # 0xf30c
cmoveq %rax, %rsi
movq %r14, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6382
movq 0x8(%rbx), %rcx
movq 0x58(%rbx), %r10
testq %r10, %r10
je 0x9d24
cmpb $0x2d, (%r10)
leaq 0x607f(%rip), %rax      # 0xfd65
leaq 0x567f(%rip), %r9       # 0xf36c
cmoveq %rax, %r9
jmp 0x9d2b
movq 0x8(%rbx), %rcx
movq 0x58(%rbx), %r10
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rbx), %xmm0
movq 0x70(%rbx), %r9
testq %r10, %r10
je 0x9d72
cmpb $0x2d, (%r10)
leaq 0x604e(%rip), %rax      # 0xfd65
leaq 0x564e(%rip), %r11      # 0xf36c
cmoveq %rax, %r11
jmp 0x9d79
leaq 0x5641(%rip), %r9       # 0xf36c
subq $0x8, %rsp
leaq 0x5604(%rip), %rsi      # 0xf33a
movq %r14, %rdi
movq %rcx, %r8
xorl %eax, %eax
pushq %r10
callq 0x6382
jmp 0x9d91
leaq 0x561e(%rip), %r15      # 0xf36c
subq $0x8, %rsp
leaq 0x5652(%rip), %rsi      # 0xf3ab
movq %r14, %rdi
movq %r8, %r9
movb $0x1, %al
pushq %r11
pushq %r15
pushq %r10
callq 0x6382
addq $0x20, %rsp
jmp 0x9d95
leaq 0x55f3(%rip), %r11      # 0xf36c
leaq 0x55ee(%rip), %rsi      # 0xf36e
movq %r14, %rdi
movq %rcx, %r8
movb $0x1, %al
pushq %r10
pushq %r11
callq 0x6382
addq $0x10, %rsp
movq %rax, %r14
cmpl $0x2, 0xb511(%rip)      # 0x152b0
jl 0x9dbd
movq 0x8(%rbx), %rsi
movl 0x28(%rbx), %edx
movl 0x38(%rbx), %ecx
movl 0x30(%rbx), %r8d
leaq 0x563f(%rip), %rdi      # 0xf3f5
xorl %eax, %eax
callq 0x2030
testb $0x2, %bpl
jne 0x9e52
movq 0x38(%rbx), %rax
cmpq %rax, 0x28(%rbx)
jle 0x9df5
testb $0x1, %bpl
leaq 0x5659(%rip), %rax      # 0xf435
leaq 0x564e(%rip), %rdx      # 0xf431
cmoveq %rax, %rdx
xorps %xmm0, %xmm0
cvtss2sd 0x18(%rbx), %xmm0
movq 0x48(%rbx), %r9
jmp 0x9e1d
cmpq %rax, 0x30(%rbx)
jle 0x9e52
testb $0x1, %bpl
leaq 0x563a(%rip), %rax      # 0xf440
leaq 0x69b8(%rip), %rdx      # 0x107c5
cmoveq %rax, %rdx
xorps %xmm0, %xmm0
cvtss2sd 0x1c(%rbx), %xmm0
movq 0x50(%rbx), %r9
movq 0x70(%rbx), %rcx
cmpb $0x2d, (%r9)
leaq 0x5f39(%rip), %rax      # 0xfd65
leaq 0x5539(%rip), %r8       # 0xf36c
cmoveq %rax, %r8
leaq 0x55dd(%rip), %rsi      # 0xf41b
movq %r14, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6382
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq