// File: /workspace/github_c_makefile_star2_O1/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 0x455f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x245d4
testq %rbx, %rbx
je 0x245e5
cmpq $0x0, 0x3bf3b(%rip)     # 0x60460
jne 0x24536
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x3bf2a(%rip)     # 0x60460
movq %rbx, %rdi
movl $0xc, %esi
callq 0x64bc
movq %rax, %r15
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x245f0
testq %r15, %r15
je 0x245e5
movl $0x640000, 0x8(%r15)    # imm = 0x640000
movabsq $0x15000000f0, %rax     # imm = 0x15000000F0
movq %rax, (%r15)
leaq 0xbc(%rip), %rsi        # 0x24637
movq %rbx, %rdi
callq 0x645c
leaq 0x127(%rip), %rsi       # 0x246b1
movq %rbx, %rdi
callq 0x648c
testq %r14, %r14
je 0x24601
movq %r14, %rdi
callq 0x6ad8
movzwl (%rax), %ecx
movw %cx, (%r15)
movzwl 0x4(%rax), %ecx
movw %cx, 0x4(%r15)
movzwl 0x8(%rax), %ecx
movw %cx, 0x8(%r15)
movzwl 0xa(%rax), %ecx
movw %cx, 0xa(%r15)
movzwl 0x6(%rax), %eax
movw %ax, 0x6(%r15)
movq %rbx, %rdi
callq 0x5e38
jmp 0x245e7
leaq 0x1aa65(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x245e3
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1aa49(%rip), %rdi     # 0x3f040
movq %r15, %rsi
callq 0x829e
jmp 0x245ff
movq %rbx, %rdi
movl $0x64, %esi
movl $0x64, %edx
callq 0x553f
callq 0x2e244
testq %rax, %rax
je 0x24626
movq 0xd0(%rax), %rsi
jmp 0x2462d
leaq 0x3b9c3(%rip), %rsi     # 0x5fff0
movq %rbx, %rdi
callq 0x5d83
jmp 0x245e7