// File: /workspace/github_c_makefile_star2_O0/antirez[P]stonky/stonky.c
// Function: sdsTimeAgo
sds sdsTimeAgo(time_t attime) {
    double t = time(NULL) - attime;
    char *unit;
    int fraction = 0; /* Use fractional part. >= hours. */
    if (t >= 3600*24*365) {
        t /= 3600*24*365;
        unit = "year";
        fraction = 1;
    } else if (t >= 3600*24*30) {
        t /= 3600*24*30;
        unit = "month";
        fraction = 1;
    } else if (t >= 3600*24) {
        t /= 3600*24;
        unit = "day";
        fraction = 1;
    } else if (t >= 3600) {
        t /= 3600;
        unit = "hour";
        fraction = 1;
    } else if (t >= 60) {
        t /= 60;
        unit = "minute";
    } else {
        unit = "second";
    }

    sds s;
    if (fraction)
        s = sdscatprintf(sdsempty(),"%.1f %s", t, unit);
    else
        s = sdscatprintf(sdsempty(),"%ld %s", (long)t, unit);
    if (t > 1) s = sdscat(s,"s"); /* Pluralize if needed. */
    return s;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x21e0
subq 0x20(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
movsd 0x18(%rsp), %xmm0
movsd 0x3808(%rip), %xmm1     # 0x155b0
ucomisd %xmm1, %xmm0
jb 0x11ddf
movsd 0x18(%rsp), %xmm0
movsd 0x37f4(%rip), %xmm1     # 0x155b0
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x4dcb(%rip), %rax      # 0x16b98
movq %rax, 0x10(%rsp)
movl $0x1, 0xc(%rsp)
jmp 0x11ef9
movsd 0x18(%rsp), %xmm0
movsd 0x37cb(%rip), %xmm1     # 0x155b8
ucomisd %xmm1, %xmm0
jb 0x11e24
movsd 0x18(%rsp), %xmm0
movsd 0x37b7(%rip), %xmm1     # 0x155b8
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x4d8b(%rip), %rax      # 0x16b9d
movq %rax, 0x10(%rsp)
movl $0x1, 0xc(%rsp)
jmp 0x11ef7
movsd 0x18(%rsp), %xmm0
movsd 0x378e(%rip), %xmm1     # 0x155c0
ucomisd %xmm1, %xmm0
jb 0x11e69
movsd 0x18(%rsp), %xmm0
movsd 0x377a(%rip), %xmm1     # 0x155c0
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x4d4c(%rip), %rax      # 0x16ba3
movq %rax, 0x10(%rsp)
movl $0x1, 0xc(%rsp)
jmp 0x11ef5
movsd 0x18(%rsp), %xmm0
movsd 0x3751(%rip), %xmm1     # 0x155c8
ucomisd %xmm1, %xmm0
jb 0x11eab
movsd 0x18(%rsp), %xmm0
movsd 0x373d(%rip), %xmm1     # 0x155c8
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x4d0b(%rip), %rax      # 0x16ba7
movq %rax, 0x10(%rsp)
movl $0x1, 0xc(%rsp)
jmp 0x11ef3
movsd 0x18(%rsp), %xmm0
movsd 0x3717(%rip), %xmm1     # 0x155d0
ucomisd %xmm1, %xmm0
jb 0x11ee5
movsd 0x18(%rsp), %xmm0
movsd 0x3703(%rip), %xmm1     # 0x155d0
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x4cce(%rip), %rax      # 0x16bac
movq %rax, 0x10(%rsp)
jmp 0x11ef1
leaq 0x4cc7(%rip), %rax      # 0x16bb3
movq %rax, 0x10(%rsp)
jmp 0x11ef3
jmp 0x11ef5
jmp 0x11ef7
jmp 0x11ef9
cmpl $0x0, 0xc(%rsp)
je 0x11f27
callq 0x8610
movq %rax, %rdi
movsd 0x18(%rsp), %xmm0
movq 0x10(%rsp), %rdx
leaq 0x4ca0(%rip), %rsi      # 0x16bba
movb $0x1, %al
callq 0x98c0
movq %rax, (%rsp)
jmp 0x11f4d
callq 0x8610
movq %rax, %rdi
cvttsd2si 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
leaq 0x4c80(%rip), %rsi      # 0x16bc2
movb $0x0, %al
callq 0x98c0
movq %rax, (%rsp)
movsd 0x18(%rsp), %xmm0
movsd 0x362d(%rip), %xmm1     # 0x15588
ucomisd %xmm1, %xmm0
jbe 0x11f75
movq (%rsp), %rdi
leaq 0x4c5b(%rip), %rsi      # 0x16bc7
callq 0x9350
movq %rax, (%rsp)
movq (%rsp), %rax
addq $0x28, %rsp
retq
nop