// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: lxw_worksheet_prepare_tables
void
lxw_worksheet_prepare_tables(lxw_worksheet *self, uint32_t table_id)
{
    lxw_table_obj *table_obj;
    lxw_rel_tuple *relationship;
    char name[LXW_ATTR_32];
    char filename[LXW_FILENAME_LENGTH];

    STAILQ_FOREACH(table_obj, self->table_objs, list_pointers) {

        relationship = calloc(1, sizeof(lxw_rel_tuple));
        GOTO_LABEL_ON_MEM_ERROR(relationship, mem_error);

        relationship->type = lxw_strdup("/table");
        GOTO_LABEL_ON_MEM_ERROR(relationship->type, mem_error);

        lxw_snprintf(filename, LXW_FILENAME_LENGTH,
                     "../tables/table%d.xml", table_id);

        relationship->target = lxw_strdup(filename);
        GOTO_LABEL_ON_MEM_ERROR(relationship->target, mem_error);

        STAILQ_INSERT_TAIL(self->external_table_links, relationship,
                           list_pointers);

        if (!table_obj->name) {
            lxw_snprintf(name, LXW_ATTR_32, "Table%d", table_id);
            table_obj->name = lxw_strdup(name);
            GOTO_LABEL_ON_MEM_ERROR(table_obj->name, mem_error);
        }
        table_obj->id = table_id;
        table_id++;
    }

    return;

mem_error:
    if (relationship) {
        free(relationship->type);
        free(relationship->target);
        free(relationship->target_mode);
        free(relationship);
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4b4b6
movl $0x1, %edi
movl $0x20, %esi
callq 0xc870
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4b332
movq 0x31ce8(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1adb6(%rip), %rsi     # 0x660d0
leaq 0x210d3(%rip), %rdx     # 0x6c3f4
movl $0xf05, %ecx            # imm = 0xF05
movb $0x0, %al
callq 0xc8f0
jmp 0x4b4b8
jmp 0x4b334
leaq 0x216c8(%rip), %rdi     # 0x6ca03
callq 0xcd80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4b37d
movq 0x31c9d(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1ad6b(%rip), %rsi     # 0x660d0
leaq 0x21088(%rip), %rdx     # 0x6c3f4
movl $0xf08, %ecx            # imm = 0xF08
movb $0x0, %al
callq 0xc8f0
jmp 0x4b4b8
jmp 0x4b37f
leaq -0xc0(%rbp), %rdi
movl -0xc(%rbp), %ecx
movl $0x80, %esi
leaq 0x21675(%rip), %rdx     # 0x6ca0a
movb $0x0, %al
callq 0xc5d0
leaq -0xc0(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x4b3e7
movq 0x31c33(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1ad01(%rip), %rsi     # 0x660d0
leaq 0x2101e(%rip), %rdx     # 0x6c3f4
movl $0xf0e, %ecx            # imm = 0xF0E
movb $0x0, %al
callq 0xc8f0
jmp 0x4b4b8
jmp 0x4b3e9
jmp 0x4b3eb
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
addq $0x18, %rcx
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4b48f
leaq -0x40(%rbp), %rdi
movl -0xc(%rbp), %ecx
movl $0x20, %esi
leaq 0x215df(%rip), %rdx     # 0x6ca20
movb $0x0, %al
callq 0xc5d0
leaq -0x40(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4b48b
movq 0x31b8c(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1ac5a(%rip), %rsi     # 0x660d0
leaq 0x20f77(%rip), %rdx     # 0x6c3f4
movl $0xf16, %ecx            # imm = 0xF16
movb $0x0, %al
callq 0xc8f0
jmp 0x4b4b8
jmp 0x4b48d
jmp 0x4b48f
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movq 0x1078(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x4b2e4
jmp 0x4b4f0
cmpq $0x0, -0x20(%rbp)
je 0x4b4ee
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0xc0d0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc0d0
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc0d0
movq -0x20(%rbp), %rdi
callq 0xc0d0
jmp 0x4b4f0
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)