LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_10/calculator.c
// Function: getop
int getop(char s[])
{
  int i = 0, c;

  while ((s[0] = c = line[line_i++]) == ' ' || c == '\t')
    ;

  s[1] = '\0';

  if (isalpha(c))
  {
    var = c;
    return VARGET;
  }

  if (!isdigit(c) && c != '.' && c != '-')
  {
    return c;
  }

  if (c == '-')
  {
    int next = line[line_i++];
    if (next == '\n' || next == ' ' || next == '\t' || next == '\0')
    {
      --line_i;
      return '-';
    }
    else if (!isdigit(next) && next != '.') // not a number
    {
      return next;
    }
    else
    {
      s[++i] = c = next;
    }
  }
  else
  {
    c = line[line_i++];
  }

  if (isdigit(c))
  {
    while (isdigit(s[++i] = c = line[line_i++]))
      ;
  }

  if (c == '.')
  {
    while (isdigit(s[++i] = c = line[line_i++]))
      ;
  }

  --line_i;

  return NUMBER;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2899(%rip), %r14      # 0x40a0
movslq 0x2882(%rip), %rax      # 0x4090
leal 0x1(%rax), %ecx
movl %ecx, 0x2879(%rip)      # 0x4090
movzbl (%rax,%r14), %r15d
movb %r15b, (%rbx)
cmpl $0x9, %r15d
je 0x1807
cmpl $0x20, %r15d
je 0x1807
movsbq %r15b, %r12
movb $0x0, 0x1(%rbx)
callq 0x10b0
movq (%rax), %rdx
movzwl (%rdx,%r12,2), %ecx
btl $0xa, %ecx
jb 0x1861
leal -0x2f(%r15), %esi
cmpb $-0x3, %sil
ja 0x1872
andl $0x800, %ecx            # imm = 0x800
jne 0x1872
movsbl %r15b, %ecx
jmp 0x194d
movb %r15b, 0x2808(%rip)     # 0x4070
movl $0x61, %ecx
jmp 0x194d
movslq 0x2817(%rip), %r9       # 0x4090
leal 0x1(%r9), %ecx
xorl %esi, %esi
movl %ecx, 0x280b(%rip)      # 0x4090
movb (%r9,%r14), %r8b
movsbq %r8b, %rdi
movsbl %r8b, %ecx
cmpb $0x2d, %r15b
jne 0x18e1
movzbl %r8b, %esi
cmpl $0x20, %esi
ja 0x18c3
movl %esi, %esi
movabsq $0x100000601, %r10      # imm = 0x100000601
btq %rsi, %r10
jae 0x18c3
movl %r9d, 0x27d7(%rip)      # 0x4090
movl $0x2d, %ecx
jmp 0x194d
cmpb $0x2e, %r8b
je 0x18d5
movzwl (%rdx,%rdi,2), %edx
andl $0x800, %edx            # imm = 0x800
je 0x194d
movb %r8b, 0x1(%rbx)
movq (%rax), %rdx
movl $0x1, %esi
testb $0x8, 0x1(%rdx,%rdi,2)
je 0x1910
movl %esi, %esi
movq (%rax), %rdx
movslq 0x279c(%rip), %rcx      # 0x4090
leal 0x1(%rcx), %edi
movl %edi, 0x2793(%rip)      # 0x4090
movsbq (%rcx,%r14), %rcx
movb %cl, 0x1(%rbx,%rsi)
incq %rsi
testb $0x8, 0x1(%rdx,%rcx,2)
jne 0x18ea
cmpl $0x2e, %ecx
jne 0x1942
movl %esi, %ecx
addq %rbx, %rcx
incq %rcx
movq (%rax), %rdx
movslq 0x2769(%rip), %rsi      # 0x4090
leal 0x1(%rsi), %edi
movl %edi, 0x2760(%rip)      # 0x4090
movsbq (%rsi,%r14), %rsi
movb %sil, (%rcx)
incq %rcx
testb $0x8, 0x1(%rdx,%rsi,2)
jne 0x191d
decl 0x2748(%rip)            # 0x4090
movl $0x30, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/aegis128l/aesnic/encrypt.c
// Function: aegis128L_ad_partial
void aegis128L_ad_partial(__m128i *state, const unsigned char *ad, unsigned long long adlen)  
{
    unsigned char plaintextblock[32], ciphertextblock[32]; 
    unsigned long long i;  
     
    for (i = 0; (i+32) <= adlen; i += 32) aegis128L_enc_aut_step(ad+i, ciphertextblock, state);  

    if ( (adlen & 0x1f) != 0 )  { 
         memset(plaintextblock, 0, 32);  
         memcpy(plaintextblock, ad+i, adlen & 0x1f);  
         aegis128L_enc_aut_step(plaintextblock, ciphertextblock, state);  
    }  
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpq $0x20, %rdx
jae 0x14bb
xorl %eax, %eax
jmp 0x14e0
xorl %r13d, %r13d
movq %rsp, %r12
leaq (%r15,%r13), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x1060
leaq 0x20(%r13), %rax
addq $0x40, %r13
cmpq %r14, %r13
movq %rax, %r13
jbe 0x14c1
andq $0x1f, %r14
je 0x1521
addq %rax, %r15
movl $0x20, %edx
subq %r14, %rdx
leaq (%rsp,%r14), %rdi
addq $0x20, %rdi
xorl %esi, %esi
callq 0x1030
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x10c0
movq %rsp, %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x1060
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/aegis128l/aesnic/encrypt.c
// Function: aegis128L_enc_partial
void aegis128L_enc_partial(__m128i *state, const unsigned char *m, unsigned long long mlen, unsigned char* c)  
{
    unsigned char plaintextblock[32], ciphertextblock[32];  
    unsigned long long i;  
     
    for (i = 0; (i+32) <= mlen; i += 32) aegis128L_enc_aut_step(m+i, c+i, state);  

    if ( (mlen & 0x1f) != 0 )  {
         memset(plaintextblock, 0, 32);    
         memcpy(plaintextblock, m + i, mlen & 0x1f);    
         aegis128L_enc_aut_step(plaintextblock, ciphertextblock, state);
         memcpy(c+i,ciphertextblock,mlen & 0x1f); 
    }  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
cmpq $0x20, %rdx
jae 0x1553
xorl %ebp, %ebp
jmp 0x1576
xorl %r13d, %r13d
leaq (%r12,%r13), %rdi
leaq (%r14,%r13), %rsi
movq %r15, %rdx
callq 0x1060
leaq 0x20(%r13), %rbp
addq $0x40, %r13
cmpq %rbx, %r13
movq %rbp, %r13
jbe 0x1556
andq $0x1f, %rbx
je 0x15c7
addq %rbp, %r12
movl $0x20, %edx
subq %rbx, %rdx
leaq (%rsp,%rbx), %rdi
xorl %esi, %esi
callq 0x1030
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x10c0
leaq 0x20(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1060
addq %rbp, %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x10c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/aegis128l/aesnic/encrypt.c
// Function: aegis128L_dec_partial
void aegis128L_dec_partial(__m128i *state, unsigned char *m, unsigned long long mlen, const unsigned char *c)  
{
    unsigned char plaintextblock[32], ciphertextblock[32];  
    unsigned long long i;  
     
    for (i = 0; (i+32) <= mlen; i += 32) aegis128L_dec_aut_step(m+i, c+i, state);  

    if (  (mlen & 0x1f) != 0 )  {
        memset(ciphertextblock, 0, 32);
        memcpy(ciphertextblock, c+i, mlen & 0x1f);
        aegis128L_dec_aut_step(plaintextblock, ciphertextblock, state);
        memcpy(m+i, plaintextblock, mlen & 0x1f);

        //need to modify the state here (because in the last block, keystream is wrongly used to update the state)
        memset(plaintextblock, 0, mlen & 0x1f);
        state[0] = _mm_xor_si128( state[0], _mm_load_si128((__m128i*)plaintextblock)  ) ;
        state[4] = _mm_xor_si128( state[4], _mm_load_si128((__m128i*)(plaintextblock+16) )  ) ;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpq $0x20, %rdx
jae 0x15fa
xorl %ebp, %ebp
jmp 0x161d
xorl %r13d, %r13d
leaq (%r15,%r13), %rdi
leaq (%r12,%r13), %rsi
movq %rbx, %rdx
callq 0x10a0
leaq 0x20(%r13), %rbp
addq $0x40, %r13
cmpq %r14, %r13
movq %rbp, %r13
jbe 0x15fd
andq $0x1f, %r14
je 0x169a
addq %rbp, %r12
movl $0x20, %edx
subq %r14, %rdx
leaq (%rsp,%r14), %rdi
xorl %esi, %esi
callq 0x1030
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x10c0
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x10a0
addq %rbp, %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x10c0
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1030
vmovaps (%r12), %xmm0
vxorps (%rbx), %xmm0, %xmm0
vmovaps %xmm0, (%rbx)
vmovaps 0x10(%r12), %xmm0
vxorps 0x40(%rbx), %xmm0, %xmm0
vmovaps %xmm0, 0x40(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: tmpfile_close
static void tmpfile_close(FILE **f, char **nam)
{
if(f)
        {
        if(*f) { fclose(*f); *f = NULL; }
        }

if(nam)
        {
        if(*nam)
                {
                unlink(*nam);
                free(*nam);
                *nam = NULL;
                }
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x58ba
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x58ba
callq 0x2110
movq $0x0, (%r14)
testq %rbx, %rbx
je 0x58db
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x58db
callq 0x2080
movq (%rbx), %rdi
callq 0x2050
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterVarint
static int fstWriterVarint(FILE *handle, uint64_t v)
{
uint64_t nxt;
unsigned char buf[10]; /* ceil(64/7) = 10 */
unsigned char *pnt = buf;
int len;

while((nxt = v>>7))
        {
        *(pnt++) = ((unsigned char)v) | 0x80;
        v = nxt;
        }
*(pnt++) = (unsigned char)v;

len = pnt-buf;
fstFwrite(buf, len, 1, handle);
return(len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rcx
leaq -0x12(%rbp), %rdi
cmpq $0x80, %rsi
jae 0x775e
movq %rdi, %rax
movq %rsi, %rdx
jmp 0x7782
leaq -0x12(%rbp), %rax
movq %rsi, %rdx
shrq $0x7, %rdx
movl %esi, %r8d
orb $-0x80, %r8b
movb %r8b, (%rax)
incq %rax
cmpq $0x3fff, %rsi           # imm = 0x3FFF
movq %rdx, %rsi
ja 0x7765
movb %dl, (%rax)
subq %rdi, %rax
incq %rax
movslq %eax, %rbx
movl $0x1, %edx
movq %rbx, %rsi
callq 0x2390
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: JenkinsFree
void JenkinsFree(void *base_i, uint32_t hashmask)
{
struct collchain_t ***base = (struct collchain_t ***)base_i;
uint32_t h;
struct collchain_t **ar;
struct collchain_t *chain, *chain_next;

if(base && *base)
        {
        ar = *base;
        for(h=0;h<=hashmask;h++)
                {
                chain = ar[h];
                while(chain)
                        {
                        chain_next = chain->next;
                        free(chain);
                        chain = chain_next;
                        }
                }

        free(*base);
        *base = NULL;
        }
}

// Assembly:
testq %rdi, %rdi
je 0x7808
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r15
testq %r15, %r15
je 0x77fa
movl %esi, %r14d
xorl %r12d, %r12d
movl %r12d, %eax
movq (%r15,%rax,8), %rdi
testq %rdi, %rdi
je 0x77e3
movq (%rdi), %r13
callq 0x2050
movq %r13, %rdi
testq %r13, %r13
jne 0x77d3
incl %r12d
cmpl %r14d, %r12d
jbe 0x77c7
movq (%rbx), %rdi
callq 0x2050
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetDate
void fstWriterSetDate(void *ctx, const char *dat)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
        {
        char s[FST_HDR_DATE_SIZE];
        off_t fpos = ftello(xc->handle);
        int len = strlen(dat);

        fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_DATE, SEEK_SET);
        memset(s, 0, FST_HDR_DATE_SIZE);
        memcpy(s, dat, (len < FST_HDR_DATE_SIZE) ? len : FST_HDR_DATE_SIZE);
        fstFwrite(s, FST_HDR_DATE_SIZE, 1, xc->handle);
        fflush(xc->handle);
        fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
        }
}

// Assembly:
testq %rdi, %rdi
je 0x78ec
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movq %r15, %rdi
callq 0x2130
movq %rax, %r12
movq (%rbx), %rdi
movl $0xca, %esi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x7859
orb $0x1, 0x12c(%rbx)
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %r13
movaps %xmm0, 0x60(%r13)
movaps %xmm0, 0x50(%r13)
movaps %xmm0, 0x40(%r13)
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x20(%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
movq $0x0, 0x6f(%r13)
cmpl $0x77, %r12d
movl $0x77, %eax
cmovll %r12d, %eax
movslq %eax, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2240
movq (%rbx), %rcx
movl $0x77, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x78de
orb $0x1, 0x12c(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetVersion
void fstWriterSetVersion(void *ctx, const char *vers)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc && vers)
        {
        char s[FST_HDR_SIM_VERSION_SIZE];
        off_t fpos = ftello(xc->handle);
        int len = strlen(vers);

        fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_SIM_VERSION, SEEK_SET);
        memset(s, 0, FST_HDR_SIM_VERSION_SIZE);
        memcpy(s, vers, (len < FST_HDR_SIM_VERSION_SIZE) ? len : FST_HDR_SIM_VERSION_SIZE);
        fstFwrite(s, FST_HDR_SIM_VERSION_SIZE, 1, xc->handle);
        fflush(xc->handle);
        fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
        }
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x79dd
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movq %r15, %rdi
callq 0x2130
movq %rax, %r12
movq (%rbx), %rdi
movl $0x4a, %esi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x794b
orb $0x1, 0x12c(%rbx)
xorps %xmm0, %xmm0
leaq -0xb0(%rbp), %r13
movaps %xmm0, 0x70(%r13)
movaps %xmm0, 0x60(%r13)
movaps %xmm0, 0x50(%r13)
movaps %xmm0, 0x40(%r13)
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x20(%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
movl $0x80, %eax
cmpl %eax, %r12d
cmovll %r12d, %eax
movslq %eax, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2240
movq (%rbx), %rcx
movl $0x80, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x79cc
orb $0x1, 0x12c(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetFileType
void fstWriterSetFileType(void *ctx, enum fstFileType filetype)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
        {
        if(/*(filetype >= FST_FT_MIN) &&*/ (filetype <= FST_FT_MAX))
                {
                off_t fpos = ftello(xc->handle);

                xc->filetype = filetype;

                fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_FILETYPE, SEEK_SET);
                fputc(xc->filetype, xc->handle);
                fflush(xc->handle);
                fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
                }
        }
}

// Assembly:
testq %rdi, %rdi
sete %al
cmpl $0x3, %esi
setae %cl
orb %al, %cl
jne 0x7a63
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movb %r15b, 0xe8(%rbx)
movq (%rbx), %rdi
movl $0x141, %esi            # imm = 0x141
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x7a2a
orb $0x1, 0x12c(%rbx)
movzbl 0xe8(%rbx), %edi
movq (%rbx), %rsi
callq 0x21c0
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x7a59
orb $0x1, 0x12c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x7b48
movq %rsi, %r13
cmpb $0x0, (%rsi)
je 0x7b48
movl %edx, %r12d
movq %rdi, %r14
movq %r13, %rdi
callq 0x2130
leaq 0x120(%r14), %rdi
movq %r13, %rsi
movl %eax, %edx
movl $0xffff, %ecx           # imm = 0xFFFF
callq 0xdf01
movq (%rax), %r15
testq %r15, %r15
jne 0x7af6
movl 0x128(%r14), %r15d
incl %r15d
movl %r15d, 0x128(%r14)
movq %r15, (%rax)
movq %r14, %rdi
movq %r13, %rsi
movl $0x3, %edx
movq %r15, %rcx
callq 0x7b71
movl %r12d, %r8d
leaq -0x33(%rbp), %rax
cmpq $0x80, %r15
jae 0x7b0b
movq %r15, %rcx
jmp 0x7b2d
movq %r15, %rdx
movq %r15, %rcx
shrq $0x7, %rcx
movl %edx, %esi
orb $-0x80, %sil
movb %sil, (%rax)
incq %rax
cmpq $0x3fff, %rdx           # imm = 0x3FFF
movq %rcx, %rdx
ja 0x7b11
movb %cl, (%rax)
testq %r15, %r15
je 0x7b38
movb $0x0, 0x1(%rax)
leaq -0x33(%rbp), %rcx
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x8268
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetAttrGeneric
static void fstWriterSetAttrGeneric(void *ctx, const char *comm, int typ, uint64_t arg)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc && comm)
        {
        char *s = strdup(comm);
        char *sf = s;

        while(*s)
                {
                if((*s == '\n') || (*s == '\r')) *s = ' ';
                s++;
                }

        fstWriterSetAttrBegin(xc, FST_AT_MISC, typ, sf, arg);
        free(sf);
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x7bbb
movl %edx, %r14d
movq %rdi, %r15
movq %rsi, %rdi
callq 0x23a0
movq %rax, %r12
movzbl (%rax), %ecx
cmpl $0xa, %ecx
je 0x7bb3
cmpl $0xd, %ecx
je 0x7bb3
testl %ecx, %ecx
jne 0x7bb6
jmp 0x7bc4
movb $0x20, (%rax)
incq %rax
jmp 0x7ba0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
xorl %esi, %esi
movl %r14d, %edx
movq %r12, %rcx
movq %rbx, %r8
callq 0x8268
movq %r12, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetTimescale
void fstWriterSetTimescale(void *ctx, int ts)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
        {
        off_t fpos = ftello(xc->handle);
        fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_TIMESCALE, SEEK_SET);
        fputc(ts & 255, xc->handle);
        fflush(xc->handle);
        fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
        }
}

// Assembly:
testq %rdi, %rdi
je 0x7c79
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movq (%rbx), %rdi
movl $0x49, %esi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x7c43
orb $0x1, 0x12c(%rbx)
movzbl %r15b, %edi
movq (%rbx), %rsi
callq 0x21c0
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x7c6f
orb $0x1, 0x12c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetTimescaleFromString
void fstWriterSetTimescaleFromString(void *ctx, const char *s)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc && s)
        {
        int mat = 0;
        int seconds_exp = -9;
        int tv = atoi(s);
        const char *pnt = s;

        while(*pnt)
                {
                switch(*pnt)
                        {
                        case 'm': seconds_exp =  -3; mat = 1; break;
                        case 'u': seconds_exp =  -6; mat = 1; break;
                        case 'n': seconds_exp =  -9; mat = 1; break;
                        case 'p': seconds_exp = -12; mat = 1; break;
                        case 'f': seconds_exp = -15; mat = 1; break;
                        case 'a': seconds_exp = -18; mat = 1; break;
                        case 'z': seconds_exp = -21; mat = 1; break;
                        case 's': seconds_exp =   0; mat = 1; break;
                        default: break;
                        }

                if(mat) break;
                pnt++;
                }

        if(tv == 10)
                {
                seconds_exp++;
                }
        else
        if(tv == 100)
                {
                seconds_exp+=2;
                }

        fstWriterSetTimescale(ctx, seconds_exp);
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x7cd3
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2360
leaq 0xc452(%rip), %rcx      # 0x140f8
movzbl (%r14), %edx
cmpl $0x6c, %edx
jle 0x7cc0
addl $-0x6d, %edx
cmpl $0xd, %edx
ja 0x7cce
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
testl %edx, %edx
je 0x7cd8
cmpl $0x61, %edx
je 0x7d06
cmpl $0x66, %edx
je 0x7cff
incq %r14
jmp 0x7ca6
popq %rbx
popq %r14
popq %rbp
retq
movl $0xfffffff7, %esi       # imm = 0xFFFFFFF7
jmp 0x7d0b
xorl %esi, %esi
jmp 0x7d0b
movl $0xfffffff4, %esi       # imm = 0xFFFFFFF4
jmp 0x7d0b
movl $0xfffffffa, %esi       # imm = 0xFFFFFFFA
jmp 0x7d0b
movl $0xffffffeb, %esi       # imm = 0xFFFFFFEB
jmp 0x7d0b
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
jmp 0x7d0b
movl $0xfffffff1, %esi       # imm = 0xFFFFFFF1
jmp 0x7d0b
movl $0xffffffee, %esi       # imm = 0xFFFFFFEE
cmpl $0x64, %eax
je 0x7d19
cmpl $0xa, %eax
jne 0x7d1c
incl %esi
jmp 0x7d1c
addl $0x2, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x7c09
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetTimezero
void fstWriterSetTimezero(void *ctx, int64_t tim)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
        {
        off_t fpos = ftello(xc->handle);
        fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_TIMEZERO, SEEK_SET);
        fstWriterUint64(xc->handle, (xc->timezero = tim));
        fflush(xc->handle);
        fstWriterFseeko(xc, xc->handle, fpos, SEEK_SET);
        }
}

// Assembly:
testq %rdi, %rdi
je 0x7dbd
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x20b0
movq %rax, %r14
movq (%rbx), %rdi
movl $0x142, %esi            # imm = 0x142
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x7d66
orb $0x1, 0x12c(%rbx)
movq (%rbx), %rcx
movq %r15, 0x78(%rbx)
movl $0x8, %eax
movb %r15b, -0x21(%rbp,%rax)
shrq $0x8, %r15
decq %rax
jne 0x7d72
leaq -0x20(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x2390
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x7db3
orb $0x1, 0x12c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetParallelMode
void fstWriterSetParallelMode(void *ctx, int enable)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
        {
        xc->parallel_was_enabled |= xc->parallel_enabled; /* make sticky */
        xc->parallel_enabled = (enable != 0);
#ifndef FST_WRITER_PARALLEL
        if(xc->parallel_enabled)
                {
                fprintf(stderr, FST_APIMESS "fstWriterSetParallelMode(), FST_WRITER_PARALLEL not enabled during compile, exiting.\n");
                exit(255);
                }
#endif
        }
}

// Assembly:
testq %rdi, %rdi
je 0x7e33
movb 0xe9(%rdi), %al
leal (%rax,%rax), %ecx
andb $-0x80, %cl
testl %esi, %esi
setne %dl
shlb $0x6, %dl
andb $-0x41, %al
orb %dl, %al
orb %cl, %al
movb %al, 0xe9(%rdi)
testl %esi, %esi
jne 0x7e34
retq
pushq %rbp
movq %rsp, %rbp
callq 0x29a6
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetScope
void fstWriterSetScope(void *ctx, enum fstScopeType scopetype,
                const char *scopename, const char *scopecomp)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;

if(xc)
        {
        fputc(FST_ST_VCD_SCOPE, xc->hier_handle);
        if(/*(scopetype < FST_ST_VCD_MODULE) ||*/ (scopetype > FST_ST_MAX)) { scopetype = FST_ST_VCD_MODULE; }
        fputc(scopetype, xc->hier_handle);
        fprintf(xc->hier_handle, "%s%c%s%c",
                scopename ? scopename : "", 0,
                scopecomp ? scopecomp : "", 0);

        if(scopename)
                {
                xc->hier_file_len += strlen(scopename);
                }
        if(scopecomp)
                {
                xc->hier_file_len += strlen(scopecomp);
                }

        xc->hier_file_len += 4; /* FST_ST_VCD_SCOPE + scopetype + two string terminating zeros */
        xc->numscopes++;
        }
}

// Assembly:
testq %rdi, %rdi
je 0x8240
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
movl $0xfe, %edi
callq 0x21c0
xorl %eax, %eax
cmpl $0x16, %r12d
cmovael %eax, %r12d
movq 0x8(%rbx), %rsi
movl %r12d, %edi
callq 0x21c0
testq %r15, %r15
leaq 0xc6d8(%rip), %r8       # 0x148b5
movq %r15, %rdx
cmoveq %r8, %rdx
movq 0x8(%rbx), %rdi
testq %r14, %r14
cmovneq %r14, %r8
leaq 0xc1a9(%rip), %rsi      # 0x1439f
xorl %ecx, %ecx
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x2210
testq %r15, %r15
je 0x8213
movq %r15, %rdi
callq 0x2130
addq %rax, 0x38(%rbx)
testq %r14, %r14
je 0x8226
movq %r14, %rdi
callq 0x2130
addq 0x38(%rbx), %rax
jmp 0x822a
movq 0x38(%rbx), %rax
addq $0x4, %rax
movq %rax, 0x38(%rbx)
incl 0xb8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterSetAttrBegin
void fstWriterSetAttrBegin(void *ctx, enum fstAttrType attrtype, int subtype,
                const char *attrname, uint64_t arg)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;

if(xc)
        {
        fputc(FST_ST_GEN_ATTRBEGIN, xc->hier_handle);
        if(/*(attrtype < FST_AT_MISC) ||*/ (attrtype > FST_AT_MAX)) { attrtype = FST_AT_MISC; subtype = FST_MT_UNKNOWN; }
        fputc(attrtype, xc->hier_handle);

        switch(attrtype)
                {
                case FST_AT_ARRAY:      if((subtype < FST_AR_NONE) || (subtype > FST_AR_MAX)) subtype = FST_AR_NONE; break;
                case FST_AT_ENUM:       if((subtype < FST_EV_SV_INTEGER) || (subtype > FST_EV_MAX)) subtype = FST_EV_SV_INTEGER; break;
                case FST_AT_PACK:       if((subtype < FST_PT_NONE) || (subtype > FST_PT_MAX)) subtype = FST_PT_NONE; break;

                case FST_AT_MISC:
                default:                break;
                }

        fputc(subtype, xc->hier_handle);
        fprintf(xc->hier_handle, "%s%c",
                attrname ? attrname : "", 0);

        if(attrname)
                {
                xc->hier_file_len += strlen(attrname);
                }

        xc->hier_file_len += 4; /* FST_ST_GEN_ATTRBEGIN + type + subtype + string terminating zero */
        xc->hier_file_len += fstWriterVarint(xc->hier_handle, arg);
        }
}

// Assembly:
testq %rdi, %rdi
je 0x8349
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
movq %r8, -0x30(%rbp)
movq 0x8(%rdi), %rsi
movl $0xfc, %edi
callq 0x21c0
xorl %r14d, %r14d
cmpl $0x4, %r13d
movl $0x8, %eax
cmovael %eax, %r12d
cmovael %r14d, %r13d
movq 0x8(%rbx), %rsi
movl %r13d, %edi
callq 0x21c0
leaq 0xbe6c(%rip), %rax      # 0x14130
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x4, %r12d
jmp 0x82d7
cmpl $0x10, %r12d
cmovael %r14d, %r12d
movq 0x8(%rbx), %rsi
movl %r12d, %edi
callq 0x21c0
movq 0x8(%rbx), %rdi
testq %r15, %r15
leaq 0xc5c0(%rip), %rdx      # 0x148b5
cmovneq %r15, %rdx
leaq 0xc0a3(%rip), %rsi      # 0x143a3
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2210
testq %r15, %r15
je 0x831c
movq %r15, %rdi
callq 0x2130
addq 0x38(%rbx), %rax
jmp 0x8320
movq 0x38(%rbx), %rax
addq $0x4, %rax
movq %rax, 0x38(%rbx)
movq 0x8(%rbx), %rdi
movq -0x30(%rbp), %rsi
callq 0x773d
cltq
addq %rax, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstUtilityBinToEscConvertedLen
int fstUtilityBinToEscConvertedLen(const unsigned char *s, int len)
{
const unsigned char *src = s;
int dlen = 0;
int i;

for(i=0;i<len;i++)
        {
        switch(src[i])
                {
                case '\a':      /* fallthrough */
                case '\b':	/* fallthrough */
                case '\f':	/* fallthrough */
                case '\n':	/* fallthrough */
                case '\r':	/* fallthrough */
                case '\t':	/* fallthrough */
                case '\v':	/* fallthrough */
                case '\'':	/* fallthrough */
                case '\"':	/* fallthrough */
                case '\\':	/* fallthrough */
                case '\?':      dlen += 2; break;
                default:        if((src[i] > ' ') && (src[i] <= '~')) /* no white spaces in output */
                                        {
					dlen++;
                                        }
                                        else
                                        {
					dlen += 4;
                                        }
                                break;
                }
        }

return(dlen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
jle 0x8655
movl %esi, %ecx
xorl %edx, %edx
movabsq $0x400000020000021, %rsi # imm = 0x400000020000021
xorl %eax, %eax
movb (%rdi,%rdx), %r9b
movzbl %r9b, %r10d
movl $0x2, %r8d
leal -0x7(%r10), %r11d
cmpl $0x7, %r11d
jb 0x8630
addl $-0x22, %r10d
cmpl $0x3a, %r10d
ja 0x863d
btq %r10, %rsi
jae 0x863d
addl %r8d, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x8608
jmp 0x8657
addb $-0x21, %r9b
xorl %r8d, %r8d
cmpb $0x5e, %r9b
setae %r8b
leal (%r8,%r8,2), %r8d
incl %r8d
jmp 0x8630
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterEmitValueChange32
void fstWriterEmitValueChange32(void *ctx, fstHandle handle,
                                uint32_t bits, uint32_t val) {
        char buf[32];
        char *s = buf;
        uint32_t i;
        for (i = 0; i < bits; ++i)
        {
                *s++ = '0' + ((val >> (bits - i - 1)) & 1);
        }
        fstWriterEmitValueChange(ctx, handle, buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
testl %edx, %edx
je 0x8a19
decl %edx
leaq -0x20(%rbp), %rax
btl %edx, %ecx
setb %r8b
orb $0x30, %r8b
movb %r8b, (%rax)
incq %rax
addl $-0x1, %edx
jb 0x8a03
leaq -0x20(%rbp), %rdx
callq 0x665a
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterEmitValueChange64
void fstWriterEmitValueChange64(void *ctx, fstHandle handle,
                                uint32_t bits, uint64_t val) {
        char buf[64];
        char *s = buf;
        uint32_t i;
        for (i = 0; i < bits; ++i)
        {
                *s++ = '0' + ((val >> (bits - i - 1)) & 1);
        }
        fstWriterEmitValueChange(ctx, handle, buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
testl %edx, %edx
je 0x8a56
movl %edx, %eax
decl %edx
xorl %r8d, %r8d
btq %rdx, %rcx
setb %r9b
orb $0x30, %r9b
movb %r9b, -0x40(%rbp,%r8)
incq %r8
decl %edx
cmpq %r8, %rax
jne 0x8a3b
leaq -0x40(%rbp), %rdx
callq 0x665a
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterEmitDumpActive
void fstWriterEmitDumpActive(void *ctx, int enable)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;

if(xc)
        {
        struct fstBlackoutChain *b = (struct fstBlackoutChain *)calloc(1, sizeof(struct fstBlackoutChain));

        b->tim = xc->curtime;
        b->active = (enable != 0);

        xc->num_blackouts++;
        if(xc->blackout_curr)
                {
                xc->blackout_curr->next = b;
                xc->blackout_curr = b;
                }
                else
                {
                xc->blackout_head = b;
                xc->blackout_curr = b;
                }
        }
}

// Assembly:
testq %rdi, %rdi
je 0x9094
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x21e0
movq 0x90(%rbx), %rcx
movq %rcx, 0x8(%rax)
testl %r14d, %r14d
setne 0x10(%rax)
incl 0xd8(%rbx)
movq 0xd0(%rbx), %rcx
leaq 0xc8(%rbx), %rdx
testq %rcx, %rcx
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq %rax, 0xd0(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderFseeko
int fstReaderFseeko(struct fstReaderContext *xc, FILE *stream, off_t offset, int whence)
{
int rc = fseeko(stream, offset, whence);

if(rc<0)
        {
        xc->fseek_failed = 1;
#ifdef FST_DEBUG
        fprintf(stderr, FST_APIMESS "Seek to #%" PRId64 " (whence = %d) failed!\n", offset, whence);
        perror("Why");
#endif
        }

return(rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x2320
testl %eax, %eax
jns 0x90b6
orb $0x1, 0x697(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderPopScope
const char *fstReaderPopScope(void *ctx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
if(xc && xc->curr_hier)
        {
        struct fstCurrHier *ch = xc->curr_hier;
        if(xc->curr_hier->prev)
                {
                xc->curr_flat_hier_nam[xc->curr_hier->prev->len] = 0;
                }
                else
                {
                *xc->curr_flat_hier_nam = 0;
                }
        xc->curr_hier = xc->curr_hier->prev;
        free(ch);
        return(xc->curr_flat_hier_nam ? xc->curr_flat_hier_nam : "");
        }

return(NULL);
}

// Assembly:
testq %rdi, %rdi
je 0x915f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x278(%rdi), %rdi
testq %rdi, %rdi
je 0x9162
movq (%rdi), %rcx
movq 0x288(%rbx), %rax
testq %rcx, %rcx
je 0x912f
movslq 0x10(%rcx), %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movq 0x278(%rbx), %rax
movq (%rax), %rax
movq %rax, 0x278(%rbx)
callq 0x2050
movq 0x288(%rbx), %rcx
testq %rcx, %rcx
leaq 0xb75c(%rip), %rax      # 0x148b5
cmovneq %rcx, %rax
jmp 0x9164
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderPushScope
const char *fstReaderPushScope(void *ctx, const char *nam, void *user_info)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
if(xc)
        {
        struct fstCurrHier *ch = (struct fstCurrHier *)malloc(sizeof(struct fstCurrHier));
        int chl = xc->curr_hier ? xc->curr_hier->len : 0;
        int len = chl + 1 + strlen(nam);
        if(len >= xc->flat_hier_alloc_len)
                {
                xc->curr_flat_hier_nam = xc->curr_flat_hier_nam ? (char *)realloc(xc->curr_flat_hier_nam, len+1) : (char *)malloc(len+1);
                }

        if(chl)
                {
                xc->curr_flat_hier_nam[chl] = '.';
                strcpy(xc->curr_flat_hier_nam + chl + 1, nam);
                }
                else
                {
                strcpy(xc->curr_flat_hier_nam, nam);
                len--;
                }

        ch->len = len;
        ch->prev = xc->curr_hier;
        ch->user_info = user_info;
        xc->curr_hier = ch;
        return(xc->curr_flat_hier_nam);
        }

return(NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %r13d, %r13d
testq %rdi, %rdi
je 0x926f
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, -0x38(%rbp)
movl $0x18, %edi
callq 0x2270
movq %rax, %r12
movq 0x278(%rbx), %rax
testq %rax, %rax
je 0x91d1
movl 0x10(%rax), %r13d
movq %r14, -0x30(%rbp)
movq %r14, %rdi
callq 0x2130
movq %rax, %r15
leal (%rax,%r13), %r14d
incl %r14d
cmpl 0x290(%rbx), %r14d
jl 0x9219
movq 0x288(%rbx), %rdi
leal 0x1(%r14), %eax
movslq %eax, %rsi
testq %rdi, %rdi
je 0x920a
callq 0x22c0
jmp 0x9212
movq %rsi, %rdi
callq 0x2270
movq %rax, 0x288(%rbx)
movq 0x288(%rbx), %rdi
testl %r13d, %r13d
je 0x923c
movslq %r13d, %rax
movb $0x2e, (%rdi,%rax)
movq 0x288(%rbx), %rcx
leaq (%rcx,%rax), %rdi
incq %rdi
jmp 0x923f
movl %r15d, %r14d
movq -0x30(%rbp), %rsi
callq 0x20a0
movl %r14d, 0x10(%r12)
movq 0x278(%rbx), %rax
movq %rax, (%r12)
movq -0x38(%rbp), %rax
movq %rax, 0x8(%r12)
movq %r12, 0x278(%rbx)
movq 0x288(%rbx), %r13
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderGetFacProcessMask
int fstReaderGetFacProcessMask(void *ctx, fstHandle facidx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;

if(xc)
        {
        facidx--;
        if(facidx<xc->maxhandle)
                {
                int process_idx = facidx/8;
                int process_bit = facidx&7;

                return( (xc->process_mask[process_idx]&(1<<process_bit)) != 0 );
                }
        }
return(0);
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x92e1
decl %esi
cmpl 0x38(%rdi), %esi
jae 0x92e1
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
shrl $0x3, %eax
movq 0x60(%rdi), %rcx
movzbl (%rcx,%rax), %ecx
andl $0x7, %esi
xorl %eax, %eax
btl %esi, %ecx
setb %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderSetFacProcessMask
void fstReaderSetFacProcessMask(void *ctx, fstHandle facidx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;

if(xc)
        {
        facidx--;
        if(facidx<xc->maxhandle)
                {
                int idx = facidx/8;
                int bitpos = facidx&7;

                xc->process_mask[idx] |= (1<<bitpos);
                }
        }
}

// Assembly:
testq %rdi, %rdi
je 0x930c
decl %esi
cmpl 0x38(%rdi), %esi
jae 0x930c
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
shrl $0x3, %eax
andb $0x7, %sil
movl $0x1, %edx
movl %esi, %ecx
shll %cl, %edx
movq 0x60(%rdi), %rcx
orb %dl, (%rcx,%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderIterateHierRewind
int fstReaderIterateHierRewind(void *ctx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
int pass_status = 0;

if(xc)
        {
        pass_status = 1;
        if(!xc->fh)
                {
                pass_status = fstReaderRecreateHierFile(xc);
                }

        xc->do_rewind = 1;
        }

return(pass_status);
}

// Assembly:
testq %rdi, %rdi
je 0x958b
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %eax
cmpq $0x0, 0x8(%rdi)
jne 0x957d
movq %rbx, %rdi
callq 0x958e
orb $0x1, 0x294(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderVarint64
static uint64_t fstReaderVarint64(FILE *f)
{
unsigned char buf[16];
unsigned char *mem = buf;
uint64_t rc = 0;
int ch;

do
        {
        ch = fgetc(f);
        *(mem++) = ch;
        } while(ch & 0x80);
mem--;

for(;;)
        {
        rc <<= 7;
        rc |= (uint64_t)(*mem & 0x7f);
        if(mem == buf)
                {
                break;
                }
        mem--;
        }

return(rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x21a0
movb %al, -0x20(%rbp,%r14)
incq %r14
testb %al, %al
js 0x9dae
xorl %eax, %eax
movq %rax, %rcx
shlq $0x7, %rcx
movzbl -0x21(%rbp,%r14), %eax
andl $0x7f, %eax
orq %rcx, %rax
decq %r14
jne 0x9dc4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderVarint32
static uint32_t fstReaderVarint32(FILE *f)
{
unsigned char buf[5];
unsigned char *mem = buf;
uint32_t rc = 0;
int ch;

do
        {
        ch = fgetc(f);
        *(mem++) = ch;
        } while(ch & 0x80);
mem--;

for(;;)
        {
        rc <<= 7;
        rc |= (uint32_t)(*mem & 0x7f);
        if(mem == buf)
                {
                break;
                }
        mem--;
        }

return(rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x21a0
movb %al, -0x15(%rbp,%r14)
incq %r14
testb %al, %al
js 0x9df6
xorl %eax, %eax
movl %eax, %ecx
shll $0x7, %ecx
movzbl -0x16(%rbp,%r14), %eax
andl $0x7f, %eax
orl %ecx, %eax
decq %r14
jne 0x9e0c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderOpen
void *fstReaderOpen(const char *nam)
{
struct fstReaderContext *xc = (struct fstReaderContext *)calloc(1, sizeof(struct fstReaderContext));

if((!nam)||(!(xc->f=fopen(nam, "rb"))))
        {
        free(xc);
        xc=NULL;
        }
        else
        {
        int flen = strlen(nam);
        char *hf = (char *)calloc(1, flen + 6);
        int rc;

#if defined(__MINGW32__) || defined(FST_MACOSX)
        setvbuf(xc->f, (char *)NULL, _IONBF, 0);   /* keeps gzip from acting weird in tandem with fopen */
#endif

        memcpy(hf, nam, flen);
        strcpy(hf + flen, ".hier");
        xc->fh = fopen(hf, "rb");

        free(hf);
        xc->filename = strdup(nam);
        rc = fstReaderInit(xc);

        if((rc) && (xc->vc_section_count) && (xc->maxhandle) && ((xc->fh)||(xc->contains_hier_section||(xc->contains_hier_section_lz4))))
                {
                /* more init */
                xc->do_rewind = 1;
                }
                else
                {
                fstReaderClose(xc);
                xc = NULL;
                }
        }

return(xc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x106b0, %esi          # imm = 0x106B0
callq 0x21e0
movq %rax, %rbx
testq %r14, %r14
je 0xaef0
leaq 0x97c3(%rip), %rsi      # 0x14607
movq %r14, %rdi
callq 0x2330
movq %rax, (%rbx)
testq %rax, %rax
je 0xaef0
movq %r14, %rdi
callq 0x2130
movq %rax, %r15
addl $0x6, %eax
movslq %eax, %rsi
movl $0x1, %edi
callq 0x21e0
movq %rax, %r12
movslq %r15d, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2240
movl $0x6569682e, (%r12,%r15) # imm = 0x6569682E
movw $0x72, 0x4(%r12,%r15)
leaq 0x9769(%rip), %rsi      # 0x14607
movq %r12, %rdi
callq 0x2330
movq %rax, 0x8(%rbx)
movq %r12, %rdi
callq 0x2050
movq %r14, %rdi
callq 0x23a0
movq %rax, 0x180(%rbx)
movq %rbx, %rdi
callq 0xa5f5
testl %eax, %eax
je 0xaefa
cmpq $0x0, 0x48(%rbx)
je 0xaefa
cmpl $0x0, 0x38(%rbx)
je 0xaefa
cmpq $0x0, 0x8(%rbx)
jne 0xaee7
testb $0x50, 0x7a(%rbx)
je 0xaefa
orb $0x1, 0x294(%rbx)
jmp 0xaf04
movq %rbx, %rdi
callq 0x2050
jmp 0xaf02
movq %rbx, %rdi
callq 0xaf10
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderClose
void fstReaderClose(void *ctx)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;

if(xc)
        {
        fstReaderDeallocateScopeData(xc);
        fstReaderDeallocateRvatData(xc);
        free(xc->rvat_sig_offs); xc->rvat_sig_offs = NULL;

        free(xc->process_mask); xc->process_mask = NULL;
        free(xc->blackout_times); xc->blackout_times = NULL;
        free(xc->blackout_activity); xc->blackout_activity = NULL;
        free(xc->temp_signal_value_buf); xc->temp_signal_value_buf = NULL;
        free(xc->signal_typs); xc->signal_typs = NULL;
        free(xc->signal_lens); xc->signal_lens = NULL;
        free(xc->filename); xc->filename = NULL;

        if(xc->fh)
                {
                tmpfile_close(&xc->fh, &xc->fh_nam);
                }

        if(xc->f)
                {
                tmpfile_close(&xc->f, &xc->f_nam);
                if(xc->filename_unpacked)
                        {
                        unlink(xc->filename_unpacked);
                        free(xc->filename_unpacked);
                        }
                }

        free(xc);
        }
}

// Assembly:
testq %rdi, %rdi
je 0xb03c
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x288(%rdi), %rdi
callq 0x2050
movq $0x0, 0x288(%rbx)
movq 0x278(%rbx), %rdi
testq %rdi, %rdi
je 0xaf5d
movq (%rdi), %r14
callq 0x2050
movq %r14, 0x278(%rbx)
movq %r14, %rdi
testq %r14, %r14
jne 0xaf46
movq %rbx, %rdi
callq 0xb03d
movq 0x210(%rbx), %rdi
callq 0x2050
xorl %r14d, %r14d
movq %r14, 0x210(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2050
movq %r14, 0x60(%rbx)
movq 0x1a0(%rbx), %rdi
callq 0x2050
movq %r14, 0x1a0(%rbx)
movq 0x1a8(%rbx), %rdi
callq 0x2050
movq %r14, 0x1a8(%rbx)
movq 0x70(%rbx), %rdi
callq 0x2050
movq %r14, 0x70(%rbx)
movq 0x58(%rbx), %rdi
callq 0x2050
movq %r14, 0x58(%rbx)
movq 0x50(%rbx), %rdi
callq 0x2050
movq %r14, 0x50(%rbx)
movq 0x180(%rbx), %rdi
callq 0x2050
movq %r14, 0x180(%rbx)
cmpq %r14, 0x8(%rbx)
je 0xaffe
leaq 0x8(%rbx), %rdi
leaq 0x106a8(%rbx), %rsi
callq 0x5894
cmpq $0x0, (%rbx)
je 0xb030
leaq 0x106a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x5894
movq 0x188(%rbx), %rdi
testq %rdi, %rdi
je 0xb030
callq 0x2080
movq 0x188(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2050
retq