// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_chart.c
// Function: lv_chart_draw_x_ticks
static void lv_chart_draw_x_ticks(lv_obj_t * chart, const lv_area_t * mask)
{
    lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);

    if(ext->x_axis.list_of_values != NULL || ext->x_axis.num_tick_marks != 0) {

        const lv_style_t * style = lv_obj_get_style(chart);
        lv_opa_t opa_scale       = lv_obj_get_opa_scale(chart);

        uint8_t i;
        uint8_t num_of_labels;
        uint8_t num_scale_ticks;
        uint8_t major_tick_len, minor_tick_len;
        lv_chart_label_iterator_t iter;
        lv_point_t p1;
        lv_point_t p2;
        lv_coord_t x_ofs = chart->coords.x1;
        lv_coord_t y_ofs = chart->coords.y1;
        lv_coord_t h     = lv_obj_get_height(chart);
        lv_coord_t w     = lv_obj_get_width(chart);
        char buf[LV_CHART_AXIS_TICK_LABEL_MAX_LEN + 1]; /* up to N symbols per label + null terminator */

        /* calculate the size of tick marks */
        if(ext->x_axis.major_tick_len == LV_CHART_TICK_LENGTH_AUTO)
            major_tick_len = (int32_t)w * LV_CHART_AXIS_MAJOR_TICK_LEN_COE;
        else
            major_tick_len = ext->x_axis.major_tick_len;

        if(ext->x_axis.minor_tick_len == LV_CHART_TICK_LENGTH_AUTO)
            minor_tick_len = major_tick_len * LV_CHART_AXIS_MINOR_TICK_LEN_COE;
        else
            minor_tick_len = ext->x_axis.minor_tick_len;

        /*determine the number of options */
        iter = lv_chart_create_label_iter(ext->x_axis.list_of_values, LV_CHART_LABEL_ITERATOR_FORWARD);
        num_of_labels = iter.items_left;

        /* we can't have string labels without ticks step, set to 1 if not specified */
        if(ext->x_axis.num_tick_marks == 0) ext->x_axis.num_tick_marks = 1;

        /* calculate total number of marks */
        if(num_of_labels < 2)
            num_scale_ticks = ext->x_axis.num_tick_marks;
        else
            num_scale_ticks = (ext->x_axis.num_tick_marks * (num_of_labels - 1));

        for(i = 0; i < (num_scale_ticks + 1); i++) { /* one extra loop - it may not exist in the list, empty label */
                                                     /* first point of the tick */
            p1.y = h + y_ofs;

            /* second point of the tick */
            if((num_of_labels != 0) && (i == 0 || i % ext->x_axis.num_tick_marks == 0))
                p2.y = p1.y + major_tick_len; /* major tick */
            else
                p2.y = p1.y + minor_tick_len; /* minor tick */

            /* draw a line at moving x position */
            p2.x = p1.x = x_ofs + (int32_t)((int32_t)(w - style->line.width) * i) / num_scale_ticks;

            if(i != num_scale_ticks)
                lv_draw_line(&p1, &p2, mask, style, opa_scale);
            else if((ext->x_axis.options & LV_CHART_AXIS_DRAW_LAST_TICK) != 0)
                lv_draw_line(&p1, &p2, mask, style, opa_scale);

            /* draw values if available */
            if(num_of_labels != 0) {
                /* add text only to major tick */
                if(lv_chart_is_tick_with_label(i, &(ext->x_axis))) {
                    lv_chart_get_next_label(&iter, buf);

                    /* reserve appropriate area */
                    lv_point_t size;
                    lv_txt_get_size(&size, buf, style->text.font, style->text.letter_space, style->text.line_space,
                                    LV_COORD_MAX, LV_TXT_FLAG_CENTER);

                    /* set the area at some distance of the major tick len under of the tick */
                    lv_area_t a = {(p2.x - size.x / 2), (p2.y + LV_CHART_AXIS_TO_LABEL_DISTANCE), (p2.x + size.x / 2),
                                   (p2.y + size.y + LV_CHART_AXIS_TO_LABEL_DISTANCE)};
                    lv_draw_label(&a, mask, style, opa_scale, buf, LV_TXT_FLAG_CENTER, NULL, NULL, NULL, lv_obj_get_base_dir(chart));
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x2609c
movq -0x18(%rbp), %rax
movzbl 0x41(%rax), %eax
cmpl $0x0, %eax
je 0x26430
movq -0x8(%rbp), %rdi
callq 0xa080
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa710
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rax
movw 0x20(%rax), %ax
movw %ax, -0x4a(%rbp)
movq -0x8(%rbp), %rax
movw 0x22(%rax), %ax
movw %ax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, -0x4e(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x42(%rax), %eax
cmpl $0xff, %eax
jne 0x2610a
movswl -0x50(%rbp), %eax
shll $0x0, %eax
movl $0xf, %ecx
cltd
idivl %ecx
movb %al, -0x25(%rbp)
jmp 0x26114
movq -0x18(%rbp), %rax
movb 0x42(%rax), %al
movb %al, -0x25(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x43(%rax), %eax
cmpl $0xff, %eax
jne 0x26136
movzbl -0x25(%rbp), %eax
shll %eax
movl $0x3, %ecx
cltd
idivl %ecx
movb %al, -0x26(%rbp)
jmp 0x26140
movq -0x18(%rbp), %rax
movb 0x43(%rax), %al
movb %al, -0x26(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0x88(%rbp), %rdi
movl $0x1, %edx
callq 0x26440
movq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x30(%rbp)
movb -0x30(%rbp), %al
movb %al, -0x23(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x41(%rax), %eax
cmpl $0x0, %eax
jne 0x2618f
movq -0x18(%rbp), %rax
movb $0x1, 0x41(%rax)
movzbl -0x23(%rbp), %eax
cmpl $0x2, %eax
jge 0x261a4
movq -0x18(%rbp), %rax
movb 0x41(%rax), %al
movb %al, -0x24(%rbp)
jmp 0x261b9
movq -0x18(%rbp), %rax
movzbl 0x41(%rax), %eax
movzbl -0x23(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
movb %al, -0x24(%rbp)
movb $0x0, -0x22(%rbp)
movzbl -0x22(%rbp), %eax
movzbl -0x24(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2642e
movswl -0x4e(%rbp), %eax
movswl -0x4c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x42(%rbp)
movzbl -0x23(%rbp), %eax
cmpl $0x0, %eax
je 0x26214
movzbl -0x22(%rbp), %eax
cmpl $0x0, %eax
je 0x26204
movzbl -0x22(%rbp), %eax
movq -0x18(%rbp), %rcx
movzbl 0x41(%rcx), %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x26214
movswl -0x42(%rbp), %eax
movzbl -0x25(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x46(%rbp)
jmp 0x26222
movswl -0x42(%rbp), %eax
movzbl -0x26(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x46(%rbp)
movswl -0x4a(%rbp), %eax
movl %eax, -0x98(%rbp)
movswl -0x50(%rbp), %eax
movq -0x20(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl %ecx, %eax
movzbl -0x22(%rbp), %ecx
imull %ecx, %eax
movzbl -0x24(%rbp), %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x98(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movw %ax, -0x48(%rbp)
movzbl -0x22(%rbp), %eax
movzbl -0x24(%rbp), %ecx
cmpl %ecx, %eax
je 0x26282
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x44(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movzbl -0x21(%rbp), %r8d
callq 0x5fcd0
jmp 0x262ae
movq -0x18(%rbp), %rax
movzbl 0x40(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x262ac
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x44(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movzbl -0x21(%rbp), %r8d
callq 0x5fcd0
jmp 0x262ae
movzbl -0x23(%rbp), %eax
cmpl $0x0, %eax
je 0x2641f
movb -0x22(%rbp), %al
movq -0x18(%rbp), %rsi
addq $0x38, %rsi
movzbl %al, %edi
callq 0x26510
testb $0x1, %al
jne 0x262d7
jmp 0x2641d
leaq -0x70(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x26550
leaq -0x70(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x20(%rbp), %rax
movw 0x30(%rax), %cx
movq -0x20(%rbp), %rax
leaq -0x8c(%rbp), %rdi
movl $0x7c18, %r9d           # imm = 0x7C18
movswl %cx, %ecx
movswl 0x32(%rax), %r8d
movl $0x4, (%rsp)
callq 0x46820
movswl -0x48(%rbp), %eax
movl %eax, -0xc0(%rbp)
movswl -0x8c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xc0(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x94(%rbp)
movswl -0x46(%rbp), %eax
addl $0x4, %eax
movw %ax, -0x92(%rbp)
movswl -0x48(%rbp), %eax
movl %eax, -0xbc(%rbp)
movswl -0x8c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xbc(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x90(%rbp)
movswl -0x46(%rbp), %eax
movswl -0x8a(%rbp), %ecx
addl %ecx, %eax
addl $0x4, %eax
movw %ax, -0x8e(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xb0(%rbp)
movb -0x21(%rbp), %al
movb %al, -0xa1(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7180
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
movb -0xa1(%rbp), %cl
movq -0xa0(%rbp), %r8
leaq -0x94(%rbp), %rdi
movl $0x4, %r9d
xorl %r10d, %r10d
movzbl %cl, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl %al, %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
jmp 0x2641f
jmp 0x26421
movb -0x22(%rbp), %al
addb $0x1, %al
movb %al, -0x22(%rbp)
jmp 0x261bd
jmp 0x26430
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)