// File: /workspace/github_c_makefile_star2_O1/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 0x455f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x8e7a
testq %rbx, %rbx
je 0x8e8b
cmpq $0x0, 0x57517(%rip)     # 0x60298
jne 0x8d92
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x57506(%rip)     # 0x60298
cmpq $0x0, 0x57506(%rip)     # 0x602a0
jne 0x8dab
movq %rbx, %rdi
callq 0x6a90
movq %rax, 0x574f5(%rip)     # 0x602a0
movq %rbx, %rdi
movl $0x18, %esi
callq 0x64bc
movq %rax, %r15
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x8e96
testq %r15, %r15
je 0x8e8b
movw $0x64, 0x4(%r15)
movl $0x0, (%r15)
movabsq $0xc8ffff00000000, %rax # imm = 0xC8FFFF00000000
movq %rax, 0x6(%r15)
andb $-0x2, 0xe(%r15)
leaq 0x571f4(%rip), %rax     # 0x5fff0
movq %rax, 0x10(%r15)
leaq 0x112(%rip), %rsi       # 0x8f19
movq %rbx, %rdi
callq 0x645c
leaq 0x170(%rip), %rsi       # 0x8f86
movq %rbx, %rdi
callq 0x648c
testq %r14, %r14
je 0x8ea7
movq %r14, %rdi
callq 0x6ad8
movzwl 0x2(%rax), %ecx
movw %cx, 0x2(%r15)
movzwl 0x4(%rax), %ecx
movw %cx, 0x4(%r15)
movzwl (%rax), %ecx
movw %cx, (%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 0x5e38
movswl (%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x928d
jmp 0x8e8d
leaq 0x361bf(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x8e89
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x361a3(%rip), %rdi     # 0x3f040
movq %r15, %rsi
callq 0x829e
jmp 0x8ea5
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5fd8
movq %rbx, %rdi
movl $0xc8, %esi
movl $0x21, %edx
callq 0x553f
movswl (%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x928d
callq 0x2e244
testq %rax, %rax
je 0x8f05
movq %rax, %r14
movq 0xa8(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9377
movq 0xb0(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9377
jmp 0x8e8d
leaq 0x5709c(%rip), %rsi     # 0x5ffa8
movq %rbx, %rdi
callq 0x5d83
jmp 0x8e8d