// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: worksheet_write_cf_rule_text
STATIC void
_worksheet_write_cf_rule_text(lxw_worksheet *self,
                              lxw_cond_format_obj *cond_format)
{
    struct xml_attribute_list attributes;
    struct xml_attribute *attribute;
    uint8_t pos;
    char formula[LXW_ATTR_32 * 2];
    char *operators[] = {
        "containsText",
        "notContains",
        "beginsWith",
        "endsWith",
    };
    uint8_t criteria = cond_format->criteria;

    LXW_INIT_ATTRIBUTES();

    if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_CONTAINING)
        LXW_PUSH_ATTRIBUTES_STR("type", "containsText");
    else if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_NOT_CONTAINING)
        LXW_PUSH_ATTRIBUTES_STR("type", "notContainsText");
    else if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_BEGINS_WITH)
        LXW_PUSH_ATTRIBUTES_STR("type", "beginsWith");
    else if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_ENDS_WITH)
        LXW_PUSH_ATTRIBUTES_STR("type", "endsWith");

    if (cond_format->dxf_index != LXW_PROPERTY_UNSET)
        LXW_PUSH_ATTRIBUTES_INT("dxfId", cond_format->dxf_index);

    LXW_PUSH_ATTRIBUTES_INT("priority", cond_format->dxf_priority);

    if (cond_format->stop_if_true)
        LXW_PUSH_ATTRIBUTES_INT("stopIfTrue", 1);

    pos = criteria - LXW_CONDITIONAL_CRITERIA_TEXT_CONTAINING;
    LXW_PUSH_ATTRIBUTES_STR("operator", operators[pos]);

    LXW_PUSH_ATTRIBUTES_STR("text", cond_format->min_value_string);

    lxw_xml_start_tag(self->file, "cfRule", &attributes);

    if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_CONTAINING) {
        lxw_snprintf(formula, LXW_ATTR_32 * 2,
                     "NOT(ISERROR(SEARCH(\"%s\",%s)))",
                     cond_format->min_value_string, cond_format->first_cell);
        _worksheet_write_formula_str(self, formula);
    }
    else if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_NOT_CONTAINING) {
        lxw_snprintf(formula, LXW_ATTR_32 * 2,
                     "ISERROR(SEARCH(\"%s\",%s))",
                     cond_format->min_value_string, cond_format->first_cell);
        _worksheet_write_formula_str(self, formula);
    }
    else if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_BEGINS_WITH) {
        lxw_snprintf(formula, LXW_ATTR_32 * 2,
                     "LEFT(%s,%d)=\"%s\"",
                     cond_format->first_cell,
                     (uint16_t) strlen(cond_format->min_value_string),
                     cond_format->min_value_string);
        _worksheet_write_formula_str(self, formula);
    }
    else if (criteria == LXW_CONDITIONAL_CRITERIA_TEXT_ENDS_WITH) {
        lxw_snprintf(formula, LXW_ATTR_32 * 2,
                     "RIGHT(%s,%d)=\"%s\"",
                     cond_format->first_cell,
                     (uint16_t) strlen(cond_format->min_value_string),
                     cond_format->min_value_string);
        _worksheet_write_formula_str(self, formula);
    }

    lxw_xml_end_tag(self->file, "cfRule");

    LXW_FREE_ATTRIBUTES();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x1dc36(%rip), %rax     # 0x7ccf0
