// File: /workspace/github_c_makefile_star2_O0/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterEmitValueChangeVec64
void fstWriterEmitValueChangeVec64(void *ctx, fstHandle handle,
                                   uint32_t bits, const uint64_t *val) {
        struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
        if (FST_UNLIKELY(bits <= 64))
        {
                fstWriterEmitValueChange64(ctx, handle, bits, val[0]);
        }
        else if(FST_LIKELY(xc))
        {
                int bq = bits / 64;
                int br = bits & 63;
                int i;
                int w;
                uint32_t v;
                unsigned char* s;
                if (FST_UNLIKELY(bits > xc->outval_alloc_siz))
                {
                        xc->outval_alloc_siz = bits*2 + 1;
                        xc->outval_mem = (unsigned char*)realloc(xc->outval_mem, xc->outval_alloc_siz);
                        if (FST_UNLIKELY(!xc->outval_mem))
                        {
                                fprintf(stderr,
                                        FST_APIMESS "Could not realloc() in fstWriterEmitValueChangeVec64, exiting.\n");
                                exit(255);
                        }
                }
                s = xc->outval_mem;
                {
                        w = bq;
                        v = val[w];
                        for (i = 0; i < br; ++i)
                        {
                                *s++ = '0' + ((v >> (br - i - 1)) & 1);
                        }
                }
                for (w = bq - 1; w >= 0; --w) {
                        v = val[w];
                        for (i = (64 - 4); i >= 0; i -= 4)
                        {
                                s[0] = '0' + ((v >> (i + 3)) & 1);
                                s[1] = '0' + ((v >> (i + 2)) & 1);
                                s[2] = '0' + ((v >> (i + 1)) & 1);
                                s[3] = '0' + ((v >> (i + 0)) & 1);
                                s += 4;
                        }
                }
                fstWriterEmitValueChange(ctx, handle, xc->outval_mem);
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x40, -0x10(%rbp)
setbe %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x9bb1
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rax
movq (%rax), %rcx
callq 0x9890
jmp 0x9dad
cmpq $0x0, -0x20(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x9dab
movl -0x10(%rbp), %eax
shrl $0x6, %eax
movl %eax, -0x24(%rbp)
movl -0x10(%rbp), %eax
andl $0x3f, %eax
movl %eax, -0x28(%rbp)
movl -0x10(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x58(%rcx), %eax
seta %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x9c71
movl -0x10(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, %esi
callq 0x22c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x50(%rax)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x9c6f
movq 0x2539c(%rip), %rax     # 0x2eff0
movq (%rax), %rdi
leaq 0x213f0(%rip), %rsi     # 0x2b04e
movb $0x0, %al
callq 0x2220
movl $0xff, %edi
callq 0x2380
jmp 0x9c71
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x9cd3
movl -0x34(%rbp), %eax
movl -0x28(%rbp), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
shrl %cl, %eax
andl $0x1, %eax
addl $0x30, %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb %cl, (%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9c99
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jl 0x9d97
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x34(%rbp)
movl $0x3c, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x9d87
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
addl $0x3, %ecx
shrl %cl, %eax
andl $0x1, %eax
addl $0x30, %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
addl $0x2, %ecx
shrl %cl, %eax
andl $0x1, %eax
addl $0x30, %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
shrl %cl, %eax
andl $0x1, %eax
addl $0x30, %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
addl $0x0, %ecx
shrl %cl, %eax
andl $0x1, %eax
addl $0x30, %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9cfc
jmp 0x9d89
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9cdc
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdx
callq 0x6100
jmp 0x9dad
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)