// File: /workspace/github_c_makefile_star2_O2/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: store_conditional_format_object
lxw_error
_store_conditional_format_object(lxw_worksheet *self,
                                 lxw_cond_format_obj *cond_format)
{
    lxw_cond_format_hash_element tmp_hash_element;
    lxw_cond_format_hash_element *found_hash_element = NULL;
    lxw_cond_format_hash_element *new_hash_element = NULL;

    /* Create a temp hash element to do the lookup. */
    LXW_ATTRIBUTE_COPY(tmp_hash_element.sqref, cond_format->sqref);
    found_hash_element = RB_FIND(lxw_cond_format_hash,
                                 self->conditional_formats,
                                 &tmp_hash_element);

    if (found_hash_element) {
        /* If the RB element exists then add the conditional format to the
         * list for the sqref range.*/
        STAILQ_INSERT_TAIL(found_hash_element->cond_formats, cond_format,
                           list_pointers);
    }
    else {
        /* Create a new RB hash element. */
        new_hash_element = calloc(1, sizeof(lxw_cond_format_hash_element));
        GOTO_LABEL_ON_MEM_ERROR(new_hash_element, mem_error);

        /* Use the sqref as the key. */
        LXW_ATTRIBUTE_COPY(new_hash_element->sqref, cond_format->sqref);

        /* Also create the list where we store the cond format objects. */
        new_hash_element->cond_formats =
            calloc(1, sizeof(struct lxw_cond_format_list));
        GOTO_LABEL_ON_MEM_ERROR(new_hash_element->cond_formats, mem_error);

        /* Initialize the list and add the conditional format object. */
        STAILQ_INIT(new_hash_element->cond_formats);
        STAILQ_INSERT_TAIL(new_hash_element->cond_formats, cond_format,
                           list_pointers);

        /* Now insert the RB hash element into the tree. */
        RB_INSERT(lxw_cond_format_hash, self->conditional_formats,
                  new_hash_element);

    }

    return LXW_NO_ERROR;

mem_error:
    free(new_hash_element);
    return LXW_ERROR_MEMORY_MALLOC_FAILED;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x850, %rsp            # imm = 0x850
movq %rsi, %r14
movq %rdi, %r12
leaq 0x9e(%rsi), %r15
leaq 0x8(%rsp), %rbx
movl $0x81f, %edx            # imm = 0x81F
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc190
movb $0x0, 0x81f(%rbx)
movq 0x58(%r12), %r13
movq %r13, %r12
movq (%r12), %r12
testq %r12, %r12
je 0x2f994
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc860
movl $0x828, %ecx            # imm = 0x828
testl %eax, %eax
js 0x2f98f
movl $0x830, %ecx            # imm = 0x830
je 0x2fa4a
addq %rcx, %r12
jmp 0x2f967
pushq $0x1
popq %rdi
movl $0x848, %esi            # imm = 0x848
callq 0xc850
movq %rax, %rbx
testq %rax, %rax
je 0x2fd1a
movl $0x81f, %edx            # imm = 0x81F
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc190
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0xc850
movq %rax, 0x820(%rbx)
testq %rax, %rax
je 0x2fd21
leaq 0x8c0(%r14), %rcx
andq $0x0, 0x8c0(%r14)
movq %r14, (%rax)
movq %rcx, 0x8(%rax)
xorl %ecx, %ecx
movq %r13, %rdx
xorl %eax, %eax
movq (%rdx), %r14
testq %r14, %r14
je 0x2fa24
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc860
movl $0x828, %edx            # imm = 0x828
testl %eax, %eax
js 0x2fa1c
movl $0x830, %edx            # imm = 0x830
je 0x2fd07
addq %r14, %rdx
movq %r14, %rcx
jmp 0x2f9f5
movq %rcx, 0x838(%rbx)
movl $0x1, 0x840(%rbx)
movq %r13, %rdx
testq %rcx, %rcx
je 0x2fa80
testl %eax, %eax
js 0x2fa79
leaq 0x830(%rcx), %rdx
jmp 0x2fa80
andq $0x0, 0x8c0(%r14)
leaq 0x8c0(%r14), %rax
movq 0x820(%r12), %rcx
movq 0x8(%rcx), %rcx
movq %r14, (%rcx)
movq 0x820(%r12), %rcx
movq %rax, 0x8(%rcx)
jmp 0x2fd07
leaq 0x828(%rcx), %rdx
movq %rbx, (%rdx)
testq %rcx, %rcx
je 0x2fcfc
cmpl $0x1, 0x840(%rcx)
jne 0x2fcfc
movq 0x838(%rcx), %rax
movq 0x828(%rax), %rdx
cmpq %rdx, %rcx
je 0x2fada
testq %rdx, %rdx
je 0x2fac3
cmpl $0x1, 0x840(%rdx)
jne 0x2fac3
andl $0x0, 0x840(%rdx)
jmp 0x2faf6
movq 0x828(%rcx), %rdx
cmpq %rbx, %rdx
je 0x2fb26
movq %rcx, %rdx
movq %rbx, %rcx
jmp 0x2fbd0
movq 0x830(%rax), %rsi
testq %rsi, %rsi
je 0x2fb0f
cmpl $0x1, 0x840(%rsi)
jne 0x2fb0f
andl $0x0, 0x840(%rsi)
andl $0x0, 0x840(%rcx)
movl $0x1, 0x840(%rax)
movq %rax, %rcx
jmp 0x2fced
movq 0x830(%rcx), %rsi
cmpq %rbx, %rsi
je 0x2fb58
movq %rcx, %rsi
movq %rbx, %rcx
jmp 0x2fc82
movq 0x830(%rdx), %rsi
movq %rsi, 0x828(%rcx)
testq %rsi, %rsi
je 0x2fb95
movq %rcx, 0x838(%rsi)
movq 0x838(%rcx), %rsi
movq %rsi, 0x838(%rdx)
movq %r13, %rdi
testq %rsi, %rsi
jne 0x2fba3
jmp 0x2fbbc
movq 0x828(%rsi), %rdx
movq %rdx, 0x830(%rcx)
testq %rdx, %rdx
je 0x2fc40
movq %rcx, 0x838(%rdx)
movq 0x838(%rcx), %rdx
movq %rdx, 0x838(%rsi)
movq %r13, %rdi
testq %rdx, %rdx
jne 0x2fc4e
jmp 0x2fc67
movq %rax, 0x838(%rdx)
movq 0x838(%rcx), %rsi
leaq 0x828(%rsi), %r8
leaq 0x830(%rsi), %rdi
cmpq 0x828(%rsi), %rcx
cmoveq %r8, %rdi
movq %rdx, (%rdi)
movq %rcx, 0x830(%rdx)
movq %rdx, 0x838(%rcx)
movq %rbx, %rdx
andl $0x0, 0x840(%rdx)
movl $0x1, 0x840(%rax)
movq 0x830(%rax), %rdx
movq 0x828(%rdx), %rsi
movq %rsi, 0x830(%rax)
testq %rsi, %rsi
je 0x2fc02
movq %rax, 0x838(%rsi)
movq 0x838(%rax), %rdi
movq %rdi, 0x838(%rdx)
movq %r13, %rsi
testq %rdi, %rdi
je 0x2fc31
leaq 0x828(%rdi), %r8
leaq 0x830(%rdi), %rsi
cmpq 0x828(%rdi), %rax
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rax, 0x828(%rdx)
jmp 0x2fce6
movq %rax, 0x838(%rsi)
movq 0x838(%rcx), %rdx
leaq 0x828(%rdx), %r8
leaq 0x830(%rdx), %rdi
cmpq 0x828(%rdx), %rcx
cmoveq %r8, %rdi
movq %rsi, (%rdi)
movq %rcx, 0x828(%rsi)
movq %rsi, 0x838(%rcx)
movq 0x828(%rax), %rdx
movq %rbx, %rsi
andl $0x0, 0x840(%rsi)
movl $0x1, 0x840(%rax)
movq 0x830(%rdx), %rsi
movq %rsi, 0x828(%rax)
testq %rsi, %rsi
je 0x2fcad
movq %rax, 0x838(%rsi)
movq 0x838(%rax), %rdi
movq %rdi, 0x838(%rdx)
movq %r13, %rsi
testq %rdi, %rdi
je 0x2fcdc
leaq 0x828(%rdi), %r8
leaq 0x830(%rdi), %rsi
cmpq 0x828(%rdi), %rax
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rax, 0x830(%rdx)
movq %rdx, 0x838(%rax)
movq %rcx, %rbx
movq 0x838(%rcx), %rcx
jmp 0x2fa83
movq (%r13), %rax
andl $0x0, 0x840(%rax)
xorl %eax, %eax
addq $0x850, %rsp            # imm = 0x850
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x10de, %ecx           # imm = 0x10DE
jmp 0x2fd26
movl $0x10e6, %ecx           # imm = 0x10E6
movq 0x232cb(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0xd3a9(%rip), %rsi      # 0x3d0e0
leaq 0x13ca2(%rip), %rdx     # 0x439e0
xorl %eax, %eax
callq 0xc8d0
movq %rbx, %rdi
callq 0xc0d0
pushq $0x1
popq %rax
jmp 0x2fd09