// File: /workspace/github_cpp_makefile_star2_O2/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 $0x18, %rsp
movss %xmm0, 0x8(%rsp)
movl %r8d, %ebx
movl %ecx, %r15d
movq %rdx, %r14
leaq 0x2338(%rip), %rsi      # 0xb898
leaq 0xf(%rsp), %rdx
movq %rdi, 0x10(%rsp)
callq 0x41a0
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4210
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x43a0
cmpl $-0x1, %eax
je 0x95a5
movq 0x7a11(%rip), %rax      # 0x10fa8
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4140
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4440
movss 0x8(%rsp), %xmm0
divss 0x1dce(%rip), %xmm0     # 0xb390
callq 0x4180
cvttss2si %xmm0, %eax
decl %eax
movslq %eax, %rbp
movl %ebx, 0x8(%rsp)
movl %ebx, %r13d
pushq $0x1
popq %rbx
cmpq %rbp, %rbx
jge 0x96db
cmpq $0x6, %rbx
ja 0x9630
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
xorl %edx, %edx
callq 0x4210
leal (%rbx,%r13), %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0x43a0
movl $0x400, %r12d           # imm = 0x400
cmpl $-0x1, %eax
je 0x96ba
movq 0x798b(%rip), %rax      # 0x10fa8
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4140
jmp 0x96ba
cmpq $0x9, %rbx
ja 0x9676
movq %r14, %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x4210
leal (%rbx,%r13), %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0x43a0
movl $0x700, %r12d           # imm = 0x700
cmpl $-0x1, %eax
je 0x96ba
movq 0x7942(%rip), %rax      # 0x10fa8
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4140
jmp 0x96ba
cmpq $0x17, %rbx
ja 0x96d3
movq %r14, %rdi
movl $0x500, %esi            # imm = 0x500
xorl %edx, %edx
callq 0x4210
leal (%rbx,%r13), %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0x43a0
movl $0x500, %r12d           # imm = 0x500
cmpl $-0x1, %eax
je 0x96ba
movq 0x78fc(%rip), %rax      # 0x10fa8
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4140
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x4440
movq 0x10(%rsp), %rax
movq (%rax), %rax
movb $0x3d, (%rax,%rbx)
incq %rbx
jmp 0x95da
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4210
movl 0x8(%rsp), %edx
addl $0x16, %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0x43a0
cmpl $-0x1, %eax
je 0x9716
movq 0x78a0(%rip), %rax      # 0x10fa8
movl 0x184(%rax), %esi
movq %r14, %rdi
callq 0x4140
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
callq 0x4440
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x973d
jmp 0x973d
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x41f0
movq %r14, %rdi
callq 0x45a0