// File: /workspace/github_c_makefile_star2_O0/neosploit[P]compiler/libfort/lib/fort.c
// Function: table_geometry
FT_INTERNAL
f_status table_geometry(const ft_table_t *table, size_t *height, size_t *width)
{
    if (table == NULL)
        return FT_GEN_ERROR;

    *height = 0;
    *width = 0;
    size_t cols = 0;
    size_t rows = 0;
    size_t *col_width_arr = NULL;
    size_t *row_height_arr = NULL;

    int status = table_rows_and_cols_geometry(table, &col_width_arr, &cols, &row_height_arr, &rows, INTERN_REPR_GEOMETRY);
    if (FT_IS_ERROR(status))
        return status;

    *width = 1 + (cols == 0 ? 1 : cols) + 1; /* for boundaries (that take 1 symbol) + newline   */
    size_t i = 0;
    for (i = 0; i < cols; ++i) {
        *width += col_width_arr[i];
    }

    /* todo: add check for non printable horizontal row separators */
    *height = 1 + (rows == 0 ? 1 : rows); /* for boundaries (that take 1 symbol)  */
    for (i = 0; i < rows; ++i) {
        *height += row_height_arr[i];
    }
    F_FREE(col_width_arr);
    F_FREE(row_height_arr);

    f_table_properties_t *properties = table->properties;
    if (properties) {
        *height += properties->entire_table_properties.top_margin;
        *height += properties->entire_table_properties.bottom_margin;
        *width += properties->entire_table_properties.left_margin;
        *width += properties->entire_table_properties.right_margin;
    }

    /* Take into account that border elements can be more than one byte long */
    f_table_properties_t *table_properties = properties ? properties : &g_table_properties;
    size_t max_border_elem_len = max_border_elem_strlen(table_properties);
    *width *= max_border_elem_len;

    return FT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x19d7a
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x19f7b
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x30(%rbp), %r8
movl $0x1, %r9d
callq 0x18f20
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jge 0x19de3
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x19f7b
cmpq $0x0, -0x28(%rbp)
jne 0x19df5
movl $0x1, %eax
movq %rax, -0x70(%rbp)
jmp 0x19dfd
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rcx
addq $0x1, %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x19e4e
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x19e20
cmpq $0x0, -0x30(%rbp)
jne 0x19e60
movl $0x1, %eax
movq %rax, -0x78(%rbp)
jmp 0x19e68
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rcx
addq $0x1, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x19ead
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x19e7f
movq 0x10374(%rip), %rax     # 0x2a228
movq -0x38(%rbp), %rdi
callq *%rax
movq 0x10367(%rip), %rax     # 0x2a228
movq -0x40(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x19f32
movq -0x58(%rbp), %rax
movl 0x16c(%rax), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movl 0x174(%rax), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movl 0x168(%rax), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movl 0x170(%rax), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
cmpq $0x0, -0x58(%rbp)
je 0x19f43
movq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x19f50
leaq 0x102ee(%rip), %rax     # 0x2a238
movq %rax, -0x80(%rbp)
jmp 0x19f50
movq -0x80(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x19f90
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rcx
movq -0x20(%rbp), %rax
imulq (%rax), %rcx
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)