// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %edx, %ebx
cmpl $0x2, %edx
je 0x1947e
movq %rsi, %r15
movq %rdi, %r14
movzbl %bl, %edx
cmpb $0x1, %dl
je 0x19472
testl %edx, %edx
jne 0x1947e
movl %edx, 0x70(%rsp)
movl %ebx, 0x94(%rsp)
movq 0x48(%r14), %rax
movq %rax, 0xa8(%rsp)
movq %r14, %rdi
callq 0x6697
movq %rax, 0x98(%rsp)
movq %r14, %rdi
callq 0x6ad8
movq %rax, 0xa0(%rsp)
movq %r14, %rdi
callq 0x6ad8
movq %rax, %rbp
movq %r14, %rdi
callq 0x6697
movq %rax, %r13
movq %r14, %rdi
callq 0x69cc
movb %al, 0x30(%rsp)
movq %r14, %rdi
callq 0x5651
movl %eax, %ebx
movzwl 0x1a(%r13), %eax
movq %rax, 0x38(%rsp)
movzwl 0x1e(%r13), %eax
movl %eax, 0x2c(%rsp)
movq %r14, %rdi
callq 0x5651
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %eax
shrl %eax
addw 0x20(%r14), %ax
movl %eax, 0x50(%rsp)
movq %r14, %rdi
callq 0x567b
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %eax
shrl %eax
addw 0x22(%r14), %ax
movl %eax, 0x4c(%rsp)
movq %r14, %rdi
callq 0x24c64
movq %r15, 0x60(%rsp)
movl %eax, %r15d
movzbl 0x21(%rbp), %ebp
movq %r14, %rdi
callq 0x24be0
movl %eax, %r12d
movq %r14, 0x88(%rsp)
movq %r14, %rdi
callq 0x24c0c
testl %ebp, %ebp
je 0x19069
movswl %r15w, %edx
movl $0x168, %ecx            # imm = 0x168
movl %edx, 0x80(%rsp)
subl %edx, %ecx
movl %ecx, %esi
shrl $0x1f, %esi
addl %ecx, %esi
sarl %esi
movq 0x38(%rsp), %rcx
leal (%rcx,%rcx,2), %ecx
movzwl %bx, %edx
shrl $0xf, %edx
addl %ebx, %edx
movswl %dx, %edx
sarl %edx
subl %ecx, %edx
subl 0x2c(%rsp), %edx
leal -0x1(%rbp), %ecx
movl %ecx, 0x2c(%rsp)
addl $0x5a, %esi
movq %rsi, 0x58(%rsp)
movswl %dx, %ecx
movl %ecx, 0x78(%rsp)
cwtl
movswl %r12w, %ecx
movl %ecx, 0x44(%rsp)
subl %ecx, %eax
movl %eax, 0x48(%rsp)
xorl %eax, %eax
movzbl 0x30(%rsp), %ecx
movl %ecx, 0x40(%rsp)
xorl %r14d, %r14d
movl %eax, 0x30(%rsp)
movq %rbp, 0x38(%rsp)
movl 0x30(%rsp), %eax
cltd
idivl 0x2c(%rsp)
movl %eax, %r15d
movq %r13, %rbp
movq 0x58(%rsp), %r13
leal (%r15,%r13), %eax
movswl %ax, %edi
callq 0x2ad8c
cwtl
movl 0x78(%rsp), %ebx
imull %ebx, %eax
movslq %eax, %r12
imulq $-0x7ffefffd, %r12, %rax # imm = 0x80010003
shrq $0x20, %rax
addl %eax, %r12d
movl %r12d, %eax
shrl $0x1f, %eax
shrl $0xe, %r12d
addl %eax, %r12d
addl 0x4c(%rsp), %r12d
leal (%r15,%r13), %eax
addl $0x5a, %eax
movq %rbp, %r13
movq 0x38(%rsp), %rbp
movswl %ax, %edi
callq 0x2ad8c
cwtl
imull %ebx, %eax
movslq %eax, %r15
imulq $-0x7ffefffd, %r15, %rax # imm = 0x80010003
shrq $0x20, %rax
addl %eax, %r15d
movl %r15d, %eax
shrl $0x1f, %eax
shrl $0xe, %r15d
addl %eax, %r15d
addl 0x50(%rsp), %r15d
movl %r14d, %eax
cltd
idivl 0x2c(%rsp)
addl 0x44(%rsp), %eax
movswl %ax, %edi
leaq 0x100(%rsp), %rbx
movq %rbx, %rsi
callq 0x2af80
movq 0x28(%r13), %rdx
movswl 0x30(%r13), %ecx
movswl 0x32(%r13), %r8d
movl $0x0, (%rsp)
leaq 0x150(%rsp), %rdi
movq %rbx, %rsi
movl $0x7c18, %r9d           # imm = 0x7C18
callq 0x2a643
movzwl 0x150(%rsp), %eax
movl %eax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %ecx
sarl %ecx
subl %ecx, %r15d
movw %r15w, 0xb8(%rsp)
movzwl 0x152(%rsp), %ecx
movl %ecx, %edx
shrl $0xf, %edx
addl %ecx, %edx
movswl %dx, %edx
sarl %edx
subl %edx, %r12d
movw %r12w, 0xba(%rsp)
addl %eax, %r15d
movw %r15w, 0xbc(%rsp)
addl %ecx, %r12d
movw %r12w, 0xbe(%rsp)
movq 0x88(%rsp), %rdi
callq 0x4abc
movzbl %al, %eax
movl %eax, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0xb8(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq %r13, %rdx
movl 0x40(%rsp), %ecx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0x3a034
movl 0x30(%rsp), %eax
addl 0x48(%rsp), %r14d
addl 0x80(%rsp), %eax
decl %ebp
jne 0x18eda
movq 0xa0(%rsp), %r12
movzwl 0x4(%r12), %ebp
movq 0x88(%rsp), %r14
movq %r14, %rdi
movq 0x60(%rsp), %r13
movq %r13, %rsi
movl 0x70(%rsp), %r15d
movl %r15d, %edx
callq *0x47310(%rip)          # 0x603a8
leaq 0x150(%rsp), %rbx
movq %rbx, %rdi
movq 0x98(%rsp), %rsi
callq 0x798d
movzbl 0x21(%r12), %eax
movw %ax, 0x4(%r12)
shlw 0x1a(%rbx)
shlw 0x1c(%rbx)
movq %rbx, 0x48(%r14)
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq *0x472d1(%rip)          # 0x603a8
movw %bp, 0x4(%r12)
movq 0xa8(%rsp), %rax
movq %rax, 0x48(%r14)
movq %r14, %rdi
callq 0x6ad8
movq %rax, %r13
movq %r14, %rdi
callq 0x6697
movq %rax, %r15
movq %r14, %rdi
callq 0x69cc
movb %al, 0x4c(%rsp)
movq %r14, %rdi
callq 0x5651
movl %eax, 0x50(%rsp)
movzwl 0x1a(%r15), %eax
movl %eax, 0x38(%rsp)
movq %r14, %rdi
callq 0x5651
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %ebp
shrl %ebp
addw 0x20(%r14), %bp
movq %r14, %rdi
callq 0x567b
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %r12d
shrl %r12d
addw 0x22(%r14), %r12w
movq %r14, %rdi
callq 0x24c64
movl %eax, %ebx
movq %r14, %rdi
callq 0x24be0
movw %ax, 0x58(%rsp)
movq %r14, %rdi
callq 0x24c0c
movl %eax, %r14d
leaq 0x100(%rsp), %rdi
movq %r15, 0x70(%rsp)
movq %r15, %rsi
callq 0x798d
movq %rbp, 0x30(%rsp)
movw %bp, 0x6c(%rsp)
movl %r12d, 0x2c(%rsp)
movw %r12w, 0x6e(%rsp)
cmpb $0x0, 0x20(%r13)
movq 0x60(%rsp), %r15
je 0x193ea
movzwl %bx, %ecx
movl $0x168, %eax            # imm = 0x168
subl %ecx, %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movl 0x50(%rsp), %esi
movzwl %si, %eax
shrl $0xf, %eax
addl %esi, %eax
cwtl
sarl %eax
subl 0x38(%rsp), %eax
movswl 0x58(%rsp), %esi
shll $0x5, %ecx
movl %ecx, 0x58(%rsp)
movswl %r14w, %ecx
movl %esi, 0x48(%rsp)
subl %esi, %ecx
movl %ecx, 0x44(%rsp)
addl $0x5a, %edx
movq %rdx, 0x78(%rsp)
cwtl
movl %eax, 0x40(%rsp)
xorl %ebx, %ebx
movq %r13, 0x80(%rsp)
movq 0x78(%rsp), %r14
movl 0x40(%rsp), %r12d
movq %rbx, 0x50(%rsp)
movq 0x10(%r13), %rax
movswl (%rax,%rbx,2), %eax
subl 0x48(%rsp), %eax
imull 0x58(%rsp), %eax
cltd
idivl 0x44(%rsp)
movl %eax, 0x38(%rsp)
movswl %ax, %ebp
sarl $0x5, %ebp
leal (%r14,%rbp), %eax
leal (%r14,%rbp), %ebx
incl %ebx
movswl %ax, %edi
callq 0x2ad8c
cwtl
imull %r12d, %eax
movslq %eax, %r15
imulq $-0x7ffefffd, %r15, %rax # imm = 0x80010003
shrq $0x20, %rax
addl %eax, %r15d
movl %r15d, %eax
shrl $0x1f, %eax
shrl $0xe, %r15d
addl %eax, %r15d
addl 0x2c(%rsp), %r15d
leal (%r14,%rbp), %eax
addl $0x5a, %eax
movswl %ax, %edi
callq 0x2ad8c
cwtl
imull %r12d, %eax
movslq %eax, %r13
imulq $-0x7ffefffd, %r13, %rax # imm = 0x80010003
shrq $0x20, %rax
addl %eax, %r13d
movl %r13d, %eax
shrl $0x1f, %eax
shrl $0xe, %r13d
addl %eax, %r13d
addl 0x30(%rsp), %r13d
movswl %bx, %edi
callq 0x2ad8c
cwtl
imull %r12d, %eax
movslq %eax, %rbx
imulq $-0x7ffefffd, %rbx, %rax # imm = 0x80010003
shrq $0x20, %rax
addl %eax, %ebx
movl %ebx, %eax
shrl $0x1f, %eax
shrl $0xe, %ebx
addl %eax, %ebx
addl 0x2c(%rsp), %ebx
leal (%r14,%rbp), %eax
addl $0x5b, %eax
movswl %ax, %edi
callq 0x2ad8c
cwtl
imull %r12d, %eax
movslq %eax, %rcx
imulq $-0x7ffefffd, %rcx, %rax # imm = 0x80010003
shrq $0x20, %rax
addl %eax, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
shrl $0xe, %ecx
addl %eax, %ecx
addl 0x30(%rsp), %ecx
movl 0x38(%rsp), %edi
andl $0x1f, %edi
movswl %r13w, %eax
movswl %cx, %ecx
movl %ecx, %esi
subl %eax, %esi
movl %esi, %edx
negl %edx
cmovsl %esi, %edx
movl $0xffff, %r10d          # imm = 0xFFFF
andl %r10d, %edx
imull %edi, %edx
movl %edi, %r11d
shrl $0x5, %edx
movswl %bx, %esi
movswl %r15w, %edi
movl %esi, %r8d
subl %edi, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
andl %r10d, %r9d
imull %r11d, %r9d
shrl $0x5, %r9d
movl %edx, %r8d
negl %r8d
movl %r9d, %r10d
negl %r10d
cmpw %ax, %cx
cmovgel %edx, %r8d
addl %r13d, %r8d
movq 0x80(%rsp), %r13
cmpw %di, %si
movw %r8w, 0x68(%rsp)
cmovgel %r9d, %r10d
addl %r15d, %r10d
movw %r10w, 0x6a(%rsp)
movq 0x18(%r13), %rax
testq %rax, %rax
je 0x193a3
movq 0x50(%rsp), %rcx
movzwl (%rax,%rcx,2), %eax
movq 0x60(%rsp), %r15
movq %rcx, %rbx
jmp 0x193b1
movw $0xf800, %ax            # imm = 0xF800
movq 0x60(%rsp), %r15
movq 0x50(%rsp), %rbx
movw %ax, 0x13c(%rsp)
movzbl 0x4c(%rsp), %r8d
leaq 0x6c(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %r15, %rdx
leaq 0x100(%rsp), %rcx
callq 0x3a7b0
incq %rbx
movzbl 0x20(%r13), %eax
cmpq %rax, %rbx
jb 0x19213
leaq 0x46b27(%rip), %rsi     # 0x5ff18
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
callq 0x798d
movq 0x70(%rsp), %rcx
movzwl 0xa(%rcx), %eax
movw %ax, 0x2(%rbx)
movw %ax, 0x4(%rbx)
movw $0x7c18, 0x6(%rbx)      # imm = 0x7C18
movzwl 0x6(%rcx), %eax
movq 0x30(%rsp), %rdx
leal (%rax,%rdx), %ecx
subl %eax, %edx
leaq 0xb0(%rsp), %r14
movw %dx, (%r14)
movl 0x2c(%rsp), %esi
movl %esi, %edx
subl %eax, %edx
movw %dx, 0x2(%r14)
movw %cx, 0x4(%r14)
addl %esi, %eax
movw %ax, 0x6(%r14)
movq 0x88(%rsp), %rdi
callq 0x69cc
movzbl %al, %ecx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x365ac
movl 0x94(%rsp), %ebx
jmp 0x1947e
movq %r14, %rdi
movq %r15, %rsi
callq *0x46f2a(%rip)          # 0x603a8
cmpb $0x2, %bl
setne %al
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq