// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x1a550
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x1a550
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x400, %ecx            # imm = 0x400
callq 0x1a550
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
cmpl $0x100, -0x3c(%rbp)     # imm = 0x100
jae 0x1bf6a
movq $0x0, -0x30(%rbp)
cmpq $0x8, -0x30(%rbp)
jae 0x1bf68
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x1bf58
cmpq $0x0, -0x30(%rbp)
je 0x1bf56
jmp 0x1bf98
jmp 0x1bf58
jmp 0x1bf5a
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1bf2f
jmp 0x1bf6c
jmp 0x1bfd8
movl -0x40(%rbp), %eax
cmpq $0x11, %rax
jae 0x1bf7f
cmpl $0x0, -0x40(%rbp)
je 0x1bf7d
jmp 0x1bf98
jmp 0x1bf81
jmp 0x1bfd8
movl -0x44(%rbp), %eax
cmpq $0x11, %rax
jae 0x1bf94
cmpl $0x0, -0x44(%rbp)
je 0x1bf92
jmp 0x1bf98
jmp 0x1bf96
jmp 0x1bfd8
jmp 0x1bff7
movq -0x20(%rbp), %rdi
leaq 0x605f(%rip), %rsi      # 0x22002
callq 0x7240
movq -0x20(%rbp), %rdi
callq 0x70d0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq -0x38(%rbp), %rcx
movq -0x28(%rbp), %r8
subq -0x38(%rbp), %r8
callq 0x1bb40
jmp 0x1bff7
leaq 0x749f(%rip), %rdi      # 0x2347e
leaq 0x6bb0(%rip), %rsi      # 0x22b96
movl $0x117e, %edx           # imm = 0x117E
leaq 0x8017(%rip), %rcx      # 0x24009
callq 0x7120
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)