// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x66b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x3b730
movq -0x20(%rbp), %rsi
leaq 0x2c91b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x3b72e
cmpq $0x0, -0x20(%rbp)
jne 0x3b744
movq $0x0, -0x8(%rbp)
jmp 0x3b8bd
cmpq $0x0, 0x4dde4(%rip)     # 0x89530
jne 0x3b75e
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x4ddd2(%rip)     # 0x89530
movq -0x20(%rbp), %rdi
movl $0xc, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x3b78f
movq -0x28(%rbp), %rsi
leaq 0x2c8bc(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x3b78d
cmpq $0x0, -0x28(%rbp)
jne 0x3b7a3
movq $0x0, -0x8(%rbp)
jmp 0x3b8bd
movq -0x28(%rbp), %rax
movw $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movw $0x64, 0xa(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x6(%rax)
movq -0x28(%rbp), %rax
movw $0x15, 0x4(%rax)
movq -0x28(%rbp), %rax
movw $0xf0, (%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x2(%rax)
movq -0x20(%rbp), %rdi
leaq 0xe7(%rip), %rsi        # 0x3b8d0
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x1c7(%rip), %rsi       # 0x3b9c0
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x3b851
movq -0x20(%rbp), %rdi
movl $0x64, %edx
movl %edx, %esi
callq 0x8180
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3b83d
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0xd0(%rax), %rdx
xorl %esi, %esi
callq 0x3bdd0
jmp 0x3b84f
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x4d876(%rip), %rdx     # 0x890c0
callq 0x3bdd0
jmp 0x3b8b5
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, (%rax)
movq -0x38(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x38(%rbp), %rax
movw 0x8(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x38(%rbp), %rax
movw 0xa(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x38(%rbp), %rax
movw 0x6(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x6(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)