// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: worksheet_write_freeze_panes
STATIC void
_worksheet_write_freeze_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;

    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);
    }
    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();

    lxw_rowcol_to_cell(top_left_cell, top_row, left_col);

    /* Set the active pane. */
    if (row && col) {
        lxw_strcpy(active_pane, "bottomRight");

        lxw_rowcol_to_cell(row_cell, row, 0);
        lxw_rowcol_to_cell(col_cell, 0, 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 (col) {
        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 (col)
        LXW_PUSH_ATTRIBUTES_INT("xSplit", col);

    if (row)
        LXW_PUSH_ATTRIBUTES_INT("ySplit", row);

    LXW_PUSH_ATTRIBUTES_STR("topLeftCell", top_left_cell);
    LXW_PUSH_ATTRIBUTES_STR("activePane", active_pane);

    if (self->panes.type == FREEZE_PANES)
        LXW_PUSH_ATTRIBUTES_STR("state", "frozen");
    else if (self->panes.type == FREEZE_SPLIT_PANES)
        LXW_PUSH_ATTRIBUTES_STR("state", "frozenSplit");

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

    free(user_selection);

    LXW_FREE_ATTRIBUTES();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %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
movq 0x48(%rax), %rax
cmpq $0x0, (%rax)
je 0x5c3ac
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 0x5c3a8
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x5c3aa
jmp 0x5c3f3
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5c3ef
movq 0x20c2b(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x9cf9(%rip), %rsi      # 0x660d0
leaq 0x10016(%rip), %rdx     # 0x6c3f4
movl $0x818, %ecx            # imm = 0x818
movb $0x0, %al
callq 0xc8f0
jmp 0x5ca65
jmp 0x5c3f1
jmp 0x5c3f3
jmp 0x5c3f5
movq $0x0, -0x18(%rbp)
leaq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x68(%rbp), %rdi
movl -0x3c(%rbp), %esi
movzwl -0x3e(%rbp), %edx
callq 0xca90
cmpl $0x0, -0x34(%rbp)
je 0x5c681
movzwl -0x36(%rbp), %eax
cmpl $0x0, %eax
je 0x5c681
leaq -0x74(%rbp), %rdi
movl $0xc, %esi
leaq 0x10468(%rip), %rdx     # 0x6c8a4
leaq 0x11f51(%rip), %rcx     # 0x6e394
movb $0x0, %al
callq 0xc5d0
leaq -0x4c(%rbp), %rdi
movl -0x34(%rbp), %esi
xorl %edx, %edx
callq 0xca90
leaq -0x5a(%rbp), %rdi
xorl %esi, %esi
movzwl -0x36(%rbp), %edx
callq 0xca90
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5c516
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0x1040f(%rip), %rdx     # 0x6c8a4
leaq 0x11f04(%rip), %rcx     # 0x6e3a0
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
leaq -0x5a(%rbp), %rcx
movl $0x1c, %esi
leaq 0x103e9(%rip), %rdx     # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
leaq -0x5a(%rbp), %rcx
movl $0x1c, %esi
leaq 0x103ca(%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 0x5c516
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5c5c5
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0x10360(%rip), %rdx     # 0x6c8a4
leaq 0x11e5e(%rip), %rcx     # 0x6e3a9
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
leaq -0x4c(%rbp), %rcx
movl $0x1c, %esi
leaq 0x1033a(%rip), %rdx     # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
leaq -0x4c(%rbp), %rcx
movl $0x1c, %esi
leaq 0x1031b(%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 0x5c5c5
movl $0x1, %edi
movl $0x50, %esi
callq 0xc870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5c67c
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0x102b1(%rip), %rdx     # 0x6c8a4
leaq 0x11d9a(%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 0x10287(%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 0x10264(%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 0x5c67c
jmp 0x5c83f
cmpw $0x0, -0x36(%rbp)
je 0x5c766
leaq -0x74(%rbp), %rdi
movl $0xc, %esi
leaq 0x10208(%rip), %rdx     # 0x6c8a4
leaq 0x11cfd(%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 0x5c761
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0x101cc(%rip), %rdx     # 0x6c8a4
leaq 0x11cc1(%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 0x101a2(%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 0x1017f(%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 0x5c761
jmp 0x5c83d
leaq -0x74(%rbp), %rdi
movl $0xc, %esi
leaq 0x1012e(%rip), %rdx     # 0x6c8a4
leaq 0x11c2c(%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 0x5c83b
movq -0x28(%rbp), %rdi
movl $0xc, %esi
leaq 0x100f2(%rip), %rdx     # 0x6c8a4
leaq 0x11bf0(%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 0x100c8(%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 0x100a5(%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 0x5c83b
jmp 0x5c83d
jmp 0x5c83f
cmpw $0x0, -0x36(%rbp)
je 0x5c88a
jmp 0x5c848
movzwl -0x36(%rbp), %eax
movl %eax, %esi
leaq 0x11b5f(%rip), %rdi     # 0x6e3b4
callq 0xc1b0
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 0x5c888
jmp 0x5c88a
cmpl $0x0, -0x34(%rbp)
je 0x5c8d3
jmp 0x5c892
movl -0x34(%rbp), %eax
movl %eax, %esi
leaq 0x11b1d(%rip), %rdi     # 0x6e3bb
callq 0xc1b0
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 0x5c8d1
jmp 0x5c8d3
jmp 0x5c8d5
leaq -0x68(%rbp), %rsi
leaq 0x11a75(%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 0x5c913
jmp 0x5c915
leaq -0x74(%rbp), %rsi
leaq 0x11aa2(%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 0x5c953
movq -0x8(%rbp), %rax
movzbl 0x240(%rax), %eax
cmpl $0x1, %eax
jne 0x5c9a8
jmp 0x5c965
leaq 0xf810(%rip), %rdi      # 0x6c17c
leaq 0x11a5a(%rip), %rsi     # 0x6e3cd
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 0x5c9a6
jmp 0x5c9ff
movq -0x8(%rbp), %rax
movzbl 0x240(%rax), %eax
cmpl $0x3, %eax
jne 0x5c9fd
jmp 0x5c9ba
leaq 0xf7bb(%rip), %rdi      # 0x6c17c
leaq 0x11a0c(%rip), %rsi     # 0x6e3d4
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 0x5c9fb
jmp 0x5c9fd
jmp 0x5c9ff
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x119d3(%rip), %rsi     # 0x6e3e0
leaq -0x18(%rbp), %rdx
callq 0xcca0
movq -0x30(%rbp), %rdi
callq 0xc0d0
jmp 0x5ca21
cmpq $0x0, -0x18(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5ca31
jmp 0x5ca63
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x1040(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x5ca56
leaq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x5ca58
movq -0x20(%rbp), %rdi
callq 0xc0d0
jmp 0x5ca21
jmp 0x5ca65
addq $0x80, %rsp
popq %rbp
retq
nop