movq %rax, -0x90(%rbp)
movq 0x1dc30(%rip), %rax     # 0x7ccf8
movq %rax, -0x88(%rbp)
movq 0x1dc2a(%rip), %rax     # 0x7cd00
movq %rax, -0x80(%rbp)
movq 0x1dc27(%rip), %rax     # 0x7cd08
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movb 0x1(%rax), %al
movb %al, -0x91(%rbp)
movq $0x0, -0x20(%rbp)
leaq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movzbl -0x91(%rbp), %eax
cmpl $0x9, %eax
jne 0x5f156
jmp 0x5f110
leaq 0x9299(%rip), %rdi      # 0x683b0
leaq 0xecb4(%rip), %rsi      # 0x6ddd2
callq 0xc030
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f151
jmp 0x5f252
movzbl -0x91(%rbp), %eax
cmpl $0xa, %eax
jne 0x5f1aa
jmp 0x5f164
leaq 0x9245(%rip), %rdi      # 0x683b0
leaq 0xf606(%rip), %rsi      # 0x6e778
callq 0xc030
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f1a5
jmp 0x5f250
movzbl -0x91(%rbp), %eax
cmpl $0xb, %eax
jne 0x5f1fb
jmp 0x5f1b8
leaq 0x91f1(%rip), %rdi      # 0x683b0
leaq 0xf59e(%rip), %rsi      # 0x6e764
callq 0xc030
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f1f9
jmp 0x5f24e
movzbl -0x91(%rbp), %eax
cmpl $0xc, %eax
jne 0x5f24c
jmp 0x5f209
leaq 0x91a0(%rip), %rdi      # 0x683b0
leaq 0xf558(%rip), %rsi      # 0x6e76f
callq 0xc030
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f24a
jmp 0x5f24c
jmp 0x5f24e
jmp 0x5f250
jmp 0x5f252
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x88(%rax)
je 0x5f2a8
jmp 0x5f261
movq -0x10(%rbp), %rax
movslq 0x88(%rax), %rsi
leaq 0xf4c3(%rip), %rdi      # 0x6e736
callq 0xc1b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f2a6
jmp 0x5f2a8
jmp 0x5f2aa
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, %esi
leaq 0xf47f(%rip), %rdi      # 0x6e73c
callq 0xc1b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f2f0
movq -0x10(%rbp), %rax
cmpb $0x0, 0x73(%rax)
je 0x5f33d
jmp 0x5f2fc
leaq 0xf442(%rip), %rdi      # 0x6e745
movl $0x1, %esi
callq 0xc1b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f33b
jmp 0x5f33d
movzbl -0x91(%rbp), %eax
subl $0x9, %eax
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movq -0x90(%rbp,%rax,8), %rsi
leaq 0xf35c(%rip), %rdi      # 0x6e6b9
callq 0xc030
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f390
jmp 0x5f392
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x891f(%rip), %rdi      # 0x67cc0
callq 0xc030
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x18(%rbp)
jmp 0x5f3d4
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0xfb4f(%rip), %rsi      # 0x6ef31
leaq -0x20(%rbp), %rdx
callq 0xc390
movzbl -0x91(%rbp), %eax
cmpl $0x9, %eax
jne 0x5f433
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %r8
addq $0x90, %r8
movl $0x40, %esi
leaq 0xf36e(%rip), %rdx      # 0x6e788
movb $0x0, %al
callq 0xc5d0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x60da0
jmp 0x5f561
movzbl -0x91(%rbp), %eax
cmpl $0xa, %eax
jne 0x5f47b
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %r8
addq $0x90, %r8
movl $0x40, %esi
leaq 0xf344(%rip), %rdx      # 0x6e7a6
movb $0x0, %al
callq 0xc5d0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x60da0
jmp 0x5f55f
movzbl -0x91(%rbp), %eax
cmpl $0xb, %eax
jne 0x5f4ec
leaq -0x70(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
addq $0x90, %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc4e0
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rcx
movzwl %ax, %r8d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %r9
movl $0x40, %esi
leaq 0xf2e9(%rip), %rdx      # 0x6e7bf
movb $0x0, %al
callq 0xc5d0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x60da0
jmp 0x5f55d
movzbl -0x91(%rbp), %eax
cmpl $0xc, %eax
jne 0x5f55b
leaq -0x70(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
addq $0x90, %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc4e0
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rcx
movzwl %ax, %r8d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %r9
movl $0x40, %esi
leaq 0xf289(%rip), %rdx      # 0x6e7d0
movb $0x0, %al
callq 0xc5d0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x60da0
jmp 0x5f55d
jmp 0x5f55f
jmp 0x5f561
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0xf9c2(%rip), %rsi      # 0x6ef31
callq 0xc060
jmp 0x5f576
cmpq $0x0, -0x20(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5f586
jmp 0x5f5b8
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x1040(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x5f5ab
leaq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x5f5ad
movq -0x28(%rbp), %rdi
callq 0xc0d0
jmp 0x5f576
jmp 0x5f5ba
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)