// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movw %r8w, %ax
movq 0x10(%rbp), %r8
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movw %dx, -0x16(%rbp)
movl %ecx, -0x1c(%rbp)
movw %ax, -0x1e(%rbp)
movq %r9, -0x28(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x52a26
movzwl -0x16(%rbp), %eax
movzwl -0x1e(%rbp), %ecx
cmpl %ecx, %eax
jne 0x52a26
movl $0xd, -0x4(%rbp)
jmp 0x52bda
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jbe 0x52a40
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x14(%rbp)
movzwl -0x16(%rbp), %eax
movzwl -0x1e(%rbp), %ecx
cmpl %ecx, %eax
jle 0x52a64
movw -0x1e(%rbp), %ax
movw %ax, -0x36(%rbp)
movw -0x16(%rbp), %ax
movw %ax, -0x1e(%rbp)
movw -0x36(%rbp), %ax
movw %ax, -0x16(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
xorl %r8d, %r8d
movzwl -0x1e(%rbp), %edx
movl %r8d, %ecx
callq 0x4ff90
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x52a8e
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x52bda
movl $0x1, %edi
movl $0x18, %esi
callq 0xc870
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x52ad8
movq 0x2a549(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x13617(%rip), %rsi     # 0x660d0
leaq 0x19934(%rip), %rdx     # 0x6c3f4
movl $0x22de, %ecx           # imm = 0x22DE
movb $0x0, %al
callq 0xc8f0
movl $0x1, -0x4(%rbp)
jmp 0x52bda
jmp 0x52ada
movl -0x14(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movw -0x16(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x8(%rax)
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movw -0x1e(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movw 0x1f4(%rax), %cx
addw $0x1, %cx
movw %cx, 0x1f4(%rax)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movw -0x16(%rbp), %ax
movq -0x28(%rbp), %rcx
movq 0x10(%rbp), %r8
movzwl %ax, %edx
callq 0xc110
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
ja 0x52bd3
movw -0x16(%rbp), %ax
movw %ax, -0x36(%rbp)
movzwl -0x36(%rbp), %eax
movzwl -0x1e(%rbp), %ecx
cmpl %ecx, %eax
jg 0x52bc6
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x52ba1
movzwl -0x36(%rbp), %eax
movzwl -0x16(%rbp), %ecx
cmpl %ecx, %eax
jne 0x52ba1
jmp 0x52bb8
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
movw -0x36(%rbp), %ax
movq 0x10(%rbp), %rcx
movzwl %ax, %edx
callq 0xc5f0
movw -0x36(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x36(%rbp)
jmp 0x52b7f
jmp 0x52bc8
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x52b6f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)