// File: /workspace/github_c_makefile_star2_O1/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 0x143d1
movl $0x1, %edi
movl $0x10, %esi
callq 0xc7f0
movq %rax, 0x128(%rbx)
testq %rax, %rax
je 0x143d8
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0xc7f0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x143df
movq %rax, %r15
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0xc7f0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x143e6
movq %rax, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x143ed
movq %rax, %r12
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0x143f4
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x143fb
movq %r12, %rdi
callq 0x146bf
testl %eax, %eax
jne 0x14405
movq 0x20(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x146bf
testl %eax, %eax
jne 0x14405
movq 0x28(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x146bf
testl %eax, %eax
jne 0x14405
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 0x2c1e3(%rip), %r14     # 0x404ec
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 0x1469f
leaq 0x2bf25(%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 0x143ba
movq %rbx, %rdi
callq 0x1ae0b
leaq 0x6d1e(%rip), %rax      # 0x1b0df
movq %rax, 0x10(%rbx)
leaq 0x6f45(%rip), %rax      # 0x1b311
jmp 0x14696
movl $0x105, %edi            # imm = 0x105
jmp 0x14400
movl $0x108, %edi            # imm = 0x108
jmp 0x14400
movl $0x10c, %edi            # imm = 0x10C
jmp 0x14400
movl $0x10f, %edi            # imm = 0x10F
jmp 0x14400
movl $0x112, %edi            # imm = 0x112
jmp 0x14400
movl $0x115, %edi            # imm = 0x115
jmp 0x14400
movl $0x118, %edi            # imm = 0x118
callq 0xd23a
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 0x1ae0b
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 0x14545
cmpl $0xc, %r14d
jne 0x14569
movb $0x3, 0xa8(%rbx)
jmp 0x14565
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 0x14588
cmpl $0x8, %r14d
jne 0x145b5
movb $0x3, 0xa8(%rbx)
jmp 0x145a8
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 0x145c1
cmpl $0x2, %r14d
jne 0x145e5
movb $0x3, 0xa8(%rbx)
jmp 0x145e1
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 0x145f1
cmpl $0x5, %r14d
jne 0x14620
movb $0x3, 0xa8(%rbx)
jmp 0x14613
movb $0x2, 0xa8(%rbx)
movq 0x58(%r15), %rdi
callq 0xc0c0
leaq 0x2ef2b(%rip), %rdi     # 0x43487
callq 0xcce0
movq %rax, 0x58(%r15)
movb $0x1, 0x9(%rbx)
leaq 0x68e8(%rip), %rax      # 0x1ae58
jmp 0x1468b
movb $0xa, 0x95(%rbx)
leaq 0x663c(%rip), %rax      # 0x1abbf
jmp 0x14637
movb $0x2, 0xa8(%rbx)
movq 0x58(%r15), %rdi
callq 0xc0c0
leaq 0x2eee8(%rip), %rdi     # 0x43487
callq 0xcce0
movq %rax, 0x58(%r15)
movw $0x6401, 0xa1(%rbx)     # imm = 0x6401
movb $0x1, 0x9(%rbx)
leaq 0x656e(%rip), %rax      # 0x1ab2a
jmp 0x1468b
movb $0x2, 0xa8(%rbx)
movq 0x58(%r15), %rdi
callq 0xc0c0
leaq 0x2eeaf(%rip), %rdi     # 0x43487
callq 0xcce0
movq %rax, 0x58(%r15)
movb $0x1, 0x9(%rbx)
leaq 0x249c(%rip), %rax      # 0x16a88
jmp 0x1468b
movb $0x2, 0xa8(%rbx)
movq 0x58(%r12), %rdi
callq 0xc0c0
leaq 0x2ee7e(%rip), %rdi     # 0x43487
callq 0xcce0
movq %rax, 0x58(%r12)
movw $0x6401, 0xa1(%rbx)     # imm = 0x6401
movb $0x1, 0x9(%rbx)
leaq 0x62cc(%rip), %rax      # 0x1a8f3
jmp 0x1468b
movb $0xe, 0x95(%rbx)
leaq 0x6a4a(%rip), %rax      # 0x1b081
movq %rax, 0x10(%rbx)
leaq 0x6656(%rip), %rax      # 0x1ac98
movq %rax, 0x18(%rbx)
movb $0x9, 0x168(%rbx)
jmp 0x1440f
movq %rbx, %rdi
callq 0x1ae0b
movb $0x14, 0x95(%rbx)
movq 0x20(%rbx), %rax
movb $0x1, %cl
movb %cl, 0x68(%rax)
movb %cl, 0xa8(%rax)
movq 0x28(%rbx), %rax
movb %cl, 0xaa(%rax)
movb $0x4, 0x61(%rax)
movb %cl, 0x168(%rbx)
leaq 0x6ec2(%rip), %rax      # 0x1b54d
movq %rax, 0x10(%rbx)
leaq 0x245f(%rip), %rax      # 0x16af5
movq %rax, 0x18(%rbx)
jmp 0x1440f
movq 0x41952(%rip), %rax     # 0x55ff8
movq (%rax), %rdi
leaq 0x2c9d0(%rip), %rsi     # 0x41080
movl %r14d, %edx
xorl %eax, %eax
callq 0xc870
jmp 0x1440f