// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: worksheet_write_split_panes
STATIC void
_worksheet_write_split_panes(lxw_worksheet *self)
{
    struct xml_attribute_list attributes;
    struct xml_attribute *attribute;

    lxw_selection *selection;
    lxw_selection *user_selection;
    lxw_row_t row = self->panes.first_row;
    lxw_col_t col = self->panes.first_col;
    lxw_row_t top_row = self->panes.top_row;
    lxw_col_t left_col = self->panes.left_col;
    double x_split = self->panes.x_split;
    double y_split = self->panes.y_split;
    uint8_t has_selection = LXW_FALSE;

    char row_cell[LXW_MAX_CELL_NAME_LENGTH];
    char col_cell[LXW_MAX_CELL_NAME_LENGTH];
    char top_left_cell[LXW_MAX_CELL_NAME_LENGTH];
    char active_pane[LXW_PANE_NAME_LENGTH];

    /* If there is a user selection we remove it from the list and use it. */
    if (!STAILQ_EMPTY(self->selections)) {
        user_selection = STAILQ_FIRST(self->selections);
        STAILQ_REMOVE_HEAD(self->selections, list_pointers);
        has_selection = LXW_TRUE;
    }
    else {
        /* or else create a new blank selection. */
        user_selection = calloc(1, sizeof(lxw_selection));
        RETURN_VOID_ON_MEM_ERROR(user_selection);
    }

    LXW_INIT_ATTRIBUTES();

    /* Convert the row and col to 1/20 twip units with padding. */
    if (y_split > 0.0)
        y_split = (uint32_t) (20 * y_split + 300);

    if (x_split > 0.0)
        x_split = _worksheet_calculate_x_split_width(x_split);

    /* For non-explicit topLeft definitions, estimate the cell offset based on
     * the pixels dimensions. This is only a workaround and doesn't take
     * adjusted cell dimensions into account.
     */
    if (top_row == row && left_col == col) {
        top_row = (lxw_row_t) (0.5 + (y_split - 300.0) / 20.0 / 15.0);
        left_col = (lxw_col_t) (0.5 + (x_split - 390.0) / 20.0 / 3.0 / 16.0);
    }

    lxw_rowcol_to_cell(top_left_cell, top_row, left_col);

    /* If there is no selection set the active cell to the top left cell. */
    if (!has_selection) {
        lxw_strcpy(user_selection->active_cell, top_left_cell);
        lxw_strcpy(user_selection->sqref, top_left_cell);
    }

    /* Set the active pane. */
    if (y_split > 0.0 && x_split > 0.0) {
        lxw_strcpy(active_pane, "bottomRight");

        lxw_rowcol_to_cell(row_cell, top_row, 0);
        lxw_rowcol_to_cell(col_cell, 0, left_col);

        selection = calloc(1, sizeof(lxw_selection));
        if (selection) {
            lxw_strcpy(selection->pane, "topRight");
            lxw_strcpy(selection->active_cell, col_cell);
            lxw_strcpy(selection->sqref, col_cell);

            STAILQ_INSERT_TAIL(self->selections, selection, list_pointers);
        }

        selection = calloc(1, sizeof(lxw_selection));
        if (selection) {
            lxw_strcpy(selection->pane, "bottomLeft");
            lxw_strcpy(selection->active_cell, row_cell);
            lxw_strcpy(selection->sqref, row_cell);

            STAILQ_INSERT_TAIL(self->selections, selection, list_pointers);
        }

        selection = calloc(1, sizeof(lxw_selection));
        if (selection) {
            lxw_strcpy(selection->pane, "bottomRight");
            lxw_strcpy(selection->active_cell, user_selection->active_cell);
            lxw_strcpy(selection->sqref, user_selection->sqref);

            STAILQ_INSERT_TAIL(self->selections, selection, list_pointers);
        }
    }
    else if (x_split > 0.0) {
        lxw_strcpy(active_pane, "topRight");

        selection = calloc(1, sizeof(lxw_selection));
        if (selection) {
            lxw_strcpy(selection->pane, "topRight");
            lxw_strcpy(selection->active_cell, user_selection->active_cell);
            lxw_strcpy(selection->sqref, user_selection->sqref);

            STAILQ_INSERT_TAIL(self->selections, selection, list_pointers);
        }
    }
    else {
        lxw_strcpy(active_pane, "bottomLeft");

        selection = calloc(1, sizeof(lxw_selection));
        if (selection) {
            lxw_strcpy(selection->pane, "bottomLeft");
            lxw_strcpy(selection->active_cell, user_selection->active_cell);
            lxw_strcpy(selection->sqref, user_selection->sqref);

            STAILQ_INSERT_TAIL(self->selections, selection, list_pointers);
        }
    }

    if (x_split > 0.0)
        LXW_PUSH_ATTRIBUTES_DBL("xSplit", x_split);

    if (y_split > 0.0)
        LXW_PUSH_ATTRIBUTES_DBL("ySplit", y_split);

    LXW_PUSH_ATTRIBUTES_STR("topLeftCell", top_left_cell);

    if (has_selection)
        LXW_PUSH_ATTRIBUTES_STR("activePane", active_pane);

    lxw_xml_empty_tag(self->file, "pane", &attributes);

    free(user_selection);

    LXW_FREE_ATTRIBUTES();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x244(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movw 0x248(%rax), %ax
movw %ax, -0x36(%rbp)
movq -0x8(%rbp), %rax
movl 0x24c(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movw 0x250(%rax), %ax
movw %ax, -0x3e(%rbp)
movq -0x8(%rbp), %rax
movsd 0x258(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movsd 0x260(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movb $0x0, -0x51(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, (%rax)
je 0x5cb36
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq 0x48(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x5cb2e
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x5cb30
movb $0x1, -0x51(%rbp)
jmp 0x5cb7d
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5cb79
movq 0x204a1(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x956f(%rip), %rsi      # 0x660d0
leaq 0xf88c(%rip), %rdx      # 0x6c3f4
movl $0x8b1, %ecx            # imm = 0x8B1
movb $0x0, %al
callq 0xc8f0
jmp 0x5d2ab
jmp 0x5cb7b
jmp 0x5cb7d
jmp 0x5cb7f
movq $0x0, -0x18(%rbp)
leaq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movsd -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5cbcb
movsd -0x50(%rbp), %xmm0
movsd 0xf76e(%rip), %xmm1     # 0x6c318
mulsd %xmm1, %xmm0
movsd 0xf77a(%rip), %xmm1     # 0x6c330
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x48(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5cbef
movsd -0x48(%rbp), %xmm0
callq 0x5d2c0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jne 0x5cc7d
movzwl -0x3e(%rbp), %eax
movzwl -0x36(%rbp), %ecx
cmpl %ecx, %eax
jne 0x5cc7d
movsd -0x50(%rbp), %xmm0
movsd 0xf724(%rip), %xmm1     # 0x6c338
addsd %xmm1, %xmm0
movsd 0xf6f8(%rip), %xmm2     # 0x6c318
divsd %xmm2, %xmm0
movsd 0xf694(%rip), %xmm1     # 0x6c2c0
divsd %xmm1, %xmm0
movsd 0x96e8(%rip), %xmm1     # 0x66320
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x3c(%rbp)
movsd -0x48(%rbp), %xmm0
movsd 0xf6ef(%rip), %xmm3     # 0x6c340
addsd %xmm3, %xmm0
divsd %xmm2, %xmm0
movsd 0xf6e7(%rip), %xmm2     # 0x6c348
divsd %xmm2, %xmm0
movsd 0xf6e3(%rip), %xmm2     # 0x6c350
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, -0x3e(%rbp)
leaq -0x7b(%rbp), %rdi
movl -0x3c(%rbp), %esi
movzwl -0x3e(%rbp), %edx
callq 0xca90
cmpb $0x0, -0x51(%rbp)
jne 0x5ccd1
movq -0x30(%rbp), %rdi
addq $0xc, %rdi
leaq -0x7b(%rbp), %rcx
movl $0x1c, %esi
leaq 0xfbf9(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
leaq -0x7b(%rbp), %rcx
movl $0x1c, %esi
leaq 0xfbda(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movsd -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5cf4d
movsd -0x48(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5cf4d
leaq -0x87(%rbp), %rdi
movl $0xc, %esi
leaq 0xfb9c(%rip), %rdx      # 0x6c8a4
leaq 0x11685(%rip), %rcx     # 0x6e394
movb $0x0, %al
callq 0xc5d0
leaq -0x5f(%rbp), %rdi
movl -0x3c(%rbp), %esi
xorl %edx, %edx
callq 0xca90
leaq -0x6d(%rbp), %rdi
xorl %esi, %esi
movzwl -0x3e(%rbp), %edx
callq 0xca90
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5cde2
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0xfb43(%rip), %rdx      # 0x6c8a4
leaq 0x11638(%rip), %rcx     # 0x6e3a0
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
leaq -0x6d(%rbp), %rcx
movl $0x1c, %esi
leaq 0xfb1d(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
leaq -0x6d(%rbp), %rcx
movl $0x1c, %esi
leaq 0xfafe(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x48, %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x5cde2
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5ce91
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0xfa94(%rip), %rdx      # 0x6c8a4
leaq 0x11592(%rip), %rcx     # 0x6e3a9
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
leaq -0x5f(%rbp), %rcx
movl $0x1c, %esi
leaq 0xfa6e(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
leaq -0x5f(%rbp), %rcx
movl $0x1c, %esi
leaq 0xfa4f(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x48, %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x5ce91
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5cf48
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0xf9e5(%rip), %rdx      # 0x6c8a4
leaq 0x114ce(%rip), %rcx     # 0x6e394
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
movq -0x30(%rbp), %rcx
addq $0xc, %rcx
movl $0x1c, %esi
leaq 0xf9bb(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
movq -0x30(%rbp), %rcx
addq $0x28, %rcx
movl $0x1c, %esi
leaq 0xf998(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x48, %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x5cf48
jmp 0x5d118
movsd -0x48(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5d03c
leaq -0x87(%rbp), %rdi
movl $0xc, %esi
leaq 0xf932(%rip), %rdx      # 0x6c8a4
leaq 0x11427(%rip), %rcx     # 0x6e3a0
movb $0x0, %al
callq 0xc5d0
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5d037
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0xf8f6(%rip), %rdx      # 0x6c8a4
leaq 0x113eb(%rip), %rcx     # 0x6e3a0
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
movq -0x30(%rbp), %rcx
addq $0xc, %rcx
movl $0x1c, %esi
leaq 0xf8cc(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
movq -0x30(%rbp), %rcx
addq $0x28, %rcx
movl $0x1c, %esi
leaq 0xf8a9(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x48, %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x5d037
jmp 0x5d116
leaq -0x87(%rbp), %rdi
movl $0xc, %esi
leaq 0xf855(%rip), %rdx      # 0x6c8a4
leaq 0x11353(%rip), %rcx     # 0x6e3a9
movb $0x0, %al
callq 0xc5d0
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5d114
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0xf819(%rip), %rdx      # 0x6c8a4
leaq 0x11317(%rip), %rcx     # 0x6e3a9
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
movq -0x30(%rbp), %rcx
addq $0xc, %rcx
movl $0x1c, %esi
leaq 0xf7ef(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
movq -0x30(%rbp), %rcx
addq $0x28, %rcx
movl $0x1c, %esi
leaq 0xf7cc(%rip), %rdx      # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x48, %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x5d114
jmp 0x5d116
jmp 0x5d118
movsd -0x48(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5d169
jmp 0x5d128
movsd -0x48(%rbp), %xmm0
leaq 0x11280(%rip), %rdi     # 0x6e3b4
callq 0xcd20
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x10(%rbp)
jmp 0x5d167
jmp 0x5d169
movsd -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5d1ba
jmp 0x5d179
movsd -0x50(%rbp), %xmm0
leaq 0x11236(%rip), %rdi     # 0x6e3bb
callq 0xcd20
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x10(%rbp)
jmp 0x5d1b8
jmp 0x5d1ba
jmp 0x5d1bc
leaq -0x7b(%rbp), %rsi
leaq 0x1118e(%rip), %rdi     # 0x6e355
callq 0xc030
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x10(%rbp)
jmp 0x5d1fa
cmpb $0x0, -0x51(%rbp)
je 0x5d245
jmp 0x5d202
leaq -0x87(%rbp), %rsi
leaq 0x111b2(%rip), %rdi     # 0x6e3c2
callq 0xc030
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x10(%rbp)
jmp 0x5d243
jmp 0x5d245
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1118d(%rip), %rsi     # 0x6e3e0
leaq -0x18(%rbp), %rdx
callq 0xcca0
movq -0x30(%rbp), %rdi
callq 0xc0d0
jmp 0x5d267
cmpq $0x0, -0x18(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5d277
jmp 0x5d2a9
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x1040(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x5d29c
leaq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x5d29e
movq -0x20(%rbp), %rdi
callq 0xc0d0
jmp 0x5d267
jmp 0x5d2ab
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)