// File: /workspace/github_cpp_makefile_star2_O1/acherkaoui[P]HTOP/terminal/terminal.cpp
// Function: Curses::ProgressBar[abi:cxx11](_win_st*, int, int, float)
std::string Curses::ProgressBar(WINDOW *win, int y, int x, float val)
{
	std::string bar = "[                    ]";
	wattron(win, COLOR_PAIR(8));
	mvwaddch(win, y, x, ACS_CKBOARD);
	wattroff(win, COLOR_PAIR(8));
	int round = (int)floor(val / 5) *5;
	int nbBars = round / 5;
	int i;
	for (i = 1; i < nbBars - 1; i++)
	{
		if (i <= nbBars && i <= 6)
		{
			wattron(win, COLOR_PAIR(4));
			mvwaddch(win, y, x + i, ACS_CKBOARD);
			wattroff(win, COLOR_PAIR(4));
			bar[i] = '=';
		}
		else if (i <= nbBars && i <= 9)
		{
			wattron(win, COLOR_PAIR(7));
			mvwaddch(win, y, x + i, ACS_CKBOARD);
			wattroff(win, COLOR_PAIR(7));
			bar[i] = '=';
		}
		else if (i <= nbBars && i <= 23)
		{
			wattron(win, COLOR_PAIR(5));
			mvwaddch(win, y, x + i, ACS_CKBOARD);
			wattroff(win, COLOR_PAIR(5));
			bar[i] = '=';
		}
	}
	wattron(win, COLOR_PAIR(8));
	mvwaddch(win, y, x + 22, ACS_CKBOARD);
	wattroff(win, COLOR_PAIR(8));
	return bar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movss %xmm0, 0x1c(%rsp)
movl %r8d, %ebx
movl %ecx, 0x8(%rsp)
movq %rdx, %r14
leaq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rdi)
leaq 0x26f3(%rip), %rsi      # 0xd8b8
leaq 0x2702(%rip), %rdx      # 0xd8ce
movq %rdi, 0x10(%rsp)
callq 0x6474
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4210
movq %r14, %rdi
movl 0x8(%rsp), %esi
movl %ebx, %edx
callq 0x4390
cmpl $-0x1, %eax
je 0xb20d
movq 0x6d99(%rip), %rax      # 0x11f98
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4130
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4450
movl %ebx, 0xc(%rsp)
movss 0x1c(%rsp), %xmm0
divss 0x2182(%rip), %xmm0     # 0xd3b0
callq 0x4190
cvttss2si %xmm0, %r13d
cmpl $0x3, %r13d
jl 0xb373
movl %r13d, %ebp
decl %r13d
movl 0xc(%rsp), %ebx
movl $0x1, %r15d
cmpq %rbp, %r15
seta %al
cmpq $0x7, %r15
setae %cl
orb %al, %cl
jne 0xb2ab
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
xorl %edx, %edx
callq 0x4210
leal (%rbx,%r15), %edx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x4390
movl $0x400, %r12d           # imm = 0x400
cmpl $-0x1, %eax
je 0xb34d
movq 0x6d00(%rip), %rax      # 0x11f98
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4130
jmp 0xb34d
cmpq %rbp, %r15
seta %al
cmpq $0xa, %r15
setae %cl
orb %al, %cl
jne 0xb2fd
movq %r14, %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x4210
leal (%rbx,%r15), %edx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x4390
movl $0x700, %r12d           # imm = 0x700
cmpl $-0x1, %eax
je 0xb34d
movq 0x6cab(%rip), %rax      # 0x11f98
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4130
jmp 0xb34d
cmpq %rbp, %r15
seta %al
cmpq $0x18, %r15
setae %cl
orb %al, %cl
jne 0xb367
movq %r14, %rdi
movl $0x500, %esi            # imm = 0x500
xorl %edx, %edx
callq 0x4210
leal (%rbx,%r15), %edx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x4390
movl $0x500, %r12d           # imm = 0x500
cmpl $-0x1, %eax
je 0xb34d
movq 0x6c59(%rip), %rax      # 0x11f98
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4130
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x4450
movq 0x10(%rsp), %rax
movq (%rax), %rax
movb $0x3d, (%rax,%r15)
incq %r15
cmpq %r15, %r13
jne 0xb252
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4210
movl 0xc(%rsp), %edx
addl $0x16, %edx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x4390
cmpl $-0x1, %eax
je 0xb3af
movq 0x6bf7(%rip), %rax      # 0x11f98
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4130
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4450
movq 0x10(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb3d6
jmp 0xb3d6
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %rdi
cmpq 0x20(%rsp), %rdi
je 0xb3ed
callq 0x4320
movq %r14, %rdi
callq 0x45c0
nop