// File: /workspace/github_c_makefile_star2_O2/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: worksheet_merge_range
lxw_error
worksheet_merge_range(lxw_worksheet *self, lxw_row_t first_row,
                      lxw_col_t first_col, lxw_row_t last_row,
                      lxw_col_t last_col, const char *string,
                      lxw_format *format)
{
    lxw_merged_range *merged_range;
    lxw_row_t tmp_row;
    lxw_col_t tmp_col;
    lxw_error err;

    /* Excel doesn't allow a single cell to be merged */
    if (first_row == last_row && first_col == last_col)
        return LXW_ERROR_PARAMETER_VALIDATION;

    /* Swap last row/col with first row/col as necessary */
    if (first_row > last_row) {
        tmp_row = last_row;
        last_row = first_row;
        first_row = tmp_row;
    }
    if (first_col > last_col) {
        tmp_col = last_col;
        last_col = first_col;
        first_col = tmp_col;
    }

    /* Check that column number is valid and store the max value */
    err = _check_dimensions(self, last_row, last_col, LXW_FALSE, LXW_FALSE);
    if (err)
        return err;

    /* Store the merge range. */
    merged_range = calloc(1, sizeof(lxw_merged_range));
    RETURN_ON_MEM_ERROR(merged_range, LXW_ERROR_MEMORY_MALLOC_FAILED);

    merged_range->first_row = first_row;
    merged_range->first_col = first_col;
    merged_range->last_row = last_row;
    merged_range->last_col = last_col;

    STAILQ_INSERT_TAIL(self->merged_ranges, merged_range, list_pointers);
    self->merged_range_count++;

    /* Write the first cell */
    worksheet_write_string(self, first_row, first_col, string, format);

    /* Pad out the rest of the area with formatted blank cells. */
    for (tmp_row = first_row; tmp_row <= last_row; tmp_row++) {
        for (tmp_col = first_col; tmp_col <= last_col; tmp_col++) {
            if (tmp_row == first_row && tmp_col == first_col)
                continue;

            worksheet_write_blank(self, tmp_row, tmp_col, format);
        }
    }

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r13d
movl %ecx, %ebx
cmpl %ecx, %esi
sete %al
cmpw %r13w, %dx
sete %cl
testb %cl, %al
je 0x3824f
pushq $0xd
popq %rax
jmp 0x38333
movq %r9, %r15
movq %rdi, %r14
cmpl %ebx, %esi
movl %ebx, %r12d
cmoval %esi, %r12d
cmovbl %esi, %ebx
cmpw %r13w, %dx
movl %r13d, %ebp
cmoval %edx, %ebp
cmovbl %edx, %r13d
movzwl %bp, %edx
movl %r12d, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x36a6c
testl %eax, %eax
jne 0x38333
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0xc850
testq %rax, %rax
je 0x38342
movq 0x40(%rsp), %r8
movl %ebx, (%rax)
movw %r13w, 0x8(%rax)
movl %r12d, 0x4(%rax)
movw %bp, 0xa(%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x40(%r14), %rdx
movq 0x8(%rdx), %rdx
movq %rax, (%rdx)
movq 0x40(%r14), %rax
movq %rcx, 0x8(%rax)
incw 0x1f4(%r14)
movzwl %r13w, %r13d
movq %r14, %rdi
movl %ebx, %esi
movl %r13d, %edx
movq %r15, %rcx
callq 0xc100
movl %ebx, %r15d
movl %r12d, 0x4(%rsp)
cmpl %r12d, %r15d
ja 0x38331
xorl %r12d, %r12d
leal (%r12,%r13), %eax
cmpw %bp, %ax
ja 0x38327
cmpl %ebx, %r15d
sete %cl
testw %r12w, %r12w
sete %dl
testb %dl, %cl
jne 0x38322
movzwl %ax, %edx
movq %r14, %rdi
movl %r15d, %esi
movq 0x40(%rsp), %rcx
callq 0xc5d0
incl %r12d
jmp 0x382f5
incl %r15d
movl 0x4(%rsp), %r12d
jmp 0x382ed
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1acaf(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x4d8d(%rip), %rsi      # 0x3d0e0
leaq 0xb686(%rip), %rdx      # 0x439e0
movl $0x22de, %ecx           # imm = 0x22DE
xorl %eax, %eax
callq 0xc8d0
pushq $0x1
jmp 0x38249