// File: /workspace/github_c_makefile_star2_O0/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterEmitValueChangeVec32
void fstWriterEmitValueChangeVec32(void *ctx, fstHandle handle,
                                   uint32_t bits, const uint32_t *val) {
        struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
        if (FST_UNLIKELY(bits <= 32))
        {
                fstWriterEmitValueChange32(ctx, handle, bits, val[0]);
        }
        else if(FST_LIKELY(xc))
        {
                int bq = bits / 32;
                int br = bits & 31;
                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 fstWriterEmitValueChangeVec32, 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 = (32 - 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 $0x20, -0x10(%rbp)
setbe %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x9960
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rax
movl (%rax), %ecx
callq 0x9810
jmp 0x9b5a
cmpq $0x0, -0x20(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x9b58
movl -0x10(%rbp), %eax
shrl $0x5, %eax
movl %eax, -0x24(%rbp)
movl -0x10(%rbp), %eax
andl $0x1f, %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 0x9a20
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 0x9a1e
movq 0x255ed(%rip), %rax     # 0x2eff0
movq (%rax), %rdi
leaq 0x215f7(%rip), %rsi     # 0x2b004
movb $0x0, %al
callq 0x2220
movl $0xff, %edi
callq 0x2380
jmp 0x9a20
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
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x9a81
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 0x9a47
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jl 0x9b44
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl $0x1c, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x9b34
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 0x9aa9
jmp 0x9b36
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9a8a
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdx
callq 0x6100
jmp 0x9b5a
addq $0x40, %rsp
popq %rbp
retq