// File: /workspace/github_c_makefile_star2_O1/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, -0x40(%rbp)
testq %rdi, %rdi
je 0xf3a5
callq 0xecb4
testq %rax, %rax
je 0xf3a5
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xf416
movq (%rax), %rax
movq %rax, -0x58(%rbp)
testq %rax, %rax
je 0xf1c2
xorl %edx, %edx
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
movq %rdx, -0x60(%rbp)
imulq %rdx, %rax
movq (%rcx,%rax), %r14
testq %r14, %r14
je 0xf3f7
xorl %edi, %edi
callq 0x12e1d
movl $0x0, %ebx
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0xf184
movq (%r14), %rax
testq %rax, %rax
je 0xf416
movq (%rax), %rax
movq %rax, -0x68(%rbp)
testq %rax, %rax
je 0xf17c
xorl %ebx, %ebx
movq %r14, -0x50(%rbp)
movq (%r14), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
imulq %rbx, %rax
movq (%rcx,%rax), %r12
testq %r12, %r12
je 0xf3b9
callq 0x13368
testq %rax, %rax
je 0xf0f2
movq %rax, %r13
movq (%rax), %r14
testq %r14, %r14
je 0xf0b6
movq (%r14), %rdi
callq *0x12192(%rip)          # 0x21238
movq $0x0, (%r14)
movq %r14, %rdi
callq *0x12182(%rip)          # 0x21238
movq (%r12), %r15
testq %r15, %r15
je 0xf3d8
movq 0x8(%r15), %rdi
movl 0x10(%r15), %esi
callq 0x12f46
testq %rax, %rax
je 0xf11f
movq %rax, %r14
movl 0x10(%r15), %eax
cmpl $0x1, %eax
je 0xf0f7
testl %eax, %eax
jne 0xf106
movq (%r15), %rsi
movq %r14, %rdi
callq 0x133f2
jmp 0xf102
xorl %r13d, %r13d
jmp 0xf146
movq (%r15), %rsi
movq %r14, %rdi
callq 0x134df
testl %eax, %eax
jns 0xf122
movq (%r14), %rdi
callq *0x12129(%rip)          # 0x21238
movq $0x0, (%r14)
movq %r14, %rdi
callq *0x12119(%rip)          # 0x21238
xorl %r14d, %r14d
movq %r14, (%r13)
testq %r14, %r14
je 0xf136
movl 0x8(%r12), %eax
movl %eax, 0x8(%r13)
jmp 0xf142
movq %r13, %rdi
callq *0x120f9(%rip)          # 0x21238
xorl %r13d, %r13d
movq -0x50(%rbp), %r14
movq %r13, -0x48(%rbp)
testq %r13, %r13
je 0xf161
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0xf454
jmp 0xf16a
movq -0x30(%rbp), %rdi
callq 0xef82
testq %r13, %r13
je 0xf182
incq %rbx
cmpq %rbx, -0x68(%rbp)
jne 0xf06c
movq -0x30(%rbp), %rbx
jmp 0xf184
xorl %ebx, %ebx
movq %rbx, -0x48(%rbp)
testq %rbx, %rbx
je 0xf19f
movq -0x38(%rbp), %rax
movq (%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0xf454
jmp 0xf1a8
movq -0x38(%rbp), %rdi
callq 0xee81
testq %rbx, %rbx
je 0xf3a5
movq -0x60(%rbp), %rdx
incq %rdx
cmpq -0x58(%rbp), %rdx
jne 0xf00d
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0xf416
movq (%rax), %rbx
testq %rbx, %rbx
je 0xf25f
leaq -0x48(%rbp), %r15
xorl %r12d, %r12d
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
imulq %r12, %rax
movq (%rcx,%rax), %rax
testq %rax, %rax
je 0xf435
movl (%rax), %r13d
movl $0x1, %edi
movl $0x4, %esi
callq *0x12016(%rip)          # 0x21230
testq %rax, %rax
je 0xf227
movq %rax, %r14
movl %r13d, (%rax)
jmp 0xf22a
xorl %r14d, %r14d
movq %r14, -0x48(%rbp)
testq %r14, %r14
je 0xf245
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
movq %r15, %rsi
callq 0xf454
jmp 0xf24e
movq -0x38(%rbp), %rdi
callq 0xee81
testq %r14, %r14
je 0xf3a5
incq %r12
cmpq %r12, %rbx
jne 0xf1e6
movq -0x38(%rbp), %rbx
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0xf294
movq 0x160(%r14), %r15
testq %r15, %r15
je 0xf28b
movq 0x8(%r15), %rdi
callq *0x11fb6(%rip)          # 0x21238
movq %r15, %rdi
callq *0x11fad(%rip)          # 0x21238
movq %r14, %rdi
callq *0x11fa4(%rip)          # 0x21238
movq -0x40(%rbp), %rax
movq 0x8(%rax), %r12
callq 0xee0d
testq %rax, %rax
je 0xf37b
movq %rax, %r15
movq 0x160(%rax), %rdi
callq 0xedc7
movq 0x160(%r12), %rbx
callq 0x1275e
testq %rax, %rax
je 0xf311
testq %rbx, %rbx
je 0xf416
movq %rax, %r13
movq (%rbx), %r14
testq %r14, %r14
je 0xf330
movq %r12, -0x30(%rbp)
xorl %r12d, %r12d
cmpq %r12, (%rbx)
jbe 0xf2f9
movq 0x18(%rbx), %rsi
imulq %r12, %rsi
addq 0x8(%rbx), %rsi
jmp 0xf2fb
xorl %esi, %esi
movq %r13, %rdi
callq 0xf454
testl %eax, %eax
js 0xf316
incq %r12
cmpq %r12, %r14
jne 0xf2e6
jmp 0xf32c
xorl %r13d, %r13d
jmp 0xf330
movq 0x8(%r13), %rdi
callq *0x11f18(%rip)          # 0x21238
movq %r13, %rdi
callq *0x11f0f(%rip)          # 0x21238
xorl %r13d, %r13d
movq -0x30(%rbp), %r12
movq %r13, 0x160(%r15)
testq %r13, %r13
movq -0x38(%rbp), %rbx
je 0xf372
movl $0x160, %edx            # imm = 0x160
movq %r15, %rdi
movq %r12, %rsi
callq 0x71f0
movups 0x168(%r12), %xmm0
movups %xmm0, 0x168(%r15)
movl 0x178(%r12), %eax
movl %eax, 0x178(%r15)
jmp 0xf37e
movq %r15, %rdi
callq *0x11ebd(%rip)          # 0x21238
xorl %r15d, %r15d
movq %r15, 0x8(%rbx)
testq %r15, %r15
je 0xf39d
movq -0x40(%rbp), %rcx
movq 0x18(%rcx), %rax
movq %rax, 0x18(%rbx)
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rbx)
jmp 0xf3a7
movq %rbx, %rdi
callq 0xee81
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb185(%rip), %rdi      # 0x1a545
leaq 0xa6bf(%rip), %rsi      # 0x19a86
leaq 0xbee7(%rip), %rcx      # 0x1b2b5
movl $0x919, %edx            # imm = 0x919
callq 0x7130
leaq 0xb4bf(%rip), %rdi      # 0x1a89e
leaq 0xa6a0(%rip), %rsi      # 0x19a86
leaq 0xbee8(%rip), %rcx      # 0x1b2d5
movl $0x1962, %edx           # imm = 0x1962
callq 0x7130
leaq 0xb2e0(%rip), %rdi      # 0x1a6de
leaq 0xa681(%rip), %rsi      # 0x19a86
leaq 0xbe8c(%rip), %rcx      # 0x1b298
movl $0x14d9, %edx           # imm = 0x14D9
callq 0x7130
leaq 0xb39e(%rip), %rdi      # 0x1a7bb
leaq 0xa662(%rip), %rsi      # 0x19a86
leaq 0xbf72(%rip), %rcx      # 0x1b39d
movl $0x1c74, %edx           # imm = 0x1C74
callq 0x7130
leaq 0xbf0c(%rip), %rdi      # 0x1b348
leaq 0xa643(%rip), %rsi      # 0x19a86
leaq 0xbf02(%rip), %rcx      # 0x1b34c
movl $0x1b06, %edx           # imm = 0x1B06
callq 0x7130