// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_chart.c
// Function: lv_chart_create
lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("chart create started");

    /*Create the ancestor basic object*/
    lv_obj_t * new_chart = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_chart);
    if(new_chart == NULL) return NULL;

    /*Allocate the object type specific extended data*/
    lv_chart_ext_t * ext = lv_obj_allocate_ext_attr(new_chart, sizeof(lv_chart_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    lv_ll_init(&ext->series_ll, sizeof(lv_chart_series_t));

    ext->series.num            = 0;
    ext->ymin                  = LV_CHART_YMIN_DEF;
    ext->ymax                  = LV_CHART_YMAX_DEF;
    ext->hdiv_cnt              = LV_CHART_HDIV_DEF;
    ext->vdiv_cnt              = LV_CHART_VDIV_DEF;
    ext->point_cnt             = LV_CHART_PNUM_DEF;
    ext->type                  = LV_CHART_TYPE_LINE;
    ext->update_mode           = LV_CHART_UPDATE_MODE_SHIFT;
    ext->series.opa            = LV_OPA_COVER;
    ext->series.dark           = LV_OPA_50;
    ext->series.width          = 2;
    ext->margin                = 0;
    memset(&ext->x_axis, 0, sizeof(ext->x_axis));
    memset(&ext->y_axis, 0, sizeof(ext->y_axis));
    memset(&ext->secondary_y_axis, 0, sizeof(ext->secondary_y_axis));
    ext->x_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO;
    ext->x_axis.minor_tick_len = LV_CHART_TICK_LENGTH_AUTO;
    ext->y_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO;
    ext->y_axis.minor_tick_len = LV_CHART_TICK_LENGTH_AUTO;
    ext->secondary_y_axis.major_tick_len = LV_CHART_TICK_LENGTH_AUTO;
    ext->secondary_y_axis.minor_tick_len = LV_CHART_TICK_LENGTH_AUTO;

    if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_cb(new_chart);
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_chart);

    lv_obj_set_signal_cb(new_chart, lv_chart_signal);
    lv_obj_set_design_cb(new_chart, lv_chart_design);

    /*Init the new chart background object*/
    if(copy == NULL) {
        lv_obj_set_size(new_chart, LV_DPI * 3, LV_DPI * 2);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_chart_set_style(new_chart, LV_CHART_STYLE_MAIN, th->style.chart);
        } else {
            lv_chart_set_style(new_chart, LV_CHART_STYLE_MAIN, &lv_style_pretty);
        }

    } else {
        lv_chart_ext_t * ext_copy = lv_obj_get_ext_attr(copy);

        ext->type       = ext_copy->type;
        ext->ymin       = ext_copy->ymin;
        ext->ymax       = ext_copy->ymax;
        ext->hdiv_cnt   = ext_copy->hdiv_cnt;
        ext->vdiv_cnt   = ext_copy->vdiv_cnt;
        ext->point_cnt  = ext_copy->point_cnt;
        ext->series.opa = ext_copy->series.opa;
        ext->margin     = ext_copy->margin;
        memcpy(&ext->x_axis, &ext_copy->x_axis, sizeof(lv_chart_axis_cfg_t));
        memcpy(&ext->y_axis, &ext_copy->y_axis, sizeof(lv_chart_axis_cfg_t));
        memcpy(&ext->secondary_y_axis, &ext_copy->secondary_y_axis, sizeof(lv_chart_axis_cfg_t));

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_chart);
    }

    LV_LOG_INFO("chart created");

    return new_chart;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
callq 0x455f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x15132
testq %rbx, %rbx
je 0x15143
movq %rbx, %rdi
movl $0x68, %esi
callq 0x64bc
movq %rax, %r15
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x15157
testq %r15, %r15
je 0x15143
movq %r15, %rdi
movl $0x10, %esi
callq 0x29bf8
movabsq $0xa050300640000, %rax  # imm = 0xA050300640000
movq %rax, 0x18(%r15)
movb $0x1, 0x20(%r15)
andb $-0x2, 0x5a(%r15)
movb $0x7f, 0x60(%r15)
movl $0xff000002, 0x5c(%r15) # imm = 0xFF000002
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r15)
movups %xmm0, 0x28(%r15)
movups %xmm0, 0x48(%r15)
movw $0x0, 0x58(%r15)
movw $0xffff, %ax            # imm = 0xFFFF
movw %ax, 0x42(%r15)
movw %ax, 0x32(%r15)
movw %ax, 0x52(%r15)
cmpq $0x0, 0x4b31a(%rip)     # 0x60380
jne 0x15077
movq %rbx, %rdi
callq 0x6a90
movq %rax, 0x4b309(%rip)     # 0x60380
cmpq $0x0, 0x4b309(%rip)     # 0x60388
jne 0x15090
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x4b2f8(%rip)     # 0x60388
leaq 0x107(%rip), %rsi       # 0x1519e
movq %rbx, %rdi
callq 0x645c
leaq 0x197(%rip), %rsi       # 0x1523d
movq %rbx, %rdi
callq 0x648c
testq %r14, %r14
je 0x15168
leaq 0x38(%r15), %r12
leaq 0x28(%r15), %r13
movq %r15, %rbp
addq $0x48, %rbp
movq %r14, %rdi
callq 0x6ad8
movb 0x20(%rax), %cl
movb %cl, 0x20(%r15)
movzwl 0x18(%rax), %ecx
movw %cx, 0x18(%r15)
movzwl 0x1a(%rax), %ecx
movw %cx, 0x1a(%r15)
movb 0x1c(%rax), %cl
movb %cl, 0x1c(%r15)
movb 0x1d(%rax), %cl
movb %cl, 0x1d(%r15)
movzwl 0x1e(%rax), %ecx
movw %cx, 0x1e(%r15)
movb 0x5f(%rax), %cl
movb %cl, 0x5f(%r15)
movzwl 0x58(%rax), %ecx
movw %cx, 0x58(%r15)
movups 0x38(%rax), %xmm0
movups %xmm0, (%r12)
movups 0x28(%rax), %xmm0
movups %xmm0, (%r13)
movups 0x48(%rax), %xmm0
movups %xmm0, (%rbp)
movq %rbx, %rdi
callq 0x5e38
jmp 0x15145
leaq 0x29f07(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x15141
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29ee2(%rip), %rdi     # 0x3f040
movq %r15, %rsi
callq 0x829e
jmp 0x15166
movq %rbx, %rdi
movl $0x12c, %esi            # imm = 0x12C
movl $0xc8, %edx
callq 0x553f
callq 0x2e244
testq %rax, %rax
je 0x1518d
movq 0x110(%rax), %rsi
jmp 0x15194
leaq 0x4ae14(%rip), %rsi     # 0x5ffa8
movq %rbx, %rdi
callq 0x5d83
jmp 0x15145