// File: /workspace/github_c_makefile_star2_O1/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 0x9f2f
movq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x21b0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
movsd 0x4808(%rip), %xmm3     # 0xe6b0
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 0x47e8(%rip), %xmm0     # 0xe6b8
movl $0x3, %eax
cmovbel %ecx, %eax
leaq 0xaea1(%rip), %rcx      # 0x14d80
movq (%rcx,%rax,8), %rdx
testb $0x2, %bpl
jne 0x9f5c
testb $0x1, %bpl
jne 0x9f81
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 0x9fd5
cmpb $0x2d, (%r11)
leaq 0x5e66(%rip), %rax      # 0xfd85
leaq 0x5466(%rip), %r15      # 0xf38c
cmoveq %rax, %r15
jmp 0x9fdc
movq %rsi, %rdx
testb $0x1, %bpl
leaq 0x5408(%rip), %rax      # 0xf345
leaq 0x53e8(%rip), %rsi      # 0xf32c
cmoveq %rax, %rsi
movq %r14, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6581
movq 0x8(%rbx), %rcx
movq 0x58(%rbx), %r10
testq %r10, %r10
je 0x9fb2
cmpb $0x2d, (%r10)
leaq 0x5e11(%rip), %rax      # 0xfd85
leaq 0x5411(%rip), %r9       # 0xf38c
cmoveq %rax, %r9
jmp 0x9fb9
movq 0x8(%rbx), %rcx
movq 0x58(%rbx), %r10
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rbx), %xmm0
movq 0x70(%rbx), %r9
testq %r10, %r10
je 0xa000
cmpb $0x2d, (%r10)
leaq 0x5de0(%rip), %rax      # 0xfd85
leaq 0x53e0(%rip), %r11      # 0xf38c
cmoveq %rax, %r11
jmp 0xa007
leaq 0x53d3(%rip), %r9       # 0xf38c
subq $0x8, %rsp
leaq 0x5396(%rip), %rsi      # 0xf35a
movq %r14, %rdi
movq %rcx, %r8
xorl %eax, %eax
pushq %r10
callq 0x6581
jmp 0xa01f
leaq 0x53b0(%rip), %r15      # 0xf38c
subq $0x8, %rsp
leaq 0x53e4(%rip), %rsi      # 0xf3cb
movq %r14, %rdi
movq %r8, %r9
movb $0x1, %al
pushq %r11
pushq %r15
pushq %r10
callq 0x6581
addq $0x20, %rsp
jmp 0xa023
leaq 0x5385(%rip), %r11      # 0xf38c
leaq 0x5380(%rip), %rsi      # 0xf38e
movq %r14, %rdi
movq %rcx, %r8
movb $0x1, %al
pushq %r10
pushq %r11
callq 0x6581
addq $0x10, %rsp
movq %rax, %r14
cmpl $0x2, 0xb283(%rip)      # 0x152b0
jl 0xa04b
movq 0x8(%rbx), %rsi
movl 0x28(%rbx), %edx
movl 0x38(%rbx), %ecx
movl 0x30(%rbx), %r8d
leaq 0x53d1(%rip), %rdi      # 0xf415
xorl %eax, %eax
callq 0x2030
testb $0x2, %bpl
jne 0xa0e0
movq 0x38(%rbx), %rax
cmpq %rax, 0x28(%rbx)
jle 0xa083
testb $0x1, %bpl
leaq 0x53eb(%rip), %rax      # 0xf455
leaq 0x53e0(%rip), %rdx      # 0xf451
cmoveq %rax, %rdx
xorps %xmm0, %xmm0
cvtss2sd 0x18(%rbx), %xmm0
movq 0x48(%rbx), %r9
jmp 0xa0ab
cmpq %rax, 0x30(%rbx)
jle 0xa0e0
testb $0x1, %bpl
leaq 0x53cc(%rip), %rax      # 0xf460
leaq 0x674a(%rip), %rdx      # 0x107e5
cmoveq %rax, %rdx
xorps %xmm0, %xmm0
cvtss2sd 0x1c(%rbx), %xmm0
movq 0x50(%rbx), %r9
movq 0x70(%rbx), %rcx
cmpb $0x2d, (%r9)
leaq 0x5ccb(%rip), %rax      # 0xfd85
leaq 0x52cb(%rip), %r8       # 0xf38c
cmoveq %rax, %r8
leaq 0x536f(%rip), %rsi      # 0xf43b
movq %r14, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6581
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq