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

    /*Create the ancestor gauge*/
    lv_obj_t * new_gauge = lv_lmeter_create(par, copy);
    LV_ASSERT_MEM(new_gauge);
    if(new_gauge == NULL) return NULL;

    /*Allocate the gauge type specific extended data*/
    lv_gauge_ext_t * ext = lv_obj_allocate_ext_attr(new_gauge, sizeof(lv_gauge_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    /*Initialize the allocated 'ext' */
    ext->needle_count  = 0;
    ext->values        = NULL;
    ext->needle_colors = NULL;
    ext->label_count   = LV_GAUGE_DEF_LABEL_COUNT;
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_gauge);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_gauge);

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_gauge, lv_gauge_signal);
    lv_obj_set_design_cb(new_gauge, lv_gauge_design);

    /*Init the new gauge gauge*/
    if(copy == NULL) {
        lv_gauge_set_scale(new_gauge, LV_GAUGE_DEF_ANGLE, LV_GAUGE_DEF_LINE_COUNT, LV_GAUGE_DEF_LABEL_COUNT);
        lv_gauge_set_needle_count(new_gauge, 1, NULL);
        lv_gauge_set_critical_value(new_gauge, 80);
        lv_obj_set_size(new_gauge, 2 * LV_DPI, 2 * LV_DPI);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_gauge_set_style(new_gauge, LV_GAUGE_STYLE_MAIN, th->style.gauge);
        } else {
            lv_gauge_set_style(new_gauge, LV_GAUGE_STYLE_MAIN, &lv_style_pretty_color);
        }
    }
    /*Copy an existing gauge*/
    else {
        lv_gauge_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        lv_gauge_set_needle_count(new_gauge, copy_ext->needle_count, copy_ext->needle_colors);

        uint8_t i;
        for(i = 0; i < ext->needle_count; i++) {
            ext->values[i] = copy_ext->values[i];
        }
        ext->label_count = copy_ext->label_count;
        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_gauge);
    }

    LV_LOG_INFO("gauge created");

    return new_gauge;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
callq 0x24c14
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x19145
testq %rbx, %rbx
je 0x19156
movq %rbx, %rdi
movl $0x28, %esi
callq 0x64db
movq %rax, %r14
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x19161
testq %r14, %r14
je 0x19156
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movw $0x600, 0x20(%r14)      # imm = 0x600
cmpq $0x0, 0x47303(%rip)     # 0x603a0
jne 0x190ae
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x472f2(%rip)     # 0x603a0
cmpq $0x0, 0x472f2(%rip)     # 0x603a8
jne 0x190c7
movq %rbx, %rdi
callq 0x6aaf
movq %rax, 0x472e1(%rip)     # 0x603a8
leaq 0x110(%rip), %rsi       # 0x191de
movq %rbx, %rdi
callq 0x647b
leaq 0x16a(%rip), %rsi       # 0x19247
movq %rbx, %rdi
callq 0x64ab
testq %r15, %r15
je 0x19172
movq %r15, %rdi
callq 0x6af7
movq %rax, %r15
movzbl 0x20(%rax), %esi
movq 0x18(%rax), %rdx
movq %rbx, %rdi
callq 0x19a23
movzbl 0x20(%r14), %eax
testq %rax, %rax
je 0x19133
movq %r14, %rdx
addq $0x10, %rdx
movq 0x10(%r15), %rcx
movq (%rdx), %rdx
xorl %esi, %esi
movzwl (%rcx,%rsi,2), %edi
movw %di, (%rdx,%rsi,2)
incq %rsi
cmpq %rsi, %rax
jne 0x19123
movb 0x21(%r15), %al
movb %al, 0x21(%r14)
movq %rbx, %rdi
callq 0x5e54
jmp 0x19158
leaq 0x25f84(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x19154
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x25f68(%rip), %rdi     # 0x3f0d0
movq %r14, %rsi
callq 0x8294
jmp 0x19170
movq %rbx, %rdi
movl $0xdc, %esi
movl $0x15, %edx
movl $0x6, %ecx
callq 0x199c9
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x19a23
movq %rbx, %rdi
movl $0x50, %esi
callq 0x25137
movq %rbx, %rdi
movl $0xc8, %esi
movl $0xc8, %edx
callq 0x5557
callq 0x2e91c
testq %rax, %rax
je 0x191ca
movq 0xd8(%rax), %rsi
jmp 0x191d1
leaq 0x46e1f(%rip), %rsi     # 0x5fff0
movq %rbx, %rdi
callq 0x5d9f
jmp 0x19158