// File: /workspace/github_c_makefile_star2_O1/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: lxw_worksheet_new
lxw_worksheet *
lxw_worksheet_new(lxw_worksheet_init_data *init_data)
{
    lxw_worksheet *worksheet = calloc(1, sizeof(lxw_worksheet));
    GOTO_LABEL_ON_MEM_ERROR(worksheet, mem_error);

    worksheet->table = calloc(1, sizeof(struct lxw_table_rows));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->table, mem_error);
    RB_INIT(worksheet->table);

    worksheet->hyperlinks = calloc(1, sizeof(struct lxw_table_rows));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->hyperlinks, mem_error);
    RB_INIT(worksheet->hyperlinks);

    worksheet->comments = calloc(1, sizeof(struct lxw_table_rows));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->comments, mem_error);
    RB_INIT(worksheet->comments);

    /* Initialize the cached rows. */
    worksheet->table->cached_row_num = LXW_ROW_MAX + 1;
    worksheet->hyperlinks->cached_row_num = LXW_ROW_MAX + 1;
    worksheet->comments->cached_row_num = LXW_ROW_MAX + 1;

    if (init_data && init_data->optimize) {
        worksheet->array = calloc(LXW_COL_MAX, sizeof(struct lxw_cell *));
        GOTO_LABEL_ON_MEM_ERROR(worksheet->array, mem_error);
    }

    worksheet->col_options =
        calloc(LXW_COL_META_MAX, sizeof(lxw_col_options *));
    worksheet->col_options_max = LXW_COL_META_MAX;
    GOTO_LABEL_ON_MEM_ERROR(worksheet->col_options, mem_error);

    worksheet->col_formats = calloc(LXW_COL_META_MAX, sizeof(lxw_format *));
    worksheet->col_formats_max = LXW_COL_META_MAX;
    GOTO_LABEL_ON_MEM_ERROR(worksheet->col_formats, mem_error);

    worksheet->optimize_row = calloc(1, sizeof(struct lxw_row));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->optimize_row, mem_error);
    worksheet->optimize_row->height = LXW_DEF_ROW_HEIGHT;

    worksheet->merged_ranges = calloc(1, sizeof(struct lxw_merged_ranges));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->merged_ranges, mem_error);
    STAILQ_INIT(worksheet->merged_ranges);

    worksheet->image_props = calloc(1, sizeof(struct lxw_image_props));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->image_props, mem_error);
    STAILQ_INIT(worksheet->image_props);

    worksheet->chart_data = calloc(1, sizeof(struct lxw_chart_props));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->chart_data, mem_error);
    STAILQ_INIT(worksheet->chart_data);

    worksheet->comment_objs = calloc(1, sizeof(struct lxw_comment_objs));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->comment_objs, mem_error);
    STAILQ_INIT(worksheet->comment_objs);

    worksheet->header_image_objs = calloc(1, sizeof(struct lxw_comment_objs));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->header_image_objs, mem_error);
    STAILQ_INIT(worksheet->header_image_objs);

    worksheet->button_objs = calloc(1, sizeof(struct lxw_comment_objs));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->button_objs, mem_error);
    STAILQ_INIT(worksheet->button_objs);

    worksheet->selections = calloc(1, sizeof(struct lxw_selections));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->selections, mem_error);
    STAILQ_INIT(worksheet->selections);

    worksheet->data_validations =
        calloc(1, sizeof(struct lxw_data_validations));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->data_validations, mem_error);
    STAILQ_INIT(worksheet->data_validations);

    worksheet->table_objs = calloc(1, sizeof(struct lxw_table_objs));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->table_objs, mem_error);
    STAILQ_INIT(worksheet->table_objs);

    worksheet->external_hyperlinks = calloc(1, sizeof(struct lxw_rel_tuples));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->external_hyperlinks, mem_error);
    STAILQ_INIT(worksheet->external_hyperlinks);

    worksheet->external_drawing_links =
        calloc(1, sizeof(struct lxw_rel_tuples));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->external_drawing_links, mem_error);
    STAILQ_INIT(worksheet->external_drawing_links);

    worksheet->drawing_links = calloc(1, sizeof(struct lxw_rel_tuples));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->drawing_links, mem_error);
    STAILQ_INIT(worksheet->drawing_links);

    worksheet->vml_drawing_links = calloc(1, sizeof(struct lxw_rel_tuples));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->vml_drawing_links, mem_error);
    STAILQ_INIT(worksheet->vml_drawing_links);

    worksheet->external_table_links =
        calloc(1, sizeof(struct lxw_rel_tuples));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->external_table_links, mem_error);
    STAILQ_INIT(worksheet->external_table_links);

    if (init_data && init_data->optimize) {
        FILE *tmpfile;

        worksheet->optimize_buffer = NULL;
        worksheet->optimize_buffer_size = 0;
        tmpfile = lxw_get_filehandle(&worksheet->optimize_buffer,
                                     &worksheet->optimize_buffer_size,
                                     init_data->tmpdir);
        if (!tmpfile) {
            LXW_ERROR("Error creating tmpfile() for worksheet in "
                      "'constant_memory' mode.");
            goto mem_error;
        }

        worksheet->optimize_tmpfile = tmpfile;
        GOTO_LABEL_ON_MEM_ERROR(worksheet->optimize_tmpfile, mem_error);
        worksheet->file = worksheet->optimize_tmpfile;
    }

    worksheet->drawing_rel_ids =
        calloc(1, sizeof(struct lxw_drawing_rel_ids));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->drawing_rel_ids, mem_error);
    RB_INIT(worksheet->drawing_rel_ids);

    worksheet->vml_drawing_rel_ids =
        calloc(1, sizeof(struct lxw_vml_drawing_rel_ids));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->vml_drawing_rel_ids, mem_error);
    RB_INIT(worksheet->vml_drawing_rel_ids);

    worksheet->conditional_formats =
        calloc(1, sizeof(struct lxw_cond_format_hash));
    GOTO_LABEL_ON_MEM_ERROR(worksheet->conditional_formats, mem_error);
    RB_INIT(worksheet->conditional_formats);

    /* Initialize the worksheet dimensions. */
    worksheet->dim_rowmax = 0;
    worksheet->dim_colmax = 0;
    worksheet->dim_rowmin = LXW_ROW_MAX;
    worksheet->dim_colmin = LXW_COL_MAX;

    worksheet->default_row_height = LXW_DEF_ROW_HEIGHT;
    worksheet->default_row_pixels = 20;
    worksheet->default_col_pixels = 64;

    /* Initialize the page setup properties. */
    worksheet->fit_height = 0;
    worksheet->fit_width = 0;
    worksheet->page_start = 0;
    worksheet->print_scale = 100;
    worksheet->fit_page = 0;
    worksheet->orientation = LXW_TRUE;
    worksheet->page_order = 0;
    worksheet->page_setup_changed = LXW_FALSE;
    worksheet->page_view = LXW_FALSE;
    worksheet->paper_size = 0;
    worksheet->vertical_dpi = 0;
    worksheet->horizontal_dpi = 0;
    worksheet->margin_left = 0.7;
    worksheet->margin_right = 0.7;
    worksheet->margin_top = 0.75;
    worksheet->margin_bottom = 0.75;
    worksheet->margin_header = 0.3;
    worksheet->margin_footer = 0.3;
    worksheet->print_gridlines = 0;
    worksheet->screen_gridlines = 1;
    worksheet->print_options_changed = 0;
    worksheet->zoom = 100;
    worksheet->zoom_scale_normal = LXW_TRUE;
    worksheet->show_zeros = LXW_TRUE;
    worksheet->outline_on = LXW_TRUE;
    worksheet->outline_style = LXW_TRUE;
    worksheet->outline_below = LXW_TRUE;
    worksheet->outline_right = LXW_FALSE;
    worksheet->tab_color = LXW_COLOR_UNSET;
    worksheet->max_url_length = 2079;
    worksheet->comment_display_default = LXW_COMMENT_DISPLAY_HIDDEN;

    worksheet->header_footer_objs[0] = &worksheet->header_left_object_props;
    worksheet->header_footer_objs[1] = &worksheet->header_center_object_props;
    worksheet->header_footer_objs[2] = &worksheet->header_right_object_props;
    worksheet->header_footer_objs[3] = &worksheet->footer_left_object_props;
    worksheet->header_footer_objs[4] = &worksheet->footer_center_object_props;
    worksheet->header_footer_objs[5] = &worksheet->footer_right_object_props;

    if (init_data) {
        worksheet->name = init_data->name;
        worksheet->quoted_name = init_data->quoted_name;
        worksheet->tmpdir = init_data->tmpdir;
        worksheet->index = init_data->index;
        worksheet->hidden = init_data->hidden;
        worksheet->sst = init_data->sst;
        worksheet->optimize = init_data->optimize;
        worksheet->active_sheet = init_data->active_sheet;
        worksheet->first_sheet = init_data->first_sheet;
        worksheet->default_url_format = init_data->default_url_format;
        worksheet->max_url_length = init_data->max_url_length;
    }

    return worksheet;

