// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl $0x180, %esi            # imm = 0x180
callq 0xc850
movq %rax, %rbx
testq %rax, %rax
je 0x113e4
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x128(%rbx)
testq %rax, %rax
je 0x113eb
movq %rax, 0x8(%rax)
pushq $0x1
popq %rdi
movl $0x108, %esi            # imm = 0x108
callq 0xc850
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x113f2
movq %rax, %r15
pushq $0x1
popq %rdi
movl $0x108, %esi            # imm = 0x108
callq 0xc850
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x113f9
movq %rax, %r14
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0xc850
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x11400
movq %rax, %r12
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0xc850
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0x11407
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0xc850
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x1140e
movq %r12, %rdi
callq 0x116ad
testl %eax, %eax
jne 0x11432
movq 0x20(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x116ad
testl %eax, %eax
jne 0x11432
movq 0x28(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x116ad
testl %eax, %eax
jne 0x11432
movb %bpl, 0x8(%rbx)
movb $0x2, 0x9a(%rbx)
movw $0x32, 0x9e(%rbx)
movq 0x20(%rbx), %rdi
movb $0x3, 0xab(%rdi)
movq 0x28(%rbx), %rax
movb $0x1, %bpl
movb %bpl, 0xab(%rax)
leaq 0x2c1b2(%rip), %r14     # 0x3d4e4
movq %r14, %rsi
callq 0x116f6
movq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x116f6
movq 0x20(%rbx), %rax
movb $0x0, 0x68(%rax)
movq 0x28(%rbx), %rdi
movb %bpl, 0x68(%rdi)
movw $0x100, 0x98(%rbx)      # imm = 0x100
movb %bpl, 0xb8(%rbx)
movl $0x1f501f5, 0xa4(%rbx)  # imm = 0x1F501F5
movzbl 0x8(%rbx), %r14d
leal -0x1(%r14), %ecx
cmpl $0x15, %ecx
ja 0x1168d
leaq 0x2bf0f(%rip), %rdx     # 0x3d298
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movb $0xf, 0x95(%rbx)
movb $0x0, 0x99(%rbx)
movb $0x1, %cl
movb %cl, 0xa9(%rbx)
movb %cl, 0xaa(%rax)
movb %cl, 0xaa(%rdi)
movb $0x2, 0x168(%rbx)
orl $0x2, %r14d
cmpl $0x12, %r14d
jne 0x113cd
movq %rbx, %rdi
callq 0x18078
leaq 0x6f78(%rip), %rax      # 0x1834c
movq %rax, 0x10(%rbx)
leaq 0x7184(%rip), %rax      # 0x18563
jmp 0x11684
movl $0x105, %ecx            # imm = 0x105
jmp 0x11413
movl $0x108, %ecx            # imm = 0x108
jmp 0x11413
movl $0x10c, %ecx            # imm = 0x10C
jmp 0x11413
movl $0x10f, %ecx            # imm = 0x10F
jmp 0x11413
movl $0x112, %ecx            # imm = 0x112
jmp 0x11413
movl $0x115, %ecx            # imm = 0x115
jmp 0x11413
movl $0x118, %ecx            # imm = 0x118
movq 0x41bde(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x2bcbc(%rip), %rsi     # 0x3d0e0
leaq 0x2c0b1(%rip), %rdx     # 0x3d4dc
xorl %eax, %eax
callq 0xc8d0
movq %rbx, %rdi
callq 0xc740
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 0x18078
movb $0x1, %al
movb %al, 0xa8(%rbx)
movq 0x20(%rbx), %rcx
movb %al, 0xa8(%rcx)
movq 0x28(%rbx), %rdi
movb %al, 0xaa(%rdi)
movb $0x2, 0x168(%rbx)
cmpl $0xd, %r14d
je 0x11566
cmpl $0xc, %r14d
jne 0x1157d
movb $0x3, 0xa8(%rbx)
jmp 0x11579
movb $0x7, 0x95(%rbx)
movb $0x0, 0x99(%rbx)
movb $0x1, %cl
movb %cl, 0xa8(%rax)
movb %cl, 0xaa(%rdi)
movb $0x8, 0x168(%rbx)
cmpl $0x9, %r14d
je 0x1159c
cmpl $0x8, %r14d
jne 0x115bc
movb $0x3, 0xa8(%rbx)
jmp 0x115af
movb $0x1, %cl
movb %cl, 0x95(%rbx)
movw $0x101, 0xa8(%rbx)      # imm = 0x101
movb %cl, 0xa8(%rax)
movb %cl, 0x168(%rbx)
cmpl $0x3, %r14d
je 0x115c8
cmpl $0x2, %r14d
jne 0x115df
movb $0x3, 0xa8(%rbx)
jmp 0x115db
movb $0x4, 0x95(%rbx)
movb $0x1, %cl
movb %cl, 0x68(%rax)
movb $0x0, 0x68(%rdi)
movb %cl, 0xa8(%rdi)
movb %cl, 0xaa(%rax)
movw $0x1, 0x98(%rbx)
movb $0x8, 0x168(%rbx)
cmpl $0x6, %r14d
je 0x115eb
cmpl $0x5, %r14d
jne 0x1160e
movb $0x3, 0xa8(%rbx)
jmp 0x11601
movb $0x2, 0xa8(%rbx)
leaq 0x2ef23(%rip), %rsi     # 0x40497
callq 0x116f6
movb $0x1, 0x9(%rbx)
leaq 0x6b45(%rip), %rax      # 0x180c9
jmp 0x11679
movb $0xa, 0x95(%rbx)
leaq 0x68aa(%rip), %rax      # 0x17e41
jmp 0x11625
movb $0x2, 0xa8(%rbx)
leaq 0x2eeed(%rip), %rsi     # 0x40497
callq 0x116f6
movw $0x6401, 0xa1(%rbx)     # imm = 0x6401
movb $0x1, 0x9(%rbx)
leaq 0x67e9(%rip), %rax      # 0x17dac
jmp 0x11679
movb $0x2, 0xa8(%rbx)
leaq 0x2eec1(%rip), %rsi     # 0x40497
callq 0x116f6
movb $0x1, 0x9(%rbx)
leaq 0x2845(%rip), %rax      # 0x13e2b
jmp 0x11679
movb $0x2, 0xa8(%rbx)
leaq 0x2ee9e(%rip), %rsi     # 0x40497
movq %rax, %rdi
callq 0x116f6
movw $0x6401, 0xa1(%rbx)     # imm = 0x6401
movb $0x1, 0x9(%rbx)
leaq 0x656c(%rip), %rax      # 0x17b81
jmp 0x11679
movb $0xe, 0x95(%rbx)
leaq 0x6cc9(%rip), %rax      # 0x182ee
movq %rax, 0x10(%rbx)
leaq 0x68e6(%rip), %rax      # 0x17f16
movq %rax, 0x18(%rbx)
movb $0x9, 0x168(%rbx)
jmp 0x1143c
movq %rbx, %rdi
callq 0x18078
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rdi
movb $0x14, 0x95(%rbx)
movb $0x1, %cl
movb %cl, 0x68(%rax)
movb %cl, 0xa8(%rax)
movb %cl, 0xaa(%rdi)
movb $0x4, 0x61(%rdi)
movb %cl, 0x168(%rbx)
leaq 0x70f9(%rip), %rax      # 0x18772
movq %rax, 0x10(%rbx)
leaq 0x2814(%rip), %rax      # 0x13e98
movq %rax, 0x18(%rbx)
jmp 0x1143c
movq 0x41964(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x2c9da(%rip), %rsi     # 0x3e078
movl %r14d, %edx
xorl %eax, %eax
callq 0xc8d0
jmp 0x1143c