// File: /workspace/github_cpp_makefile_star2_O1/yueww[P]TSR/exportDataAndIndex.cpp
// Function: exportPortIndexFile(portIndexTable*, int)
int exportPortIndexFile(portIndexTable *pit,int flag){
    int base=65536*sizeof(int);
    int i;
    for(i=0;i<65536;i++){
        if(pit->indexList[i]){
            portOffsetTable[i]=base+indexOffset*sizeof(unsigned);
            compressIndexLink(pit->indexList[i]);
        }
    }
    int id;
    int indexFileBytes;
    if(flag==1){
        id=countFiles("./index/","srcPortIndex");
        strcpy(srcPortIndexFileName,"srcPortIndex");
        char idStr[16];
        iToStr(id,idStr);
        strcat(srcPortIndexFileName,idStr);
        char path[128];
        strcpy(path,"./index/");
        strcat(path,srcPortIndexFileName);
        indexFileBytes=writePortIndexFile(path);
    }
    if(flag==2){
        id=countFiles("./index/","dstPortIndex");
        strcpy(dstPortIndexFileName,"dstPortIndex");
        char idStr[16];
        iToStr(id,idStr);
        strcat(dstPortIndexFileName,idStr);
        char path[128];
        strcpy(path,"./index/");
        strcat(path,dstPortIndexFileName);
        indexFileBytes=writePortIndexFile(path); 
    }
    memset(portOffsetTable,0,sizeof(int)*65536);
    memset(compressedIndexArr,0,sizeof(unsigned)*indexOffset);
    indexOffset=0;
    return indexFileBytes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
leaq 0x679f81fe(%rip), %r12  # 0x679fcf00
leaq 0x6aacc267(%rip), %r13  # 0x6aad0f70
movq (%r14,%r15,2), %rdi
testq %rdi, %rdi
je 0x4d26
movl (%r12), %eax
leal 0x40000(,%rax,4), %eax
movl %eax, (%r15,%r13)
callq 0x42dc
addq $0x4, %r15
cmpq $0x40000, %r15          # imm = 0x40000
jne 0x4d09
movabsq $0x7865646e497472, %r13 # imm = 0x7865646E497472
cmpl $0x1, %ebx
jne 0x4dbc
leaq 0x2572(%rip), %rdi      # 0x72bb
leaq 0x258a(%rip), %rsi      # 0x72da
callq 0x418c
movabsq $0x4974726f50637273, %rcx # imm = 0x4974726F50637273
movq %rcx, 0x6ab0c26a(%rip)  # 0x6ab10fd0
movq %r13, 0x6ab0c268(%rip)  # 0x6ab10fd5
leaq 0x6ab0c25c(%rip), %r14  # 0x6ab10fd0
leaq -0x40(%rbp), %r15
movl %eax, %edi
movq %r15, %rsi
callq 0x4217
movq %r14, %rdi
movq %r15, %rsi
callq 0x24c0
leaq -0xc0(%rbp), %r15
movabsq $0x2f7865646e692f2e, %rax # imm = 0x2F7865646E692F2E
movq %rax, (%r15)
movb $0x0, 0x8(%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0x24c0
movq %r15, %rdi
callq 0x4ee7
movl %eax, %r14d
cmpl $0x2, %ebx
jne 0x4e3b
leaq 0x24f3(%rip), %rdi      # 0x72bb
leaq 0x2518(%rip), %rsi      # 0x72e7
callq 0x418c
movabsq $0x4974726f50747364, %rcx # imm = 0x4974726F50747364
movq %rcx, 0x6ab0c20b(%rip)  # 0x6ab10ff0
movq %r13, 0x6ab0c209(%rip)  # 0x6ab10ff5
leaq 0x6ab0c1fd(%rip), %rbx  # 0x6ab10ff0
leaq -0x40(%rbp), %r14
movl %eax, %edi
movq %r14, %rsi
callq 0x4217
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24c0
leaq -0xc0(%rbp), %r14
movabsq $0x2f7865646e692f2e, %rax # imm = 0x2F7865646E692F2E
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x24c0
movq %r14, %rdi
callq 0x4ee7
movl %eax, %r14d
leaq 0x6aacc12e(%rip), %rdi  # 0x6aad0f70
movl $0x40000, %edx          # imm = 0x40000
xorl %esi, %esi
callq 0x2160
movslq (%r12), %rdx
shlq $0x2, %rdx
leaq 0x653d26a3(%rip), %rdi  # 0x653d7500
xorl %esi, %esi
callq 0x2160
movl $0x0, (%r12)
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq