// File: /workspace/github_c_makefile_star2_O3/pencode-lab[P]Shoit/shoit_progress.c
// Function: shoit_progress_show_all
void shoit_progress_show_all(FILE *fp,progress_t *progress, float bit,long total)               
{                                                                                                                                    
                                                                                                                                     
                                                                                                                                     
    int val = (int)(bit * progress->max);                                                                                                 
    char buffer[512]={0};                                                                                                            

    float mbps = 1e-6 * 8*progress->total / (progress->utime == 0 ? .01 : progress->utime);
                                                                                                                                     
    memset(buffer,0,512);                                                                                                            
    snprintf(buffer,sizeof(buffer)-1,"%gMbps    %ld/%ldK    %.2fs    ",mbps,progress->total>>10,total,progress->utime);                                        
                                                                                                                                     
    int prog = (int)(progress->offset * val);                                                                                             
                                                                                                                                     
    if(prog>100) prog=100;                                                                                                           
                                                                                                                                     
    fprintf(fp,"\033[?25l\033[31m\033[1m%s%d%%\033[?25h\033[0m\r",                                                                   
        buffer, prog);                                                                                                               
    fflush(fp);                                                                                                                      
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdx, %r15
movq %rsi, %r14
cvtsi2ssl 0x14(%rsi), %xmm4
movq %rdi, %rbx
movq 0x28(%rsi), %r12
movss 0x30(%rsi), %xmm1
xorps %xmm2, %xmm2
ucomiss %xmm1, %xmm2
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
movaps %xmm2, %xmm1
jne 0x39ec
movaps %xmm2, %xmm1
jp 0x39ec
movsd 0x2b34(%rip), %xmm1     # 0x6520
movsd %xmm2, 0x8(%rsp)
movq %r12, %xmm2
punpckldq 0x2b31(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x2b39(%rip), %xmm2     # 0x6540
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
mulsd 0x2b0d(%rip), %xmm3     # 0x6528
divsd %xmm1, %xmm3
mulss %xmm0, %xmm4
movaps %xmm4, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsd2ss %xmm3, %xmm0
movss %xmm0, 0x4(%rsp)
leaq 0x20(%rsp), %r13
movl $0x200, %edx            # imm = 0x200
movq %r13, %rdi
xorl %esi, %esi
callq 0x2190
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
shrq $0xa, %r12
leaq 0x2b66(%rip), %rdx      # 0x65c3
movl $0x1ff, %esi            # imm = 0x1FF
movq %r13, %rdi
movq %r12, %rcx
movq %r15, %r8
movsd 0x8(%rsp), %xmm1
movb $0x2, %al
callq 0x2130
cvttps2dq 0x10(%rsp), %xmm0
cvtdq2ps %xmm0, %xmm0
mulss 0x18(%r14), %xmm0
cvttss2si %xmm0, %eax
cmpl $0x64, %eax
movl $0x64, %ecx
cmovll %eax, %ecx
leaq 0x2ab3(%rip), %rsi      # 0x6550
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2250
movq %rbx, %rdi
callq 0x22f0
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq