// File: /workspace/github_cpp_makefile_star2_O2/Phidelux[P]terminal-table/src/cell.cpp
// Function: bornageek::utils::termtab::Cell::render[abi:cxx11](unsigned short, unsigned short) const
const std::string Cell::render(const std::uint16_t line, const std::uint16_t col) const {
        std::stringstream ss;

        std::uint16_t width = this->width(col);

        std::string left(this->mTable->style().paddingLeft(), ' ');
        std::string right(this->mTable->style().paddingRight(), ' ');

        switch(this->mAlign) {
          case Alignment::LEFT:
            ss << left << std::setw(width) 
              << std::left << std::setfill(' ') << this->line(line) << right;
            break;
          case Alignment::RIGHT:
            ss << left << std::setw(width) 
              << std::right << std::setfill(' ') << this->line(line) << right;
            break;
          case Alignment::CENTER:
            std::string val = this->line(line); 
            std::uint16_t innerWidth = width + this->mTable->cellPadding();
            std::uint16_t spaceLeft = innerWidth / 2 - val.length() / 2;
            
            ss << std::string(spaceLeft, ' ') << std::setw(innerWidth - spaceLeft)
               << std::left << std::setfill(' ') << this->line(line);
            break;
        }

        return ss.str();
      }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x2100
movq %r14, %rdi
movl %r15d, %esi
callq 0x382a
movl %eax, %r15d
movq (%r14), %rsi
leaq 0x28(%rsp), %rdi
callq 0x46ca
leaq 0x28(%rsp), %rdi
callq 0x24ee
movzwl %ax, %esi
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x48(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0x21b0
movq (%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x46ca
leaq 0x8(%rsp), %rdi
callq 0x24fc
movzwl %ax, %esi
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x28(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0x21b0
movl 0x28(%r14), %eax
testl %eax, %eax
je 0x3c7e
cmpl $0x1, %eax
je 0x3c0b
cmpl $0x2, %eax
jne 0x3cf6
movzwl %bp, %ebp
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x394e
movq (%r14), %rdi
callq 0x4342
addl %r15d, %eax
movzwl %ax, %r15d
movl %r15d, %r12d
shrl %r12d
movq 0x10(%rsp), %rax
shrq %rax
subq %rax, %r12
movzwl %r12w, %esi
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x68(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0x21b0
leaq 0xb8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2170
movzwl %r12w, %ecx
subl %ecx, %r15d
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movslq %r15d, %rsi
movq %rsi, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl 0x18(%rax,%rcx), %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x2230
movq %rax, %r15
leaq 0x88(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x394e
leaq 0x88(%rsp), %rsi
movq %r15, %rdi
callq 0x2170
leaq 0x88(%rsp), %rdi
callq 0x20a0
leaq 0x68(%rsp), %rdi
callq 0x20a0
jmp 0x3cec
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2170
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movzwl %r15w, %esi
movq %rsi, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl 0x18(%rax,%rcx), %edx
orl $0x80, %edx
movl %edx, 0x18(%rax,%rcx)
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x2230
movq %rax, %r15
movzwl %bp, %edx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x394e
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2170
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x2170
jmp 0x3cec
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2170
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movzwl %r15w, %esi
movq %rsi, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl 0x18(%rax,%rcx), %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x2230
movq %rax, %r15
movzwl %bp, %edx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x394e
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2170
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x8(%rsp), %rdi
callq 0x20a0
leaq 0xc0(%rsp), %rsi
movq %rbx, %rdi
callq 0x2240
leaq 0x28(%rsp), %rdi
callq 0x20a0
leaq 0x48(%rsp), %rdi
callq 0x20a0
leaq 0xa8(%rsp), %rdi
callq 0x2130
movq %rbx, %rax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x20a0
jmp 0x3d5b
jmp 0x3d58
jmp 0x3d69
jmp 0x3d7e
jmp 0x3d7e
jmp 0x3d69
jmp 0x3d7e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x20a0
jmp 0x3d6c
jmp 0x3d69
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20a0
jmp 0x3d81
jmp 0x3d8d
jmp 0x3d9c
jmp 0x3d9c
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20a0
jmp 0x3d90
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x20a0
jmp 0x3d9f
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2280