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

    /*Create the ancestor of line meter*/
    lv_obj_t * new_lmeter = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_lmeter);
    if(new_lmeter == NULL) return NULL;

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

    /*Allocate the line meter type specific extended data*/
    lv_lmeter_ext_t * ext = lv_obj_allocate_ext_attr(new_lmeter, sizeof(lv_lmeter_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    /*Initialize the allocated 'ext' */
    ext->min_value   = 0;
    ext->max_value   = 100;
    ext->cur_value   = 0;
    ext->line_cnt    = 21;  /*Odd scale number looks better*/
    ext->scale_angle = 240; /*(scale_num - 1) * N looks better */
    ext->angle_ofs = 0;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_lmeter, lv_lmeter_signal);
    lv_obj_set_design_cb(new_lmeter, lv_lmeter_design);

    /*Init the new line meter line meter*/
    if(copy == NULL) {
        lv_obj_set_size(new_lmeter, LV_DPI, LV_DPI);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_lmeter_set_style(new_lmeter, LV_LMETER_STYLE_MAIN, th->style.lmeter);
        } else {
            lv_lmeter_set_style(new_lmeter, LV_LMETER_STYLE_MAIN, &lv_style_pretty_color);
        }
    }
    /*Copy an existing line meter*/
    else {
        lv_lmeter_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->scale_angle           = copy_ext->scale_angle;
        ext->line_cnt              = copy_ext->line_cnt;
        ext->min_value             = copy_ext->min_value;
        ext->max_value             = copy_ext->max_value;
        ext->cur_value             = copy_ext->cur_value;

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_lmeter);
    }

    LV_LOG_INFO("line meter created");

    return new_lmeter;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x454f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x24cd0
testq %rbx, %rbx
je 0x24ce1
cmpq $0x0, 0x3b81b(%rip)     # 0x60460
jne 0x24c56
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x3b80a(%rip)     # 0x60460
movq %rbx, %rdi
movl $0xc, %esi
callq 0x64db
movq %rax, %r15
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x24cec
testq %r15, %r15
je 0x24ce1
movl $0x640000, 0x8(%r15)    # imm = 0x640000
movabsq $0x15000000f0, %rax     # imm = 0x15000000F0
movq %rax, (%r15)
leaq 0xa0(%rip), %rsi        # 0x24d33
movq %rbx, %rdi
callq 0x647b
leaq 0x10d(%rip), %rsi       # 0x24daf
movq %rbx, %rdi
callq 0x64ab
testq %r14, %r14
je 0x24cfd
movq %r14, %rdi
callq 0x6af7
movzwl (%rax), %ecx
movw %cx, (%r15)
movq 0x4(%rax), %rax
movq %rax, 0x4(%r15)
movq %rbx, %rdi
callq 0x5e54
jmp 0x24ce3
leaq 0x1a3f9(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x24cdf
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1a3dd(%rip), %rdi     # 0x3f0d0
movq %r15, %rsi
callq 0x8294
jmp 0x24cfb
movq %rbx, %rdi
movl $0x64, %esi
movl $0x64, %edx
callq 0x5557
callq 0x2e91c
testq %rax, %rax
je 0x24d22
movq 0xd0(%rax), %rsi
jmp 0x24d29
leaq 0x3b2c7(%rip), %rsi     # 0x5fff0
movq %rbx, %rdi
callq 0x5d9f
jmp 0x24ce3