mem_error:
    lxw_worksheet_free(worksheet);
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x3c8, %esi            # imm = 0x3C8
callq 0xc7f0
movq %rax, %rbx
testq %rax, %rax
je 0x2df74
movl $0x1, %edi
movl $0x18, %esi
callq 0xc7f0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x2df7e
movq %rax, %r15
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x18, %esi
callq 0xc7f0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x2df88
movq %rax, %r12
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x18, %esi
callq 0xc7f0
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x2df92
movq $0x0, (%rax)
movl $0x100001, %ecx         # imm = 0x100001
movl %ecx, 0x10(%r15)
movl %ecx, 0x10(%r12)
movl %ecx, 0x10(%rax)
testq %r14, %r14
je 0x2da3f
cmpb $0x0, 0x3(%r14)
je 0x2da3f
movl $0x4000, %edi           # imm = 0x4000
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x2e012
movl $0x80, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0xf0(%rbx)
movw $0x80, 0xf8(%rbx)
testq %rax, %rax
je 0x2df9c
movl $0x80, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x110(%rbx)
movw $0x80, 0x118(%rbx)
testq %rax, %rax
je 0x2dfa6
movl $0x1, %edi
movl $0x48, %esi
callq 0xc7f0
movq %rax, 0x120(%rbx)
testq %rax, %rax
je 0x2dfb0
movabsq $0x402e000000000000, %r12 # imm = 0x402E000000000000
movq %r12, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x2dfb7
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x2dfbe
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x2dfc5
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x2dfcc
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x2dfd3
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x90(%rbx)
testq %rax, %rax
je 0x2dfda
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x2dfe1
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x2dfe8
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x2dfef
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x218(%rbx)
testq %rax, %rax
je 0x2dff6
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x220(%rbx)
testq %rax, %rax
je 0x2dffd
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x228(%rbx)
testq %rax, %rax
je 0x2e004
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x230(%rbx)
testq %rax, %rax
je 0x2e00b
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x238(%rbx)
testq %rax, %rax
je 0x2e019
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
testq %r14, %r14
je 0x2dd39
cmpb $0x0, 0x3(%r14)
je 0x2dd39
leaq 0x10(%rbx), %rdi
leaq 0x18(%rbx), %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x30(%r14), %rdx
callq 0xce00
movq %rax, %r15
testq %rax, %rax
je 0x2e051
movq %r15, 0x8(%rbx)
movq %r15, (%rbx)
testq %r15, %r15
je 0x2e038
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x2e020
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x2e027
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x58(%rbx)
testq %rax, %rax
je 0x2e02e
leaq 0x378(%rbx), %rcx
leaq 0x380(%rbx), %rdx
leaq 0x388(%rbx), %rsi
leaq 0x390(%rbx), %rdi
leaq 0x398(%rbx), %r8
movq %rbx, %r9
addq $0x3a0, %r9             # imm = 0x3A0
xorl %r10d, %r10d
movq $0x0, (%rax)
movq $0x100000, 0xa4(%rbx) # imm = 0x100000
movl $0x4000, 0xac(%rbx)     # imm = 0x4000
movq %r12, 0x198(%rbx)
movabsq $0x4000000014, %rax     # imm = 0x4000000014
movq %rax, 0x1a0(%rbx)
movl %r10d, 0x128(%rbx)
movl $0x640000, 0x130(%rbx)  # imm = 0x640000
movb %r10b, 0x13b(%rbx)
movb $0x1, %al
movb %al, 0x13d(%rbx)
movw %r10w, 0x136(%rbx)
movw %r10w, 0x12c(%rbx)
movl %r10d, 0x143(%rbx)
movabsq $0x3fe6666666666666, %r11 # imm = 0x3FE6666666666666
movq %r11, 0x168(%rbx)
movq %r11, 0x170(%rbx)
movabsq $0x3fe8000000000000, %r11 # imm = 0x3FE8000000000000
movq %r11, 0x178(%rbx)
movq %r11, 0x180(%rbx)
movabsq $0x3fd3333333333333, %r11 # imm = 0x3FD3333333333333
movq %r11, 0x188(%rbx)
movq %r11, 0x190(%rbx)
movb %r10b, 0x147(%rbx)
movw $0x101, 0x14b(%rbx)     # imm = 0x101
movb %r10b, 0x149(%rbx)
movw $0x64, 0x138(%rbx)
movb %al, 0x14e(%rbx)
movl $0x10101, 0x13f(%rbx)   # imm = 0x10101
movl %r10d, 0x164(%rbx)
movw $0x81f, 0x1f6(%rbx)     # imm = 0x81F
movb %al, 0x2ec(%rbx)
movq %rcx, 0x348(%rbx)
movq %rdx, 0x350(%rbx)
movq %rsi, 0x358(%rbx)
movq %rdi, 0x360(%rbx)
movq %r8, 0x368(%rbx)
movq %r9, 0x370(%rbx)
testq %r14, %r14
je 0x2e042
movq 0x20(%r14), %rax
movq %rax, 0xb8(%rbx)
movq 0x28(%r14), %rax
movq %rax, 0xc0(%rbx)
movq 0x30(%r14), %rax
movq %rax, 0xc8(%rbx)
movzwl (%r14), %eax
movw %ax, 0xd0(%rbx)
movb 0x2(%r14), %al
movb %al, 0xd4(%rbx)
movq 0x18(%r14), %rax
movq %rax, 0xb0(%rbx)
movb 0x3(%r14), %al
movb %al, 0x11c(%rbx)
movq 0x8(%r14), %rax
movq %rax, 0xd8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0xe0(%rbx)
movq 0x38(%r14), %rax
movq %rax, 0x298(%rbx)
movzwl 0x40(%r14), %eax
movw %ax, 0x1f6(%rbx)
jmp 0x2e042
movl $0x63, %edi
jmp 0x2e033
movl $0x66, %edi
jmp 0x2e033
movl $0x6a, %edi
jmp 0x2e033
movl $0x6e, %edi
jmp 0x2e033
movl $0x7e, %edi
jmp 0x2e033
movl $0x82, %edi
jmp 0x2e033
movl $0x85, %edi
jmp 0x2e033
movl $0x89, %edi
jmp 0x2e033
movl $0x8d, %edi
jmp 0x2e033
movl $0x91, %edi
jmp 0x2e033
movl $0x95, %edi
jmp 0x2e033
movl $0x99, %edi
jmp 0x2e033
movl $0x9d, %edi
jmp 0x2e033
movl $0xa1, %edi
jmp 0x2e033
movl $0xa6, %edi
jmp 0x2e033
movl $0xaa, %edi
jmp 0x2e033
movl $0xae, %edi
jmp 0x2e033
movl $0xb3, %edi
jmp 0x2e033
movl $0xb7, %edi
jmp 0x2e033
movl $0xbb, %edi
jmp 0x2e033
movl $0x78, %edi
jmp 0x2e033
movl $0xc0, %edi
jmp 0x2e033
movl $0xd8, %edi
jmp 0x2e033
movl $0xdd, %edi
jmp 0x2e033
movl $0xe2, %edi
callq 0xe5a3
movq %rbx, %rdi
callq 0xcdb0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0xe57f
jmp 0x2dd30