// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_calendar.c
// Function: draw_header
static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
{
    lv_calendar_ext_t * ext = lv_obj_get_ext_attr(calendar);

    lv_bidi_dir_t bidi_dir = lv_obj_get_base_dir(calendar);

    lv_opa_t opa_scale      = lv_obj_get_opa_scale(calendar);

    lv_area_t header_area;
    header_area.x1 = calendar->coords.x1;
    header_area.x2 = calendar->coords.x2;
    header_area.y1 = calendar->coords.y1;
    header_area.y2 = calendar->coords.y1 + get_header_height(calendar);

    lv_draw_rect(&header_area, mask, ext->style_header, opa_scale);

    /*Add the year + month name*/
    char txt_buf[64];
    lv_utils_num_to_str(ext->showed_date.year, txt_buf);
    txt_buf[4] = ' ';
    txt_buf[5] = '\0';
    strcpy(&txt_buf[5], get_month_name(calendar, ext->showed_date.month));
    header_area.y1 += ext->style_header->body.padding.top;
    lv_draw_label(&header_area, mask, ext->style_header, opa_scale, txt_buf, LV_TXT_FLAG_CENTER, NULL, NULL, NULL, bidi_dir);

    /*Add the left arrow*/
    const lv_style_t * arrow_style = ext->btn_pressing < 0 ? ext->style_header_pr : ext->style_header;
    header_area.x1 += ext->style_header->body.padding.left;
    lv_draw_label(&header_area, mask, arrow_style, opa_scale, LV_SYMBOL_LEFT, LV_TXT_FLAG_NONE, NULL, NULL, NULL, bidi_dir);

    /*Add the right arrow*/
    arrow_style    = ext->btn_pressing > 0 ? ext->style_header_pr : ext->style_header;
    header_area.x1 = header_area.x2 - ext->style_header->body.padding.right -
                     lv_txt_get_width(LV_SYMBOL_RIGHT, (uint16_t)strlen(LV_SYMBOL_RIGHT), arrow_style->text.font,
                                      arrow_style->text.line_space, LV_TXT_FLAG_NONE);
    lv_draw_label(&header_area, mask, arrow_style, opa_scale, LV_SYMBOL_RIGHT, LV_TXT_FLAG_NONE, NULL, NULL, NULL, bidi_dir);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7180
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa710
movb %al, -0x1a(%rbp)
movq -0x8(%rbp), %rax
movw 0x20(%rax), %ax
movw %ax, -0x22(%rbp)
movq -0x8(%rbp), %rax
movw 0x24(%rax), %ax
movw %ax, -0x1e(%rbp)
movq -0x8(%rbp), %rax
movw 0x22(%rax), %ax
movw %ax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movswl 0x22(%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x8(%rbp), %rdi
callq 0x227d0
movw %ax, %cx
movl -0x84(%rbp), %eax
movswl %cx, %ecx
addl %ecx, %eax
movw %ax, -0x1c(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdx
leaq -0x22(%rbp), %rdi
movzbl -0x1a(%rbp), %ecx
callq 0x5a9e0
movq -0x18(%rbp), %rax
movzwl 0x4(%rax), %edi
leaq -0x70(%rbp), %rsi
callq 0x475d0
movb $0x20, -0x6c(%rbp)
movb $0x0, -0x6b(%rbp)
leaq -0x70(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movsbl 0x6(%rax), %esi
callq 0x22820
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x2040
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movswl 0x16(%rax), %ecx
movswl -0x20(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdx
movb -0x1a(%rbp), %al
leaq -0x70(%rbp), %r8
leaq -0x22(%rbp), %rdi
movl $0x4, %r9d
xorl %ecx, %ecx
movzbl %al, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl -0x19(%rbp), %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
movq -0x18(%rbp), %rax
movsbl 0x10(%rax), %eax
cmpl $0x0, %eax
jge 0x21dcd
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x21ddc
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movswl 0x1a(%rax), %ecx
movswl -0x22(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x22(%rbp)
movq -0x10(%rbp), %rsi
movq -0x78(%rbp), %rdx
movb -0x1a(%rbp), %al
leaq -0x22(%rbp), %rdi
leaq 0x4651a(%rip), %r8      # 0x6832d
xorl %r9d, %r9d
xorl %ecx, %ecx
movzbl %al, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl -0x19(%rbp), %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
movq -0x18(%rbp), %rax
movsbl 0x10(%rax), %eax
cmpl $0x0, %eax
jle 0x21e60
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x21e6f
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x78(%rbp)
movswl -0x1e(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movswl 0x1c(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x9c(%rbp)
movq -0x78(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x78(%rbp), %rax
leaq 0x4648c(%rip), %rdi     # 0x68331
movl $0x3, %esi
xorl %r8d, %r8d
movswl 0x32(%rax), %ecx
callq 0x46bd0
movw %ax, %cx
movl -0x9c(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x22(%rbp)
movq -0x10(%rbp), %rsi
movq -0x78(%rbp), %rdx
movb -0x1a(%rbp), %al
leaq -0x22(%rbp), %rdi
leaq 0x46453(%rip), %r8      # 0x68331
xorl %r9d, %r9d
xorl %ecx, %ecx
movzbl %al, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl -0x19(%rbp), %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)