// File: /workspace/github_c_makefile_star2_O3/Paxa[P]fast_excel/libxlsxwriter/src/workbook.c
// Function: workbook_new_opt
lxw_workbook *
workbook_new_opt(const char *filename, lxw_workbook_options *options)
{
    lxw_format *format;
    lxw_workbook *workbook;

    /* Create the workbook object. */
    workbook = calloc(1, sizeof(lxw_workbook));
    GOTO_LABEL_ON_MEM_ERROR(workbook, mem_error);
    workbook->filename = lxw_strdup(filename);

    /* Add the sheets list. */
    workbook->sheets = calloc(1, sizeof(struct lxw_sheets));
    GOTO_LABEL_ON_MEM_ERROR(workbook->sheets, mem_error);
    STAILQ_INIT(workbook->sheets);

    /* Add the worksheets list. */
    workbook->worksheets = calloc(1, sizeof(struct lxw_worksheets));
    GOTO_LABEL_ON_MEM_ERROR(workbook->worksheets, mem_error);
    STAILQ_INIT(workbook->worksheets);

    /* Add the chartsheets list. */
    workbook->chartsheets = calloc(1, sizeof(struct lxw_chartsheets));
    GOTO_LABEL_ON_MEM_ERROR(workbook->chartsheets, mem_error);
    STAILQ_INIT(workbook->chartsheets);

    /* Add the worksheet names tree. */
    workbook->worksheet_names = calloc(1, sizeof(struct lxw_worksheet_names));
    GOTO_LABEL_ON_MEM_ERROR(workbook->worksheet_names, mem_error);
    RB_INIT(workbook->worksheet_names);

    /* Add the chartsheet names tree. */
    workbook->chartsheet_names = calloc(1,
                                        sizeof(struct lxw_chartsheet_names));
    GOTO_LABEL_ON_MEM_ERROR(workbook->chartsheet_names, mem_error);
    RB_INIT(workbook->chartsheet_names);

    /* Add the image MD5 tree. */
    workbook->image_md5s = calloc(1, sizeof(struct lxw_image_md5s));
    GOTO_LABEL_ON_MEM_ERROR(workbook->image_md5s, mem_error);
    RB_INIT(workbook->image_md5s);

    /* Add the header image MD5 tree. */
    workbook->header_image_md5s = calloc(1, sizeof(struct lxw_image_md5s));
    GOTO_LABEL_ON_MEM_ERROR(workbook->header_image_md5s, mem_error);
    RB_INIT(workbook->header_image_md5s);

    /* Add the background image MD5 tree. */
    workbook->background_md5s = calloc(1, sizeof(struct lxw_image_md5s));
    GOTO_LABEL_ON_MEM_ERROR(workbook->background_md5s, mem_error);
    RB_INIT(workbook->background_md5s);

    /* Add the charts list. */
    workbook->charts = calloc(1, sizeof(struct lxw_charts));
    GOTO_LABEL_ON_MEM_ERROR(workbook->charts, mem_error);
    STAILQ_INIT(workbook->charts);

    /* Add the ordered charts list to track chart insertion order. */
    workbook->ordered_charts = calloc(1, sizeof(struct lxw_charts));
    GOTO_LABEL_ON_MEM_ERROR(workbook->ordered_charts, mem_error);
    STAILQ_INIT(workbook->ordered_charts);

    /* Add the formats list. */
    workbook->formats = calloc(1, sizeof(struct lxw_formats));
    GOTO_LABEL_ON_MEM_ERROR(workbook->formats, mem_error);
    STAILQ_INIT(workbook->formats);

    /* Add the defined_names list. */
    workbook->defined_names = calloc(1, sizeof(struct lxw_defined_names));
    GOTO_LABEL_ON_MEM_ERROR(workbook->defined_names, mem_error);
    TAILQ_INIT(workbook->defined_names);

    /* Add the shared strings table. */
    workbook->sst = lxw_sst_new();
    GOTO_LABEL_ON_MEM_ERROR(workbook->sst, mem_error);

    /* Add the default workbook properties. */
    workbook->properties = calloc(1, sizeof(lxw_doc_properties));
    GOTO_LABEL_ON_MEM_ERROR(workbook->properties, mem_error);

    /* Add a hash table to track format indices. */
    workbook->used_xf_formats = lxw_hash_new(128, 1, 0);
    GOTO_LABEL_ON_MEM_ERROR(workbook->used_xf_formats, mem_error);

    /* Add a hash table to track format indices. */
    workbook->used_dxf_formats = lxw_hash_new(128, 1, 0);
    GOTO_LABEL_ON_MEM_ERROR(workbook->used_dxf_formats, mem_error);

    /* Add the worksheets list. */
    workbook->custom_properties =
        calloc(1, sizeof(struct lxw_custom_properties));
    GOTO_LABEL_ON_MEM_ERROR(workbook->custom_properties, mem_error);
    STAILQ_INIT(workbook->custom_properties);

    /* Add the default cell format. */
    format = workbook_add_format(workbook);
    GOTO_LABEL_ON_MEM_ERROR(format, mem_error);

    /* Initialize its index. */
    lxw_format_get_xf_index(format);

    /* Add the default hyperlink format. */
    format = workbook_add_format(workbook);
    GOTO_LABEL_ON_MEM_ERROR(format, mem_error);
    format_set_hyperlink(format);
    workbook->default_url_format = format;

    if (options) {
        workbook->options.constant_memory = options->constant_memory;
        workbook->options.tmpdir = lxw_strdup(options->tmpdir);
        workbook->options.use_zip64 = options->use_zip64;
        workbook->options.output_buffer = options->output_buffer;
        workbook->options.output_buffer_size = options->output_buffer_size;
    }

    workbook->max_url_length = 2079;

    return workbook;

mem_error:
    lxw_workbook_free(workbook);
    workbook = NULL;
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0xc7f0
movq %rax, %rbx
testq %rax, %rax
je 0x2b2f2
movq %r15, %rdi
callq 0xcce0
movq %rax, 0x80(%rbx)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x2b2fc
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x2b303
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x2b30a
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x2b311
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x2b318
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x2b31f
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x2b326
movl $0x1, %edi
movl $0x8, %esi
callq 0xc7f0
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x2b32d
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x2b334
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x2b33b
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x58(%rbx)
testq %rax, %rax
je 0x2b342
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x2b349
movq %rax, 0x8(%rax)
callq 0xc300
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x2b350
movl $0x1, %edi
movl $0x58, %esi
callq 0xc7f0
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x2b357
movl $0x80, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0xc4a0
movq %rax, 0xd8(%rbx)
testq %rax, %rax
je 0x2b35e
movl $0x80, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0xc4a0
movq %rax, 0xe0(%rbx)
testq %rax, %rax
je 0x2b365
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x2b36c
movq %rax, 0x8(%rax)
movq %rbx, %rdi
callq 0xcfc0
testq %rax, %rax
je 0x2b373
movq %rax, %rdi
callq 0xc9c0
movq %rbx, %rdi
callq 0xcfc0
testq %rax, %rax
je 0x2b37a
movq %rax, %r15
movq %rax, %rdi
callq 0xc1b0
movq %r15, 0x100(%rbx)
testq %r14, %r14
je 0x2b2e4
movb (%r14), %al
movb %al, 0x88(%rbx)
movq 0x8(%r14), %rdi
callq 0xcce0
movq %rax, 0x90(%rbx)
movb 0x10(%r14), %al
movb %al, 0x98(%rbx)
movups 0x18(%r14), %xmm0
movups %xmm0, 0xa0(%rbx)
movw $0x81f, 0xcc(%rbx)      # imm = 0x81F
jmp 0x2b389
movl $0x6f5, %edi            # imm = 0x6F5
jmp 0x2b37f
movl $0x6fa, %edi            # imm = 0x6FA
jmp 0x2b37f
movl $0x6ff, %edi            # imm = 0x6FF
jmp 0x2b37f
movl $0x704, %edi            # imm = 0x704
jmp 0x2b37f
movl $0x709, %edi            # imm = 0x709
jmp 0x2b37f
movl $0x70f, %edi            # imm = 0x70F
jmp 0x2b37f
movl $0x714, %edi            # imm = 0x714
jmp 0x2b37f
movl $0x719, %edi            # imm = 0x719
jmp 0x2b37f
movl $0x71e, %edi            # imm = 0x71E
jmp 0x2b37f
movl $0x723, %edi            # imm = 0x723
jmp 0x2b37f
movl $0x728, %edi            # imm = 0x728
jmp 0x2b37f
movl $0x72d, %edi            # imm = 0x72D
jmp 0x2b37f
movl $0x732, %edi            # imm = 0x732
jmp 0x2b37f
movl $0x737, %edi            # imm = 0x737
jmp 0x2b37f
movl $0x73b, %edi            # imm = 0x73B
jmp 0x2b37f
movl $0x73f, %edi            # imm = 0x73F
jmp 0x2b37f
movl $0x743, %edi            # imm = 0x743
jmp 0x2b37f
movl $0x748, %edi            # imm = 0x748
jmp 0x2b37f
movl $0x74d, %edi            # imm = 0x74D
jmp 0x2b37f
movl $0x754, %edi            # imm = 0x754
movq %rbx, %rsi
callq 0xdf36
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq