// File: /workspace/github_c_makefile_star2_O0/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetSourceStem_2
static void fstWriterSetSourceStem_2(void *ctx, const char *path, unsigned int line, unsigned int use_realpath, int typ)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;

if(xc && path && path[0])
        {
        uint64_t sidx = 0;
        int slen = strlen(path);
#ifndef _WAVE_HAVE_JUDY
        const uint32_t hashmask = FST_PATH_HASHMASK;
        const unsigned char *path2 = (const unsigned char *)path;
	PPvoid_t pv;
#else
        char *path2 = (char *)alloca(slen + 1); /* judy lacks const qualifier in its JudyHSIns definition */
	PPvoid_t pv;
        strcpy(path2, path);
#endif

        pv = JudyHSIns(&(xc->path_array), path2, slen, NULL);
        if(*pv)
                {
                sidx = (intptr_t)(*pv);
                }
                else
                {
                char *rp = NULL;

                sidx = ++xc->path_array_count;
                *pv = (void *)(intptr_t)(xc->path_array_count);

                if(use_realpath)
                        {
                        rp = fstRealpath(
#ifndef _WAVE_HAVE_JUDY
                                (const char *)
#endif
                                path2, NULL);
                        }

                fstWriterSetAttrGeneric(xc, rp ? rp :
#ifndef _WAVE_HAVE_JUDY
                        (const char *)
#endif
                        path2, FST_MT_PATHNAME, sidx);

                if(rp)
                        {
                        free(rp);
                        }
                }

        fstWriterSetAttrDoubleArgGeneric(xc, typ, sidx, line);
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x7eee
cmpq $0x0, -0x10(%rbp)
je 0x7eee
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x7eee
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2130
movl %eax, -0x34(%rbp)
movl $0xffff, -0x38(%rbp)    # imm = 0xFFFF
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %edx
movl $0xffff, %ecx           # imm = 0xFFFF
callq 0x12030
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, (%rax)
je 0x7e45
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7ed9
movq $0x0, -0x50(%rbp)
movq -0x28(%rbp), %rcx
movl 0x128(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x128(%rcx)
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movl 0x128(%rax), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0x18(%rbp)
je 0x7e90
movq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12dd0
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x7ea9
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x7eb1
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x30(%rbp), %rcx
movl $0x3, %edx
callq 0x7f70
cmpq $0x0, -0x50(%rbp)
je 0x7ed7
movq -0x50(%rbp), %rdi
callq 0x2040
jmp 0x7ed9
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x30(%rbp), %rdx
movl -0x14(%rbp), %eax
movl %eax, %ecx
callq 0x12de0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)