// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, -0x30(%rbp)
testq %rdi, %rdi
je 0xf1fe
callq 0xeb2d
testq %rax, %rax
je 0xf1fe
movq %rax, %r13
movq -0x30(%rbp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xf26c
movq (%rax), %rax
movq %rax, -0x60(%rbp)
testq %rax, %rax
je 0xefe7
xorl %ebx, %ebx
movq %r13, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
imulq %rbx, %rax
movq (%rcx,%rax), %rax
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0xf28b
xorl %edi, %edi
callq 0x12b11
movq %rax, -0x50(%rbp)
testq %rax, %rax
je 0xf1af
movq %rbx, -0x68(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xf26c
movq (%rax), %rax
movq %rax, -0x70(%rbp)
testq %rax, %rax
je 0xefbd
xorl %ebx, %ebx
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
imulq %rbx, %rax
movq (%rcx,%rax), %r13
testq %r13, %r13
je 0xf20f
callq 0x12e45
testq %rax, %rax
je 0xf19a
movq %rax, %r15
movq (%rax), %r12
testq %r12, %r12
je 0xef3a
movq (%r12), %rdi
callq *0x1130f(%rip)          # 0x20238
movq $0x0, (%r12)
movq %r12, %rdi
callq *0x112fe(%rip)          # 0x20238
movq (%r13), %r14
testq %r14, %r14
je 0xf22e
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x12c36
testq %rax, %rax
je 0xf18a
movq %rax, %r12
movl 0x10(%r14), %eax
cmpl $0x1, %eax
je 0xef7e
testl %eax, %eax
jne 0xf16f
movq (%r14), %rsi
movq %r12, %rdi
callq 0x12ec6
jmp 0xef89
movq (%r14), %rsi
movq %r12, %rdi
callq 0x12f81
testl %eax, %eax
js 0xf16f
movq %r12, (%r15)
movl 0x8(%r13), %eax
movl %eax, 0x8(%r15)
movq %r15, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0xf2aa
incq %rbx
cmpq %rbx, -0x70(%rbp)
jne 0xeee6
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %r13
movq (%r13), %rdi
leaq -0x58(%rbp), %rsi
callq 0xf2aa
movq -0x68(%rbp), %rbx
incq %rbx
cmpq -0x60(%rbp), %rbx
jne 0xee88
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0xf26c
movq (%rax), %rbx
testq %rbx, %rbx
je 0xf05f
xorl %r14d, %r14d
leaq -0x40(%rbp), %r15
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
imulq %r14, %rax
movq (%rcx,%rax), %rax
testq %rax, %rax
je 0xf24d
movl (%rax), %r12d
movl $0x1, %edi
movl $0x4, %esi
callq *0x111f5(%rip)          # 0x20230
testq %rax, %rax
je 0xf1b9
movl %r12d, (%rax)
movq %rax, -0x40(%rbp)
movq 0x28(%r13), %rdi
movq %r15, %rsi
callq 0xf2aa
incq %r14
cmpq %r14, %rbx
jne 0xf007
movq 0x8(%r13), %r15
testq %r15, %r15
je 0xf091
movq 0x160(%r15), %r12
testq %r12, %r12
je 0xf088
movq 0x8(%r12), %rdi
callq *0x111b9(%rip)          # 0x20238
movq %r12, %rdi
callq *0x111b0(%rip)          # 0x20238
movq %r15, %rdi
callq *0x111a7(%rip)          # 0x20238
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r14
callq 0xec85
testq %rax, %rax
je 0xf1ee
movq %rax, %r15
movq %r13, -0x38(%rbp)
movq 0x160(%rax), %rdi
callq 0xec3f
movq 0x160(%r14), %rbx
callq 0x1241c
testq %rax, %rax
je 0xf1d6
movq %r14, -0x48(%rbp)
testq %rbx, %rbx
je 0xf26c
movq %rax, %r13
movq (%rbx), %r14
testq %r14, %r14
je 0xf117
xorl %r12d, %r12d
cmpq %r12, (%rbx)
jbe 0xf0fd
movq 0x18(%rbx), %rsi
imulq %r12, %rsi
addq 0x8(%rbx), %rsi
jmp 0xf0ff
xorl %esi, %esi
movq %r13, %rdi
callq 0xf2aa
testl %eax, %eax
js 0xf1c3
incq %r12
cmpq %r12, %r14
jne 0xf0ea
movq %r13, 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 -0x38(%rbp), %rax
movq %r15, 0x8(%rax)
movq -0x30(%rbp), %rdx
movq 0x18(%rdx), %rcx
movq %rcx, 0x18(%rax)
movq 0x20(%rdx), %rcx
movq %rcx, 0x20(%rax)
jmp 0xf200
movq (%r12), %rdi
callq *0x110bf(%rip)          # 0x20238
movq $0x0, (%r12)
movq %r12, %rdi
callq *0x110ae(%rip)          # 0x20238
movq $0x0, (%r15)
movq %r15, %rdi
callq *0x1109e(%rip)          # 0x20238
movq $0x0, -0x40(%rbp)
movq -0x50(%rbp), %rdi
callq 0xedfa
movq -0x38(%rbp), %r13
movq $0x0, -0x58(%rbp)
jmp 0xf1f6
movq $0x0, -0x40(%rbp)
jmp 0xf1f6
movq 0x8(%r13), %rdi
callq *0x1106b(%rip)          # 0x20238
movq %r13, %rdi
callq *0x11062(%rip)          # 0x20238
movq $0x0, 0x160(%r15)
movq %r15, %rdi
callq *0x1104e(%rip)          # 0x20238
movq -0x38(%rbp), %r13
movq $0x0, 0x8(%r13)
movq %r13, %rdi
callq 0xecf9
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb2be(%rip), %rdi      # 0x1a4d4
leaq 0xa859(%rip), %rsi      # 0x19a76
leaq 0xbec4(%rip), %rcx      # 0x1b0e8
movl $0x919, %edx            # imm = 0x919
callq 0x7120
leaq 0xb5f8(%rip), %rdi      # 0x1a82d
leaq 0xa83a(%rip), %rsi      # 0x19a76
leaq 0xbec5(%rip), %rcx      # 0x1b108
movl $0x1962, %edx           # imm = 0x1962
callq 0x7120
leaq 0xbf27(%rip), %rdi      # 0x1b17b
leaq 0xa81b(%rip), %rsi      # 0x19a76
leaq 0xbf1d(%rip), %rcx      # 0x1b17f
movl $0x1b06, %edx           # imm = 0x1B06
callq 0x7120
leaq 0xb4d7(%rip), %rdi      # 0x1a74a
leaq 0xa7fc(%rip), %rsi      # 0x19a76
leaq 0xbf4f(%rip), %rcx      # 0x1b1d0
movl $0x1c74, %edx           # imm = 0x1C74
callq 0x7120
leaq 0xb3db(%rip), %rdi      # 0x1a66d
leaq 0xa7dd(%rip), %rsi      # 0x19a76
leaq 0xbe2b(%rip), %rcx      # 0x1b0cb
movl $0x14d9, %edx           # imm = 0x14D9
callq 0x7120