// File: /workspace/github_c_makefile_star2_O0/albinoloverats[P]hide/common/src/cli.c
// Function: cli_display
extern void cli_display(cli_s *p)
{
	CLI_DO_INIT;

#ifndef _WIN32
	cli_sigwinch(SIGWINCH);
#endif
	cli_size_width = 0;

	cli_bps_s bps[BPS];
	memset(bps, 0x00, BPS * sizeof( cli_bps_s ));
	int b = 0;

	fprintf(stderr, "\e[?25l\n"); /* hide cursor */
	while (*p->status == CLI_INIT || *p->status == CLI_RUN)
	{
		struct timespec s = { 0, 10 * MILLION }; /* 10 milliseconds */
		nanosleep(&s, NULL);
		if (*p->status == CLI_INIT)
			continue;
		struct timeval tv;
		gettimeofday(&tv, NULL);
		bps[b].time = tv.tv_sec * MILLION + tv.tv_usec;
		bps[b].bytes = p->current->offset;
		b++;
		if (b >= BPS)
			b = 0;
		cli_display_bars(p->total, p->current, bps);
	}
	if (*p->status == CLI_DONE)
	{
		p->total->offset = p->total->size;
		p->current->offset = p->current->size;
		cli_display_bars(p->total, p->current, bps);
	}
	fprintf(stderr, "\e[?25h\n"); /* restore cursor */

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x840, %rsp            # imm = 0x840
movq %rdi, -0x8(%rbp)
cmpl $0x1, 0x3702(%rip)      # 0x81e8
je 0x4aed
callq 0x4200
movl $0x1c, %edi
callq 0x4cd0
movl $0x0, 0x3737(%rip)      # 0x8238
leaq -0x810(%rbp), %rdi
xorl %esi, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x2170
movl $0x0, -0x814(%rbp)
movq 0x34d3(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x1864(%rip), %rsi      # 0x6393
movb $0x0, %al
callq 0x2200
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movb $0x1, %al
cmpl $0x1, (%rcx)
movb %al, -0x839(%rbp)
je 0x4b5d
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpl $0x2, (%rax)
sete %al
movb %al, -0x839(%rbp)
movb -0x839(%rbp), %al
testb $0x1, %al
jne 0x4b6c
jmp 0x4c4a
movq 0x17dd(%rip), %rax      # 0x6350
movq %rax, -0x828(%rbp)
movq 0x17d7(%rip), %rax      # 0x6358
movq %rax, -0x820(%rbp)
leaq -0x828(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2150
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x4ba6
jmp 0x4b36
leaq -0x838(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2160
imulq $0xf4240, -0x838(%rbp), %rcx # imm = 0xF4240
addq -0x830(%rbp), %rcx
movslq -0x814(%rbp), %rdx
leaq -0x810(%rbp), %rax
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movslq -0x814(%rbp), %rdx
leaq -0x810(%rbp), %rax
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x814(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x814(%rbp)
cmpl $0x80, -0x814(%rbp)
jl 0x4c29
movl $0x0, -0x814(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x810(%rbp), %rdx
callq 0x4d20
jmp 0x4b36
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, (%rax)
jne 0x4ca0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x810(%rbp), %rdx
callq 0x4d20
movq 0x3351(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x15bf(%rip), %rsi      # 0x6270
movb $0x0, %al
callq 0x2200
addq $0x840, %rsp            # imm = 0x840
popq %rbp
retq
nopw %cs:(%rax,%rax)