// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: ft_copy_table
ft_table_t *ft_copy_table(ft_table_t *table)
{
    if (table == NULL)
        return NULL;

    ft_table_t *result = ft_create_table();
    if (result == NULL)
        return NULL;

    size_t i = 0;
    size_t rows_n = vector_size(table->rows);
    for (i = 0; i < rows_n; ++i) {
        f_row_t *row = VECTOR_AT(table->rows, i, f_row_t *);
        f_row_t *new_row = copy_row(row);
        if (new_row == NULL) {
            ft_destroy_table(result);
            return NULL;
        }
        vector_push(result->rows, &new_row);
    }

    size_t sep_sz = vector_size(table->separators);
    for (i = 0; i < sep_sz; ++i) {
        f_separator_t *sep = VECTOR_AT(table->separators, i, f_separator_t *);
        f_separator_t *new_sep = copy_separator(sep);
        if (new_sep == NULL) {
            ft_destroy_table(result);
            return NULL;
        }
        vector_push(result->separators, &new_sep);
    }

    /* note: by default new table has allocated default properties, so we
     * have to destroy them first.
     */
    if (result->properties) {
        destroy_table_properties(result->properties);
    }
    result->properties = copy_table_properties(table->properties);
    if (result->properties == NULL) {
        ft_destroy_table(result);
        return NULL;
    }

    /* todo: copy conv_buffer  ??  */

    result->cur_row = table->cur_row;
    result->cur_col = table->cur_col;
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rdi, %rdi
je 0xe9fc
movq %rdi, %r14
callq 0xe52a
testq %rax, %rax
je 0xe9fc
movq %rax, %rbx
movq (%r14), %rdi
callq 0xe77d
movq %rax, %r15
xorl %edx, %edx
movq %r14, -0x40(%rbp)
movq %rbx, -0x30(%rbp)
movq %rax, -0x60(%rbp)
cmpq %r15, %rdx
je 0xea0d
movq (%r14), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
movq %rdx, -0x68(%rbp)
imulq %rdx, %rax
movq (%rcx,%rax), %rax
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0xebda
callq 0x12074
movq %rax, -0x50(%rbp)
testq %rax, %rax
je 0xe9ef
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0xe77d
movq %rax, -0x70(%rbp)
xorl %r15d, %r15d
cmpq %r15, -0x70(%rbp)
je 0xe99d
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
imulq %r15, %rax
movq (%rcx,%rax), %r12
testq %r12, %r12
je 0xeb9c
callq 0x122e3
testq %rax, %rax
je 0xe9dd
movq %rax, %r14
movq (%rax), %rdi
callq 0xe817
movq (%r12), %r13
testq %r13, %r13
je 0xebbb
movq 0x8(%r13), %rdi
movl 0x10(%r13), %esi
callq 0x12080
testq %rax, %rax
je 0xe9d1
movq %rax, %rbx
movl 0x10(%r13), %eax
cmpl $0x1, %eax
je 0xe965
testl %eax, %eax
jne 0xe9c9
movq (%r13), %rsi
movq %rbx, %rdi
callq 0x1232c
jmp 0xe971
movq (%r13), %rsi
movq %rbx, %rdi
callq 0x1240f
testl %eax, %eax
js 0xe9c9
movq %rbx, (%r14)
movl 0x8(%r12), %eax
movl %eax, 0x8(%r14)
movq %r14, -0x38(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0xec18
incq %r15
jmp 0xe8e1
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
leaq -0x58(%rbp), %rsi
callq 0xec18
movq -0x68(%rbp), %rdx
incq %rdx
movq -0x40(%rbp), %r14
movq -0x60(%rbp), %r15
jmp 0xe88f
movq %rbx, %rdi
callq 0xe817
andq $0x0, (%r14)
movq %r14, %rdi
callq 0x12048
andq $0x0, -0x38(%rbp)
movq -0x50(%rbp), %rdi
callq 0xe7a9
movq -0x30(%rbp), %rbx
andq $0x0, -0x58(%rbp)
movq %rbx, %rdi
callq 0xe6ca
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%r14), %rdi
callq 0xe77d
movq %rax, %r14
xorl %ebx, %ebx
pushq $0x1
popq %r15
pushq $0x4
popq %r12
cmpq %rbx, %r14
je 0xea7e
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
imulq %rbx, %rax
movq (%rcx,%rax), %rax
testq %rax, %rax
je 0xebf9
movl (%rax), %r13d
movq %r15, %rdi
movq %r12, %rsi
callq *0x117d8(%rip)          # 0x20230
testq %rax, %rax
je 0xeb36
movl %r13d, (%rax)
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0xec18
incq %rbx
jmp 0xea23
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0xea90
callq 0xe7e2
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rbx
callq 0xe659
testq %rax, %rax
je 0xeb28
movq %rax, %r15
movq 0x160(%rax), %rdi
callq 0xe613
movq 0x160(%rbx), %r13
callq 0x119b3
testq %rax, %rax
je 0xeb18
movq %rax, %r14
movq %rbx, -0x48(%rbp)
movq %r13, %rdi
callq 0xe77d
movq %rax, %rbx
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0xeb44
cmpq %r12, (%r13)
jbe 0xeaf4
movq 0x18(%r13), %rsi
imulq %r12, %rsi
addq 0x8(%r13), %rsi
jmp 0xeaf6
xorl %esi, %esi
movq %r14, %rdi
callq 0xec18
incq %r12
testl %eax, %eax
jns 0xeadb
movq 0x8(%r14), %rdi
callq *0x11729(%rip)          # 0x20238
movq %r14, %rdi
callq *0x11720(%rip)          # 0x20238
andq $0x0, 0x160(%r15)
movq %r15, %rdi
callq 0xe7e2
movq -0x30(%rbp), %rdi
andq $0x0, 0x8(%rdi)
jmp 0xe9f7
andq $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rdi
jmp 0xe9f7
movq %r14, 0x160(%r15)
movl $0x160, %edx            # imm = 0x160
movq %r15, %rdi
movq -0x48(%rbp), %rbx
movq %rbx, %rsi
callq 0x71e0
movups 0x168(%rbx), %xmm0
movups %xmm0, 0x168(%r15)
movl 0x178(%rbx), %eax
movl %eax, 0x178(%r15)
movq -0x30(%rbp), %rax
movq %r15, 0x8(%rax)
movq -0x40(%rbp), %rdx
movq 0x18(%rdx), %rcx
movq %rcx, 0x18(%rax)
movq 0x20(%rdx), %rcx
movq %rcx, 0x20(%rax)
jmp 0xe9fe
leaq 0xa931(%rip), %rdi      # 0x194d4
leaq 0x9ecc(%rip), %rsi      # 0x18a76
leaq 0xb5a7(%rip), %rcx      # 0x1a158
movl $0x919, %edx            # imm = 0x919
callq 0x7120
leaq 0xac73(%rip), %rdi      # 0x19835
leaq 0x9ead(%rip), %rsi      # 0x18a76
leaq 0xb5a8(%rip), %rcx      # 0x1a178
movl $0x1962, %edx           # imm = 0x1962
callq 0x7120
leaq 0xaa8c(%rip), %rdi      # 0x1966d
leaq 0x9e8e(%rip), %rsi      # 0x18a76
leaq 0xb54c(%rip), %rcx      # 0x1a13b
movl $0x14d9, %edx           # imm = 0x14D9
callq 0x7120
leaq 0xb5eb(%rip), %rdi      # 0x1a1eb
leaq 0x9e6f(%rip), %rsi      # 0x18a76
leaq 0xb5e1(%rip), %rcx      # 0x1a1ef
movl $0x1b06, %edx           # imm = 0x1B06
callq 0x7120