// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %r15
testq %rsi, %rsi
je 0x2e659
movq %rsi, %r12
leaq 0x8(%rsp), %rsi
movq %r12, 0x8(%rsi)
movq 0x70(%r15), %rdi
callq 0x3b02d
movq %rax, %rbx
testq %rax, %rax
jne 0x2e66a
leaq 0x20c(%r15), %rbx
movl 0x20c(%r15), %ebp
incl %ebp
movl %ebp, 0x20c(%r15)
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0xc850
testq %rax, %rax
je 0x2e66a
movq %rax, %r14
movl %ebp, (%rax)
movq %r12, %rdi
callq 0xcd50
movq %rax, 0x8(%r14)
movq 0x70(%r15), %r12
xorl %ecx, %ecx
pushq $0x10
popq %r13
pushq $0x18
popq %rbp
movq %r12, %rdx
xorl %eax, %eax
movq (%rdx), %r15
testq %r15, %r15
je 0x2e67b
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b076
movq %r13, %rdx
testl %eax, %eax
js 0x2e651
movq %rbp, %rdx
je 0x2e66a
addq %r15, %rdx
movq %r15, %rcx
jmp 0x2e632
incl 0x20c(%r15)
addq $0x20c, %r15            # imm = 0x20C
movq %r15, %rbx
movl (%rbx), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, 0x20(%r14)
movl $0x1, 0x28(%r14)
movq %r12, %rdx
testq %rcx, %rcx
je 0x2e69d
testl %eax, %eax
js 0x2e699
leaq 0x18(%rcx), %rdx
jmp 0x2e69d
leaq 0x10(%rcx), %rdx
movq %r14, (%rdx)
testq %rcx, %rcx
je 0x2e858
cmpl $0x1, 0x28(%rcx)
jne 0x2e858
movq 0x20(%rcx), %rax
movq 0x10(%rax), %rdx
cmpq %rdx, %rcx
je 0x2e6e5
testq %rdx, %rdx
je 0x2e6d1
cmpl $0x1, 0x28(%rdx)
jne 0x2e6d1
andl $0x0, 0x28(%rdx)
jmp 0x2e6f8
movq 0x10(%rcx), %rdx
cmpq %r14, %rdx
je 0x2e71f
movq %rcx, %rdx
movq %r14, %rcx
jmp 0x2e792
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x2e70b
cmpl $0x1, 0x28(%rsi)
jne 0x2e70b
andl $0x0, 0x28(%rsi)
andl $0x0, 0x28(%rcx)
movl $0x1, 0x28(%rax)
movq %rax, %rcx
jmp 0x2e84c
movq 0x18(%rcx), %rsi
cmpq %r14, %rsi
je 0x2e742
movq %rcx, %rsi
movq %r14, %rcx
jmp 0x2e805
movq 0x18(%rdx), %rsi
movq %rsi, 0x10(%rcx)
testq %rsi, %rsi
je 0x2e76c
movq %rcx, 0x20(%rsi)
movq 0x20(%rcx), %rsi
movq %rsi, 0x20(%rdx)
movq %r12, %rdi
testq %rsi, %rsi
jne 0x2e774
jmp 0x2e784
movq 0x10(%rsi), %rdx
movq %rdx, 0x18(%rcx)
testq %rdx, %rdx
je 0x2e7db
movq %rcx, 0x20(%rdx)
movq 0x20(%rcx), %rdx
movq %rdx, 0x20(%rsi)
movq %r12, %rdi
testq %rdx, %rdx
jne 0x2e7e3
jmp 0x2e7f3
movq %rax, 0x20(%rdx)
movq 0x20(%rcx), %rsi
leaq 0x10(%rsi), %r8
leaq 0x18(%rsi), %rdi
cmpq 0x10(%rsi), %rcx
cmoveq %r8, %rdi
movq %rdx, (%rdi)
movq %rcx, 0x18(%rdx)
movq %rdx, 0x20(%rcx)
movq %r14, %rdx
andl $0x0, 0x28(%rdx)
movl $0x1, 0x28(%rax)
movq 0x18(%rax), %rdx
movq 0x10(%rdx), %rsi
movq %rsi, 0x18(%rax)
testq %rsi, %rsi
je 0x2e7b2
movq %rax, 0x20(%rsi)
movq 0x20(%rax), %rdi
movq %rdi, 0x20(%rdx)
movq %r12, %rsi
testq %rdi, %rdi
je 0x2e7d2
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq 0x10(%rdi), %rax
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rax, 0x10(%rdx)
jmp 0x2e848
movq %rax, 0x20(%rsi)
movq 0x20(%rcx), %rdx
leaq 0x10(%rdx), %r8
leaq 0x18(%rdx), %rdi
cmpq 0x10(%rdx), %rcx
cmoveq %r8, %rdi
movq %rsi, (%rdi)
movq %rcx, 0x10(%rsi)
movq %rsi, 0x20(%rcx)
movq 0x10(%rax), %rdx
movq %r14, %rsi
andl $0x0, 0x28(%rsi)
movl $0x1, 0x28(%rax)
movq 0x18(%rdx), %rsi
movq %rsi, 0x10(%rax)
testq %rsi, %rsi
je 0x2e821
movq %rax, 0x20(%rsi)
movq 0x20(%rax), %rdi
movq %rdi, 0x20(%rdx)
movq %r12, %rsi
testq %rdi, %rdi
je 0x2e841
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq 0x10(%rdi), %rax
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rax, 0x18(%rdx)
movq %rdx, 0x20(%rax)
movq %rcx, %r14
movq 0x20(%rcx), %rcx
jmp 0x2e6a0
movq (%r12), %rax
andl $0x0, 0x28(%rax)
jmp 0x2e66a