// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl $0x108, %esi            # imm = 0x108
callq 0xc850
movq %rax, %rbx
testq %rax, %rax
je 0x27c89
movq %r15, %rdi
callq 0xcd50
movq %rax, 0x80(%rbx)
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x27c93
andq $0x0, (%rax)
movq %rax, 0x8(%rax)
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x27c9a
andq $0x0, (%rax)
movq %rax, 0x8(%rax)
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x27ca1
andq $0x0, (%rax)
movq %rax, 0x8(%rax)
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0xc850
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x27ca8
andq $0x0, (%rax)
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0xc850
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x27caf
andq $0x0, (%rax)
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0xc850
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x27cb6
andq $0x0, (%rax)
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0xc850
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x27cbd
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0xc850
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x27cc4
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x27ccb
movq %rax, 0x8(%rax)
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x27cd2
movq %rax, 0x8(%rax)
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x58(%rbx)
testq %rax, %rax
je 0x27cd9
movq %rax, 0x8(%rax)
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x27ce0
movq %rax, 0x8(%rax)
callq 0xc320
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x27ce7
pushq $0x1
popq %rdi
pushq $0x58
popq %rsi
callq 0xc850
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x27cee
pushq $0x1
popq %rsi
movl $0x80, %edi
xorl %edx, %edx
callq 0xc4e0
movq %rax, 0xd8(%rbx)
testq %rax, %rax
je 0x27cf5
pushq $0x1
popq %rsi
movl $0x80, %edi
xorl %edx, %edx
callq 0xc4e0
movq %rax, 0xe0(%rbx)
testq %rax, %rax
je 0x27cfc
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x27d03
movq %rax, 0x8(%rax)
movq %rbx, %rdi
callq 0xd040
testq %rax, %rax
je 0x27d0a
movq %rax, %rdi
callq 0xca20
movq %rbx, %rdi
callq 0xd040
testq %rax, %rax
je 0x27d11
movq %rax, %r15
movq %rax, %rdi
callq 0xc1d0
movq %r15, 0x100(%rbx)
testq %r14, %r14
je 0x27c7b
movb (%r14), %al
movb %al, 0x88(%rbx)
movq 0x8(%r14), %rdi
callq 0xcd50
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 0x27d3f
movl $0x6f5, %ecx            # imm = 0x6F5
jmp 0x27d16
movl $0x6fa, %ecx            # imm = 0x6FA
jmp 0x27d16
movl $0x6ff, %ecx            # imm = 0x6FF
jmp 0x27d16
movl $0x704, %ecx            # imm = 0x704
jmp 0x27d16
movl $0x709, %ecx            # imm = 0x709
jmp 0x27d16
movl $0x70f, %ecx            # imm = 0x70F
jmp 0x27d16
movl $0x714, %ecx            # imm = 0x714
jmp 0x27d16
movl $0x719, %ecx            # imm = 0x719
jmp 0x27d16
movl $0x71e, %ecx            # imm = 0x71E
jmp 0x27d16
movl $0x723, %ecx            # imm = 0x723
jmp 0x27d16
movl $0x728, %ecx            # imm = 0x728
jmp 0x27d16
movl $0x72d, %ecx            # imm = 0x72D
jmp 0x27d16
movl $0x732, %ecx            # imm = 0x732
jmp 0x27d16
movl $0x737, %ecx            # imm = 0x737
jmp 0x27d16
movl $0x73b, %ecx            # imm = 0x73B
jmp 0x27d16
movl $0x73f, %ecx            # imm = 0x73F
jmp 0x27d16
movl $0x743, %ecx            # imm = 0x743
jmp 0x27d16
movl $0x748, %ecx            # imm = 0x748
jmp 0x27d16
movl $0x74d, %ecx            # imm = 0x74D
jmp 0x27d16
movl $0x754, %ecx            # imm = 0x754
movq 0x2b2db(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x153b9(%rip), %rsi     # 0x3d0e0
leaq 0x1ac23(%rip), %rdx     # 0x42951
xorl %eax, %eax
callq 0xc8d0
movq %rbx, %rdi
callq 0xcbc0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq