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

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

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

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

    ext->min_value = 0;
    ext->max_value = 100;
    ext->cur_value = 0;
#if LV_USE_ANIMATION
    ext->anim_time  = 200;
    ext->anim_start = 0;
    ext->anim_end   = 0;
    ext->anim_state = LV_BAR_ANIM_STATE_INV;
#endif
    ext->sym         = 0;
    ext->style_indic = &lv_style_pretty_color;

    lv_obj_set_signal_cb(new_bar, lv_bar_signal);
    lv_obj_set_design_cb(new_bar, lv_bar_design);

    /*Init the new  bar object*/
    if(copy == NULL) {
        lv_obj_set_click(new_bar, false);
        lv_obj_set_size(new_bar, LV_DPI * 2, LV_DPI / 3);
        lv_bar_set_value(new_bar, ext->cur_value, false);

        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_bar_set_style(new_bar, LV_BAR_STYLE_BG, th->style.bar.bg);
            lv_bar_set_style(new_bar, LV_BAR_STYLE_INDIC, th->style.bar.indic);
        } else {
            lv_obj_set_style(new_bar, &lv_style_pretty);
        }
    } else {
        lv_bar_ext_t * ext_copy = lv_obj_get_ext_attr(copy);
        ext->min_value          = ext_copy->min_value;
        ext->max_value          = ext_copy->max_value;
        ext->cur_value          = ext_copy->cur_value;
        ext->style_indic        = ext_copy->style_indic;
        ext->sym                = ext_copy->sym;
        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_bar);

        lv_bar_set_value(new_bar, ext->cur_value, false);
    }

    LV_LOG_INFO("bar created");

    return new_bar;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x454f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x8dd7
testq %rbx, %rbx
je 0x8de8
cmpq $0x0, 0x575ab(%rip)     # 0x60298
jne 0x8cfe
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x5759a(%rip)     # 0x60298
cmpq $0x0, 0x5759a(%rip)     # 0x602a0
jne 0x8d17
movq %rbx, %rdi
callq 0x6aaf
movq %rax, 0x57589(%rip)     # 0x602a0
movq %rbx, %rdi
movl $0x18, %esi
callq 0x64db
movq %rax, %r15
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x8df3
testq %r15, %r15
je 0x8de8
movw $0xc8, 0xc(%r15)
movabsq $0x6400000000, %rax     # imm = 0x6400000000
movq %rax, (%r15)
movl $0xffff0000, 0x8(%r15)  # imm = 0xFFFF0000
andb $-0x2, 0xe(%r15)
leaq 0x57288(%rip), %rax     # 0x5fff0
movq %rax, 0x10(%r15)
leaq 0x103(%rip), %rsi       # 0x8e76
movq %rbx, %rdi
callq 0x647b
leaq 0x163(%rip), %rsi       # 0x8ee5
movq %rbx, %rdi
callq 0x64ab
testq %r14, %r14
je 0x8e04
movq %r14, %rdi
callq 0x6af7
movzwl 0x4(%rax), %ecx
movw %cx, 0x4(%r15)
movl (%rax), %ecx
movl %ecx, (%r15)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%r15)
movb 0xe(%rax), %al
andb $0x1, %al
movb 0xe(%r15), %cl
andb $-0x2, %cl
orb %al, %cl
movb %cl, 0xe(%r15)
movq %rbx, %rdi
callq 0x5e54
movswl (%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x920b
jmp 0x8dea
leaq 0x362f2(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x8de6
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x362d6(%rip), %rdi     # 0x3f0d0
movq %r15, %rsi
callq 0x8294
jmp 0x8e02
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5ff7
movq %rbx, %rdi
movl $0xc8, %esi
movl $0x21, %edx
callq 0x5557
movswl (%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x920b
callq 0x2e91c
testq %rax, %rax
je 0x8e62
movq %rax, %r14
movq 0xa8(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x92f5
movq 0xb0(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x92f5
jmp 0x8dea
leaq 0x5713f(%rip), %rsi     # 0x5ffa8
movq %rbx, %rdi
callq 0x5d9f
jmp 0x8dea