// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_triangle.c
// Function: lv_draw_triangle
void lv_draw_triangle(const lv_point_t * points, const lv_area_t * mask, const lv_style_t * style, lv_opa_t opa_scale)
{
    /*Return if the triangle is degenerated*/
    if(points[0].x == points[1].x && points[0].y == points[1].y) return;
    if(points[1].x == points[2].x && points[1].y == points[2].y) return;
    if(points[0].x == points[2].x && points[0].y == points[2].y) return;

    if(points[0].x == points[1].x && points[1].x == points[2].x) return;
    if(points[0].y == points[1].y && points[1].y == points[2].y) return;

    lv_opa_t opa = opa_scale == LV_OPA_COVER ? style->body.opa : (uint16_t)((uint16_t)style->body.opa * opa_scale) >> 8;

    /*Is the triangle flat or tall?*/
    lv_coord_t x_min = LV_MATH_MIN(LV_MATH_MIN(points[0].x, points[1].x), points[2].x);
    lv_coord_t x_max = LV_MATH_MAX(LV_MATH_MAX(points[0].x, points[1].x), points[2].x);
    lv_coord_t y_min = LV_MATH_MIN(LV_MATH_MIN(points[0].y, points[1].y), points[2].y);
    lv_coord_t y_max = LV_MATH_MAX(LV_MATH_MAX(points[0].y, points[1].y), points[2].y);

    /* Draw the tall rectangles from vertical lines
     * and from the flat triangles from horizontal lines
     * to minimize the number of lines.
     * Some pixels are overdrawn on the common edges of the triangles
     * so use it only if the triangle has no opacity*/

    /* Draw from horizontal lines*/
    if(x_max - x_min < y_max - y_min) {
        tri_draw_tall(points, mask, style, opa);
    }
    /*Else flat so draw from vertical lines*/
    else {
        tri_draw_flat(points, mask, style, opa);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jne 0x64015
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jne 0x64015
jmp 0x64340
movq -0x8(%rbp), %rax
movswl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jne 0x64042
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jne 0x64042
jmp 0x64340
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jne 0x6406e
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jne 0x6406e
jmp 0x64340
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jne 0x6409a
movq -0x8(%rbp), %rax
movswl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jne 0x6409a
jmp 0x64340
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jne 0x640c7
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jne 0x640c7
jmp 0x64340
movzbl -0x19(%rbp), %eax
cmpl $0xff, %eax
jne 0x640df
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0x28(%rbp)
jmp 0x640fa
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
movzwl %ax, %eax
movzbl -0x19(%rbp), %ecx
imull %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movb %al, -0x1a(%rbp)
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jge 0x6411f
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x6412a
movq -0x8(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jge 0x6416b
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jge 0x64158
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movl %eax, -0x30(%rbp)
jmp 0x64163
movq -0x8(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x64176
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movw %ax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jle 0x6419c
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movl %eax, -0x38(%rbp)
jmp 0x641a7
movq -0x8(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jle 0x641e8
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jle 0x641d5
movq -0x8(%rbp), %rax
movswl (%rax), %eax
movl %eax, -0x3c(%rbp)
jmp 0x641e0
movq -0x8(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0x641f3
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movw %ax, -0x1e(%rbp)
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jge 0x6421b
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x64226
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jge 0x64269
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jge 0x64256
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x48(%rbp)
jmp 0x64261
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x64274
movq -0x8(%rbp), %rax
movswl 0xa(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movw %ax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jle 0x6429c
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x50(%rbp)
jmp 0x642a7
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jle 0x642ea
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jle 0x642d7
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x54(%rbp)
jmp 0x642e2
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
jmp 0x642f5
movq -0x8(%rbp), %rax
movswl 0xa(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movw %ax, -0x22(%rbp)
movswl -0x1e(%rbp), %eax
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movswl -0x22(%rbp), %ecx
movswl -0x20(%rbp), %edx
subl %edx, %ecx
cmpl %ecx, %eax
jge 0x6432b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movzbl -0x1a(%rbp), %ecx
callq 0x64350
jmp 0x64340
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movzbl -0x1a(%rbp), %ecx
callq 0x648b0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)