// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_label.c
// Function: lv_draw_label
void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style, lv_opa_t opa_scale,
                   const char * txt, lv_txt_flag_t flag, lv_point_t * offset, lv_draw_label_txt_sel_t * sel,
                   lv_draw_label_hint_t * hint, lv_bidi_dir_t bidi_dir)
{
    const lv_font_t * font = style->text.font;
    lv_coord_t w;

    /*No need to waste processor time if string is empty*/
    if (txt[0] == '\0')  return;

    if((flag & LV_TXT_FLAG_EXPAND) == 0) {
        /*Normally use the label's width as width*/
        w = lv_area_get_width(coords);
    } else {
        /*If EXAPND is enabled then not limit the text's width to the object's width*/
        lv_point_t p;
        lv_txt_get_size(&p, txt, style->text.font, style->text.letter_space, style->text.line_space, LV_COORD_MAX,
                flag);
        w = p.x;
    }

    lv_coord_t line_height = lv_font_get_line_height(font) + style->text.line_space;

    /*Init variables for the first line*/
    lv_coord_t line_width = 0;
    lv_point_t pos;
    pos.x = coords->x1;
    pos.y = coords->y1;

    lv_coord_t x_ofs = 0;
    lv_coord_t y_ofs = 0;
    if(offset != NULL) {
        x_ofs = offset->x;
        y_ofs = offset->y;
        pos.y += y_ofs;
    }

    uint32_t line_start     = 0;
    int32_t last_line_start = -1;

    /*Check the hint to use the cached info*/
    if(hint && y_ofs == 0 && coords->y1 < 0) {
        /*If the label changed too much recalculate the hint.*/
        if(LV_MATH_ABS(hint->coord_y - coords->y1) > LV_LABEL_HINT_UPDATE_TH - 2 * line_height) {
            hint->line_start = -1;
        }
        last_line_start = hint->line_start;
    }

    /*Use the hint if it's valid*/
    if(hint && last_line_start >= 0) {
        line_start = last_line_start;
        pos.y += hint->y;
    }


    uint32_t line_end = line_start + lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, w, flag);

    /*Go the first visible line*/
    while(pos.y + line_height < mask->y1) {
        /*Go to next line*/
        line_start = line_end;
        line_end += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, w, flag);
        pos.y += line_height;

        /*Save at the threshold coordinate*/
        if(hint && pos.y >= -LV_LABEL_HINT_UPDATE_TH && hint->line_start < 0) {
            hint->line_start = line_start;
            hint->y          = pos.y - coords->y1;
            hint->coord_y    = coords->y1;
        }

        if(txt[line_start] == '\0') return;
    }

    /*Align to middle*/
    if(flag & LV_TXT_FLAG_CENTER) {
        line_width = lv_txt_get_width(&txt[line_start], line_end - line_start, font, style->text.letter_space, flag);

        pos.x += (lv_area_get_width(coords) - line_width) / 2;

    }
    /*Align to the right*/
    else if(flag & LV_TXT_FLAG_RIGHT) {
        line_width = lv_txt_get_width(&txt[line_start], line_end - line_start, font, style->text.letter_space, flag);
        pos.x += lv_area_get_width(coords) - line_width;
    }

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

    uint16_t sel_start = 0xFFFF;
    uint16_t sel_end = 0xFFFF;
    if(sel) {
        sel_start = sel->start;
        sel_end = sel->end;
        if(sel_start > sel_end) {
            uint16_t tmp = sel_start;
            sel_start = sel_end;
            sel_end = tmp;
        }
    }

    cmd_state_t cmd_state = CMD_STATE_WAIT;
    uint32_t i;
    uint16_t par_start = 0;
    lv_color_t recolor;
    lv_coord_t letter_w;
    lv_style_t sel_style;
    lv_style_copy(&sel_style, &lv_style_plain_color);
    sel_style.body.main_color = sel_style.body.grad_color = style->text.sel_color;

    /*Write out all lines*/
    while(txt[line_start] != '\0') {
        if(offset != NULL) {
            pos.x += x_ofs;
        }
        /*Write all letter of a line*/
        cmd_state = CMD_STATE_WAIT;
        i         = 0;
        uint32_t letter;
        uint32_t letter_next;
#if LV_USE_BIDI
        char *bidi_txt = lv_draw_get_buf(line_end - line_start + 1);
        lv_bidi_process_paragraph(txt + line_start, bidi_txt, line_end - line_start, bidi_dir, NULL, 0);
#else
        const char *bidi_txt = txt + line_start;
#endif

        while(i < line_end - line_start) {
            uint16_t logical_char_pos = 0;
            if(sel_start != 0xFFFF && sel_end != 0xFFFF) {
#if LV_USE_BIDI
                logical_char_pos = lv_txt_encoded_get_char_id(txt, line_start);
                uint16_t t = lv_txt_encoded_get_char_id(bidi_txt, i);
                logical_char_pos += lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, bidi_dir, t, NULL);
#else
                logical_char_pos = lv_txt_encoded_get_char_id(txt, line_start + i);
#endif
            }

            letter      = lv_txt_encoded_next(bidi_txt, &i);
            letter_next = lv_txt_encoded_next(&bidi_txt[i], NULL);


            /*Handle the re-color command*/
            if((flag & LV_TXT_FLAG_RECOLOR) != 0) {
                if(letter == (uint32_t)LV_TXT_COLOR_CMD[0]) {
                    if(cmd_state == CMD_STATE_WAIT) { /*Start char*/
                        par_start = i;
                        cmd_state = CMD_STATE_PAR;
                        continue;
                    } else if(cmd_state == CMD_STATE_PAR) { /*Other start char in parameter escaped cmd. char */
                        cmd_state = CMD_STATE_WAIT;
                    } else if(cmd_state == CMD_STATE_IN) { /*Command end */
                        cmd_state = CMD_STATE_WAIT;
                        continue;
                    }
                }

                /*Skip the color parameter and wait the space after it*/
                if(cmd_state == CMD_STATE_PAR) {
                    if(letter == ' ') {
                        /*Get the parameter*/
                        if(i - par_start == LABEL_RECOLOR_PAR_LENGTH + 1) {
                            char buf[LABEL_RECOLOR_PAR_LENGTH + 1];
                            memcpy(buf, &bidi_txt[par_start], LABEL_RECOLOR_PAR_LENGTH);
                            buf[LABEL_RECOLOR_PAR_LENGTH] = '\0';
                            int r, g, b;
                            r       = (hex_char_to_num(buf[0]) << 4) + hex_char_to_num(buf[1]);
                            g       = (hex_char_to_num(buf[2]) << 4) + hex_char_to_num(buf[3]);
                            b       = (hex_char_to_num(buf[4]) << 4) + hex_char_to_num(buf[5]);
                            recolor = lv_color_make(r, g, b);
                        } else {
                            recolor.full = style->text.color.full;
                        }
                        cmd_state = CMD_STATE_IN; /*After the parameter the text is in the command*/
                    }
                    continue;
                }
            }

            lv_color_t color = style->text.color;

            if(cmd_state == CMD_STATE_IN) color = recolor;

            letter_w = lv_font_get_glyph_width(font, letter, letter_next);

            if(sel_start != 0xFFFF && sel_end != 0xFFFF) {
                if(logical_char_pos >= sel_start && logical_char_pos < sel_end) {
                    lv_area_t sel_coords;
                    sel_coords.x1 = pos.x;
                    sel_coords.y1 = pos.y;
                    sel_coords.x2 = pos.x + letter_w + style->text.letter_space - 1;
                    sel_coords.y2 = pos.y + line_height - 1;
                    lv_draw_rect(&sel_coords, mask, &sel_style, opa);
                }
            }

            lv_draw_letter(&pos, mask, font, letter, color, opa);

            if(letter_w > 0) {
                pos.x += letter_w + style->text.letter_space;
            }
        }
        /*Go to next line*/
        line_start = line_end;
        line_end += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, w, flag);

        pos.x = coords->x1;
        /*Align to middle*/
        if(flag & LV_TXT_FLAG_CENTER) {
            line_width =
                    lv_txt_get_width(&txt[line_start], line_end - line_start, font, style->text.letter_space, flag);

            pos.x += (lv_area_get_width(coords) - line_width) / 2;

        }
        /*Align to the right*/
        else if(flag & LV_TXT_FLAG_RIGHT) {
            line_width =
                    lv_txt_get_width(&txt[line_start], line_end - line_start, font, style->text.letter_space, flag);
            pos.x += lv_area_get_width(coords) - line_width;
        }

        /*Go the next line position*/
        pos.y += line_height;

        if(pos.y > mask->y2) return;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movb %r9b, %al
