// File: /workspace/github_c_makefile_star2_O1/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: get_drawing_rel_index
STATIC uint32_t
_get_drawing_rel_index(lxw_worksheet *self, char *target)
{
    lxw_drawing_rel_id tmp_drawing_rel_id;
    lxw_drawing_rel_id *found_duplicate_target = NULL;
    lxw_drawing_rel_id *new_drawing_rel_id = NULL;

    if (target) {
        tmp_drawing_rel_id.target = target;
        found_duplicate_target = RB_FIND(lxw_drawing_rel_ids,
                                         self->drawing_rel_ids,
                                         &tmp_drawing_rel_id);
    }

    if (found_duplicate_target) {
        return found_duplicate_target->id;
    }
    else {
        self->drawing_rel_id++;

        if (target) {
            new_drawing_rel_id = calloc(1, sizeof(lxw_drawing_rel_id));

            if (new_drawing_rel_id) {
                new_drawing_rel_id->id = self->drawing_rel_id;
                new_drawing_rel_id->target = lxw_strdup(target);

                RB_INSERT(lxw_drawing_rel_ids, self->drawing_rel_ids,
                          new_drawing_rel_id);
            }
        }

        return self->drawing_rel_id;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movq %rdi, %r15
testq %rsi, %rsi
je 0x315af
leaq 0x8(%rsp), %rsi
movq %r12, 0x8(%rsi)
movq 0x70(%r15), %rdi
callq 0x3dcb4
movq %rax, %rbx
jmp 0x315b1
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x315c7
movl (%rbx), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20c(%r15), %rbx
movl 0x20c(%r15), %ebp
incl %ebp
movl %ebp, 0x20c(%r15)
testq %r12, %r12
je 0x315b6
movl $0x1, %edi
movl $0x30, %esi
callq 0xc7f0
testq %rax, %rax
je 0x315b6
movq %rax, %r14
movl %ebp, (%rax)
movq %r12, %rdi
callq 0xcce0
movq %rax, 0x8(%r14)
movq 0x70(%r15), %r15
movq (%r15), %rcx
testq %rcx, %rcx
je 0x3164f
movq %rax, %r12
movq %rcx, %r13
movq 0x8(%rcx), %rsi
movq %r12, %rdi
callq 0xc800
movl $0x10, %ecx
testl %eax, %eax
js 0x31636
movl $0x18, %ecx
je 0x315b6
movq (%r13,%rcx), %rcx
testq %rcx, %rcx
jne 0x31617
notl %eax
shrl $0x1f, %eax
leaq 0x10(,%rax,8), %rax
jmp 0x31657
movl $0x18, %eax
xorl %r13d, %r13d
movq %r13, 0x20(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movl $0x1, 0x28(%r14)
testq %r13, %r13
je 0x3182c
movq %r14, (%r13,%rax)
xorl %eax, %eax
cmpl $0x1, 0x28(%r13)
jne 0x3182f
movq 0x20(%r13), %rcx
movq 0x10(%rcx), %rdx
cmpq %rdx, %r13
je 0x316b2
testq %rdx, %rdx
je 0x3169e
cmpl $0x1, 0x28(%rdx)
je 0x316c1
movq 0x10(%r13), %rdx
cmpq %r14, %rdx
je 0x316ef
movq %r13, %rdx
movq %r14, %r13
jmp 0x31732
movq 0x18(%rcx), %rdx
testq %rdx, %rdx
je 0x316d7
cmpl $0x1, 0x28(%rdx)
jne 0x316d7
movl %eax, 0x28(%rdx)
movl %eax, 0x28(%r13)
movl $0x1, 0x28(%rcx)
movq %rcx, %r13
jmp 0x3181a
movq 0x18(%r13), %rdx
cmpq %r14, %rdx
je 0x31785
movq %r13, %rdx
movq %r14, %r13
jmp 0x317c8
movq 0x18(%rdx), %rsi
movq %rsi, 0x10(%r13)
testq %rsi, %rsi
je 0x31700
movq %r13, 0x20(%rsi)
movq 0x20(%r13), %rdi
movq %rdi, 0x20(%rdx)
movq %r15, %rsi
testq %rdi, %rdi
je 0x31724
movq 0x20(%r13), %rdi
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq 0x10(%rdi), %r13
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %r13, 0x18(%rdx)
movq %rdx, 0x20(%r13)
movq %r14, %rdx
movl $0x0, 0x28(%rdx)
movl $0x1, 0x28(%rcx)
movq 0x18(%rcx), %rdx
movq 0x10(%rdx), %rsi
movq %rsi, 0x18(%rcx)
testq %rsi, %rsi
je 0x31755
movq %rcx, 0x20(%rsi)
movq 0x20(%rcx), %rdi
movq %rdi, 0x20(%rdx)
movq %r15, %rsi
testq %rdi, %rdi
je 0x31779
movq 0x20(%rcx), %rdi
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq 0x10(%rdi), %rcx
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rcx, 0x10(%rdx)
jmp 0x31816
movq 0x10(%rdx), %rsi
movq %rsi, 0x18(%r13)
testq %rsi, %rsi
je 0x31796
movq %r13, 0x20(%rsi)
movq 0x20(%r13), %rdi
movq %rdi, 0x20(%rdx)
movq %r15, %rsi
testq %rdi, %rdi
je 0x317ba
movq 0x20(%r13), %rdi
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq 0x10(%rdi), %r13
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %r13, 0x10(%rdx)
movq %rdx, 0x20(%r13)
movq %r14, %rdx
movl $0x0, 0x28(%rdx)
movl $0x1, 0x28(%rcx)
movq 0x10(%rcx), %rdx
movq 0x18(%rdx), %rsi
movq %rsi, 0x10(%rcx)
testq %rsi, %rsi
je 0x317eb
movq %rcx, 0x20(%rsi)
movq 0x20(%rcx), %rdi
movq %rdi, 0x20(%rdx)
movq %r15, %rsi
testq %rdi, %rdi
je 0x3180f
movq 0x20(%rcx), %rdi
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq 0x10(%rdi), %rcx
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rcx, 0x18(%rdx)
movq %rdx, 0x20(%rcx)
movq %r13, %r14
movq 0x20(%r13), %r13
testq %r13, %r13
jne 0x3167b
jmp 0x3182f
movq %r14, (%r15)
movq (%r15), %rax
movl $0x0, 0x28(%rax)
jmp 0x315b6