// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_gauge.c
// Function: lv_gauge_design
static bool lv_gauge_design(lv_obj_t * gauge, const lv_area_t * mask, lv_design_mode_t mode)
{
    /*Return false if the object is not covers the mask_p area*/
    if(mode == LV_DESIGN_COVER_CHK) {
        return false;
    }
    /*Draw the object*/
    else if(mode == LV_DESIGN_DRAW_MAIN) {

        /* Store the real pointer because of 'lv_group'
         * If the object is in focus 'lv_obj_get_style()' will give a pointer to tmp style
         * and to the real object style. It is important because of style change tricks below*/
        const lv_style_t * style_ori_p = gauge->style_p;
        const lv_style_t * style       = lv_obj_get_style(gauge);
        lv_gauge_ext_t * ext           = lv_obj_get_ext_attr(gauge);

        lv_gauge_draw_scale(gauge, mask);

        /*Draw the ancestor line meter with max value to show the rainbow like line colors*/
        uint16_t line_cnt_tmp = ext->lmeter.line_cnt;
        ancestor_design(gauge, mask, mode); /*To draw lines*/

        /*Temporally modify the line meter to draw longer lines where labels are*/
        lv_style_t style_tmp;
        lv_style_copy(&style_tmp, style);
        ext->lmeter.line_cnt         = ext->label_count;                 /*Only to labels*/
        style_tmp.body.padding.left  = style_tmp.body.padding.left * 2;  /*Longer lines*/
        style_tmp.body.padding.right = style_tmp.body.padding.right * 2; /*Longer lines*/
        gauge->style_p               = &style_tmp;

        ancestor_design(gauge, mask, mode); /*To draw lines*/

        ext->lmeter.line_cnt = line_cnt_tmp; /*Restore the parameters*/
        gauge->style_p       = style_ori_p;  /*Restore the ORIGINAL style pointer*/

        lv_gauge_draw_needle(gauge, mask);

    }
    /*Post draw when the children are drawn*/
    else if(mode == LV_DESIGN_DRAW_POST) {
        ancestor_design(gauge, mask, mode);
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x2, %eax
jne 0x28aba
movb $0x0, -0x1(%rbp)
jmp 0x28bc3
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0x28b9d
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa080
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x29050
movq -0x38(%rbp), %rax
movw 0x4(%rax), %ax
movw %ax, -0x3a(%rbp)
movq 0x6096b(%rip), %rax     # 0x89478
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
movq -0x30(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0xc550
movq -0x38(%rbp), %rax
movzbl 0x21(%rax), %eax
movw %ax, %cx
movq -0x38(%rbp), %rax
movw %cx, 0x4(%rax)
movswl -0x6e(%rbp), %eax
shll %eax
movw %ax, -0x6e(%rbp)
movswl -0x6c(%rbp), %eax
shll %eax
movw %ax, -0x6c(%rbp)
movq -0x10(%rbp), %rax
leaq -0x88(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq 0x60910(%rip), %rax     # 0x89478
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
movw -0x3a(%rbp), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x29320
jmp 0x28bbd
movzbl -0x19(%rbp), %eax
cmpl $0x1, %eax
jne 0x28bbb
movq 0x608cb(%rip), %rax     # 0x89478
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
jmp 0x28bbd
jmp 0x28bbf
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)