// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x66b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x23000
movq -0x20(%rbp), %rsi
leaq 0x4504b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x22ffe
cmpq $0x0, -0x20(%rbp)
jne 0x23014
movq $0x0, -0x8(%rbp)
jmp 0x232d0
movq -0x20(%rbp), %rdi
movl $0x68, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x23045
movq -0x28(%rbp), %rsi
leaq 0x45006(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x23043
cmpq $0x0, -0x28(%rbp)
jne 0x23059
movq $0x0, -0x8(%rbp)
jmp 0x232d0
movq -0x28(%rbp), %rdi
movl $0x10, %esi
callq 0x453a0
movq -0x28(%rbp), %rax
movb $0x0, 0x5e(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
movw $0x64, 0x1a(%rax)
movq -0x28(%rbp), %rax
movb $0x3, 0x1c(%rax)
movq -0x28(%rbp), %rax
movb $0x5, 0x1d(%rax)
movq -0x28(%rbp), %rax
movw $0xa, 0x1e(%rax)
movq -0x28(%rbp), %rax
movb $0x1, 0x20(%rax)
movq -0x28(%rbp), %rax
movb 0x5a(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x5a(%rax)
movq -0x28(%rbp), %rax
movb $-0x1, 0x5f(%rax)
movq -0x28(%rbp), %rax
movb $0x7f, 0x60(%rax)
movq -0x28(%rbp), %rax
movw $0x2, 0x5c(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x58(%rax)
movq -0x28(%rbp), %rdi
addq $0x38, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2090
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2090
movq -0x28(%rbp), %rdi
addq $0x48, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2090
movq -0x28(%rbp), %rax
movb $-0x1, 0x42(%rax)
movq -0x28(%rbp), %rax
movb $-0x1, 0x43(%rax)
movq -0x28(%rbp), %rax
movb $-0x1, 0x32(%rax)
movq -0x28(%rbp), %rax
movb $-0x1, 0x33(%rax)
movq -0x28(%rbp), %rax
movb $-0x1, 0x52(%rax)
movq -0x28(%rbp), %rax
movb $-0x1, 0x53(%rax)
cmpq $0x0, 0x66303(%rip)     # 0x89450
jne 0x2315f
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x662f1(%rip)     # 0x89450
cmpq $0x0, 0x662f1(%rip)     # 0x89458
jne 0x23179
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x662df(%rip)     # 0x89458
movq -0x20(%rbp), %rdi
leaq 0x15c(%rip), %rsi       # 0x232e0
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x22c(%rip), %rsi       # 0x233c0
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x231f2
movq -0x20(%rbp), %rdi
movl $0x12c, %esi            # imm = 0x12C
movl $0xc8, %edx
callq 0x8180
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x231db
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x110(%rax), %rdx
xorl %esi, %esi
callq 0x23540
jmp 0x231ed
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x65e90(%rip), %rdx     # 0x89078
callq 0x23540
jmp 0x232c8
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb 0x20(%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, 0x20(%rax)
movq -0x38(%rbp), %rax
movw 0x18(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x18(%rax)
movq -0x38(%rbp), %rax
movw 0x1a(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x1a(%rax)
movq -0x38(%rbp), %rax
movb 0x1c(%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, 0x1c(%rax)
movq -0x38(%rbp), %rax
movb 0x1d(%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, 0x1d(%rax)
movq -0x38(%rbp), %rax
movw 0x1e(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x1e(%rax)
movq -0x38(%rbp), %rax
movb 0x5f(%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, 0x5f(%rax)
movq -0x38(%rbp), %rax
movw 0x58(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x58(%rax)
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x38(%rcx), %rdx
movq %rdx, 0x38(%rax)
movq 0x40(%rcx), %rcx
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x28(%rcx), %rdx
movq %rdx, 0x28(%rax)
movq 0x30(%rcx), %rcx
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x48(%rcx), %rdx
movq %rdx, 0x48(%rax)
movq 0x50(%rcx), %rcx
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)