// File: /workspace/github_c_makefile_star2_O2/albinoloverats[P]hide/common/src/cli.c
// Function: cli_display_bars
static void cli_display_bars(cli_progress_s *t, cli_progress_s *c, cli_bps_s *bps)
{
	double total   = PERCENT * (t->offset + (1.0f * c->offset / c->size)) / t->size;
	double current = PERCENT * c->offset / c->size;
	bool single = t->size == 1;

	if (!single)
	{
		char name[CLI_TRUNCATED_DISPLAY_LONG] = { 0x0 };
		char *nm = c->display ? /*dir_get_name(c->display, '.')*/ : CLI_UNKNOWN;
		if (strlen(nm) < CLI_TRUNCATED_DISPLAY_LONG)
			strcpy(name, nm);
		else
		{
			strncpy(name, nm, CLI_TRUNCATED_DISPLAY_SHORT);
			strcat(name, CLI_TRUNCATED_ELLIPSE);
			if (cli_width > CLI_DEFAULT)
				strcat(name, nm + (strlen(nm) - CLI_TRUNCATED_DISPLAY_SHORT));
		}
		fprintf(stderr, "\x1B[1F"); // go up 1 line
		cli_display_bar(name, c, current);
		cli_display_bps(bps);
		fprintf(stderr, "\n");
	}
	cli_display_bar("Total", single ? c : t, total);

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
testq %rcx, %rcx
js 0x3d17
cvtsi2ss %rcx, %xmm1
jmp 0x3d2c
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
movq 0x8(%rbx), %rbp
testq %rax, %rax
js 0x3d3c
cvtsi2ss %rax, %xmm2
jmp 0x3d51
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
movq (%rbx), %r13
cmpq $0x1, %rbp
jne 0x3dd6
movq %r15, %rbx
divss %xmm2, %xmm1
testq %r13, %r13
js 0x3d6d
cvtsi2ss %r13, %xmm0
jmp 0x3d83
movq %r13, %rax
shrq %rax
andl $0x1, %r13d
orq %rax, %r13
cvtsi2ss %r13, %xmm0
addss %xmm0, %xmm0
addss %xmm0, %xmm1
mulss 0x15a1(%rip), %xmm1     # 0x5330
testq %rbp, %rbp
js 0x3d9b
cvtsi2ss %rbp, %xmm0
jmp 0x3db0
movq %rbp, %rax
shrq %rax
andl $0x1, %ebp
orq %rax, %rbp
cvtsi2ss %rbp, %xmm0
addss %xmm0, %xmm0
divss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
leaq 0x15c0(%rip), %rdi      # 0x537f
movq %rbx, %rsi
callq 0x4011
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movss 0x1552(%rip), %xmm0     # 0x5330
movss %xmm1, 0xc(%rsp)
mulss %xmm1, %xmm0
movss %xmm2, 0x8(%rsp)
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x19(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x10(%r15), %rax
testq %rax, %rax
leaq 0x1554(%rip), %r12      # 0x536b
cmovneq %rax, %r12
movq %r12, %rdi
callq 0x2100
leaq 0x10(%rsp), %rdi
cmpq $0x18, %rax
ja 0x3e38
movq %r12, %rsi
callq 0x20a0
jmp 0x3e7d
pushq $0xa
popq %rdx
movq %r12, %rsi
callq 0x2070
leaq 0x10(%rsp), %rdi
callq 0x2100
movl $0x2e2e2e2e, 0x10(%rsp,%rax) # imm = 0x2E2E2E2E
movb $0x0, 0x14(%rsp,%rax)
cmpl $0x51, 0x4397(%rip)     # 0x81f8
jl 0x3e7d
movq %r12, %rdi
callq 0x2100
leaq (%r12,%rax), %rsi
addq $-0xa, %rsi
leaq 0x10(%rsp), %rdi
callq 0x2320
movq 0x4174(%rip), %r12      # 0x7ff8
movq (%r12), %rcx
leaq 0x14eb(%rip), %rdi      # 0x537a
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x2350
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movsd 0x30(%rsp), %xmm0
callq 0x4011
movq %r14, %rdi
callq 0x3a3b
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3ed9
movq (%r12), %rcx
leaq 0x14de(%rip), %rdi      # 0x53a7
pushq $0xb
popq %rsi
pushq $0x1
popq %rdx
callq 0x2350
jmp 0x3fb1
movsd 0x13ef(%rip), %xmm1     # 0x52d0
ucomisd %xmm0, %xmm1
jbe 0x3ef7
movq (%r12), %rdi
leaq 0x14c1(%rip), %rsi      # 0x53b3
jmp 0x3faa
movsd 0x13c1(%rip), %xmm1     # 0x52c0
ucomisd %xmm0, %xmm1
jbe 0x3f1d
movq (%r12), %rdi
mulsd 0x1407(%rip), %xmm0     # 0x5318
leaq 0x14a7(%rip), %rsi      # 0x53bf
jmp 0x3faa
movsd 0x13b3(%rip), %xmm1     # 0x52d8
ucomisd %xmm0, %xmm1
jbe 0x3f40
movq (%r12), %rdi
mulsd 0x13d9(%rip), %xmm0     # 0x5310
leaq 0x148d(%rip), %rsi      # 0x53cb
jmp 0x3faa
movsd 0x1398(%rip), %xmm1     # 0x52e0
ucomisd %xmm0, %xmm1
jbe 0x3f63
movq (%r12), %rdi
mulsd 0x13ae(%rip), %xmm0     # 0x5308
leaq 0x1476(%rip), %rsi      # 0x53d7
jmp 0x3faa
movsd 0x137d(%rip), %xmm1     # 0x52e8
ucomisd %xmm0, %xmm1
jbe 0x3f86
movq (%r12), %rdi
mulsd 0x1383(%rip), %xmm0     # 0x5300
leaq 0x145f(%rip), %rsi      # 0x53e3
jmp 0x3faa
movsd 0x1362(%rip), %xmm1     # 0x52f0
ucomisd %xmm0, %xmm1
movq (%r12), %rcx
jbe 0x3fce
mulsd 0x1358(%rip), %xmm0     # 0x52f8
leaq 0x1448(%rip), %rsi      # 0x53ef
movq %rcx, %rdi
movb $0x1, %al
callq 0x2210
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x21b0
movss 0xc(%rsp), %xmm1
movss 0x8(%rsp), %xmm2
jmp 0x3d5d
leaq 0x1426(%rip), %rdi      # 0x53fb
jmp 0x3ec9