// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movb %dil, %al
movb %al, -0x9(%rbp)
movl $0x1, %edi
movl $0x180, %esi            # imm = 0x180
callq 0xc870
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x14511
movq 0x68b09(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x51bd7(%rip), %rsi     # 0x660d0
leaq 0x51e2c(%rip), %rdx     # 0x6632c
movl $0x105, %ecx            # imm = 0x105
movb $0x0, %al
callq 0xc8f0
jmp 0x1485a
jmp 0x14513
movl $0x1, %edi
movl $0x10, %esi
callq 0xc870
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x128(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x128(%rax)
jne 0x14567
movq 0x68ab3(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x51b81(%rip), %rsi     # 0x660d0
leaq 0x51dd6(%rip), %rdx     # 0x6632c
movl $0x108, %ecx            # imm = 0x108
movb $0x0, %al
callq 0xc8f0
jmp 0x1485a
jmp 0x14569
jmp 0x1456b
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq %rcx, 0x8(%rax)
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0xc870
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x145e5
movq 0x68a35(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x51b03(%rip), %rsi     # 0x660d0
leaq 0x51d58(%rip), %rdx     # 0x6632c
movl $0x10c, %ecx            # imm = 0x10C
movb $0x0, %al
callq 0xc8f0
jmp 0x1485a
jmp 0x145e7
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0xc870
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x14635
movq 0x689e5(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x51ab3(%rip), %rsi     # 0x660d0
leaq 0x51d08(%rip), %rdx     # 0x6632c
movl $0x10f, %ecx            # imm = 0x10F
movb $0x0, %al
callq 0xc8f0
jmp 0x1485a
jmp 0x14637
movl $0x1, %edi
movl $0x28, %esi
callq 0xc870
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x14685
movq 0x68995(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x51a63(%rip), %rsi     # 0x660d0
leaq 0x51cb8(%rip), %rdx     # 0x6632c
movl $0x112, %ecx            # imm = 0x112
movb $0x0, %al
callq 0xc8f0
jmp 0x1485a
jmp 0x14687
movl $0x1, %edi
movl $0x28, %esi
callq 0xc870
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x146dd
movq 0x6893d(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x51a0b(%rip), %rsi     # 0x660d0
leaq 0x51c60(%rip), %rdx     # 0x6632c
movl $0x115, %ecx            # imm = 0x115
movb $0x0, %al
callq 0xc8f0
jmp 0x1485a
jmp 0x146df
movl $0x1, %edi
movl $0x28, %esi
callq 0xc870
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x14735
movq 0x688e5(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x519b3(%rip), %rsi     # 0x660d0
leaq 0x51c08(%rip), %rdx     # 0x6632c
movl $0x118, %ecx            # imm = 0x118
movb $0x0, %al
callq 0xc8f0
jmp 0x1485a
jmp 0x14737
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x14880
cmpl $0x0, %eax
je 0x1474e
jmp 0x1485a
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rdi
callq 0x14880
cmpl $0x0, %eax
je 0x14769
jmp 0x1485a
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rdi
callq 0x14880
cmpl $0x0, %eax
je 0x14784
jmp 0x1485a
movb -0x9(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x18(%rbp), %rax
movb $0x2, 0x9a(%rax)
movq -0x18(%rbp), %rax
movw $0x32, 0x9e(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x3, 0xab(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movb $0x1, 0xab(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x51b61(%rip), %rsi     # 0x66334
callq 0x14920
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
leaq 0x51b4d(%rip), %rsi     # 0x66334
callq 0x14920
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x0, 0x68(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movb $0x1, 0x68(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x98(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x99(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0xb8(%rax)
movq -0x18(%rbp), %rax
movw $0x1f5, 0xa4(%rax)      # imm = 0x1F5
movq -0x18(%rbp), %rax
movw $0x1f5, 0xa6(%rax)      # imm = 0x1F5
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %esi
callq 0x14960
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1486b
movq -0x18(%rbp), %rdi
callq 0xc760
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)