// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: worksheet_write_hyperlinks
STATIC void
_worksheet_write_hyperlinks(lxw_worksheet *self)
{

    lxw_row *row;
    lxw_cell *link;
    lxw_rel_tuple *relationship;

    if (RB_EMPTY(self->hyperlinks))
        return;

    /* Write the hyperlink elements. */
    lxw_xml_start_tag(self->file, "hyperlinks", NULL);

    RB_FOREACH(row, lxw_table_rows, self->hyperlinks) {

        RB_FOREACH(link, lxw_table_cells, row->cells) {

            if (link->type == HYPERLINK_URL
                || link->type == HYPERLINK_EXTERNAL) {

                self->rel_count++;

                relationship = calloc(1, sizeof(lxw_rel_tuple));
                GOTO_LABEL_ON_MEM_ERROR(relationship, mem_error);

                relationship->type = lxw_strdup("/hyperlink");
                GOTO_LABEL_ON_MEM_ERROR(relationship->type, mem_error);

                relationship->target = lxw_strdup(link->u.string);
                GOTO_LABEL_ON_MEM_ERROR(relationship->target, mem_error);

                relationship->target_mode = lxw_strdup("External");
                GOTO_LABEL_ON_MEM_ERROR(relationship->target_mode, mem_error);

                STAILQ_INSERT_TAIL(self->external_hyperlinks, relationship,
                                   list_pointers);

                _worksheet_write_hyperlink_external(self, link->row_num,
                                                    link->col_num,
                                                    link->user_data1,
                                                    link->user_data2,
                                                    self->rel_count);
            }

            if (link->type == HYPERLINK_INTERNAL) {

                _worksheet_write_hyperlink_internal(self, link->row_num,
                                                    link->col_num,
                                                    link->u.string,
                                                    link->user_data1,
                                                    link->user_data2);
            }

        }

    }

    lxw_xml_end_tag(self->file, "hyperlinks");
    return;

mem_error:
    if (relationship) {
        free(relationship->type);
        free(relationship->target);
        free(relationship->target_mode);
        free(relationship);
    }
    lxw_xml_end_tag(self->file, "hyperlinks");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, (%rax)
jne 0x4f05f
jmp 0x4f344
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1fcb6(%rip), %rsi     # 0x6ed23
xorl %eax, %eax
movl %eax, %edx
callq 0xc390
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x46150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x4f2e6
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4afb0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4f2d2
movq -0x18(%rbp), %rax
cmpl $0xb, 0x8(%rax)
je 0x4f0d0
movq -0x18(%rbp), %rax
cmpl $0xd, 0x8(%rax)
jne 0x4f282
movq -0x8(%rbp), %rax
movw 0x134(%rax), %cx
addw $0x1, %cx
movw %cx, 0x134(%rax)
movl $0x1, %edi
movl $0x20, %esi
callq 0xc870
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4f129
movq 0x2def1(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x16fbf(%rip), %rsi     # 0x660d0
leaq 0x1d2dc(%rip), %rdx     # 0x6c3f4
movl $0x1579, %ecx           # imm = 0x1579
movb $0x0, %al
callq 0xc8f0
jmp 0x4f2fb
jmp 0x4f12b
leaq 0x1d7b5(%rip), %rdi     # 0x6c8e7
callq 0xcd80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4f174
movq 0x2dea6(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x16f74(%rip), %rsi     # 0x660d0
leaq 0x1d291(%rip), %rdx     # 0x6c3f4
movl $0x157c, %ecx           # imm = 0x157C
movb $0x0, %al
callq 0xc8f0
jmp 0x4f2fb
jmp 0x4f176
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x4f1c2
movq 0x2de58(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x16f26(%rip), %rsi     # 0x660d0
leaq 0x1d243(%rip), %rdx     # 0x6c3f4
movl $0x157f, %ecx           # imm = 0x157F
movb $0x0, %al
callq 0xc8f0
jmp 0x4f2fb
jmp 0x4f1c4
leaq 0x1d73b(%rip), %rdi     # 0x6c906
callq 0xcd80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x4f20f
movq 0x2de0b(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x16ed9(%rip), %rsi     # 0x660d0
leaq 0x1d1f6(%rip), %rdx     # 0x6c3f4
movl $0x1582, %ecx           # imm = 0x1582
movb $0x0, %al
callq 0xc8f0
jmp 0x4f2fb
jmp 0x4f211
jmp 0x4f213
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
addq $0x18, %rcx
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x18(%rbp), %rax
movw 0x4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %r8
movq -0x8(%rbp), %rax
movzwl %dx, %edx
movzwl 0x134(%rax), %r9d
callq 0x62580
movq -0x18(%rbp), %rax
cmpl $0xc, 0x8(%rax)
jne 0x4f2be
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x18(%rbp), %rax
movw 0x4(%rax), %ax
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x18(%rbp), %rdx
movq 0x30(%rdx), %r8
movq -0x18(%rbp), %rdx
movq 0x38(%rdx), %r9
movzwl %ax, %edx
callq 0x62760
jmp 0x4f2c0
movq -0x18(%rbp), %rdi
callq 0x4b010
movq %rax, -0x18(%rbp)
jmp 0x4f0ad
jmp 0x4f2d4
movq -0x10(%rbp), %rdi
callq 0x461b0
movq %rax, -0x10(%rbp)
jmp 0x4f08c
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1fa2f(%rip), %rsi     # 0x6ed23
callq 0xc060
jmp 0x4f344
cmpq $0x0, -0x20(%rbp)
je 0x4f331
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0xc0d0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc0d0
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc0d0
movq -0x20(%rbp), %rdi
callq 0xc0d0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1f9e4(%rip), %rsi     # 0x6ed23
callq 0xc060
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)