// File: /workspace/github_cpp_makefile_star2_O2/Stygain[P]bandwidth-monitor/src/graph.cpp
// Function: Graph::Create(int, int, int, int)
void Graph::Create(int placementX, int placementY, int width, int height)
{
	this->placementX = placementX;
	this->placementY = placementY;
	this->width = width;
	this->height = height;

	this->graphTitle->Create(this->placementX + 1, this->placementY, this->width, 1);
	this->graphMaxItem->Create(this->placementX + 2, this->placementY + 1, 5, 1);

	this->win = newwin(this->height, this->width, this->placementY + 1, this->placementX);
	wborder(this->win, 0, 0, 0, 0, 0, 0, 0, 0);

	this->numCols = (this->width - 3);
	for (int i = 0; i < this->numCols; i++)
	{
		this->gDataCols.push_back(new GraphDataColumn(this->graphType, this->interfaces, this->interface));
	}

	for (size_t i = 0; i < (this->gDataCols.size() - 1); i++)
	{
		gDataCols[i]->SetNext(gDataCols[i+1]);
	}

	this->numRows = (this->height - 2);
	for (int i = 0; i < this->numRows; i++)
	{
		this->gRows.push_back(
			new GraphRow(
				1,
				(this->width - 3),
				(this->placementX + 1),
				(this->placementY + 1 + ((i * 1) + 1)),
				(this->numRows - i - 1),
				(this->numRows - 1)
			)
		);
	}

	wrefresh(this->win);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movl %ecx, 0x10(%rdi)
movl %r8d, 0x14(%rdi)
movq 0x38(%rdi), %rdi
incl %esi
pushq $0x1
popq %rbp
movl %ebp, %r8d
callq 0x7aa0
movq 0x40(%rbx), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
addl $0x2, %esi
incl %edx
pushq $0x5
popq %rcx
movl %ebp, %r8d
callq 0x7baa
movl 0x14(%rbx), %edi
movl 0x10(%rbx), %esi
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %edx
incl %edx
callq 0x32e0
movq %rax, (%rbx)
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x31c0
movl 0x10(%rbx), %eax
addl $-0x3, %eax
movl %eax, 0x1c(%rbx)
leaq 0x60(%rbx), %r14
pushq $0x20
popq %r15
leaq 0x20(%rsp), %r12
cmpl %eax, %ebp
jge 0x7dea
movq %r15, %rdi
callq 0x32c0
movl 0x30(%rbx), %ecx
andl $0x0, (%rax)
andq $0x0, 0x18(%rax)
movl %ecx, 0x4(%rax)
movups 0x20(%rbx), %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, 0x20(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x8582
incl %ebp
movl 0x1c(%rbx), %eax
jmp 0x7db1
movq 0x60(%rbx), %rax
movq 0x68(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
pushq $0x1
popq %rdx
cmpq %rdx, %rcx
je 0x7e13
movq -0x8(%rax,%rdx,8), %rsi
movq (%rax,%rdx,8), %rdi
movq %rdi, 0x18(%rsi)
incq %rdx
jmp 0x7dfc
movl 0x14(%rbx), %r12d
addl $-0x2, %r12d
movl %r12d, 0x18(%rbx)
leaq 0x48(%rbx), %r14
pushq $0x2
popq %r15
pushq $-0x1
popq %rbp
leal -0x2(%r15), %eax
cmpl %r12d, %eax
jge 0x7e83
pushq $0x20
popq %rdi
callq 0x32c0
movq %rax, %r13
movl 0x8(%rbx), %ecx
movl 0x10(%rbx), %edx
addl $-0x3, %edx
incl %ecx
movl 0xc(%rbx), %r8d
addl %r15d, %r8d
leal (%r12,%rbp), %r9d
decl %r12d
movl %r12d, (%rsp)
movq %rax, %rdi
pushq $0x1
popq %rsi
callq 0x795c
movq %r13, 0x20(%rsp)
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0x86fe
movl 0x18(%rbx), %r12d
incl %r15d
decl %ebp
jmp 0x7e2a
movq (%rbx), %rdi
callq 0x3310
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r13, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0x3540