// File: /workspace/github_c_makefile_star2_O0/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstWriterCreateMmaps
static void fstWriterCreateMmaps(struct fstWriterContext *xc)
{
off_t curpos = ftello(xc->handle);

fflush(xc->hier_handle);

/* write out intermediate header */
fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_START_TIME, SEEK_SET);
fstWriterUint64(xc->handle, xc->firsttime);
fstWriterUint64(xc->handle, xc->curtime);
fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_NUM_SCOPES, SEEK_SET);
fstWriterUint64(xc->handle, xc->numscopes);
fstWriterUint64(xc->handle, xc->numsigs);
fstWriterUint64(xc->handle, xc->maxhandle);
fstWriterUint64(xc->handle, xc->secnum);
fstWriterFseeko(xc, xc->handle, curpos, SEEK_SET);
fflush(xc->handle);

/* do mappings */
if(!xc->valpos_mem)
        {
        fflush(xc->valpos_handle);
	errno = 0;
	if(xc->maxhandle)
		{
	        fstWriterMmapSanity(xc->valpos_mem = (uint32_t *)fstMmap(NULL, xc->maxhandle * 4 * sizeof(uint32_t), PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->valpos_handle), 0), __FILE__, __LINE__, "xc->valpos_mem");
		}
        }
if(!xc->curval_mem)
        {
        fflush(xc->curval_handle);
	errno = 0;
	if(xc->maxvalpos)
		{
	        fstWriterMmapSanity(xc->curval_mem = (unsigned char *)fstMmap(NULL, xc->maxvalpos, PROT_READ|PROT_WRITE, MAP_SHARED, fileno(xc->curval_handle), 0), __FILE__, __LINE__, "xc->curval_handle");
		}
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x20a0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2290
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0x9, %edx
xorl %ecx, %ecx
callq 0x5e80
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rsi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rsi
callq 0x7840
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0x29, %edx
xorl %ecx, %ecx
callq 0x5e80
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0xb8(%rax), %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x6c(%rax), %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x68(%rax), %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %eax
movl %eax, %esi
callq 0x7840
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
xorl %ecx, %ecx
callq 0x5e80
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x2290
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x96a6
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2290
callq 0x2060
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x68(%rax)
je 0x96a4
movq -0x8(%rbp), %rax
movl 0x68(%rax), %eax
shll $0x2, %eax
movl %eax, %eax
shlq $0x2, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2270
movq -0x18(%rbp), %rsi
movl %eax, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %edx
movl $0x1, %ecx
movq %r9, %rdi
callq 0x2140
movq %rax, %rdi
movq -0x8(%rbp), %rax
movq %rdi, 0x40(%rax)
leaq 0x21891(%rip), %rsi     # 0x2af24
movl $0x3f5, %edx            # imm = 0x3F5
leaq 0x21e2f(%rip), %rcx     # 0x2b4ce
callq 0x77c0
jmp 0x96a6
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x972e
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2290
callq 0x2060
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x70(%rax)
je 0x972c
movq -0x8(%rbp), %rax
movl 0x70(%rax), %eax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2270
movq -0x20(%rbp), %rsi
movl %eax, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %edx
movl $0x1, %ecx
movq %r9, %rdi
callq 0x2140
movq %rax, %rdi
movq -0x8(%rbp), %rax
movq %rdi, 0x48(%rax)
leaq 0x21809(%rip), %rsi     # 0x2af24
movl $0x3fe, %edx            # imm = 0x3FE
leaq 0x21db6(%rip), %rcx     # 0x2b4dd
callq 0x77c0
jmp 0x972e
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)