// File: /workspace/github_c_makefile_star2_O3/Paxa[P]fast_excel/libxlsxwriter/src/comment.c
// Function: get_author_index
STATIC uint32_t
_get_author_index(lxw_comment *self, char *author)
{
    lxw_author_id tmp_author_id;
    lxw_author_id *existing_author = NULL;
    lxw_author_id *new_author_id = NULL;

    if (!author)
        return 0;

    tmp_author_id.author = author;
    existing_author = RB_FIND(lxw_author_ids,
                              self->author_ids, &tmp_author_id);

    if (existing_author) {
        return existing_author->id;
    }
    else {
        new_author_id = calloc(1, sizeof(lxw_author_id));

        if (new_author_id) {
            new_author_id->id = self->author_id;
            new_author_id->author = lxw_strdup(author);
            self->author_id++;

            RB_INSERT(lxw_author_ids, self->author_ids, new_author_id);

            return new_author_id->id;
        }
        else {
            return 0;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebp, %ebp
testq %rsi, %rsi
je 0x1cb1f
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %rdi
callq 0x1cb2a
movq %rax, %rbx
testq %rax, %rax
jne 0x1cb1d
movl $0x1, %edi
movl $0x30, %esi
callq 0xc7f0
testq %rax, %rax
je 0x1cb1f
movq %rax, %rbx
movl 0x20(%r14), %eax
movl %eax, (%rbx)
movq %r15, %rdi
callq 0xcce0
movq %rax, 0x8(%rbx)
incl 0x20(%r14)
movq 0x10(%r14), %r14
movq (%r14), %rcx
testq %rcx, %rcx
je 0x1cb09
movq %rax, %r15
movq %rcx, %r12
movq 0x8(%rcx), %rsi
movq %r15, %rdi
callq 0xc800
movl $0x10, %ecx
testl %eax, %eax
js 0x1c913
movl $0x18, %ecx
je 0x1cb1d
movq (%r12,%rcx), %rcx
testq %rcx, %rcx
jne 0x1c8f0
movq %r12, 0x20(%rbx)
movl $0x1, 0x28(%rbx)
notl %eax
shrl $0x1f, %eax
movq %rbx, 0x10(%r12,%rax,8)
xorl %eax, %eax
movq %rbx, %rdx
cmpl $0x1, 0x28(%r12)
jne 0x1cb04
movq 0x20(%r12), %rcx
movq 0x10(%rcx), %rsi
cmpq %rsi, %r12
je 0x1c975
testq %rsi, %rsi
je 0x1c960
cmpl $0x1, 0x28(%rsi)
jne 0x1c960
movl %eax, 0x28(%rsi)
jmp 0x1c987
movq 0x10(%r12), %rsi
cmpq %rdx, %rsi
je 0x1c9b0
movq %r12, %rsi
movq %rdx, %r12
jmp 0x1ca2d
movq 0x18(%rcx), %rdi
testq %rdi, %rdi
je 0x1c99b
cmpl $0x1, 0x28(%rdi)
jne 0x1c99b
movl %eax, 0x28(%rdi)
movl %eax, 0x28(%r12)
movl $0x1, 0x28(%rcx)
movq %rcx, %r12
jmp 0x1caf3
movq 0x18(%r12), %rdi
cmpq %rdx, %rdi
je 0x1c9d5
movq %r12, %rdi
movq %rdx, %r12
jmp 0x1caa9
movq 0x18(%rsi), %rdi
movq %rdi, 0x10(%r12)
testq %rdi, %rdi
je 0x1ca05
movq %r12, 0x20(%rdi)
movq 0x20(%r12), %rdi
movq %rdi, 0x20(%rsi)
movq %r14, %r8
testq %rdi, %rdi
jne 0x1ca0e
jmp 0x1ca1e
movq 0x10(%rdi), %rsi
movq %rsi, 0x18(%r12)
testq %rsi, %rsi
je 0x1ca7d
movq %r12, 0x20(%rsi)
movq 0x20(%r12), %rsi
movq %rsi, 0x20(%rdi)
movq %r14, %r8
testq %rsi, %rsi
jne 0x1ca86
jmp 0x1ca96
movq %rcx, 0x20(%rsi)
movq 0x20(%r12), %rdi
leaq 0x10(%rdi), %r9
leaq 0x18(%rdi), %r8
cmpq 0x10(%rdi), %r12
cmoveq %r9, %r8
movq %rsi, (%r8)
movq %r12, 0x18(%rsi)
movq %rsi, 0x20(%r12)
movq %rdx, %rsi
movl $0x0, 0x28(%rsi)
movl $0x1, 0x28(%rcx)
movq 0x18(%rcx), %rdx
movq 0x10(%rdx), %rsi
movq %rsi, 0x18(%rcx)
testq %rsi, %rsi
je 0x1ca50
movq %rcx, 0x20(%rsi)
movq 0x20(%rcx), %rdi
movq %rdi, 0x20(%rdx)
movq %r14, %rsi
testq %rdi, %rdi
je 0x1ca70
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq 0x10(%rdi), %rcx
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rcx, 0x10(%rdx)
movq %rdx, 0x20(%rcx)
jmp 0x1caf3
movq %rcx, 0x20(%rdi)
movq 0x20(%r12), %rsi
leaq 0x10(%rsi), %r9
leaq 0x18(%rsi), %r8
cmpq 0x10(%rsi), %r12
cmoveq %r9, %r8
movq %rdi, (%r8)
movq %r12, 0x10(%rdi)
movq %rdi, 0x20(%r12)
movq 0x10(%rcx), %rsi
movq %rdx, %rdi
movl $0x0, 0x28(%rdi)
movl $0x1, 0x28(%rcx)
movq 0x18(%rsi), %rdx
movq %rdx, 0x10(%rcx)
testq %rdx, %rdx
je 0x1cac8
movq %rcx, 0x20(%rdx)
movq 0x20(%rcx), %rdi
movq %rdi, 0x20(%rsi)
movq %r14, %rdx
testq %rdi, %rdi
je 0x1cae8
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rdx
cmpq 0x10(%rdi), %rcx
cmoveq %r8, %rdx
movq %rsi, (%rdx)
movq %rcx, 0x18(%rsi)
movq %rsi, 0x20(%rcx)
movq %r12, %rdx
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0x1c936
movq (%r14), %rax
jmp 0x1cb16
movl $0x1, 0x28(%rbx)
movq %rbx, (%r14)
movq %rbx, %rax
movl $0x0, 0x28(%rax)
movl (%rbx), %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq