// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x20e0
movq %r14, %rdi
movl %r15d, %esi
callq 0x3d60
movl %eax, %r15d
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x50cc
leaq 0x20(%rsp), %rdi
callq 0x2550
movzwl %ax, %esi
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x40(%rsp), %rdi
movl $0x20, %edx
callq 0x21b0
movq (%r14), %rsi
movq %rsp, %rdi
callq 0x50cc
movq %rsp, %rdi
callq 0x255e
movzwl %ax, %esi
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x20(%rsp), %rdi
movl $0x20, %edx
callq 0x21b0
movl 0x28(%r14), %eax
testl %eax, %eax
je 0x435f
cmpl $0x1, %eax
je 0x42b4
cmpl $0x2, %eax
jne 0x441d
movzwl %bp, %ebp
movq %rsp, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3f0a
movq (%r14), %rdi
callq 0x4b96
addl %r15d, %eax
movzwl %ax, %r12d
movl %r12d, %r13d
shrl %r13d
movq 0x8(%rsp), %rax
shrq %rax
subq %rax, %r13
movzwl %r13w, %esi
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x60(%rsp), %rdi
movl $0x20, %edx
callq 0x21b0
leaq 0xb0(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x21a0
movq %rax, %r15
movzwl %r13w, %eax
subl %eax, %r12d
movq (%r15), %rax
movq -0x18(%rax), %rcx
movslq %r12d, %rdx
movq %rdx, 0x10(%r15,%rcx)
movq -0x18(%rax), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl 0x18(%r15,%rcx), %edx
orl $0x20, %edx
movl %edx, 0x18(%r15,%rcx)
movq -0x18(%rax), %rax
movq %r15, %r12
addq %rax, %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x4236
movq %r12, %rdi
movl $0x20, %esi
callq 0x2150
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
leaq 0x50(%rsp), %r13
callq 0x3f0a
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %r15, %rdi
callq 0x21a0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x428f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x4402
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x4402
leaq 0xb0(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x21a0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rcx
movzwl %r15w, %edx
movq %rdx, 0x10(%r12,%rcx)
movq -0x18(%rax), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl 0x18(%r12,%rcx), %edx
orl $0x80, %edx
movl %edx, 0x18(%r12,%rcx)
movq -0x18(%rax), %rax
movq %r12, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r12,%rax)
jne 0x4321
movq %r15, %rdi
movl $0x20, %esi
callq 0x2150
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movzwl %bp, %edx
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3f0a
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rdi
callq 0x21a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rax, %rdi
callq 0x21a0
jmp 0x4402
leaq 0xb0(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x21a0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rcx
movzwl %r15w, %edx
movq %rdx, 0x10(%r12,%rcx)
movq -0x18(%rax), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl 0x18(%r12,%rcx), %edx
orl $0x20, %edx
movl %edx, 0x18(%r12,%rcx)
movq -0x18(%rax), %rax
movq %r12, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r12,%rax)
jne 0x43c9
movq %r15, %rdi
movl $0x20, %esi
callq 0x2150
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movzwl %bp, %edx
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3f0a
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rdi
callq 0x21a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rax, %rdi
callq 0x21a0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x441d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2180
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2220
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4449
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x4460
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x6b39(%rip), %rsi      # 0xafa0
leaq 0xa0(%rsp), %rdi
callq 0x2110
leaq 0x120(%rsp), %rdi
callq 0x2050
movq %rbx, %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x44cb
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x44cb
jmp 0x44c8
jmp 0x44eb
jmp 0x4511
jmp 0x4511
jmp 0x44eb
jmp 0x4511
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x44ee
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x44ee
jmp 0x44eb
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4514
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x4514
jmp 0x4532
jmp 0x4553
jmp 0x4553
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4535
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x4535
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4556
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x4556
movq %rax, %rbx
movq 0x6a43(%rip), %rsi      # 0xafa0
leaq 0xa0(%rsp), %rdi
callq 0x2110
leaq 0x120(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2260