// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: lxw_worksheet_prepare_background
void
lxw_worksheet_prepare_background(lxw_worksheet *self,
                                 uint32_t image_ref_id,
                                 lxw_object_properties *object_props)
{
    lxw_rel_tuple *relationship = NULL;
    char filename[LXW_FILENAME_LENGTH];

    STAILQ_INSERT_TAIL(self->image_props, object_props, list_pointers);

    relationship = calloc(1, sizeof(lxw_rel_tuple));
    RETURN_VOID_ON_MEM_ERROR(relationship);

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

    lxw_snprintf(filename, 32, "../media/image%d.%s", image_ref_id,
                 object_props->extension);

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

    self->external_background_link = relationship;

    return;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0xb8(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
addq $0xb8, %rcx
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, 0x8(%rax)
movl $0x1, %edi
movl $0x20, %esi
callq 0xc870
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4a4ba
movq 0x32b60(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1bc2e(%rip), %rsi     # 0x660d0
leaq 0x21f4b(%rip), %rdx     # 0x6c3f4
movl $0xdd8, %ecx            # imm = 0xDD8
movb $0x0, %al
callq 0xc8f0
jmp 0x4a5bd
jmp 0x4a4bc
leaq 0x224bf(%rip), %rdi     # 0x6c982
callq 0xcd80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4a505
movq 0x32b15(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1bbe3(%rip), %rsi     # 0x660d0
leaq 0x21f00(%rip), %rdx     # 0x6c3f4
movl $0xddb, %ecx            # imm = 0xDDB
movb $0x0, %al
callq 0xc8f0
jmp 0x4a587
jmp 0x4a507
leaq -0xa0(%rbp), %rdi
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movq 0x78(%rax), %r8
movl $0x20, %esi
leaq 0x22464(%rip), %rdx     # 0x6c989
movb $0x0, %al
callq 0xc5d0
leaq -0xa0(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x4a574
movq 0x32aa3(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1bb71(%rip), %rsi     # 0x660d0
leaq 0x21e8e(%rip), %rdx     # 0x6c3f4
movl $0xde1, %ecx            # imm = 0xDE1
movb $0x0, %al
callq 0xc8f0
jmp 0x4a587
jmp 0x4a576
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x2c0(%rax)
jmp 0x4a5bd
cmpq $0x0, -0x20(%rbp)
je 0x4a5bd
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
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)