// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/relationships.c
// Function: add_relationship
STATIC void
_add_relationship(lxw_relationships *self, const char *schema,
                  const char *type, const char *target,
                  const char *target_mode)
{
    lxw_rel_tuple *relationship;

    if (!schema || !type || !target)
        return;

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

    relationship->type = calloc(1, LXW_MAX_ATTRIBUTE_LENGTH);
    GOTO_LABEL_ON_MEM_ERROR(relationship->type, mem_error);

    /* Add the schema to the relationship type. */
    lxw_snprintf(relationship->type, LXW_MAX_ATTRIBUTE_LENGTH, "%s%s",
                 schema, type);

    relationship->target = lxw_strdup(target);
    GOTO_LABEL_ON_MEM_ERROR(relationship->target, mem_error);

    if (target_mode) {
        relationship->target_mode = lxw_strdup(target_mode);
        GOTO_LABEL_ON_MEM_ERROR(relationship->target_mode, mem_error);
    }

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

    return;

mem_error:
    if (relationship) {
        free(relationship->type);
        free(relationship->target);
        free(relationship->target_mode);
        free(relationship);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x30911
cmpq $0x0, -0x18(%rbp)
je 0x30911
cmpq $0x0, -0x20(%rbp)
jne 0x30916
jmp 0x30ad2
movl $0x1, %edi
movl $0x20, %esi
callq 0xc870
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x30959
movq 0x4c6c1(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x3578f(%rip), %rsi     # 0x660d0
leaq 0x386e5(%rip), %rdx     # 0x6902d
movl $0xab, %ecx
movb $0x0, %al
callq 0xc8f0
jmp 0x30a9c
jmp 0x3095b
movl $0x1, %edi
movl $0x820, %esi            # imm = 0x820
callq 0xc870
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x309a7
movq 0x4c673(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x35741(%rip), %rsi     # 0x660d0
leaq 0x38697(%rip), %rdx     # 0x6902d
movl $0xae, %ecx
movb $0x0, %al
callq 0xc8f0
jmp 0x30a9c
jmp 0x309a9
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
movl $0x820, %esi            # imm = 0x820
leaq 0x356c4(%rip), %rdx     # 0x66088
movb $0x0, %al
callq 0xc5d0
movq -0x20(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x30a13
movq 0x4c607(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x356d5(%rip), %rsi     # 0x660d0
leaq 0x3862b(%rip), %rdx     # 0x6902d
movl $0xb5, %ecx
movb $0x0, %al
callq 0xc8f0
jmp 0x30a9c
jmp 0x30a15
cmpq $0x0, -0x28(%rbp)
je 0x30a65
movq -0x28(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x30a61
movq 0x4c5b6(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x35684(%rip), %rsi     # 0x660d0
leaq 0x385da(%rip), %rdx     # 0x6902d
movl $0xb9, %ecx
movb $0x0, %al
callq 0xc8f0
jmp 0x30a9c
jmp 0x30a63
jmp 0x30a65
jmp 0x30a67
movq -0x30(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
addq $0x18, %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x30ad2
cmpq $0x0, -0x30(%rbp)
je 0x30ad2
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0xc0d0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc0d0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc0d0
movq -0x30(%rbp), %rdi
callq 0xc0d0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)