// File: /workspace/github_c_makefile_star2_O0/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterEmitHdrBytes
static void fstWriterEmitHdrBytes(struct fstWriterContext *xc)
{
char vbuf[FST_HDR_SIM_VERSION_SIZE];
char dbuf[FST_HDR_DATE_SIZE];
double endtest = FST_DOUBLE_ENDTEST;
time_t walltime;

#define FST_HDR_OFFS_TAG                        (0)
fputc(FST_BL_HDR, xc->handle);                  /* +0 tag */

#define FST_HDR_OFFS_SECLEN                     (FST_HDR_OFFS_TAG + 1)
fstWriterUint64(xc->handle, 329);               /* +1 section length */

#define FST_HDR_OFFS_START_TIME                 (FST_HDR_OFFS_SECLEN + 8)
fstWriterUint64(xc->handle, 0);                 /* +9 start time */

#define FST_HDR_OFFS_END_TIME                   (FST_HDR_OFFS_START_TIME + 8)
fstWriterUint64(xc->handle, 0);                 /* +17 end time */

#define FST_HDR_OFFS_ENDIAN_TEST                (FST_HDR_OFFS_END_TIME + 8)
fstFwrite(&endtest, 8, 1, xc->handle);          /* +25 endian test for reals */

#define FST_HDR_OFFS_MEM_USED                   (FST_HDR_OFFS_ENDIAN_TEST + 8)
fstWriterUint64(xc->handle, xc->fst_break_size);/* +33 memory used by writer */

#define FST_HDR_OFFS_NUM_SCOPES                 (FST_HDR_OFFS_MEM_USED + 8)
fstWriterUint64(xc->handle, 0);                 /* +41 scope creation count */

#define FST_HDR_OFFS_NUM_VARS                   (FST_HDR_OFFS_NUM_SCOPES + 8)
fstWriterUint64(xc->handle, 0);                 /* +49 var creation count */

#define FST_HDR_OFFS_MAXHANDLE                  (FST_HDR_OFFS_NUM_VARS + 8)
fstWriterUint64(xc->handle, 0);                 /* +57 max var idcode */

#define FST_HDR_OFFS_SECTION_CNT                (FST_HDR_OFFS_MAXHANDLE + 8)
fstWriterUint64(xc->handle, 0);                 /* +65 vc section count */

#define FST_HDR_OFFS_TIMESCALE                  (FST_HDR_OFFS_SECTION_CNT + 8)
fputc((-9)&255, xc->handle);                    /* +73 timescale 1ns */

#define FST_HDR_OFFS_SIM_VERSION                (FST_HDR_OFFS_TIMESCALE + 1)
memset(vbuf, 0, FST_HDR_SIM_VERSION_SIZE);
strcpy(vbuf, FST_WRITER_STR);
fstFwrite(vbuf, FST_HDR_SIM_VERSION_SIZE, 1, xc->handle); /* +74 version */

#define FST_HDR_OFFS_DATE                       (FST_HDR_OFFS_SIM_VERSION + FST_HDR_SIM_VERSION_SIZE)
memset(dbuf, 0, FST_HDR_DATE_SIZE);
time(&walltime);
strcpy(dbuf, asctime(localtime(&walltime)));
fstFwrite(dbuf, FST_HDR_DATE_SIZE, 1, xc->handle);      /* +202 date */

/* date size is deliberately overspecified at 119 bytes (originally 128) in order to provide backfill for new args */

#define FST_HDR_OFFS_FILETYPE                   (FST_HDR_OFFS_DATE + FST_HDR_DATE_SIZE)
fputc(xc->filetype, xc->handle);                /* +321 filetype */

#define FST_HDR_OFFS_TIMEZERO                   (FST_HDR_OFFS_FILETYPE + FST_HDR_FILETYPE_SIZE)
fstWriterUint64(xc->handle, xc->timezero);      /* +322 timezero */

#define FST_HDR_LENGTH                          (FST_HDR_OFFS_TIMEZERO + FST_HDR_TIMEZERO_SIZE)
                                                /* +330 next section starts here */
fflush(xc->handle);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movsd 0x25481(%rip), %xmm0    # 0x2a0a8
movsd %xmm0, -0x118(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
xorl %edi, %edi
callq 0x21c0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x149, %esi            # imm = 0x149
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rcx
leaq -0x118(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x78b0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x100(%rax), %rsi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0xf7, %edi
callq 0x21c0
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x2190
leaq -0x90(%rbp), %rdi
leaq 0x2676d(%rip), %rsi     # 0x2b481
callq 0x2090
leaq -0x90(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movl $0x80, %esi
movl $0x1, %edx
callq 0x78b0
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x77, %edx
callq 0x2190
leaq -0x120(%rbp), %rdi
callq 0x2260
leaq -0x110(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2050
movq %rax, %rdi
callq 0x2150
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x2090
leaq -0x110(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movl $0x77, %esi
movl $0x1, %edx
callq 0x78b0
movq -0x8(%rbp), %rax
movzbl 0xe8(%rax), %edi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
callq 0x21c0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rsi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x2290
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)