// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_basic.c
// Function: lv_draw_letter
void lv_draw_letter(const lv_point_t * pos_p, const lv_area_t * mask_p, const lv_font_t * font_p, uint32_t letter,
                    lv_color_t color, lv_opa_t opa)
{
    /*clang-format off*/
    const uint8_t bpp1_opa_table[2]  = {0, 255};          /*Opacity mapping with bpp = 1 (Just for compatibility)*/
    const uint8_t bpp2_opa_table[4]  = {0, 85, 170, 255}; /*Opacity mapping with bpp = 2*/
    const uint8_t bpp4_opa_table[16] = {0,  17, 34,  51,  /*Opacity mapping with bpp = 4*/
                                        68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255};
    /*clang-format on*/

    if(opa < LV_OPA_MIN) return;
    if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;

    if(font_p == NULL) {
        LV_LOG_WARN("Font: character's bitmap not found");
        return;
    }

    lv_font_glyph_dsc_t g;
    bool g_ret = lv_font_get_glyph_dsc(font_p, &g, letter, '\0');
    if(g_ret == false) return;


    lv_coord_t pos_x = pos_p->x + g.ofs_x;
    lv_coord_t pos_y = pos_p->y + (font_p->line_height - font_p->base_line) - g.box_h - g.ofs_y;

    const uint8_t * bpp_opa_table;
    uint8_t bitmask_init;
    uint8_t bitmask;

    /*bpp = 3 should be converted to bpp = 4 in lv_font_get_glyph_bitmap */
    if(g.bpp == 3) g.bpp = 4;

    switch(g.bpp) {
        case 1:
            bpp_opa_table = bpp1_opa_table;
            bitmask_init  = 0x80;
            break;
        case 2:
            bpp_opa_table = bpp2_opa_table;
            bitmask_init  = 0xC0;
            break;
        case 4:
            bpp_opa_table = bpp4_opa_table;
            bitmask_init  = 0xF0;
            break;
        case 8:
            bpp_opa_table = NULL;
            bitmask_init  = 0xFF;
            break;       /*No opa table, pixel value will be used directly*/
        default: return; /*Invalid bpp. Can't render the letter*/
    }

    const uint8_t * map_p = lv_font_get_glyph_bitmap(font_p, letter);

    if(map_p == NULL) return;

    /*If the letter is completely out of mask don't draw it */
    if(pos_x + g.box_w < mask_p->x1 || pos_x > mask_p->x2 || pos_y + g.box_h < mask_p->y1 || pos_y > mask_p->y2) return;

    lv_disp_t * disp    = lv_refr_get_disp_refreshing();
    lv_disp_buf_t * vdb = lv_disp_get_buf(disp);

    lv_coord_t vdb_width     = lv_area_get_width(&vdb->area);
    lv_color_t * vdb_buf_tmp = vdb->buf_act;
    lv_coord_t col, row;

    uint8_t width_byte_scr = g.box_w >> 3; /*Width in bytes (on the screen finally) (e.g. w = 11 -> 2 bytes wide)*/
    if(g.box_w & 0x7) width_byte_scr++;
    uint16_t width_bit = g.box_w * g.bpp; /*Letter width in bits*/

    bool subpx = font_p->subpx == LV_FONT_SUBPX_NONE ? false : true;

    /* Calculate the col/row start/end on the map*/
    lv_coord_t col_start;
    lv_coord_t col_end;
    lv_coord_t row_start;
    lv_coord_t row_end;

    if(subpx == false) {
        col_start = pos_x >= mask_p->x1 ? 0 : mask_p->x1 - pos_x;
        col_end   = pos_x + g.box_w <= mask_p->x2 ? g.box_w : mask_p->x2 - pos_x + 1;
        row_start = pos_y >= mask_p->y1 ? 0 : mask_p->y1 - pos_y;
        row_end   = pos_y + g.box_h <= mask_p->y2 ? g.box_h : mask_p->y2 - pos_y + 1;
    } else {
        col_start = pos_x >= mask_p->x1 ? 0 : (mask_p->x1 - pos_x) * 3;
        col_end   = pos_x + g.box_w / 3 <= mask_p->x2 ? g.box_w : (mask_p->x2 - pos_x + 1) * 3;
        row_start = pos_y >= mask_p->y1 ? 0 : mask_p->y1 - pos_y;
        row_end   = pos_y + g.box_h <= mask_p->y2 ? g.box_h : mask_p->y2 - pos_y + 1;
    }

    /*Set a pointer on VDB to the first pixel of the letter*/
    vdb_buf_tmp += ((pos_y - vdb->area.y1) * vdb_width) + pos_x - vdb->area.x1;

    /*If the letter is partially out of mask the move there on VDB*/
    if(subpx) vdb_buf_tmp += (row_start * vdb_width) + col_start / 3;
    else vdb_buf_tmp += (row_start * vdb_width) + col_start;

    /*Move on the map too*/
    uint32_t bit_ofs = (row_start * width_bit) + (col_start * g.bpp);
    map_p += bit_ofs >> 3;

    uint8_t letter_px;
    lv_opa_t px_opa = 0;
    uint16_t col_bit;
    col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */

    bool scr_transp = false;
#if LV_COLOR_DEPTH == 32 && LV_COLOR_SCREEN_TRANSP
    scr_transp = disp->driver.screen_transp;
#endif

    uint8_t font_rgb[3];
    uint8_t txt_rgb[3] = {LV_COLOR_GET_R(color), LV_COLOR_GET_G(color), LV_COLOR_GET_B(color)};

    for(row = row_start; row < row_end; row++) {
        bitmask = bitmask_init >> col_bit;
        uint8_t sub_px_cnt = 0;
        for(col = col_start; col < col_end; col++) {
            letter_px = (*map_p & bitmask) >> (8 - col_bit - g.bpp);

            /*subpx == 0*/
            if(subpx == false) {
                if(letter_px != 0) {
                    if(opa == LV_OPA_COVER) {
                        px_opa = g.bpp == 8 ? letter_px : bpp_opa_table[letter_px];
                    } else {
                        px_opa = g.bpp == 8 ? (uint16_t)((uint16_t)letter_px * opa) >> 8
                                : (uint16_t)((uint16_t)bpp_opa_table[letter_px] * opa) >> 8;
                    }

                    if(disp->driver.set_px_cb) {
                        disp->driver.set_px_cb(&disp->driver, (uint8_t *)vdb->buf_act, vdb_width,
                                (col + pos_x) - vdb->area.x1, (row + pos_y) - vdb->area.y1, color, px_opa);
                    } else if(vdb_buf_tmp->full != color.full) {
                        if(px_opa > LV_OPA_MAX) {
                            *vdb_buf_tmp = color;
                        } else if(px_opa > LV_OPA_MIN) {
                            if(scr_transp == false) {
                                *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, px_opa);
                            } else {
#if LV_COLOR_DEPTH == 32 && LV_COLOR_SCREEN_TRANSP
        *vdb_buf_tmp = color_mix_2_alpha(*vdb_buf_tmp, (*vdb_buf_tmp).ch.alpha, color, px_opa);
#endif
                            }
                        }
                    }
                }
                vdb_buf_tmp++;
            }
            /*Handle subpx drawing*/
            else {
                if(letter_px != 0) {
                    if(opa == LV_OPA_COVER) {
                        px_opa = g.bpp == 8 ? letter_px : bpp_opa_table[letter_px];
                    } else {
                        px_opa = g.bpp == 8 ? (uint16_t)((uint16_t)letter_px * opa) >> 8
                                : (uint16_t)((uint16_t)bpp_opa_table[letter_px] * opa) >> 8;
                    }

                    font_rgb[sub_px_cnt] = px_opa;
                } else {
                    font_rgb[sub_px_cnt] = 0;
                }
                sub_px_cnt ++;

                if(sub_px_cnt == 3) {
                    lv_color_t res_color;

                    if(font_rgb[0] == 0 && font_rgb[1] == 0 && font_rgb[2] == 0) {
                        res_color = *vdb_buf_tmp;
                    } else {

                        uint8_t bg_rgb[3] = {LV_COLOR_GET_R(*vdb_buf_tmp), LV_COLOR_GET_G(*vdb_buf_tmp), LV_COLOR_GET_B(*vdb_buf_tmp)};

#if LV_FONT_SUBPX_BGR
                        LV_COLOR_SET_B(res_color, (uint16_t)((uint16_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[2] * (255 - font_rgb[0]))) >> 8);
                        LV_COLOR_SET_R(res_color, (uint16_t)((uint16_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[0] * (255 - font_rgb[2]))) >> 8);
#else
                        LV_COLOR_SET_R(res_color, (uint16_t)((uint16_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[0] * (255 - font_rgb[0]))) >> 8);
                        LV_COLOR_SET_B(res_color, (uint16_t)((uint16_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[2] * (255 - font_rgb[2]))) >> 8);
#endif
                        LV_COLOR_SET_G(res_color, (uint16_t)((uint16_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8);
                    }
                    if(scr_transp == false) {
                        vdb_buf_tmp->full = res_color.full;
#if LV_COLOR_DEPTH == 32 && LV_COLOR_SCREEN_TRANSP
                    } else {
                        *vdb_buf_tmp = color_mix_2_alpha(*vdb_buf_tmp, (*vdb_buf_tmp).ch.alpha, color, px_opa);
#endif
                    }
                    sub_px_cnt = 0;
                    vdb_buf_tmp++;
                }
            }


            if(col_bit < 8 - g.bpp) {
                col_bit += g.bpp;
                bitmask = bitmask >> g.bpp;
            } else {
                col_bit = 0;
                bitmask = bitmask_init;
                map_p++;
            }
        }

        col_bit += ((g.box_w - col_end) + col_start) * g.bpp;

        map_p += (col_bit >> 3);
        col_bit = col_bit & 0x7;

        /*Next row in VDB*/
        if(subpx) vdb_buf_tmp += vdb_width - (col_end - col_start) / 3;
        else vdb_buf_tmp += vdb_width - (col_end - col_start);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movb %r9b, %al
movw %r8w, -0x2(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movb %al, -0x25(%rbp)
movw 0x12ca8(%rip), %ax      # 0x6bfb4
movw %ax, -0x27(%rbp)
movl 0x12ca0(%rip), %eax     # 0x6bfb6
movl %eax, -0x2b(%rbp)
movq 0x12ca0(%rip), %rax     # 0x6bfc0
movq %rax, -0x40(%rbp)
movq 0x12c9d(%rip), %rax     # 0x6bfc8
movq %rax, -0x38(%rbp)
movzbl -0x25(%rbp), %eax
cmpl $0x10, %eax
jge 0x5933d
jmp 0x59f23
movzbl -0x25(%rbp), %eax
cmpl $0xfb, %eax
jle 0x5934c
movb $-0x1, -0x25(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x59358
jmp 0x59f23
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq -0x48(%rbp), %rsi
xorl %ecx, %ecx
callq 0x415a0
andb $0x1, %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59381
jmp 0x59f23
movq -0x10(%rbp), %rax
movswl (%rax), %eax
movsbl -0x44(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x20(%rbp), %rcx
movzbl 0x10(%rcx), %ecx
movq -0x20(%rbp), %rdx
movzbl 0x11(%rdx), %edx
subl %edx, %ecx
addl %ecx, %eax
movzbl -0x45(%rbp), %ecx
subl %ecx, %eax
movsbl -0x43(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x4e(%rbp)
movzbl -0x42(%rbp), %eax
cmpl $0x3, %eax
jne 0x593cb
movb $0x4, -0x42(%rbp)
movzbl -0x42(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xc0(%rbp)
subl $0x7, %eax
ja 0x5942e
movq -0xc0(%rbp), %rax
leaq 0x12ba7(%rip), %rcx     # 0x6bf94
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x27(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $-0x80, -0x59(%rbp)
jmp 0x59433
leaq -0x2b(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $-0x40, -0x59(%rbp)
jmp 0x59433
leaq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $-0x10, -0x59(%rbp)
jmp 0x59433
movq $0x0, -0x58(%rbp)
movb $-0x1, -0x59(%rbp)
jmp 0x59433
jmp 0x59f23
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x41570
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x5944f
jmp 0x59f23
movswl -0x4c(%rbp), %eax
movzbl -0x46(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x5949a
movswl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jg 0x5949a
movswl -0x4e(%rbp), %eax
movzbl -0x45(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jl 0x5949a
movswl -0x4e(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jle 0x5949f
jmp 0x59f23
callq 0xafe0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xdbd0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
addq $0x1c, %rdi
callq 0x58d60
movw %ax, -0x7a(%rbp)
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movzbl -0x46(%rbp), %eax
sarl $0x3, %eax
movb %al, -0x8d(%rbp)
movzbl -0x46(%rbp), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0x594fc
movb -0x8d(%rbp), %al
addb $0x1, %al
movb %al, -0x8d(%rbp)
movzbl -0x46(%rbp), %eax
movzbl -0x42(%rbp), %ecx
imull %ecx, %eax
movw %ax, -0x90(%rbp)
movq -0x20(%rbp), %rax
movb 0x12(%rax), %al
andb $0x3, %al
movzbl %al, %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5964e
movswl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x59562
xorl %eax, %eax
movl %eax, -0xc4(%rbp)
jmp 0x59575
movq -0x18(%rbp), %rax
movswl (%rax), %eax
movswl -0x4c(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movw %ax, -0x94(%rbp)
movswl -0x4c(%rbp), %eax
movzbl -0x46(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jg 0x595a4
movzbl -0x46(%rbp), %eax
movl %eax, -0xc8(%rbp)
jmp 0x595bb
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %eax
movswl -0x4c(%rbp), %ecx
subl %ecx, %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movw %ax, -0x96(%rbp)
movswl -0x4e(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jl 0x595e2
xorl %eax, %eax
movl %eax, -0xcc(%rbp)
jmp 0x595f6
movq -0x18(%rbp), %rax
movswl 0x2(%rax), %eax
movswl -0x4e(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
movw %ax, -0x98(%rbp)
movswl -0x4e(%rbp), %eax
movzbl -0x45(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jg 0x59625
movzbl -0x45(%rbp), %eax
movl %eax, -0xd0(%rbp)
jmp 0x5963c
movq -0x18(%rbp), %rax
movswl 0x6(%rax), %eax
movswl -0x4e(%rbp), %ecx
subl %ecx, %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
movw %ax, -0x9a(%rbp)
jmp 0x5976a
movswl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x59667
xorl %eax, %eax
movl %eax, -0xd4(%rbp)
jmp 0x5967d
movq -0x18(%rbp), %rax
movswl (%rax), %eax
movswl -0x4c(%rbp), %ecx
subl %ecx, %eax
imull $0x3, %eax, %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movw %ax, -0x94(%rbp)
movswl -0x4c(%rbp), %eax
movl %eax, -0xd8(%rbp)
movzbl -0x46(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xd8(%rbp), %eax
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jg 0x596c2
movzbl -0x46(%rbp), %eax
movl %eax, -0xdc(%rbp)
jmp 0x596dc
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %eax
movswl -0x4c(%rbp), %ecx
subl %ecx, %eax
addl $0x1, %eax
imull $0x3, %eax, %eax
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %eax
movw %ax, -0x96(%rbp)
movswl -0x4e(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jl 0x59703
xorl %eax, %eax
movl %eax, -0xe0(%rbp)
jmp 0x59717
movq -0x18(%rbp), %rax
movswl 0x2(%rax), %eax
movswl -0x4e(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xe0(%rbp)
movl -0xe0(%rbp), %eax
movw %ax, -0x98(%rbp)
movswl -0x4e(%rbp), %eax
movzbl -0x45(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl 0x6(%rcx), %ecx
cmpl %ecx, %eax
jg 0x59746
movzbl -0x45(%rbp), %eax
movl %eax, -0xe4(%rbp)
jmp 0x5975d
movq -0x18(%rbp), %rax
movswl 0x6(%rax), %eax
movswl -0x4e(%rbp), %ecx
subl %ecx, %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movw %ax, -0x9a(%rbp)
movswl -0x4e(%rbp), %ecx
movq -0x78(%rbp), %rax
movswl 0x1e(%rax), %eax
subl %eax, %ecx
movswl -0x7a(%rbp), %eax
imull %eax, %ecx
movswl -0x4c(%rbp), %eax
addl %eax, %ecx
movq -0x78(%rbp), %rax
movswl 0x1c(%rax), %eax
subl %eax, %ecx
movq -0x88(%rbp), %rax
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
testb $0x1, -0x91(%rbp)
je 0x597e7
movswl -0x98(%rbp), %ecx
movswl -0x7a(%rbp), %eax
imull %eax, %ecx
movswl -0x94(%rbp), %eax
movl $0x3, %esi
cltd
idivl %esi
addl %eax, %ecx
movq -0x88(%rbp), %rax
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x59815
movswl -0x98(%rbp), %ecx
movswl -0x7a(%rbp), %eax
imull %eax, %ecx
movswl -0x94(%rbp), %eax
addl %eax, %ecx
movq -0x88(%rbp), %rax
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movswl -0x98(%rbp), %eax
movzwl -0x90(%rbp), %ecx
imull %ecx, %eax
movswl -0x94(%rbp), %ecx
movzbl -0x42(%rbp), %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %ecx
shrl $0x3, %ecx
movq -0x68(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movb $0x0, -0xa2(%rbp)
movl -0xa0(%rbp), %eax
andl $0x7, %eax
movw %ax, -0xa4(%rbp)
movb $0x0, -0xa5(%rbp)
movw -0x2(%rbp), %ax
shrw $0xb, %ax
movb %al, -0xab(%rbp)
movw -0x2(%rbp), %ax
shrw $0x5, %ax
andw $0x3f, %ax
movb %al, -0xaa(%rbp)
movw -0x2(%rbp), %ax
andw $0x1f, %ax
movb %al, -0xa9(%rbp)
movw -0x98(%rbp), %ax
movw %ax, -0x8c(%rbp)
movswl -0x8c(%rbp), %eax
movswl -0x9a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x59f23
movzbl -0x59(%rbp), %eax
movzwl -0xa4(%rbp), %ecx
sarl %cl, %eax
movb %al, -0x5a(%rbp)
movb $0x0, -0xac(%rbp)
movw -0x94(%rbp), %ax
movw %ax, -0x8a(%rbp)
movswl -0x8a(%rbp), %eax
movswl -0x96(%rbp), %ecx
cmpl %ecx, %eax
jge 0x59e47
movq -0x68(%rbp), %rax
movzbl (%rax), %eax
movzbl -0x5a(%rbp), %ecx
andl %ecx, %eax
movzwl -0xa4(%rbp), %edx
movl $0x8, %ecx
subl %edx, %ecx
movzbl -0x42(%rbp), %edx
subl %edx, %ecx
sarl %cl, %eax
movb %al, -0xa1(%rbp)
movb -0x91(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59b25
movzbl -0xa1(%rbp), %eax
cmpl $0x0, %eax
je 0x59b0e
movzbl -0x25(%rbp), %eax
cmpl $0xff, %eax
jne 0x59990
movzbl -0x42(%rbp), %eax
cmpl $0x8, %eax
jne 0x5996d
movzbl -0xa1(%rbp), %eax
movl %eax, -0xe8(%rbp)
jmp 0x59982
movq -0x58(%rbp), %rax
movzbl -0xa1(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
movb %al, -0xa2(%rbp)
jmp 0x599e9
movzbl -0x42(%rbp), %eax
cmpl $0x8, %eax
jne 0x599b8
movzbl -0xa1(%rbp), %eax
movzwl %ax, %eax
movzbl -0x25(%rbp), %ecx
imull %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movl %eax, -0xec(%rbp)
jmp 0x599dd
movq -0x58(%rbp), %rax
movzbl -0xa1(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movzwl %ax, %eax
movzbl -0x25(%rbp), %ecx
imull %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %eax
movb %al, -0xa2(%rbp)
movq -0x70(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x59a68
movq -0x70(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rcx
movq 0x10(%rcx), %rsi
movw -0x7a(%rbp), %dx
movswl -0x8a(%rbp), %ecx
movswl -0x4c(%rbp), %r8d
addl %r8d, %ecx
movq -0x78(%rbp), %r8
movswl 0x1c(%r8), %r8d
subl %r8d, %ecx
movswl -0x8c(%rbp), %r8d
movswl -0x4e(%rbp), %r9d
addl %r9d, %r8d
movq -0x78(%rbp), %r9
movswl 0x1e(%r9), %r9d
subl %r9d, %r8d
movb -0xa2(%rbp), %r10b
movswl %dx, %edx
movswl %cx, %ecx
movswl %r8w, %r8d
movzwl -0x2(%rbp), %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
callq *%rax
jmp 0x59b0c
movq -0x88(%rbp), %rax
movzwl (%rax), %eax
movzwl -0x2(%rbp), %ecx
cmpl %ecx, %eax
je 0x59b0a
movzbl -0xa2(%rbp), %eax
cmpl $0xfb, %eax
jle 0x59a9c
movq -0x88(%rbp), %rax
movw -0x2(%rbp), %cx
movw %cx, (%rax)
jmp 0x59b08
movzbl -0xa2(%rbp), %eax
cmpl $0x10, %eax
jle 0x59b06
movb -0xa5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59b02
movq -0x88(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x88(%rbp), %rcx
movb -0xa2(%rbp), %al
movw -0x2(%rbp), %dx
movzwl %dx, %edi
movzwl (%rcx), %esi
movzbl %al, %edx
callq 0x58d80
movw %ax, %cx
movq -0xf8(%rbp), %rax
movw %cx, -0xae(%rbp)
movw -0xae(%rbp), %cx
movw %cx, (%rax)
jmp 0x59b04
jmp 0x59b04
jmp 0x59b06
jmp 0x59b08
jmp 0x59b0a
jmp 0x59b0c
jmp 0x59b0e
movq -0x88(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x88(%rbp)
jmp 0x59dda
movzbl -0xa1(%rbp), %eax
cmpl $0x0, %eax
je 0x59bea
movzbl -0x25(%rbp), %eax
cmpl $0xff, %eax
jne 0x59b7b
movzbl -0x42(%rbp), %eax
cmpl $0x8, %eax
jne 0x59b58
movzbl -0xa1(%rbp), %eax
movl %eax, -0xfc(%rbp)
jmp 0x59b6d
movq -0x58(%rbp), %rax
movzbl -0xa1(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
movb %al, -0xa2(%rbp)
jmp 0x59bd4
movzbl -0x42(%rbp), %eax
cmpl $0x8, %eax
jne 0x59ba3
movzbl -0xa1(%rbp), %eax
movzwl %ax, %eax
movzbl -0x25(%rbp), %ecx
imull %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movl %eax, -0x100(%rbp)
jmp 0x59bc8
movq -0x58(%rbp), %rax
movzbl -0xa1(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movzwl %ax, %eax
movzbl -0x25(%rbp), %ecx
imull %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movl %eax, -0x100(%rbp)
movl -0x100(%rbp), %eax
movb %al, -0xa2(%rbp)
movb -0xa2(%rbp), %cl
movzbl -0xac(%rbp), %eax
movb %cl, -0xa8(%rbp,%rax)
jmp 0x59bf9
movzbl -0xac(%rbp), %eax
movb $0x0, -0xa8(%rbp,%rax)
movb -0xac(%rbp), %al
addb $0x1, %al
movb %al, -0xac(%rbp)
movzbl -0xac(%rbp), %eax
cmpl $0x3, %eax
jne 0x59dd8
movzbl -0xa8(%rbp), %eax
cmpl $0x0, %eax
jne 0x59c51
movzbl -0xa7(%rbp), %eax
cmpl $0x0, %eax
jne 0x59c51
movzbl -0xa6(%rbp), %eax
cmpl $0x0, %eax
jne 0x59c51
movq -0x88(%rbp), %rax
movw (%rax), %ax
movw %ax, -0xb0(%rbp)
jmp 0x59d9e
movq -0x88(%rbp), %rax
movw (%rax), %ax
shrw $0xb, %ax
movb %al, -0xb3(%rbp)
movq -0x88(%rbp), %rax
movw (%rax), %ax
shrw $0x5, %ax
andw $0x3f, %ax
movb %al, -0xb2(%rbp)
movq -0x88(%rbp), %rax
movw (%rax), %ax
andw $0x1f, %ax
movb %al, -0xb1(%rbp)
movzbl -0xab(%rbp), %eax
movzwl %ax, %eax
movzbl -0xa8(%rbp), %ecx
imull %ecx, %eax
movzbl -0xb3(%rbp), %ecx
movzbl -0xa8(%rbp), %esi
movl $0xff, %edx
subl %esi, %edx
imull %edx, %ecx
addl %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movzbl %al, %eax
andl $0x1f, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0xb0(%rbp), %ax
andw $0x1f, %cx
shlw $0xb, %cx
andw $0x7ff, %ax             # imm = 0x7FF
orw %cx, %ax
movw %ax, -0xb0(%rbp)
movzbl -0xa9(%rbp), %eax
movzwl %ax, %eax
movzbl -0xa6(%rbp), %ecx
imull %ecx, %eax
movzbl -0xb1(%rbp), %ecx
movzbl -0xa6(%rbp), %esi
movl $0xff, %edx
subl %esi, %edx
imull %edx, %ecx
addl %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
andl $0x1f, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0xb0(%rbp), %ax
andw $0x1f, %cx
andw $-0x20, %ax
orw %cx, %ax
movw %ax, -0xb0(%rbp)
movzbl -0xaa(%rbp), %eax
movzwl %ax, %eax
movzbl -0xa7(%rbp), %ecx
imull %ecx, %eax
movzbl -0xb2(%rbp), %ecx
movzbl -0xa7(%rbp), %esi
movl $0xff, %edx
subl %esi, %edx
imull %edx, %ecx
addl %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
andl $0x3f, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0xb0(%rbp), %ax
andw $0x3f, %cx
shlw $0x5, %cx
andw $0xf81f, %ax            # imm = 0xF81F
orw %cx, %ax
movw %ax, -0xb0(%rbp)
movb -0xa5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59dbf
movw -0xb0(%rbp), %cx
movq -0x88(%rbp), %rax
movw %cx, (%rax)
movb $0x0, -0xac(%rbp)
movq -0x88(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x88(%rbp)
jmp 0x59dda
movzwl -0xa4(%rbp), %eax
movzbl -0x42(%rbp), %edx
movl $0x8, %ecx
subl %edx, %ecx
cmpl %ecx, %eax
jge 0x59e13
movzbl -0x42(%rbp), %ecx
movzwl -0xa4(%rbp), %eax
addl %ecx, %eax
movw %ax, -0xa4(%rbp)
movzbl -0x5a(%rbp), %eax
movzbl -0x42(%rbp), %ecx
sarl %cl, %eax
movb %al, -0x5a(%rbp)
jmp 0x59e2e
movw $0x0, -0xa4(%rbp)
movb -0x59(%rbp), %al
movb %al, -0x5a(%rbp)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x59e30
movw -0x8a(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x8a(%rbp)
jmp 0x598e7
movzbl -0x46(%rbp), %ecx
movswl -0x96(%rbp), %eax
subl %eax, %ecx
movswl -0x94(%rbp), %eax
addl %eax, %ecx
movzbl -0x42(%rbp), %eax
imull %eax, %ecx
movzwl -0xa4(%rbp), %eax
addl %ecx, %eax
movw %ax, -0xa4(%rbp)
movzwl -0xa4(%rbp), %ecx
sarl $0x3, %ecx
movq -0x68(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movzwl -0xa4(%rbp), %eax
andl $0x7, %eax
movw %ax, -0xa4(%rbp)
testb $0x1, -0x91(%rbp)
je 0x59edd
movswl -0x7a(%rbp), %ecx
movswl -0x96(%rbp), %eax
movswl -0x94(%rbp), %edx
subl %edx, %eax
movl $0x3, %esi
cltd
idivl %esi
subl %eax, %ecx
movq -0x88(%rbp), %rax
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x59f0a
movswl -0x7a(%rbp), %ecx
movswl -0x96(%rbp), %eax
movswl -0x94(%rbp), %edx
subl %edx, %eax
subl %eax, %ecx
movq -0x88(%rbp), %rax
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x59f0c
movw -0x8c(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x8c(%rbp)
jmp 0x598ac
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax)