// File: /workspace/github_c_makefile_star2_O2/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 0x42c9
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x860d
testq %rbx, %rbx
je 0x861e
cmpq $0x0, 0x55d73(%rip)     # 0x5e298
jne 0x8536
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x55d62(%rip)     # 0x5e298
cmpq $0x0, 0x55d62(%rip)     # 0x5e2a0
jne 0x854f
movq %rbx, %rdi
callq 0x66ff
movq %rax, 0x55d51(%rip)     # 0x5e2a0
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r15
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x8629
testq %r15, %r15
je 0x861e
movw $0xc8, 0xc(%r15)
movabsq $0x6400000000, %rax     # imm = 0x6400000000
movq %rax, (%r15)
movl $0xffff0000, 0x8(%r15)  # imm = 0xFFFF0000
andb $-0x2, 0xe(%r15)
leaq 0x55a52(%rip), %rax     # 0x5dff0
movq %rax, 0x10(%r15)
leaq 0xff(%rip), %rsi        # 0x86a8
movq %rbx, %rdi
callq 0x60e6
leaq 0x15d(%rip), %rsi       # 0x8715
movq %rbx, %rdi
callq 0x6116
testq %r14, %r14
je 0x863a
movq %r14, %rdi
callq 0x6747
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 0x5ae7
movswl (%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x8a31
jmp 0x8620
leaq 0x32a2c(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x861c
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x32a10(%rip), %rdi     # 0x3b040
movq %r15, %rsi
callq 0x7b01
jmp 0x8638
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5c6f
pushq $0x21
popq %rdx
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x520e
movswl (%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x8a31
callq 0x2be75
testq %rax, %rax
je 0x8694
movq %rax, %r14
movq 0xa8(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8b13
movq 0xb0(%r14), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x8b13
jmp 0x8620
leaq 0x5590d(%rip), %rsi     # 0x5dfa8
movq %rbx, %rdi
callq 0x5a3d
jmp 0x8620