// File: /workspace/github_c_makefile_star2_O3/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 $0x1a8, %rsp            # imm = 0x1A8
movl %edx, %ebx
cmpl $0x2, %edx
je 0x199b1
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x1, %bl
je 0x199a0
movzbl %bl, %eax
testl %eax, %eax
jne 0x199b1
movl %ebx, 0x98(%rsp)
movq 0x48(%r15), %rax
movq %rax, 0x78(%rsp)
movq %r15, %rdi
callq 0x66b6
movq %rax, 0xb8(%rsp)
movq %r15, %rdi
callq 0x6af7
movq %rax, 0xa0(%rsp)
movq %r15, %rdi
callq 0x6af7
movq %rax, %r12
movq %r15, %rdi
callq 0x66b6
movq %rax, %rbp
movq %r15, %rdi
callq 0x69eb
movb %al, 0x24(%rsp)
movq %r15, %rdi
callq 0x566d
movl %eax, %ebx
movq %r14, 0x70(%rsp)
movzwl 0x1a(%rbp), %eax
movq %rax, 0x28(%rsp)
movzwl 0x1e(%rbp), %eax
movl %eax, 0x40(%rsp)
movq %r15, %rdi
callq 0x566d
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %eax
shrl %eax
addw 0x20(%r15), %ax
movl %eax, 0x68(%rsp)
movq %r15, %rdi
callq 0x5697
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %eax
shrl %eax
addw 0x22(%r15), %ax
movl %eax, 0x60(%rsp)
movq %r15, %rdi
callq 0x25361
movl %eax, %r13d
movzbl 0x21(%r12), %r12d
movq %r15, %rdi
callq 0x252dd
movl %eax, %r14d
movq %r15, 0x90(%rsp)
movq %r15, %rdi
callq 0x25309
testl %r12d, %r12d
je 0x19560
movswl %r13w, %edx
movl $0x168, %ecx            # imm = 0x168
movl %edx, 0x3c(%rsp)
subl %edx, %ecx
movl %ecx, %esi
shrl $0x1f, %esi
addl %ecx, %esi
sarl %esi
movq 0x28(%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 0x40(%rsp), %edx
leal -0x1(%r12), %ecx
movl %ecx, 0x40(%rsp)
addl $0x5a, %esi
movq %rsi, 0x88(%rsp)
movswl %dx, %ecx
movl %ecx, 0x80(%rsp)
cwtl
movswl %r14w, %ecx
movl %ecx, 0x34(%rsp)
subl %ecx, %eax
movl %eax, 0x38(%rsp)
xorl %eax, %eax
movzbl 0x24(%rsp), %ecx
movl %ecx, 0x30(%rsp)
xorl %r14d, %r14d
movl %eax, 0x24(%rsp)
movq %r12, 0x28(%rsp)
movl 0x24(%rsp), %eax
cltd
idivl 0x40(%rsp)
movl %eax, %r15d
movq %rbp, %r12
movq 0x88(%rsp), %rbp
leal (%r15,%rbp), %eax
movswl %ax, %edi
callq 0x2b4d8
cwtl
movl 0x80(%rsp), %ebx
imull %ebx, %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 0x60(%rsp), %r13d
leal (%r15,%rbp), %eax
addl $0x5a, %eax
movq %r12, %rbp
movq 0x28(%rsp), %r12
movswl %ax, %edi
callq 0x2b4d8
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 0x68(%rsp), %r15d
movl %r14d, %eax
cltd
idivl 0x40(%rsp)
addl 0x34(%rsp), %eax
movswl %ax, %edi
leaq 0x110(%rsp), %rbx
movq %rbx, %rsi
callq 0x2b6c4
movq 0x28(%rbp), %rdx
movswl 0x30(%rbp), %ecx
movswl 0x32(%rbp), %r8d
movl $0x0, (%rsp)
leaq 0x160(%rsp), %rdi
movq %rbx, %rsi
movl $0x7c18, %r9d           # imm = 0x7C18
callq 0x2acd4
movzwl 0x160(%rsp), %eax
movl %eax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %ecx
sarl %ecx
subl %ecx, %r15d
movw %r15w, 0xc8(%rsp)
movzwl 0x162(%rsp), %ecx
movl %ecx, %edx
shrl $0xf, %edx
addl %ecx, %edx
movswl %dx, %edx
sarl %edx
subl %edx, %r13d
movw %r13w, 0xca(%rsp)
addl %eax, %r15d
movw %r15w, 0xcc(%rsp)
addl %ecx, %r13d
movw %r13w, 0xce(%rsp)
movq 0x90(%rsp), %rdi
callq 0x4ab2
movzbl %al, %eax
movl %eax, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0xc8(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq %rbp, %rdx
movl 0x30(%rsp), %ecx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0x3a5ac
movl 0x24(%rsp), %eax
addl 0x38(%rsp), %r14d
addl 0x3c(%rsp), %eax
decl %r12d
jne 0x193ce
movq 0xa0(%rsp), %r14
movzwl 0x4(%r14), %ebp
movq 0x90(%rsp), %r12
movq %r12, %rdi
movq 0x70(%rsp), %r13
movq %r13, %rsi
xorl %edx, %edx
callq *0x46e20(%rip)          # 0x603a8
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
movq 0xb8(%rsp), %rsi
callq 0x799d
movzbl 0x21(%r14), %eax
movw %ax, 0x4(%r14)
movd 0x1a(%rbx), %xmm0
paddw %xmm0, %xmm0
movd %xmm0, 0x1a(%rbx)
movq %rbx, 0x48(%r12)
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq *0x46ddd(%rip)          # 0x603a8
movw %bp, 0x4(%r14)
movq 0x78(%rsp), %rax
movq %rax, 0x48(%r12)
movq %r12, %rdi
callq 0x6af7
movq %rax, 0x60(%rsp)
movq %r12, %rdi
callq 0x66b6
movq %rax, %rbx
movq %r12, %rdi
callq 0x69eb
movb %al, 0x3c(%rsp)
movq %r12, %rdi
callq 0x566d
movl %eax, 0x28(%rsp)
movzwl 0x1a(%rbx), %eax
movl %eax, 0x24(%rsp)
movq %r12, %rdi
callq 0x566d
movl %eax, %r14d
movss 0x20(%r12), %xmm0
movaps %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0x5697
movd %r14d, %xmm0
pinsrw $0x1, %eax, %xmm0
movdqa %xmm0, %xmm1
psrlw $0xf, %xmm1
paddw %xmm0, %xmm1
psraw $0x1, %xmm1
movdqa 0x40(%rsp), %xmm0
pinsrw $0x1, 0x22(%r12), %xmm0
paddw %xmm1, %xmm0
movdqa %xmm0, 0x40(%rsp)
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
movdqa %xmm0, 0xa0(%rsp)
movq %r12, %rdi
callq 0x25361
movl %eax, %r15d
movq %r12, %rdi
callq 0x252dd
movl %eax, %ebp
movq %r12, %rdi
callq 0x25309
movl %eax, %r14d
leaq 0x110(%rsp), %rdi
movq %rbx, 0x78(%rsp)
movq %rbx, %rsi
movq 0x60(%rsp), %rbx
callq 0x799d
movdqa 0x40(%rsp), %xmm0
movd %xmm0, 0x9c(%rsp)
cmpb $0x0, 0x20(%rbx)
je 0x19913
movzwl %r15w, %ecx
movl $0x168, %eax            # imm = 0x168
subl %ecx, %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movl 0x28(%rsp), %esi
movzwl %si, %eax
shrl $0xf, %eax
addl %esi, %eax
cwtl
sarl %eax
subl 0x24(%rsp), %eax
movswl %bp, %esi
shll $0x5, %ecx
movl %ecx, 0x88(%rsp)
movswl %r14w, %ecx
movl %esi, 0x38(%rsp)
subl %esi, %ecx
movl %ecx, 0x34(%rsp)
addl $0x5a, %edx
movq %rdx, 0x80(%rsp)
cwtl
movl %eax, 0x30(%rsp)
movd %xmm0, 0x24(%rsp)
pextrw $0x1, %xmm0, %eax
movl %eax, 0x40(%rsp)
xorl %r14d, %r14d
movq 0x80(%rsp), %r12
movq %r14, 0x68(%rsp)
movq 0x10(%rbx), %rax
movswl (%rax,%r14,2), %eax
subl 0x38(%rsp), %eax
imull 0x88(%rsp), %eax
cltd
idivl 0x34(%rsp)
movl %eax, 0x28(%rsp)
movswl %ax, %ebx
sarl $0x5, %ebx
leal (%r12,%rbx), %eax
leal (%r12,%rbx), %r15d
incl %r15d
movswl %ax, %edi
callq 0x2b4d8
cwtl
movl 0x30(%rsp), %r14d
imull %r14d, %eax
movslq %eax, %rbp
imulq $-0x7ffefffd, %rbp, %rax # imm = 0x80010003
shrq $0x20, %rax
addl %eax, %ebp
movl %ebp, %eax
shrl $0x1f, %eax
shrl $0xe, %ebp
addl %eax, %ebp
addl 0x40(%rsp), %ebp
leal (%r12,%rbx), %eax
addl $0x5a, %eax
movswl %ax, %edi
callq 0x2b4d8
cwtl
imull %r14d, %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 0x24(%rsp), %r13d
movswl %r15w, %edi
callq 0x2b4d8
cwtl
imull %r14d, %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 0x40(%rsp), %r15d
leal (%r12,%rbx), %eax
addl $0x5b, %eax
movq 0x60(%rsp), %rbx
movswl %ax, %edi
callq 0x2b4d8
cwtl
imull %r14d, %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 0x24(%rsp), %ecx
movl 0x28(%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 %r15w, %esi
movswl %bp, %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
cmpw %di, %si
movw %r8w, 0x5c(%rsp)
cmovgel %r9d, %r10d
addl %ebp, %r10d
movw %r10w, 0x5e(%rsp)
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x198ca
movq 0x68(%rsp), %rcx
movzwl (%rax,%rcx,2), %eax
movq 0x70(%rsp), %r13
movq %rcx, %r14
jmp 0x198d8
movw $0xf800, %ax            # imm = 0xF800
movq 0x70(%rsp), %r13
movq 0x68(%rsp), %r14
movw %ax, 0x14c(%rsp)
movzbl 0x3c(%rsp), %r8d
leaq 0x9c(%rsp), %rdi
leaq 0x5c(%rsp), %rsi
movq %r13, %rdx
leaq 0x110(%rsp), %rcx
callq 0x3ad34
incq %r14
movzbl 0x20(%rbx), %eax
cmpq %rax, %r14
jb 0x19732
leaq 0x465fe(%rip), %rsi     # 0x5ff18
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
callq 0x799d
movq 0x78(%rsp), %rcx
movzwl 0xa(%rcx), %eax
movw %ax, 0x2(%rbx)
movw %ax, 0x4(%rbx)
movw $0x7c18, 0x6(%rbx)      # imm = 0x7C18
movzwl 0x6(%rcx), %eax
movd %eax, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movdqa 0xa0(%rsp), %xmm2
movdqa %xmm2, %xmm1
psubw %xmm0, %xmm1
paddw %xmm0, %xmm2
pshufd $0x55, %xmm2, %xmm0     # xmm0 = xmm2[1,1,1,1]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
leaq 0xc0(%rsp), %r14
movq %xmm1, (%r14)
movq 0x90(%rsp), %rdi
callq 0x69eb
movzbl %al, %ecx
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x36968
movl 0x98(%rsp), %ebx
jmp 0x199b1
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq *0x469f7(%rip)          # 0x603a8
cmpb $0x2, %bl
setne %al
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq