// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_line.c
// Function: lv_line_create
lv_obj_t * lv_line_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("line create started");

    /*Create a basic object*/
    lv_obj_t * new_line = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_line);
    if(new_line == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_line);

    /*Extend the basic object to line object*/
    lv_line_ext_t * ext = lv_obj_allocate_ext_attr(new_line, sizeof(lv_line_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->point_num   = 0;
    ext->point_array = NULL;
    ext->auto_size   = 1;
    ext->y_inv       = 0;

    lv_obj_set_design_cb(new_line, lv_line_design);
    lv_obj_set_signal_cb(new_line, lv_line_signal);

    /*Init the new line*/
    if(copy == NULL) {
        lv_obj_set_size(new_line, LV_DPI,
                        LV_DPI);          /*Auto size is enables, but set default size until no points are added*/
        lv_obj_set_style(new_line, NULL); /*Inherit parent's style*/
        lv_obj_set_click(new_line, false);
    }
    /*Copy an existing object*/
    else {
        lv_line_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        lv_line_set_auto_size(new_line, lv_line_get_auto_size(copy));
        lv_line_set_y_invert(new_line, lv_line_get_y_invert(copy));
        lv_line_set_auto_size(new_line, lv_line_get_auto_size(copy));
        lv_line_set_points(new_line, copy_ext->point_array, copy_ext->point_num);
        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_line);
    }

    LV_LOG_INFO("line created");

    return new_line;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x42c9
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0xc7d0
testq %rbx, %rbx
je 0xc7e1
cmpq $0x0, 0x51bf3(%rip)     # 0x5e2f0
jne 0xc70e
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x51be2(%rip)     # 0x5e2f0
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r15
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0xc7ec
testq %r15, %r15
je 0xc7e1
andw $0x0, 0x8(%r15)
andq $0x0, (%r15)
movb 0xa(%r15), %al
andb $-0x4, %al
incb %al
movb %al, 0xa(%r15)
leaq 0xce(%rip), %rsi        # 0xc820
movq %rbx, %rdi
callq 0x6116
leaq 0x2d4(%rip), %rsi       # 0xca35
movq %rbx, %rdi
callq 0x60e6
testq %r14, %r14
je 0xc7fd
movq %r14, %rdi
callq 0x6747
movq %rax, %r15
movq %r14, %rdi
callq 0xcb00
movzbl %al, %esi
movq %rbx, %rdi
callq 0xca9f
movq %r14, %rdi
callq 0xcb86
movzbl %al, %esi
movq %rbx, %rdi
callq 0xcb2d
movq %r14, %rdi
callq 0xcb00
movzbl %al, %esi
movq %rbx, %rdi
callq 0xca9f
movq (%r15), %rsi
movzwl 0x8(%r15), %edx
movq %rbx, %rdi
callq 0xcbb5
movq %rbx, %rdi
callq 0x5ae7
jmp 0xc7e3
leaq 0x2e869(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0xc7df
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2e84d(%rip), %rdi     # 0x3b040
movq %r15, %rsi
callq 0x7b01
jmp 0xc7fb
pushq $0x64
popq %rdx
movq %rbx, %rdi
movl %edx, %esi
callq 0x520e
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5a3d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5c6f
jmp 0xc7e3