LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: fill_buffer_from_wstring
FT_INTERNAL
f_status fill_buffer_from_wstring(f_string_buffer_t *buffer, const wchar_t *str)
{
    assert(buffer);
    assert(str);

    wchar_t *copy = F_WCSDUP(str);
    if (copy == NULL)
        return FT_MEMORY_ERROR;

    F_FREE(buffer->str.data);
    buffer->str.wstr = copy;
    buffer->type = W_CHAR_BUF;

    return FT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x12452
testq %rsi, %rsi
je 0x12471
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x123aa
testq %rax, %rax
je 0x1244a
movq %rax, %r14
movq (%rbx), %rdi
callq *0xddfc(%rip)           # 0x20238
movq %r14, (%rbx)
movl $0x1, 0x10(%rbx)
xorl %eax, %eax
jmp 0x1244d
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x73dc(%rip), %rdi      # 0x19835
leaq 0x6616(%rip), %rsi      # 0x18a76
leaq 0x70f3(%rip), %rcx      # 0x1955a
movl $0x19a1, %edx           # imm = 0x19A1
callq 0x7120
leaq 0x701f(%rip), %rdi      # 0x19497
leaq 0x65f7(%rip), %rsi      # 0x18a76
leaq 0x70d4(%rip), %rcx      # 0x1955a
movl $0x19a2, %edx           # imm = 0x19A2
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: get_cell_impl
static
f_cell_t *get_cell_impl(f_row_t *row, size_t col, enum f_get_policy policy)
{
    if (row == NULL || row->cells == NULL) {
        return NULL;
    }

    switch (policy) {
        case DONT_CREATE_ON_NULL:
            if (col < columns_in_row(row)) {
                return VECTOR_AT(row->cells, col, f_cell_t *);
            }
            return NULL;
        case CREATE_ON_NULL:
            while (col >= columns_in_row(row)) {
                f_cell_t *new_cell = create_cell();
                if (new_cell == NULL)
                    return NULL;
                if (FT_IS_ERROR(vector_push(row->cells, &new_cell))) {
                    destroy_cell(new_cell);
                    return NULL;
                }
            }
            return VECTOR_AT(row->cells, col, f_cell_t *);
    }

    assert(0 && "Shouldn't be here!");
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x124c6
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0x12502
movq %rsi, %rbx
cmpl $0x1, %edx
jne 0x124c9
cmpq %rbx, (%rax)
jbe 0x12502
movq 0x8(%rax), %rcx
imulq 0x18(%rax), %rbx
movq (%rcx,%rbx), %rax
jmp 0x12504
xorl %eax, %eax
retq
leaq -0x20(%rbp), %r15
testq %rax, %rax
je 0x124d7
cmpq %rbx, (%rax)
ja 0x124b7
callq 0x122e3
movq %rax, -0x20(%rbp)
testq %rax, %rax
je 0x12502
movq (%r14), %rdi
movq %r15, %rsi
callq 0xec18
testl %eax, %eax
js 0x124f9
movq (%r14), %rax
jmp 0x124cd
movq -0x20(%rbp), %rdi
callq 0x12048
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: fill_buffer_from_u8string
FT_INTERNAL
f_status fill_buffer_from_u8string(f_string_buffer_t *buffer, const void *str)
{
    assert(buffer);
    assert(str);

    void *copy = F_UTF8DUP(str);
    if (copy == NULL)
        return FT_MEMORY_ERROR;

    F_FREE(buffer->str.u8str);
    buffer->str.u8str = copy;
    buffer->type = UTF8_BUF;

    return FT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x12552
testq %rsi, %rsi
je 0x12571
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xd5af
testq %rax, %rax
je 0x1254a
movq %rax, %r14
movq (%rbx), %rdi
callq *0xdcfc(%rip)           # 0x20238
movq %r14, (%rbx)
movl $0x2, 0x10(%rbx)
xorl %eax, %eax
jmp 0x1254d
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x72dc(%rip), %rdi      # 0x19835
leaq 0x6516(%rip), %rsi      # 0x18a76
leaq 0x70bc(%rip), %rcx      # 0x19623
movl $0x19b4, %edx           # imm = 0x19B4
callq 0x7120
leaq 0x6f1f(%rip), %rdi      # 0x19497
leaq 0x64f7(%rip), %rsi      # 0x18a76
leaq 0x709d(%rip), %rcx      # 0x19623
movl $0x19b5, %edx           # imm = 0x19B5
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: vector_reallocate_
static int vector_reallocate_(f_vector_t *vector, size_t new_capacity)
{
    assert(vector);
    assert(new_capacity > vector->m_capacity);

    size_t new_size = new_capacity * vector->m_item_size;
    vector->m_data = F_REALLOC(vector->m_data, new_size);
    if (vector->m_data == NULL)
        return -1;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpq %rsi, 0x10(%rdi)
jae 0x125c3
movq %rdi, %rbx
imulq 0x18(%rdi), %rsi
movq 0x8(%rdi), %rdi
callq *0xde22(%rip)           # 0x203d0
movq %rax, 0x8(%rbx)
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x71bc(%rip), %rdi      # 0x19786
leaq 0x64a5(%rip), %rsi      # 0x18a76
leaq 0x7181(%rip), %rcx      # 0x19759
movl $0x1c47, %edx           # imm = 0x1C47
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: ft_write_impl_
static int ft_write_impl_(ft_table_t *table, const f_string_view_t *cell_content)
{
    assert(table);
    f_string_buffer_t *buf = get_cur_str_buffer_and_create_if_not_exists(table);
    if (buf == NULL)
        return FT_GEN_ERROR;

    int status = FT_SUCCESS;
    switch (cell_content->type) {
        case CHAR_BUF:
            status = fill_buffer_from_string(buf, cell_content->u.cstr);
            break;
#ifdef FT_HAVE_WCHAR
        case W_CHAR_BUF:
            status = fill_buffer_from_wstring(buf, cell_content->u.wstr);
            break;
#endif
#ifdef FT_HAVE_UTF8
        case UTF8_BUF:
            status = fill_buffer_from_u8string(buf, cell_content->u.u8str);
            break;
#endif
        default:
            status = FT_GEN_ERROR;
    }
    if (FT_IS_SUCCESS(status)) {
        table->cur_col++;
    }
    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
callq 0x11bec
pushq $-0x4
popq %r14
testq %rax, %rax
je 0x126dd
movq %rax, %r12
movq 0x8(%rbx), %rax
movl 0x178(%rax), %eax
testl %eax, %eax
je 0x12679
cmpl $0x1, %eax
jne 0x1270e
cmpq $0x0, (%r12)
je 0x126dd
movq 0x20(%rbx), %rax
movq %rax, -0x30(%rbp)
callq 0x122e3
movq %rax, -0x38(%rbp)
testq %rax, %rax
je 0x1268f
movq %rax, %r13
movq (%r12), %rdi
leaq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xee34
testl %eax, %eax
js 0x12687
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq -0x30(%rbp), %rdx
imulq 0x18(%rax), %rdx
movq (%rcx,%rdx), %rax
jmp 0x12691
movq 0x20(%rbx), %rsi
movq %r12, %rdi
callq 0x121d5
jmp 0x12691
movq %r13, %rdi
callq 0x12048
xorl %eax, %eax
testq %rax, %rax
je 0x126dd
movq (%rax), %rdi
testq %rdi, %rdi
je 0x126ef
movl 0x8(%r15), %eax
cmpl $0x2, %eax
je 0x126c4
cmpl $0x1, %eax
je 0x126ba
testl %eax, %eax
jne 0x126dd
movq (%r15), %rsi
callq 0x1232c
jmp 0x126cc
movq (%r15), %rsi
callq 0x1240f
jmp 0x126cc
movq (%r15), %rsi
callq 0x1250f
testl %eax, %eax
js 0x126d9
incq 0x20(%rbx)
xorl %r14d, %r14d
jmp 0x126dd
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7135(%rip), %rdi      # 0x1982b
leaq 0x6379(%rip), %rsi      # 0x18a76
leaq 0x70f1(%rip), %rcx      # 0x197f5
movl $0xa01, %edx            # imm = 0xA01
callq 0x7120
leaq 0x638c(%rip), %rdi      # 0x18aa1
leaq 0x635a(%rip), %rsi      # 0x18a76
leaq 0x7085(%rip), %rcx      # 0x197a8
movl $0x1b51, %edx           # imm = 0x1B51
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: cell_vis_width
FT_INTERNAL
size_t cell_vis_width(const f_cell_t *cell, const f_context_t *context)
{
    /* todo:
     * At the moment min width includes paddings. Maybe it is better that min width weren't include
     * paddings but be min width of the cell content without padding
     */

    assert(cell);
    assert(context);

    f_table_properties_t *properties = context->table_properties;
    size_t row = context->row;
    size_t column = context->column;

    size_t padding_left = get_cell_property_hierarchically(properties, row, column, FT_CPROP_LEFT_PADDING);
    size_t padding_right = get_cell_property_hierarchically(properties, row, column, FT_CPROP_RIGHT_PADDING);
    size_t result = padding_left + padding_right;
    if (cell->str_buffer && cell->str_buffer->str.data) {
        result += buffer_text_visible_width(cell->str_buffer);
    }
    result = MAX(result, (size_t)get_cell_property_hierarchically(properties, row, column, FT_CPROP_MIN_WIDTH));
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, -0x30(%rbp)
testq %rsi, %rsi
je 0x13322
movq (%rsi), %rbx
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %r15
pushq $0x10
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x133f4
movslq %eax, %r13
pushq $0x20
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x133f4
movslq %eax, %r12
addq %r13, %r12
movq -0x30(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x132e4
cmpq $0x0, (%rdi)
je 0x132e4
callq 0x13756
addq %rax, %r12
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x133f4
cltq
cmpq %rax, %r12
ja 0x13310
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x133f4
movslq %eax, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x65de(%rip), %rdi      # 0x19907
leaq 0x5746(%rip), %rsi      # 0x18a76
leaq 0x6593(%rip), %rcx      # 0x198ca
movl $0x93f, %edx            # imm = 0x93F
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: hint_height_cell
FT_INTERNAL
size_t hint_height_cell(const f_cell_t *cell, const f_context_t *context)
{
    assert(cell);
    assert(context);
    f_table_properties_t *properties = context->table_properties;
    size_t row = context->row;
    size_t column = context->column;

    size_t padding_top = get_cell_property_hierarchically(properties, row, column, FT_CPROP_TOP_PADDING);
    size_t padding_bottom = get_cell_property_hierarchically(properties, row, column, FT_CPROP_BOTTOM_PADDING);
    size_t empty_string_height = get_cell_property_hierarchically(properties, row, column, FT_CPROP_EMPTY_STR_HEIGHT);

    size_t result = padding_top + padding_bottom;
    if (cell->str_buffer && cell->str_buffer->str.data) {
        size_t text_height = buffer_text_visible_height(cell->str_buffer);
        result += text_height == 0 ? empty_string_height : text_height;
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, -0x30(%rbp)
testq %rsi, %rsi
je 0x133d5
movq (%rsi), %r15
movq 0x8(%rsi), %r12
movq 0x10(%rsi), %r13
pushq $0x4
popq %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x133f4
movslq %eax, %rbx
pushq $0x8
popq %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x133f4
movslq %eax, %r14
addq %rbx, %r14
pushq $0x40
popq %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x133f4
movq -0x30(%rbp), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x133c3
cmpq $0x0, (%rdi)
je 0x133c3
movslq %eax, %rbx
callq 0x13cc9
testq %rax, %rax
cmovneq %rax, %rbx
addq %rbx, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x652b(%rip), %rdi      # 0x19907
leaq 0x5693(%rip), %rsi      # 0x18a76
leaq 0x6557(%rip), %rcx      # 0x19941
movl $0x970, %edx            # imm = 0x970
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: cell_invis_codes_width
FT_INTERNAL
size_t cell_invis_codes_width(const f_cell_t *cell, const f_context_t *context)
{
    assert(cell);
    assert(context);

    f_table_properties_t *properties = context->table_properties;
    size_t row = context->row;
    size_t column = context->column;

    size_t result = 0;
    char cell_style_tag[TEXT_STYLE_TAG_MAX_SIZE];
    get_style_tag_for_cell(properties, row, column, cell_style_tag, TEXT_STYLE_TAG_MAX_SIZE);
    result += strlen(cell_style_tag);

    char reset_cell_style_tag[TEXT_STYLE_TAG_MAX_SIZE];
    get_reset_style_tag_for_cell(properties, row, column, reset_cell_style_tag, TEXT_STYLE_TAG_MAX_SIZE);
    result += strlen(reset_cell_style_tag);

    char content_style_tag[TEXT_STYLE_TAG_MAX_SIZE];
    get_style_tag_for_content(properties, row, column, content_style_tag, TEXT_STYLE_TAG_MAX_SIZE);
    result += strlen(content_style_tag);

    char reset_content_style_tag[TEXT_STYLE_TAG_MAX_SIZE];
    get_reset_style_tag_for_content(properties, row, column, reset_content_style_tag, TEXT_STYLE_TAG_MAX_SIZE);
    result += strlen(reset_content_style_tag);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
testq %rdi, %rdi
je 0x13621
movq (%rdi), %rbx
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %r15
leaq -0x230(%rbp), %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x13dc4
movq %r12, %rdi
callq 0x70d0
movq %rax, %r13
leaq -0x1b0(%rbp), %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x13e7f
movq %r12, %rdi
callq 0x70d0
movq %rax, %r12
addq %r13, %r12
leaq -0x130(%rbp), %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x13f34
movq %r13, %rdi
callq 0x70d0
movq %rax, %r13
leaq -0xb0(%rbp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rcx, %rbx
callq 0x14036
movq %rbx, %rdi
callq 0x70d0
addq %r13, %rax
addq %r12, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x62df(%rip), %rdi      # 0x19907
leaq 0x5447(%rip), %rsi      # 0x18a76
leaq 0x63e1(%rip), %rcx      # 0x19a17
movl $0x953, %edx            # imm = 0x953
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: group_cell_number
FT_INTERNAL
size_t group_cell_number(const f_row_t *row, size_t master_cell_col)
{
    assert(row);
    const f_cell_t *master_cell = get_cell_c(row, master_cell_col);
    if (master_cell == NULL)
        return 0;

    if (get_cell_type(master_cell) != GROUP_MASTER_CELL)
        return 1;

    size_t total_cols = vector_size(row->cells);
    size_t slave_col = master_cell_col + 1;
    while (slave_col < total_cols) {
        const f_cell_t *cell = get_cell_c(row, slave_col);
        if (cell && get_cell_type(cell) == GROUP_SLAVE_CELL) {
            ++slave_col;
        } else {
            break;
        }
    }
    return slave_col - master_cell_col;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x136ae
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1326a
testq %rax, %rax
je 0x13699
cmpl $0x1, 0x8(%rax)
jne 0x1369e
movq (%r14), %rdi
callq 0xe77d
movq %rax, %r12
pushq $0x1
popq %rcx
movq %rcx, %r15
leaq (%rbx,%rcx), %rsi
cmpq %r12, %rsi
jae 0x136a2
movq %r14, %rdi
callq 0x1326a
testq %rax, %rax
je 0x136a2
leaq 0x1(%r15), %rcx
cmpl $0x2, 0x8(%rax)
je 0x13674
jmp 0x136a2
xorl %r15d, %r15d
jmp 0x136a2
pushq $0x1
popq %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5fb8(%rip), %rdi      # 0x1966d
leaq 0x53ba(%rip), %rsi      # 0x18a76
leaq 0x65fe(%rip), %rcx      # 0x19cc1
movl $0x1596, %edx           # imm = 0x1596
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: get_row_impl
static
f_row_t *get_row_impl(ft_table_t *table, size_t row, enum f_get_policy policy)
{
    if (table == NULL || table->rows == NULL) {
        return NULL;
    }

    switch (policy) {
        case DONT_CREATE_ON_NULL:
            if (row < vector_size(table->rows)) {
                return VECTOR_AT(table->rows, row, f_row_t *);
            }
            return NULL;
        case CREATE_ON_NULL:
            while (row >= vector_size(table->rows)) {
                f_row_t *new_row = create_row();
                if (new_row == NULL)
                    return NULL;
                if (FT_IS_ERROR(vector_push(table->rows, &new_row))) {
                    destroy_row(new_row);
                    return NULL;
                }
            }
            return VECTOR_AT(table->rows, row, f_row_t *);
    }

    assert(0 && "Shouldn't be here!");
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x13749
movq %rsi, %rbx
cmpl $0x1, %edx
jne 0x136fe
cmpq %rbx, (%rdi)
jbe 0x13749
movq 0x8(%rdi), %rax
imulq 0x18(%rdi), %rbx
movq (%rax,%rbx), %rax
jmp 0x1374b
leaq -0x20(%rbp), %r15
callq 0xe77d
cmpq %rbx, %rax
ja 0x1372e
callq 0x12074
movq %rax, -0x20(%rbp)
testq %rax, %rax
je 0x13749
movq (%r14), %rdi
movq %r15, %rsi
callq 0xec18
testl %eax, %eax
js 0x13740
movq (%r14), %rdi
jmp 0x13702
movq (%r14), %rax
movq 0x8(%rax), %rcx
imulq 0x18(%rax), %rbx
movq (%rcx,%rbx), %rax
jmp 0x1374b
movq -0x20(%rbp), %rdi
callq 0xe7a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: str_n_substring
FT_INTERNAL
void str_n_substring(const char *str, char ch_separator, size_t n, const char **begin, const char **end)
{
    const char *beg = str_n_substring_beg(str, ch_separator, n);
    if (beg == NULL) {
        *begin = NULL;
        *end = NULL;
        return;
    }

    const char *en = strchr(beg, ch_separator);
    if (en == NULL) {
        en = str + strlen(str);
    }

    *begin = beg;
    *end = en;
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
testq %rdi, %rdi
je 0x13919
movq %rsi, %r13
movq %rdi, %r12
movq %rdi, %r15
testq %rsi, %rsi
je 0x138fc
movq %rbx, -0x30(%rbp)
decq %r13
pushq $0xa
popq %rbx
xorl %r15d, %r15d
movq %r12, %rax
movq %rax, %rdi
movl %ebx, %esi
callq 0x70e0
subq $0x1, %r13
jb 0x138ed
testq %rax, %rax
je 0x13920
incq %rax
jmp 0x138d3
testq %rax, %rax
movq -0x30(%rbp), %rbx
je 0x13919
incq %rax
movq %rax, %r15
pushq $0xa
popq %rsi
movq %r15, %rdi
callq 0x70e0
testq %rax, %rax
jne 0x13926
movq %r12, %rdi
callq 0x70d0
addq %r12, %rax
jmp 0x13926
xorl %r15d, %r15d
xorl %eax, %eax
jmp 0x13926
xorl %eax, %eax
movq -0x30(%rbp), %rbx
movq %r15, (%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: wstr_n_substring
FT_INTERNAL
void wstr_n_substring(const wchar_t *str, wchar_t ch_separator, size_t n, const wchar_t **begin, const wchar_t **end)
{
    const wchar_t *beg = wstr_n_substring_beg(str, ch_separator, n);
    if (beg == NULL) {
        *begin = NULL;
        *end = NULL;
        return;
    }

    const wchar_t *en = wcschr(beg, ch_separator);
    if (en == NULL) {
        en = str + wcslen(str);
    }

    *begin = beg;
    *end = en;
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
testq %rdi, %rdi
je 0x139bb
movq %rsi, %r13
movq %rdi, %r12
movq %rdi, %r15
testq %rsi, %rsi
je 0x1399d
movq %rbx, -0x30(%rbp)
decq %r13
pushq $0xa
popq %rbx
xorl %r15d, %r15d
movq %r12, %rax
movq %rax, %rdi
movl %ebx, %esi
callq 0x7230
subq $0x1, %r13
jb 0x1398d
testq %rax, %rax
je 0x139c2
addq $0x4, %rax
jmp 0x13972
testq %rax, %rax
movq -0x30(%rbp), %rbx
je 0x139bb
addq $0x4, %rax
movq %rax, %r15
pushq $0xa
popq %rsi
movq %r15, %rdi
callq 0x7230
testq %rax, %rax
jne 0x139c8
movq %r12, %rdi
callq 0x7100
leaq (%r12,%rax,4), %rax
jmp 0x139c8
xorl %r15d, %r15d
xorl %eax, %eax
jmp 0x139c8
xorl %eax, %eax
movq -0x30(%rbp), %rbx
movq %r15, (%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: mk_wcswidth
FT_INTERNAL
int mk_wcswidth(const wchar_t *pwcs, size_t n)
{
    int width = 0;

    for (; *pwcs && n-- > 0; pwcs++) {
        int w;
        if ((w = mk_wcwidth(*pwcs)) < 0)
            return -1;
        else
            width += w;
    }

    return width;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0x1, %r9d
movl $0x2, %r10d
leaq 0x4b8f(%rip), %r11      # 0x18590
movl (%rdi), %ebx
testl %ebx, %ebx
je 0x13b5c
subq $0x1, %rsi
jb 0x13b5c
cmpl $0x20, %ebx
jl 0x13b59
leal -0x7f(%rbx), %eax
cmpl $0x21, %eax
jb 0x13b59
leal -0xe01f0(%rbx), %eax
cmpl $0xfff20110, %eax       # imm = 0xFFF20110
jae 0x13b20
movl %r9d, %eax
cmpl $0x1100, %ebx           # imm = 0x1100
jl 0x13b15
cmpl $0x1160, %ebx           # imm = 0x1160
setb %al
leal -0x2329(%rbx), %edx
cmpl $0x2, %edx
setb %dl
orb %al, %dl
movl %r10d, %eax
jne 0x13b15
leal -0x2e80(%rbx), %eax
cmpl $0x7650, %eax           # imm = 0x7650
setb %al
cmpl $0x303f, %ebx           # imm = 0x303F
setne %dl
andb %al, %dl
leal -0xac00(%rbx), %eax
cmpl $0x2ba4, %eax           # imm = 0x2BA4
setb %al
leal -0xf900(%rbx), %r14d
cmpl $0x200, %r14d           # imm = 0x200
setb %r14b
orb %al, %r14b
orb %dl, %r14b
leal -0xfe10(%rbx), %eax
cmpl $0xa, %eax
setb %al
leal -0xfe30(%rbx), %edx
cmpl $0x40, %edx
setb %dl
orb %al, %dl
leal -0xff00(%rbx), %eax
cmpl $0x61, %eax
setb %al
orb %dl, %al
orb %r14b, %al
leal -0xffe0(%rbx), %edx
cmpl $0x7, %edx
setb %dl
leal -0x20000(%rbx), %r14d
cmpl $0xfffe, %r14d          # imm = 0xFFFE
setb %r14b
orb %dl, %r14b
orb %al, %r14b
movl %r10d, %eax
testb $0x1, %r14b
jne 0x13b15
addl $0xfffd0000, %ebx       # imm = 0xFFFD0000
cmpl $0xfffe, %ebx           # imm = 0xFFFE
movl $0x0, %eax
adcl $0x1, %eax
addl %eax, %ecx
addq $0x4, %rdi
jmp 0x13a01
xorl %r14d, %r14d
movl $0x8d, %r15d
cmpl %r14d, %r15d
jl 0x13a3b
leal (%r14,%r15), %eax
cltd
idivl %r10d
movslq %eax, %rdx
cmpl %ebx, 0x4(%r11,%rdx,8)
jge 0x13b4b
incl %eax
movl %eax, %r14d
jmp 0x13b29
leal -0x1(%rdx), %r15d
xorl %eax, %eax
cmpl %ebx, (%r11,%rdx,8)
jg 0x13b29
jmp 0x13b15
movl %r8d, %ecx
movl %ecx, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: utf8_n_substring
FT_INTERNAL
void utf8_n_substring(const void *str, utf8_int32_t ch_separator, size_t n, const void **begin, const void **end)
{
    const char *beg = (const char *)utf8_n_substring_beg(str, ch_separator, n);
    if (beg == NULL) {
        *begin = NULL;
        *end = NULL;
        return;
    }

    const char *en = (const char *)utf8chr(beg, ch_separator);
    if (en == NULL) {
        en = (const char *)str + strlen((const char *)str);
    }

    *begin = beg;
    *end = en;
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
testq %rdi, %rdi
je 0x13bf1
movq %rsi, %r13
movq %rdi, %r12
movq %rdi, %r15
testq %rsi, %rsi
je 0x13bd4
movq %rbx, -0x30(%rbp)
decq %r13
pushq $0xa
popq %rbx
xorl %r15d, %r15d
movq %r12, %rdi
movl %ebx, %esi
callq 0xd3db
subq $0x1, %r13
jb 0x13bbb
testq %rax, %rax
je 0x13bf8
movq %rax, %rdi
callq 0x13cb2
movq %rax, %rdi
jmp 0x13b9c
testq %rax, %rax
movq -0x30(%rbp), %rbx
je 0x13bf1
movq %rax, %rdi
callq 0x13cb2
movq %rax, %r15
testq %rax, %rax
je 0x13bf1
pushq $0xa
popq %rsi
movq %r15, %rdi
callq 0xd3db
testq %rax, %rax
jne 0x13bfe
movq %r12, %rdi
callq 0x70d0
addq %r12, %rax
jmp 0x13bfe
xorl %r15d, %r15d
xorl %eax, %eax
jmp 0x13bfe
xorl %eax, %eax
movq -0x30(%rbp), %rbx
movq %r15, (%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: utf8_width
static
size_t utf8_width(const void *beg, const void *end)
{
    if (_custom_u8strwid) {
        size_t width = 0;
        if (!_custom_u8strwid(beg, end, &width))
            return width;
    }

    size_t sz = (size_t)((const char *)end - (const char *)beg);
    char *tmp = (char *)F_MALLOC(sizeof(char) * (sz + 1));
    // @todo: add check to tmp
    assert(tmp);

    memcpy(tmp, beg, sz);
    tmp[sz] = '\0';
    size_t result = utf8width(tmp);
    F_FREE(tmp);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0xdf56(%rip), %rax      # 0x21b80
testq %rax, %rax
je 0x13c43
leaq -0x20(%rbp), %rdx
andq $0x0, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x13c81
subq %r14, %rbx
leaq 0x1(%rbx), %rdi
callq *0xc778(%rip)           # 0x203c8
testq %rax, %rax
je 0x13c93
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x71e0
movb $0x0, (%r15,%rbx)
movq %r15, %rdi
callq 0xd8e4
movq %rax, %rbx
movq %r15, %rdi
callq *0xc5b9(%rip)           # 0x20238
jmp 0x13c85
movq -0x20(%rbp), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5c75(%rip), %rdi      # 0x1990f
leaq 0x4dd5(%rip), %rsi      # 0x18a76
leaq 0x5c6b(%rip), %rcx      # 0x19913
movl $0x19fa, %edx           # imm = 0x19FA
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: buffer_text_visible_height
FT_INTERNAL
size_t buffer_text_visible_height(const f_string_buffer_t *buffer)
{
    if (buffer == NULL || buffer->str.data == NULL || buf_str_len(buffer) == 0) {
        return 0;
    }
    if (buffer->type == CHAR_BUF)
        return 1 + strchr_count(buffer->str.cstr, '\n');
#ifdef FT_HAVE_WCHAR
    else if (buffer->type == W_CHAR_BUF)
        return 1 + wstrchr_count(buffer->str.wstr, L'\n');
#endif /* FT_HAVE_WCHAR */
#ifdef FT_HAVE_UTF8
    else if (buffer->type == UTF8_BUF)
        return 1 + utf8chr_count(buffer->str.u8str, '\n');
#endif /* FT_HAVE_WCHAR */

    assert(0);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x13d49
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x13d49
movl 0x10(%rdi), %r14d
cmpl $0x2, %r14d
je 0x13d0d
cmpl $0x1, %r14d
je 0x13d03
testl %r14d, %r14d
jne 0x13da5
movq %rbx, %rdi
callq 0x70d0
jmp 0x13d15
movq %rbx, %rdi
callq 0x7100
jmp 0x13d15
movq %rbx, %rdi
callq 0xd5f8
testq %rax, %rax
je 0x13d49
testl %r14d, %r14d
je 0x13d5a
cmpl $0x1, %r14d
jne 0x13d7d
pushq $0x1
popq %r14
pushq $0xa
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x7230
testq %rax, %rax
je 0x13d4c
movq %rax, %rbx
addq $0x4, %rbx
incq %r14
jmp 0x13d2d
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %r14
pushq $0xa
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x70e0
testq %rax, %rax
je 0x13d4c
movq %rax, %rbx
incq %rbx
incq %r14
jmp 0x13d62
pushq $0x1
popq %r14
pushq $0xa
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0xd3db
testq %rax, %rax
je 0x13d4c
movq %rax, %rdi
callq 0x13cb2
movq %rax, %rbx
incq %r14
jmp 0x13d85
leaq 0x558e(%rip), %rdi      # 0x1933a
leaq 0x4cc3(%rip), %rsi      # 0x18a76
leaq 0x5bc6(%rip), %rcx      # 0x19980
movl $0x1854, %edx           # imm = 0x1854
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: get_style_tag_for_cell
void get_style_tag_for_cell(const f_table_properties_t *props,
                            size_t row, size_t col, char *style_tag, size_t sz)
{
    (void)sz;
    size_t i = 0;

    unsigned bg_color_number = get_cell_property_hierarchically(props, row, col, FT_CPROP_CELL_BG_COLOR);
    unsigned text_style = get_cell_property_hierarchically(props, row, col, FT_CPROP_CELL_TEXT_STYLE);

    style_tag[0] = '\0';

    if (text_style < (1U << n_styles)) {
        for (i = 0; i < n_styles; ++i) {
            if (text_style & (1 << i)) {
                strcat(style_tag, text_styles[i]);
            }
        }
    } else {
        goto error;
    }

    if (bg_color_number < n_bg_colors) {
        strcat(style_tag, bg_colors[bg_color_number]);
    } else {
        goto error;
    }

    return;

error:
    /* shouldn't be here */
    assert(0);
    style_tag[0] = '\0';
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl $0x200, %ecx            # imm = 0x200
callq 0x133f4
movl %eax, %r14d
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x800, %ecx            # imm = 0x800
callq 0x133f4
movb $0x0, (%rbx)
cmpl $0xff, %eax
ja 0x13e60
movl %eax, %r15d
leaq 0xb82e(%rip), %r12      # 0x1f640
xorl %r13d, %r13d
cmpq $0x8, %r13
je 0x13e36
btl %r13d, %r15d
jae 0x13e2d
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x7250
incq %r13
addq $0x8, %r12
jmp 0x13e15
cmpl $0x10, %r14d
ja 0x13e60
movl %r14d, %eax
leaq 0xb83a(%rip), %rcx      # 0x1f680
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7250
leaq 0x54d3(%rip), %rdi      # 0x1933a
leaq 0x4c08(%rip), %rsi      # 0x18a76
leaq 0x5be7(%rip), %rcx      # 0x19a5c
movl $0x10f0, %edx           # imm = 0x10F0
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: get_reset_style_tag_for_cell
void get_reset_style_tag_for_cell(const f_table_properties_t *props,
                                  size_t row, size_t col, char *reset_style_tag, size_t sz)
{
    (void)sz;
    size_t i = 0;

    unsigned bg_color_number = get_cell_property_hierarchically(props, row, col, FT_CPROP_CELL_BG_COLOR);
    unsigned text_style = get_cell_property_hierarchically(props, row, col, FT_CPROP_CELL_TEXT_STYLE);

    reset_style_tag[0] = '\0';

    if (text_style < (1U << n_styles)) {
        for (i = 0; i < n_styles; ++i) {
            if (text_style & (1 << i)) {
                if (i != 0) // FT_TSTYLE_DEFAULT
                    goto reset_style;
            }
        }
    } else {
        goto error;
    }

    if (bg_color_number < n_bg_colors) {
        if (bg_color_number)
            goto reset_style;
    } else {
        goto error;
    }

    return;


reset_style:
    strcat(reset_style_tag, UNIVERSAL_RESET_TAG);
    return;

error:
    /* shouldn't be here */
    assert(0);
    reset_style_tag[0] = '\0';
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl $0x200, %ecx            # imm = 0x200
callq 0x133f4
movl %eax, %r14d
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x800, %ecx            # imm = 0x800
callq 0x133f4
movb $0x0, (%rbx)
cmpl $0xff, %eax
ja 0x13f15
xorl %ecx, %ecx
pushq $0x1
popq %rdx
cmpq $0x8, %rcx
je 0x13ee7
movl %edx, %esi
shll %cl, %esi
leaq 0x1(%rcx), %rdi
testq %rcx, %rcx
movq %rdi, %rcx
je 0x13ec8
movq %rdi, %rcx
andl %eax, %esi
je 0x13ec8
jmp 0x13ef2
cmpl $0x10, %r14d
ja 0x13f15
testl %r14d, %r14d
je 0x13f06
movq %rbx, %rdi
callq 0x70d0
movl $0x6d305b1b, (%rbx,%rax) # imm = 0x6D305B1B
movb $0x0, 0x4(%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x541e(%rip), %rdi      # 0x1933a
leaq 0x4b53(%rip), %rsi      # 0x18a76
leaq 0x5c17(%rip), %rcx      # 0x19b41
movl $0x111b, %edx           # imm = 0x111B
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: get_style_tag_for_content
void get_style_tag_for_content(const f_table_properties_t *props,
                               size_t row, size_t col, char *style_tag, size_t sz)
{
    (void)sz;
    size_t i = 0;

    unsigned text_style = get_cell_property_hierarchically(props, row, col, FT_CPROP_CONT_TEXT_STYLE);
    unsigned fg_color_number = get_cell_property_hierarchically(props, row, col, FT_CPROP_CONT_FG_COLOR);
    unsigned bg_color_number = get_cell_property_hierarchically(props, row, col, FT_CPROP_CONT_BG_COLOR);

    style_tag[0] = '\0';

    if (text_style < (1U << n_styles)) {
        for (i = 0; i < n_styles; ++i) {
            if (text_style & (1 << i)) {
                strcat(style_tag, text_styles[i]);
            }
        }
    } else {
        goto error;
    }

    if (fg_color_number < n_fg_colors) {
        if (fg_color_number)
            strcat(style_tag, fg_colors[fg_color_number]);
    } else {
        goto error;
    }

    if (bg_color_number < n_bg_colors) {
        strcat(style_tag, bg_colors[bg_color_number]);
    } else {
        goto error;
    }

    return;

error:
    /* shouldn't be here */
    assert(0);
    style_tag[0] = '\0';
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
movl $0x1000, %ecx           # imm = 0x1000
callq 0x133f4
movl %eax, %r12d
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x133f4
movl %eax, -0x30(%rbp)
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movl $0x400, %ecx            # imm = 0x400
callq 0x133f4
movb $0x0, (%rbx)
cmpl $0xff, %r12d
ja 0x14017
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %r14d
leaq 0xb69e(%rip), %r15      # 0x1f640
xorl %r13d, %r13d
cmpq $0x8, %r13
je 0x13fc5
btl %r13d, %r12d
jae 0x13fbc
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x7250
incq %r13
addq $0x8, %r15
jmp 0x13fa5
cmpl $0x10, %r14d
movl -0x2c(%rbp), %r15d
ja 0x14017
testl %r14d, %r14d
je 0x13fed
movl %r14d, %eax
leaq 0x4a22(%rip), %rcx      # 0x18a00
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rbx, %rdi
callq 0x7250
cmpl $0x10, %r15d
ja 0x14017
movl %r15d, %eax
leaq 0xb683(%rip), %rcx      # 0x1f680
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7250
leaq 0x531c(%rip), %rdi      # 0x1933a
leaq 0x4a51(%rip), %rsi      # 0x18a76
leaq 0x5b75(%rip), %rcx      # 0x19ba1
movl $0x1148, %edx           # imm = 0x1148
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: get_reset_style_tag_for_content
void get_reset_style_tag_for_content(const f_table_properties_t *props,
                                     size_t row, size_t col, char *reset_style_tag, size_t sz)
{
    (void)sz;
    size_t i = 0;
    size_t len = 0;

    unsigned text_style = get_cell_property_hierarchically(props, row, col, FT_CPROP_CONT_TEXT_STYLE);
    unsigned fg_color_number = get_cell_property_hierarchically(props, row, col, FT_CPROP_CONT_FG_COLOR);
    unsigned bg_color_number = get_cell_property_hierarchically(props, row, col, FT_CPROP_CONT_BG_COLOR);

    reset_style_tag[0] = '\0';

    if (text_style < (1U << n_styles)) {
        for (i = 0; i < n_styles; ++i) {
            if (text_style & (1 << i)) {
                if (i != 0) // FT_TSTYLE_DEFAULT
                    goto reset_style;
            }
        }
    } else {
        goto error;
    }

    if (fg_color_number < n_fg_colors) {
        if (fg_color_number)
            goto reset_style;
    } else {
        goto error;
    }

    if (bg_color_number < n_bg_colors) {
        if (bg_color_number)
            goto reset_style;
    } else {
        goto error;
    }

    return;


reset_style:
    strcat(reset_style_tag, UNIVERSAL_RESET_TAG);
    len = strlen(reset_style_tag);
    get_style_tag_for_cell(props, row, col, reset_style_tag + len, sz - len);
    return;

error:
    /* shouldn't be here */
    assert(0);
    reset_style_tag[0] = '\0';
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl $0x1000, %ecx           # imm = 0x1000
callq 0x133f4
movl %eax, %r13d
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x133f4
movl %eax, -0x2c(%rbp)
movq %r14, -0x38(%rbp)
movq %r14, %rdi
movq %r12, -0x40(%rbp)
movq %r12, %rsi
movq %r15, -0x48(%rbp)
movq %r15, %rdx
movl $0x400, %ecx            # imm = 0x400
callq 0x133f4
movl -0x2c(%rbp), %r14d
movb $0x0, (%rbx)
cmpl $0xff, %r13d
ja 0x14132
xorl %ecx, %ecx
pushq $0x1
popq %rdx
cmpq $0x8, %rcx
je 0x140ce
movl %edx, %esi
shll %cl, %esi
leaq 0x1(%rcx), %rdi
testq %rcx, %rcx
movq %rdi, %rcx
je 0x140ae
movq %rdi, %rcx
andl %r13d, %esi
je 0x140ae
jmp 0x140e2
cmpl $0x10, %r14d
ja 0x14132
testl %r14d, %r14d
jne 0x140e2
cmpl $0x10, %eax
ja 0x14132
testl %eax, %eax
je 0x14123
movq %rbx, %rdi
callq 0x70d0
movl $0x6d305b1b, (%rbx,%rax) # imm = 0x6D305B1B
movb $0x0, 0x4(%rbx,%rax)
movq %rbx, %rdi
callq 0x70d0
addq %rax, %rbx
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rcx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13dc4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5201(%rip), %rdi      # 0x1933a
leaq 0x4936(%rip), %rsi      # 0x18a76
leaq 0x5b17(%rip), %rcx      # 0x19c5e
movl $0x117e, %edx           # imm = 0x117E
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: get_row_cell_types
FT_INTERNAL
int get_row_cell_types(const f_row_t *row, enum f_cell_type *types, size_t types_sz)
{
    assert(row);
    assert(types);
    size_t i = 0;
    for (i = 0; i < types_sz; ++i) {
        const f_cell_t *cell = get_cell_c(row, i);
        if (cell) {
            types[i] = get_cell_type(cell);
        } else {
            types[i] = COMMON_CELL;
        }
    }
    return FT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0x1419b
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x14192
movq %r15, %rdi
movq %r12, %rsi
callq 0x1326a
testq %rax, %rax
je 0x14187
movl 0x8(%rax), %eax
jmp 0x14189
xorl %eax, %eax
movl %eax, (%r14,%r12,4)
incq %r12
jmp 0x1416d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5c8c(%rip), %rdi      # 0x19e2e
leaq 0x48cd(%rip), %rsi      # 0x18a76
leaq 0x5c3a(%rip), %rcx      # 0x19dea
movl $0x15b0, %edx           # imm = 0x15B0
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: custom_fort_calloc
static void *custom_fort_calloc(size_t nmemb, size_t size)
{
    size_t total_size = nmemb * size;
    void *result = F_MALLOC(total_size);
    if (result != NULL)
        memset(result, 0, total_size);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
imulq %rsi, %rbx
movq %rbx, %rdi
callq *0xc1f8(%rip)           # 0x203c8
testq %rax, %rax
je 0x141e8
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7130
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: custom_fort_realloc
static void *custom_fort_realloc(void *ptr, size_t size)
{
    if (ptr == NULL)
        return F_MALLOC(size);
    if (size == 0) {
        F_FREE(ptr);
        return NULL;
    }

    void *new_chunk = F_MALLOC(size);
    if (new_chunk == NULL)
        return NULL;

    /*
     * In theory we should copy MIN(size, size allocated for ptr) bytes,
     * but this is rather dummy implementation so we don't care about it
     */
    memcpy(new_chunk, ptr, size);
    F_FREE(ptr);
    return new_chunk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
testq %rdi, %rdi
je 0x14233
movq %rdi, %rbx
testq %r15, %r15
je 0x14246
movq %r15, %rdi
callq *0xc1b6(%rip)           # 0x203c8
testq %rax, %rax
je 0x1424f
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x71e0
movq %rbx, %rdi
callq *0xc007(%rip)           # 0x20238
jmp 0x14252
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0xc182(%rip)           # 0x203c8
movq %rbx, %rdi
callq *0xbfe9(%rip)           # 0x20238
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/neosploit[P]compiler/libfort/lib/fort.c
// Function: set_entire_table_property_internal
static f_status set_entire_table_property_internal(fort_entire_table_properties_t *properties, uint32_t property, int value)
{
    assert(properties);
    CHECK_NOT_NEGATIVE(value);
    if (PROP_IS_SET(property, FT_TPROP_LEFT_MARGIN)) {
        properties->left_margin = value;
    } else if (PROP_IS_SET(property, FT_TPROP_TOP_MARGIN)) {
        properties->top_margin = value;
    } else if (PROP_IS_SET(property, FT_TPROP_RIGHT_MARGIN)) {
        properties->right_margin = value;
    } else if (PROP_IS_SET(property, FT_TPROP_BOTTOM_MARGIN)) {
        properties->bottom_margin = value;
    } else if (PROP_IS_SET(property, FT_TPROP_ADDING_STRATEGY)) {
        properties->add_strategy = (enum ft_adding_strategy)value;
    } else {
        return FT_EINVAL;
    }
    return FT_SUCCESS;

fort_fail:
    return FT_EINVAL;
}

// Assembly:
testq %rdi, %rdi
je 0x1439b
pushq $-0x2
popq %rax
testl %edx, %edx
js 0x1439a
testb $0x1, %sil
jne 0x14396
testb $0x2, %sil
jne 0x14386
testb $0x4, %sil
jne 0x1438c
testb $0x8, %sil
jne 0x14392
testb $0x10, %sil
je 0x1439a
addq $0x10, %rdi
jmp 0x14396
addq $0x4, %rdi
jmp 0x14396
addq $0x8, %rdi
jmp 0x14396
addq $0xc, %rdi
movl %edx, (%rdi)
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x54dc(%rip), %rdi      # 0x19882
leaq 0x46c9(%rip), %rsi      # 0x18a76
leaq 0x5d2a(%rip), %rcx      # 0x1a0de
movl $0x1402, %edx           # imm = 0x1402
callq 0x7120
// File: /workspace/github_c_makefile_star2_O2/zpole[P]IICV/src/test_qsort-def.c
// Function: main
int
main (int argc VL_UNUSED, char ** argv VL_UNUSED)
{
  float values [] = {.4, 12.3, 44.0, 1.2, 3.4, 5.6} ;
  vl_size n = sizeof(values) / sizeof(values[0]) ;
  vl_uindex i ;

  for (i = 0 ; i < n ; ++i) printf("%5.2f ", values [i]) ;
  printf("\n") ;

  my_qsort_sort (values, n) ;

  for (i = 0 ; i < n ; ++i) printf("%5.2f ", values [i]) ;
  printf("\n") ;

  return 0 ;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movaps 0xeb6(%rip), %xmm0      # 0x2010
movaps %xmm0, (%rsp)
movabsq $0x40b333334059999a, %rax # imm = 0x40B333334059999A
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
leaq 0xeb1(%rip), %rbx       # 0x2028
cmpq $0x6, %r14
je 0x1192
cvtss2sd (%rsp,%r14,4), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x1040
incq %r14
jmp 0x1177
pushq $0xa
popq %rdi
callq 0x1030
xorl %r14d, %r14d
movq %rsp, %rdi
pushq $0x5
popq %rdx
xorl %esi, %esi
callq 0x11de
leaq 0xe77(%rip), %rbx       # 0x2028
cmpq $0x6, %r14
je 0x11cc
cvtss2sd (%rsp,%r14,4), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x1040
incq %r14
jmp 0x11b1
pushq $0xa
popq %rdi
callq 0x1030
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ryuichiueda[P]glueutils/src/rep.c
// Function: usage
void usage(void){
	fputs("rep: repeatedly excute the same command\n", stderr);
	fputs("usage: rep <num> <command> [args]\n", stderr);
	fputs("\nCopyright (C) 2021 Ryuichi Ueda\n", stderr);
	fputs("Released under the MIT License.\n", stderr);
	fputs("https://github.com/ryuichiueda/glueutils\n", stderr);
}

// Assembly:
pushq %rbx
movq 0x2e24(%rip), %rbx      # 0x3ff8
movq (%rbx), %rsi
leaq 0xe26(%rip), %rdi       # 0x2004
callq 0x1040
movq (%rbx), %rsi
leaq 0xe40(%rip), %rdi       # 0x202d
callq 0x1040
movq (%rbx), %rsi
leaq 0xe54(%rip), %rdi       # 0x2050
callq 0x1040
movq (%rbx), %rsi
leaq 0xe67(%rip), %rdi       # 0x2072
callq 0x1040
movq (%rbx), %rsi
leaq 0xe79(%rip), %rdi       # 0x2093
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/ryuichiueda[P]glueutils/src/rep.c
// Function: main
int main(int argc, char * argv[])
{
	if(argc < 3){
		usage();
		exit(1);
	}

	long rep = strtol(argv[1], NULL, 10);
	if(errno != 0){
		fprintf(stderr, "Error: %s\n", strerror(errno));
		exit(1);
	}

	int lasterror = 0;
	for(int i=0;i<rep;i++){
		int pid = fork();
		if(pid == 0){//child proc
			return -execvp(argv[2], &argv[2]);
		}

		int wstatus;
		int wpid;
		if((wpid = waitpid(pid, &wstatus, 0)) > 0){
			if(WIFEXITED(wstatus) && WEXITSTATUS(wstatus)){
				lasterror = WEXITSTATUS(wstatus);
			}
		}else{
			fprintf(stderr, "Error: waiting child error");
			exit(1);
		}
	}
	exit(lasterror);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jle 0x12e1
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
xorl %r14d, %r14d
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x1060
movq %rax, %r15
callq 0x1030
movl (%rax), %edi
testl %edi, %edi
jne 0x12e8
testq %r15, %r15
cmovleq %r14, %r15
leaq 0x4(%rsp), %r12
subq $0x1, %r15
jb 0x12b5
callq 0x10c0
testl %eax, %eax
je 0x1297
movl %eax, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1070
testl %eax, %eax
jle 0x12bd
movl 0x4(%rsp), %eax
movzbl %ah, %ecx
testl %ecx, %ecx
cmovel %r14d, %ecx
testb $0x7f, %al
cmovel %ecx, %r14d
jmp 0x1263
movq 0x10(%rbx), %rdi
addq $0x10, %rbx
movq %rbx, %rsi
callq 0x1080
negl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %r14d, %edi
callq 0x1090
movq 0x2d34(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xdfa(%rip), %rdi       # 0x20c8
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x10a0
pushq $0x1
popq %rdi
callq 0x1090
callq 0x11cc
jmp 0x12d9
movq 0x2d09(%rip), %rax      # 0x3ff8
movq (%rax), %rbx
callq 0x10b0
leaq 0xdbf(%rip), %rsi       # 0x20bd
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1050
jmp 0x12d9
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-embedimage.c
// Function: ngaLoadImage
CELL ngaLoadImage(char *imageFile) {
  FILE *fp;
  CELL imageSize;
  long fileLen;
  if ((fp = fopen(imageFile, "rb")) != NULL) {
    /* Determine length (in cells) */
    fseek(fp, 0, SEEK_END);
    fileLen = ftell(fp) / sizeof(CELL);
    rewind(fp);
    /* Read the file into memory */
    imageSize = fread(&memory, sizeof(CELL), fileLen, fp);
    fclose(fp);
  }
  else {
    printf("Unable to find the ngaImage!\n");
    exit(1);
  }
  return imageSize;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xe3d(%rip), %rsi       # 0x2004
callq 0x10a0
testq %rax, %rax
je 0x1223
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x1090
movq %rbx, %rdi
callq 0x1080
movq %rax, %r14
shrq $0x2, %r14
movq %rbx, %rdi
callq 0x1070
leaq 0x2e81(%rip), %rdi      # 0x4080
pushq $0x4
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1040
movq %rax, %r14
movq %rbx, %rdi
callq 0x1050
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xe3f(%rip), %rdi       # 0x2069
callq 0x1030
pushq $0x1
popq %rdi
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-embedimage.c
// Function: output_header
void output_header(int size) {
  printf("#include <stdint.h>\n");
  printf("#ifndef CELL\n");
  printf("#ifndef BIT64\n");
  printf("#define CELL int32_t\n");
  printf("#define CELL_MIN INT_MIN + 1\n");
  printf("#define CELL_MAX INT_MAX - 1\n");
  printf("#else\n");
  printf("#define CELL int64_t\n");
  printf("#define CELL_MIN LLONG_MIN + 1\n");
  printf("#define CELL_MAX LLONG_MAX - 1\n");
  printf("#endif\n");
  printf("#endif\n");
  printf("CELL ngaImageCells = %lld;\n", (long long)size);
  printf("CELL ngaImage[] = { ");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0xe42(%rip), %rdi       # 0x2086
callq 0x1030
leaq 0xe4a(%rip), %rdi       # 0x209a
callq 0x1030
leaq 0xe4b(%rip), %rdi       # 0x20a7
callq 0x1030
leaq 0xe4d(%rip), %rdi       # 0x20b5
callq 0x1030
leaq 0xe56(%rip), %rdi       # 0x20ca
callq 0x1030
leaq 0xe67(%rip), %rdi       # 0x20e7
callq 0x1030
leaq 0xe78(%rip), %rdi       # 0x2104
callq 0x1030
leaq 0xe72(%rip), %rdi       # 0x210a
callq 0x1030
leaq 0xe7b(%rip), %rdi       # 0x211f
callq 0x1030
leaq 0xe8e(%rip), %rdi       # 0x213e
callq 0x1030
leaq 0xea1(%rip), %r14       # 0x215d
movq %r14, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movslq %ebx, %rsi
leaq 0xd31(%rip), %rdi       # 0x2007
xorl %eax, %eax
callq 0x1060
leaq 0xd3f(%rip), %rdi       # 0x2023
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1060