movb 0x28(%rbp), %r9b
movq 0x20(%rbp), %r9
movq 0x18(%rbp), %r9
movq 0x10(%rbp), %r9
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %cl, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x5f261
jmp 0x5fb5a
movzbl -0x29(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x5f27c
movq -0x8(%rbp), %rdi
callq 0x5fb70
movw %ax, -0x3a(%rbp)
jmp 0x5f2bd
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x18(%rbp), %rax
movw 0x30(%rax), %cx
movq -0x18(%rbp), %rax
movw 0x32(%rax), %ax
leaq -0x3e(%rbp), %rdi
movl $0x7c18, %r9d           # imm = 0x7C18
movswl %cx, %ecx
movswl %ax, %r8d
movzbl -0x29(%rbp), %eax
movl %eax, (%rsp)
callq 0x46820
movw -0x3e(%rbp), %ax
movw %ax, -0x3a(%rbp)
movq -0x38(%rbp), %rdi
callq 0x5fb90
movzbl %al, %eax
movq -0x18(%rbp), %rcx
movswl 0x32(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x40(%rbp)
movw $0x0, -0x42(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x46(%rbp)
movq -0x8(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x44(%rbp)
movw $0x0, -0x48(%rbp)
movw $0x0, -0x4a(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x5f32c
movq 0x10(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x48(%rbp)
movq 0x10(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x4a(%rbp)
movswl -0x4a(%rbp), %ecx
movswl -0x44(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movl $0x0, -0x50(%rbp)
movl $0xffffffff, -0x54(%rbp) # imm = 0xFFFFFFFF
cmpq $0x0, 0x20(%rbp)
je 0x5f3d3
movswl -0x4a(%rbp), %eax
cmpl $0x0, %eax
jne 0x5f3d3
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
cmpl $0x0, %eax
jge 0x5f3d3
movq 0x20(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x2(%rcx), %ecx
subl %ecx, %eax
cmpl $0x0, %eax
jle 0x5f38e
movq 0x20(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x2(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0xf0(%rbp)
jmp 0x5f3a9
movq 0x20(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
subl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0xf0(%rbp)
movl -0xf0(%rbp), %eax
movswl -0x40(%rbp), %edx
shll %edx
movl $0x400, %ecx            # imm = 0x400
subl %edx, %ecx
cmpl %ecx, %eax
jle 0x5f3ca
movq 0x20(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x54(%rbp)
cmpq $0x0, 0x20(%rbp)
je 0x5f3f7
cmpl $0x0, -0x54(%rbp)
jl 0x5f3f7
movl -0x54(%rbp), %eax
movl %eax, -0x50(%rbp)
movq 0x20(%rbp), %rax
movl 0x4(%rax), %ecx
movswl -0x44(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0xf4(%rbp)
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %eax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movw 0x30(%rax), %cx
movw -0x3a(%rbp), %ax
movswl %cx, %edx
movswl %ax, %ecx
movzbl -0x29(%rbp), %r8d
callq 0x46a40
movw %ax, %cx
movl -0xf4(%rbp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
movl %eax, -0x58(%rbp)
movswl -0x44(%rbp), %eax
movswl -0x40(%rbp), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movswl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jge 0x5f4fe
movl -0x58(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %eax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movw 0x30(%rax), %cx
movw -0x3a(%rbp), %ax
movswl %cx, %edx
movswl %ax, %ecx
movzbl -0x29(%rbp), %r8d
callq 0x46a40
movzwl %ax, %eax
addl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movswl -0x40(%rbp), %ecx
movswl -0x44(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
cmpq $0x0, 0x20(%rbp)
je 0x5f4e4
movswl -0x44(%rbp), %eax
cmpl $0xfffffc00, %eax       # imm = 0xFFFFFC00
jl 0x5f4e4
movq 0x20(%rbp), %rax
cmpl $0x0, (%rax)
jge 0x5f4e4
movl -0x50(%rbp), %ecx
movq 0x20(%rbp), %rax
movl %ecx, (%rax)
movswl -0x44(%rbp), %ecx
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
subl %eax, %ecx
movq 0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %ecx
movq 0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x5f4f9
jmp 0x5fb5a
jmp 0x5f43b
movzbl -0x29(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5f563
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %eax
addq %rax, %rdi
movl -0x58(%rbp), %eax
subl -0x50(%rbp), %eax
movw %ax, %cx
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rax
movw 0x30(%rax), %ax
movzwl %cx, %esi
movswl %ax, %ecx
movzbl -0x29(%rbp), %r8d
callq 0x46bd0
movw %ax, -0x42(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5fb70
cwtl
movswl -0x42(%rbp), %ecx
subl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movswl -0x46(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x46(%rbp)
jmp 0x5f5c0
movzbl -0x29(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x5f5be
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %eax
addq %rax, %rdi
movl -0x58(%rbp), %eax
subl -0x50(%rbp), %eax
movw %ax, %cx
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rax
movw 0x30(%rax), %ax
movzwl %cx, %esi
movswl %ax, %ecx
movzbl -0x29(%rbp), %r8d
callq 0x46bd0
movw %ax, -0x42(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5fb70
movswl %ax, %ecx
movswl -0x42(%rbp), %eax
subl %eax, %ecx
movswl -0x46(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x46(%rbp)
jmp 0x5f5c0
movzbl -0x19(%rbp), %eax
cmpl $0xff, %eax
jne 0x5f5db
movq -0x18(%rbp), %rax
movzbl 0x34(%rax), %eax
movl %eax, -0xf8(%rbp)
jmp 0x5f5f9
movq -0x18(%rbp), %rax
movzbl 0x34(%rax), %eax
movzwl %ax, %eax
movzbl -0x19(%rbp), %ecx
imull %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
movb %al, -0x59(%rbp)
movw $0xffff, -0x5c(%rbp)    # imm = 0xFFFF
movw $0xffff, -0x5e(%rbp)    # imm = 0xFFFF
cmpq $0x0, 0x18(%rbp)
je 0x5f652
movq 0x18(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x5c(%rbp)
movq 0x18(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x5e(%rbp)
movzwl -0x5c(%rbp), %eax
movzwl -0x5e(%rbp), %ecx
cmpl %ecx, %eax
jle 0x5f650
movw -0x5c(%rbp), %ax
movw %ax, -0x60(%rbp)
movw -0x5e(%rbp), %ax
movw %ax, -0x5c(%rbp)
movw -0x60(%rbp), %ax
movw %ax, -0x5e(%rbp)
jmp 0x5f652
movb $0x0, -0x61(%rbp)
movw $0x0, -0x6a(%rbp)
leaq -0xb8(%rbp), %rdi
leaq 0x299c6(%rip), %rsi     # 0x89030
callq 0xc550
movq -0x18(%rbp), %rax
movw 0x22(%rax), %ax
movw %ax, -0xb4(%rbp)
movw -0xb4(%rbp), %ax
movw %ax, -0xb6(%rbp)
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x5fb5a
cmpq $0x0, 0x10(%rbp)
je 0x5f6b5
movswl -0x48(%rbp), %ecx
movswl -0x46(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x46(%rbp)
movb $0x0, -0x61(%rbp)
movl $0x0, -0x68(%rbp)
movq -0x28(%rbp), %rax
movl -0x50(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movl -0x68(%rbp), %eax
movl -0x58(%rbp), %ecx
subl -0x50(%rbp), %ecx
cmpl %ecx, %eax
jae 0x5fa2f
movw $0x0, -0xca(%rbp)
movzwl -0x5c(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x5f71e
movzwl -0x5e(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x5f71e
leaq 0x1cfd0(%rip), %rax     # 0x7c6d8
movq (%rax), %rax
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %esi
addl -0x68(%rbp), %esi
callq *%rax
movw %ax, -0xca(%rbp)
leaq 0x1cf9b(%rip), %rax     # 0x7c6c0
movq (%rax), %rax
movq -0xc8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq *%rax
movl %eax, -0xbc(%rbp)
leaq 0x1cf7e(%rip), %rax     # 0x7c6c0
movq (%rax), %rax
movq -0xc8(%rbp), %rdi
movl -0x68(%rbp), %ecx
addq %rcx, %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movl %eax, -0xc0(%rbp)
movzbl -0x29(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5f906
movl -0xbc(%rbp), %eax
movsbl 0x8b9e(%rip), %ecx      # 0x68319
cmpl %ecx, %eax
jne 0x5f7bf
movzbl -0x61(%rbp), %eax
cmpl $0x0, %eax
jne 0x5f798
movl -0x68(%rbp), %eax
movw %ax, -0x6a(%rbp)
movb $0x1, -0x61(%rbp)
jmp 0x5f6d1
movzbl -0x61(%rbp), %eax
cmpl $0x1, %eax
jne 0x5f7a7
movb $0x0, -0x61(%rbp)
jmp 0x5f7bb
movzbl -0x61(%rbp), %eax
cmpl $0x2, %eax
jne 0x5f7b9
movb $0x0, -0x61(%rbp)
jmp 0x5f6d1
jmp 0x5f7bb
jmp 0x5f7bd
jmp 0x5f7bf
movzbl -0x61(%rbp), %eax
cmpl $0x1, %eax
jne 0x5f904
cmpl $0x20, -0xbc(%rbp)
jne 0x5f8ff
movl -0x68(%rbp), %eax
movzwl -0x6a(%rbp), %ecx
subl %ecx, %eax
cmpl $0x7, %eax
jne 0x5f8ef
movq -0xc8(%rbp), %rax
movzwl -0x6a(%rbp), %ecx
movl (%rax,%rcx), %edx
movl %edx, -0xd1(%rbp)
movw 0x4(%rax,%rcx), %ax
movw %ax, -0xcd(%rbp)
movb $0x0, -0xcb(%rbp)
movsbl -0xd1(%rbp), %edi
callq 0x5fbb0
movzbl %al, %eax
shll $0x4, %eax
movl %eax, -0x104(%rbp)
movsbl -0xd0(%rbp), %edi
callq 0x5fbb0
movb %al, %cl
movl -0x104(%rbp), %eax
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0xd8(%rbp)
movsbl -0xcf(%rbp), %edi
callq 0x5fbb0
movzbl %al, %eax
shll $0x4, %eax
movl %eax, -0x100(%rbp)
movsbl -0xce(%rbp), %edi
callq 0x5fbb0
movb %al, %cl
movl -0x100(%rbp), %eax
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0xdc(%rbp)
movsbl -0xcd(%rbp), %edi
callq 0x5fbb0
movzbl %al, %eax
shll $0x4, %eax
movl %eax, -0xfc(%rbp)
movsbl -0xcc(%rbp), %edi
callq 0x5fbb0
movb %al, %cl
movl -0xfc(%rbp), %eax
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0xe0(%rbp)
movl -0xd8(%rbp), %eax
movb %al, %dl
movl -0xdc(%rbp), %eax
movb %al, %cl
movl -0xe0(%rbp), %eax
movzbl %dl, %edi
movzbl %cl, %esi
movzbl %al, %edx
callq 0x5fc50
movw %ax, -0xe2(%rbp)
movw -0xe2(%rbp), %ax
movw %ax, -0x6c(%rbp)
jmp 0x5f8fb
movq -0x18(%rbp), %rax
movw 0x20(%rax), %ax
movw %ax, -0x6c(%rbp)
movb $0x2, -0x61(%rbp)
jmp 0x5f6d1
jmp 0x5f906
movq -0x18(%rbp), %rax
movw 0x20(%rax), %ax
movw %ax, -0xe4(%rbp)
movzbl -0x61(%rbp), %eax
cmpl $0x2, %eax
jne 0x5f929
movw -0x6c(%rbp), %ax
movw %ax, -0xe4(%rbp)
movq -0x38(%rbp), %rdi
movl -0xbc(%rbp), %esi
movl -0xc0(%rbp), %edx
callq 0x415e0
movw %ax, -0x6e(%rbp)
movzwl -0x5c(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x5f9e3
movzwl -0x5e(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x5f9e3
movzwl -0xca(%rbp), %eax
movzwl -0x5c(%rbp), %ecx
cmpl %ecx, %eax
jl 0x5f9e1
movzwl -0xca(%rbp), %eax
movzwl -0x5e(%rbp), %ecx
cmpl %ecx, %eax
jge 0x5f9e1
movw -0x46(%rbp), %ax
movw %ax, -0xec(%rbp)
movw -0x44(%rbp), %ax
movw %ax, -0xea(%rbp)
movswl -0x46(%rbp), %eax
movswl -0x6e(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl 0x30(%rcx), %ecx
addl %ecx, %eax
subl $0x1, %eax
movw %ax, -0xe8(%rbp)
movswl -0x44(%rbp), %eax
movswl -0x40(%rbp), %ecx
addl %ecx, %eax
subl $0x1, %eax
movw %ax, -0xe6(%rbp)
movq -0x10(%rbp), %rsi
leaq -0xec(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
movzbl -0x59(%rbp), %ecx
callq 0x5a9e0
jmp 0x5f9e3
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl -0xbc(%rbp), %ecx
movb -0x59(%rbp), %al
leaq -0x46(%rbp), %rdi
movzwl -0xe4(%rbp), %r8d
movzbl %al, %r9d
callq 0x592e0
movswl -0x6e(%rbp), %eax
cmpl $0x0, %eax
jle 0x5fa2a
movswl -0x6e(%rbp), %ecx
movq -0x18(%rbp), %rax
movswl 0x30(%rax), %eax
addl %eax, %ecx
movswl -0x46(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x46(%rbp)
jmp 0x5f6d1
movl -0x58(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %eax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movw 0x30(%rax), %cx
movw -0x3a(%rbp), %ax
movswl %cx, %edx
movswl %ax, %ecx
movzbl -0x29(%rbp), %r8d
callq 0x46a40
movzwl %ax, %eax
addl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x46(%rbp)
movzbl -0x29(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5fad8
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %eax
addq %rax, %rdi
movl -0x58(%rbp), %eax
subl -0x50(%rbp), %eax
movw %ax, %cx
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rax
movw 0x30(%rax), %ax
movzwl %cx, %esi
movswl %ax, %ecx
movzbl -0x29(%rbp), %r8d
callq 0x46bd0
movw %ax, -0x42(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5fb70
cwtl
movswl -0x42(%rbp), %ecx
subl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movswl -0x46(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x46(%rbp)
jmp 0x5fb35
movzbl -0x29(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x5fb33
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %eax
addq %rax, %rdi
movl -0x58(%rbp), %eax
subl -0x50(%rbp), %eax
movw %ax, %cx
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rax
movw 0x30(%rax), %ax
movzwl %cx, %esi
movswl %ax, %ecx
movzbl -0x29(%rbp), %r8d
callq 0x46bd0
movw %ax, -0x42(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5fb70
movswl %ax, %ecx
movswl -0x42(%rbp), %eax
subl %eax, %ecx
movswl -0x46(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x46(%rbp)
jmp 0x5fb35
movswl -0x40(%rbp), %ecx
movswl -0x44(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movswl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jle 0x5fb55
jmp 0x5fb5a
jmp 0x5f68c
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)