// File: /workspace/github_c_makefile_star2_O3/Paxa[P]fast_excel/libxlsxwriter/src/chart.c
// Function: lxw_chart_new
lxw_chart *
lxw_chart_new(uint8_t type)
{
    lxw_chart *chart = calloc(1, sizeof(lxw_chart));
    GOTO_LABEL_ON_MEM_ERROR(chart, mem_error);

    chart->series_list = calloc(1, sizeof(struct lxw_chart_series_list));
    GOTO_LABEL_ON_MEM_ERROR(chart->series_list, mem_error);
    STAILQ_INIT(chart->series_list);

    chart->x_axis = calloc(1, sizeof(struct lxw_chart_axis));
    GOTO_LABEL_ON_MEM_ERROR(chart->x_axis, mem_error);

    chart->y_axis = calloc(1, sizeof(struct lxw_chart_axis));
    GOTO_LABEL_ON_MEM_ERROR(chart->y_axis, mem_error);

    chart->title.range = calloc(1, sizeof(lxw_series_range));
    GOTO_LABEL_ON_MEM_ERROR(chart->title.range, mem_error);

    chart->x_axis->title.range = calloc(1, sizeof(lxw_series_range));
    GOTO_LABEL_ON_MEM_ERROR(chart->x_axis->title.range, mem_error);

    chart->y_axis->title.range = calloc(1, sizeof(lxw_series_range));
    GOTO_LABEL_ON_MEM_ERROR(chart->y_axis->title.range, mem_error);

    /* Initialize the ranges in the chart titles. */
    if (_chart_init_data_cache(chart->title.range) != LXW_NO_ERROR)
        goto mem_error;

    if (_chart_init_data_cache(chart->x_axis->title.range) != LXW_NO_ERROR)
        goto mem_error;

    if (_chart_init_data_cache(chart->y_axis->title.range) != LXW_NO_ERROR)
        goto mem_error;

    chart->type = type;
    chart->style_id = 2;
    chart->hole_size = 50;

    /* Set the default axis positions. */
    chart->x_axis->axis_position = LXW_CHART_AXIS_BOTTOM;
    chart->y_axis->axis_position = LXW_CHART_AXIS_LEFT;

    /* Set the default axis number formats. */
    _chart_axis_set_default_num_format(chart->x_axis, "General");
    _chart_axis_set_default_num_format(chart->y_axis, "General");

    chart->x_axis->major_gridlines.visible = LXW_FALSE;
    chart->y_axis->major_gridlines.visible = LXW_TRUE;

    chart->has_horiz_cat_axis = LXW_FALSE;
    chart->has_horiz_val_axis = LXW_TRUE;

    chart->legend.position = LXW_CHART_LEGEND_RIGHT;

    chart->gap_y1 = LXW_CHART_DEFAULT_GAP;
    chart->gap_y2 = LXW_CHART_DEFAULT_GAP;

    /* Initialize the chart specific properties. */
    _chart_initialize(chart, chart->type);

    return chart;

mem_error:
    lxw_chart_free(chart);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebp
movl $0x1, %edi
movl $0x180, %esi            # imm = 0x180
callq 0xc7f0
movq %rax, %rbx
testq %rax, %rax
je 0x145c2
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x128(%rbx)
testq %rax, %rax
je 0x145c9
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0xc7f0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x145d0
movq %rax, %r15
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0xc7f0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x145d7
movq %rax, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x145de
movq %rax, %r12
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0x145e5
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x145ec
movq %r12, %rdi
callq 0x148b6
testl %eax, %eax
jne 0x145f6
movq 0x20(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x148b6
testl %eax, %eax
jne 0x145f6
movq 0x28(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x148b6
testl %eax, %eax
jne 0x145f6
movb %bpl, 0x8(%rbx)
movb $0x2, 0x9a(%rbx)
movw $0x32, 0x9e(%rbx)
movq 0x20(%rbx), %r15
movb $0x3, 0xab(%r15)
movq 0x28(%rbx), %rax
movb $0x1, %bpl
movb %bpl, 0xab(%rax)
movq 0x58(%r15), %rdi
callq 0xc0c0
leaq 0x2bfea(%rip), %r14     # 0x404e4
movq %r14, %rdi
callq 0xcce0
movq %rax, 0x58(%r15)
movq 0x28(%rbx), %r15
movq 0x58(%r15), %rdi
callq 0xc0c0
movq %r14, %rdi
callq 0xcce0
movq %rax, 0x58(%r15)
movq 0x20(%rbx), %r12
movb $0x0, 0x68(%r12)
movq 0x28(%rbx), %r15
movb %bpl, 0x68(%r15)
movw $0x100, 0x98(%rbx)      # imm = 0x100
movb %bpl, 0xb8(%rbx)
movl $0x1f501f5, 0xa4(%rbx)  # imm = 0x1F501F5
movzbl 0x8(%rbx), %r14d
leal -0x1(%r14), %eax
cmpl $0x15, %eax
ja 0x14896
leaq 0x2bd34(%rip), %rcx     # 0x40298
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0xf, 0x95(%rbx)
movb $0x0, 0x99(%rbx)
movb $0x1, %al
movb %al, 0xa9(%rbx)
movb %al, 0xaa(%r12)
movb %al, 0xaa(%r15)
movb $0x2, 0x168(%rbx)
orl $0x2, %r14d
cmpl $0x12, %r14d
jne 0x145ab
movq %rbx, %rdi
callq 0x1b0a9
leaq 0x6db5(%rip), %rax      # 0x1b367
movq %rax, 0x10(%rbx)
leaq 0x6fdc(%rip), %rax      # 0x1b599
jmp 0x1488d
movl $0x105, %edi            # imm = 0x105
jmp 0x145f1
movl $0x108, %edi            # imm = 0x108
jmp 0x145f1
movl $0x10c, %edi            # imm = 0x10C
jmp 0x145f1
movl $0x10f, %edi            # imm = 0x10F
jmp 0x145f1
movl $0x112, %edi            # imm = 0x112
jmp 0x145f1
movl $0x115, %edi            # imm = 0x115
jmp 0x145f1
movl $0x118, %edi            # imm = 0x118
callq 0xd209
movq %rbx, %rdi
callq 0xc6e0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0xb, 0x95(%rbx)
movq %rbx, %rdi
callq 0x1b0a9
movb $0x1, %al
movb %al, 0xa8(%rbx)
movq 0x20(%rbx), %rcx
movb %al, 0xa8(%rcx)
movq 0x28(%rbx), %r15
movb %al, 0xaa(%r15)
movb $0x2, 0x168(%rbx)
cmpl $0xd, %r14d
je 0x14736
cmpl $0xc, %r14d
jne 0x1475a
movb $0x3, 0xa8(%rbx)
jmp 0x14756
movb $0x7, 0x95(%rbx)
movb $0x0, 0x99(%rbx)
movb $0x1, %al
movb %al, 0xa8(%r12)
movb %al, 0xaa(%r15)
movb $0x8, 0x168(%rbx)
cmpl $0x9, %r14d
je 0x14779
cmpl $0x8, %r14d
jne 0x147a6
movb $0x3, 0xa8(%rbx)
jmp 0x14799
movb $0x1, %al
movb %al, 0x95(%rbx)
movw $0x101, 0xa8(%rbx)      # imm = 0x101
movb %al, 0xa8(%r12)
movb %al, 0x168(%rbx)
cmpl $0x3, %r14d
je 0x147b2
cmpl $0x2, %r14d
jne 0x147d6
movb $0x3, 0xa8(%rbx)
jmp 0x147d2
movb $0x4, 0x95(%rbx)
movb $0x1, %al
movb %al, 0x68(%r12)
movb $0x0, 0x68(%r15)
movb %al, 0xa8(%r15)
movb %al, 0xaa(%r12)
movw $0x1, 0x98(%rbx)
movb $0x8, 0x168(%rbx)
cmpl $0x6, %r14d
je 0x147e2
cmpl $0x5, %r14d
jne 0x14811
movb $0x3, 0xa8(%rbx)
jmp 0x14804
movb $0x2, 0xa8(%rbx)
movq 0x58(%r15), %rdi
callq 0xc0c0
leaq 0x2ed4a(%rip), %rdi     # 0x43497
callq 0xcce0
movq %rax, 0x58(%r15)
movb $0x1, 0x9(%rbx)
leaq 0x697f(%rip), %rax      # 0x1b0e0
jmp 0x14882
movb $0xa, 0x95(%rbx)
leaq 0x66e9(%rip), %rax      # 0x1ae5d
jmp 0x14828
movb $0x2, 0xa8(%rbx)
movq 0x58(%r15), %rdi
callq 0xc0c0
leaq 0x2ed07(%rip), %rdi     # 0x43497
callq 0xcce0
movq %rax, 0x58(%r15)
movw $0x6401, 0xa1(%rbx)     # imm = 0x6401
movb $0x1, 0x9(%rbx)
leaq 0x661b(%rip), %rax      # 0x1adc8
jmp 0x14882
movb $0x2, 0xa8(%rbx)
movq 0x58(%r15), %rdi
callq 0xc0c0
leaq 0x2ecce(%rip), %rdi     # 0x43497
callq 0xcce0
movq %rax, 0x58(%r15)
movb $0x1, 0x9(%rbx)
leaq 0x24bf(%rip), %rax      # 0x16c9c
jmp 0x14882
movb $0x2, 0xa8(%rbx)
movq 0x58(%r12), %rdi
callq 0xc0c0
leaq 0x2ec9d(%rip), %rdi     # 0x43497
callq 0xcce0
movq %rax, 0x58(%r12)
movw $0x6401, 0xa1(%rbx)     # imm = 0x6401
movb $0x1, 0x9(%rbx)
leaq 0x6379(%rip), %rax      # 0x1ab91
jmp 0x14882
movb $0xe, 0x95(%rbx)
leaq 0x6ae1(%rip), %rax      # 0x1b309
movq %rax, 0x10(%rbx)
leaq 0x6703(%rip), %rax      # 0x1af36
movq %rax, 0x18(%rbx)
movb $0x9, 0x168(%rbx)
jmp 0x14600
movq %rbx, %rdi
callq 0x1b0a9
movq 0x20(%rbx), %r12
movq 0x28(%rbx), %r15
movb $0x14, 0x95(%rbx)
movb $0x1, %al
movb %al, 0x68(%r12)
movb %al, 0xa8(%r12)
movb %al, 0xaa(%r15)
movb $0x4, 0x61(%r15)
movb %al, 0x168(%rbx)
leaq 0x6f66(%rip), %rax      # 0x1b7e8
movq %rax, 0x10(%rbx)
leaq 0x247c(%rip), %rax      # 0x16d09
movq %rax, 0x18(%rbx)
jmp 0x14600
movq 0x4275b(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x2c7d1(%rip), %rsi     # 0x41078
movl %r14d, %edx
xorl %eax, %eax
callq 0xc870
jmp 0x14600