// File: /workspace/github_cpp_makefile_star2_O3/yueww[P]TSR/test.c
// Function: main
int main(int argc,char *argv[]){
    if(argc<3){
        printf("not enough arguments!\n");
        exit(0);
    }
    if(argc==4){
        if(strcmp(argv[3],"-t")==0){
            printf("please input host:");
            scanf("%s",host);
            printf("please input user:");
            scanf("%s",user);
            printf("please input password:");
            scanf("%s",password);
            printf("please input database:");
            scanf("%s",database);
            printf("please input port:");
            scanf("%u",&port);
            fflush(stdin);
            mysql_init(&mysql);
            if(!mysql_real_connect(&mysql,host,user,password,database,port,NULL,0)){
                printf("mysql_real_connect failed!\n");
                return 0;
            }
            useDb=true;
        }else{
            printf("unknown option:%s\n",argv[3]);
            return 0;
        }
    }
    if(argc>4){
        printf("too much arguments!\n");
        return 0;
    }
    /*
    set a share memory,use it to check whether export process is running. 
    */
    if((shmid=shmget(IPC_PRIVATE,SHM_SIZE,IPC_CREAT|0666))==-1){
        printf("shmget error!\n");
        exit(0);
    }
    if((shmptr=shmat(shmid,(const void *)0,0))==(void *)-1){
        printf("shmat error!\n");
        exit(0);
    }
    *(int *)shmptr=0;
    /*
    initiate correlative data structure. 
    */
    unusedChainHead=&flowNodeBuf[0];
    unusedChainTail=&flowNodeBuf[LINKNODEBUFSIZE-1];
    int i;
    for(i=0;i<LINKNODEBUFSIZE-1;i++){
        flowNodeBuf[i].next=&flowNodeBuf[i+1];
    }
    flowNodeBuf[i].next=NULL;
    srcIpRootNode=&srcIpInnerNodeBuf[0];
    currUsedSrcIpInnerNodes++;
    dstIpRootNode=&dstIpInnerNodeBuf[0];
    currUsedDstIpInnerNodes++;
    for(i=0;i<FLOWAMOUNTINMEM;i++){
        srcIpIndexNodeBuf[i].indexNum=i;
        srcPortIndexNodeBuf[i].indexNum=i;
        dstIpIndexNodeBuf[i].indexNum=i;
        dstPortIndexNodeBuf[i].indexNum=i;
    }
    genAllParas(VECTORDIM,W);
    pthread_t proc;
    int createRes=pthread_create(&proc,0,processFunc,0);
    if(createRes!=0){
        printf("fail to create storage process,exit system!\n");
        exit(0);
    }
    char *command=processCommand(argv[1],argv[2]);
    if(!command){
        exit(0);
    }
    int exeRes=system(command);
    free(command);
    if(exeRes==127){
        printf("fail to launch probe because of exec error!\n");
        exit(0);
    }else if(exeRes==-1){
        printf("fail to launch probe because of fork error!\n");
        exit(0);
    }else{
        char flag;
        while(1){
            printf("input q to stop emitting flows!\n");
            scanf("%c",&flag);
            if(flag=='q'){
                int res=system("ps aux | grep fprobe | grep -v grep | cut -c 9-15 | xargs kill -9");
                while(res==-1||res==127){
                    res=system("ps aux | grep fprobe | grep -v grep | cut -c 9-15 | xargs kill -9");
                }
                break;
            }else{
                continue;
            }
        }
        printf("emit process terminated!\n");
        sleep(1);
        while(*(int *)shmptr){
            
        }
        int canRes=pthread_cancel(pro);
        if(canRes!=0){
            printf("fail to cancel process which receive flows!\n");
        }
        threadpool_destroy(pThreadPool);
        canRes=pthread_cancel(con);
        if(canRes!=0){
            printf("fail to cancel process which index flows!\n");
        }
        /*
         resort left flowRecord in cache(flowBlock).left flowRecords are fewer than 40, so
         we can not resort them by call resort().
        */
        int k;
        tuple4vec vec;
        int key;
        for(k=0;k<n;k++){
            extractTuple4(&vec,flowBlock[out+k]);
            key=myHash(vec);
            insertFlowsToBucket(flowBlock[out+k],key);
        }
        /*
        flush the hashTable which is used in resort,because the left flowRecord can not satisfy the 
        old rule,they can not be exported automatically.
        */
        int i;
        flowRecordNode *pF;
        for(i=0;i<TABLESIZE;i++){
            if(hashTable[i].currNum>0){
                pF=&hashTable[i].head;
                int j;
                for(j=0;j<hashTable[i].currNum;j++){
                    pF=pF->next;
                    memcpy(&flowWaitExport[inBase++],&(pF->rec),FLOWSIZE);
                }
            }
        }
        /*
        index();
        int *exportRes=exportDataAndIndex();
        FILE *fp=fopen("./exportRecord.log","a+");
        */
        FILE *fp=fopen("./exportRecord.log","a+");
        while(outBase<inBase){
            int exportFlag=index();
            if(exportFlag){
                int *exportRes=exportDataAndIndex();
                int writeRes[6];
                writeRes[0]=fprintf(fp,"export %d flows.\n",exportRes[0]/48);
                writeRes[1]=fprintf(fp,"data take up %d bytes\n",exportRes[0]);
                writeRes[2]=fprintf(fp,"srcIp take up %d bytes\n",exportRes[1]);
                writeRes[3]=fprintf(fp,"dstIp take up %d bytes\n",exportRes[2]);
                writeRes[4]=fprintf(fp,"srcPort take up %d bytes\n",exportRes[3]);
                writeRes[5]=fprintf(fp,"dstPort take up %d bytes\n",exportRes[4]);
                if(writeRes[0]<0 || writeRes[1]<0 || writeRes[2]<0 || writeRes[3]<0 ||writeRes[4]<0 ||writeRes[5]<0){
                    printf("error in write log!\n");
                } 
                free(exportRes);
                memcpy(flowWaitExport,flowWaitExport+outBase,(inBase-outBase)*FLOWSIZE);
                int i;
                for(i=0;i<outBase;i++){
                    srcIpIndexNodeBuf[i].next=NULL;
                    dstIpIndexNodeBuf[i].next=NULL;
                    srcPortIndexNodeBuf[i].next=NULL;
                    dstPortIndexNodeBuf[i].next=NULL;
                }
                memset(srcIpInnerNodeBuf,0,sizeof(innerNode)*currUsedSrcIpInnerNodes);
                memset(dstIpInnerNodeBuf,0,sizeof(innerNode)*currUsedDstIpInnerNodes);
                memset(srcIpLeafNodeBuf,0,sizeof(leafNode)*currUsedSrcIpLeafNodes);
                memset(dstIpLeafNodeBuf,0,sizeof(leafNode)*currUsedDstIpLeafNodes);
                memset(&srcPortIndexTable,0,sizeof(portIndexTable));
                memset(&dstPortIndexTable,0,sizeof(portIndexTable));
                srcIpRootNode=&srcIpInnerNodeBuf[0];
                dstIpRootNode=&dstIpInnerNodeBuf[0];
                inBase-=outBase;
                outBase=0;
                currUsedSrcIpInnerNodes=1;
                currUsedDstIpInnerNodes=1;
                currUsedSrcIpLeafNodes=0;
                currUsedDstIpLeafNodes=0;
                currUsedSrcIpIndexNodes=0;
                currUsedDstIpIndexNodes=0;
                currUsedSrcPortIndexNodes=0;
                currUsedDstPortIndexNodes=0;
            }
        }
        int *exportRes=exportDataAndIndex();
        int writeRes[6];
        writeRes[0]=fprintf(fp,"export %d flows.\n",exportRes[0]/48);
        writeRes[1]=fprintf(fp,"data take up %d bytes\n",exportRes[0]);
        writeRes[2]=fprintf(fp,"srcIp take up %d bytes\n",exportRes[1]);
        writeRes[3]=fprintf(fp,"dstIp take up %d bytes\n",exportRes[2]);
        writeRes[4]=fprintf(fp,"srcPort take up %d bytes\n",exportRes[3]);
        writeRes[5]=fprintf(fp,"dstPort take up %d bytes\n",exportRes[4]);
        if(writeRes[0]<0 || writeRes[1]<0 || writeRes[2]<0 || writeRes[3]<0 ||writeRes[4]<0 ||writeRes[5]<0){
            printf("error in write log!\n");
        } 
        free(exportRes);
    }
    mysql_close(&mysql);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpl $0x2, %edi
jle 0x5f98
movq %rsi, %r15
cmpl $0x4, %edi
jne 0x579e
movq 0x18(%r15), %rsi
cmpb $0x2d, (%rsi)
jne 0x578b
cmpb $0x74, 0x1(%rsi)
jne 0x578b
cmpb $0x0, 0x2(%rsi)
je 0x57b5
leaq 0x1df6(%rip), %rdi      # 0x7588
xorl %eax, %eax
callq 0x2040
jmp 0x5f7b
jbe 0x58b8
leaq 0x1ffa(%rip), %rdi      # 0x77a5
callq 0x2440
jmp 0x5f7b
leaq 0x1d5f(%rip), %rdi      # 0x751b
xorl %eax, %eax
callq 0x2040
leaq 0x1d64(%rip), %r13      # 0x752e
leaq 0x6ab3a66f(%rip), %rsi  # 0x6ab3fe40
movq %r13, %rdi
xorl %eax, %eax
callq 0x22f0
leaq 0x1d4f(%rip), %rdi      # 0x7531
xorl %eax, %eax
callq 0x2040
leaq 0x6ab3a750(%rip), %r14  # 0x6ab3ff40
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x22f0
leaq 0x1d40(%rip), %rdi      # 0x7544
xorl %eax, %eax
callq 0x2040
leaq 0x6ab3a7ae(%rip), %r12  # 0x6ab3ffc0
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x22f0
leaq 0x1d35(%rip), %rdi      # 0x755b
xorl %eax, %eax
callq 0x2040
leaq 0x6ab3a80c(%rip), %rbx  # 0x6ab40040
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22f0
leaq 0x1d2a(%rip), %rdi      # 0x7572
xorl %eax, %eax
callq 0x2040
leaq 0x1d2f(%rip), %rdi      # 0x7585
leaq 0x6ab3a863(%rip), %rsi  # 0x6ab400c0
xorl %eax, %eax
callq 0x22f0
movq 0x4765(%rip), %rax      # 0x9fd0
movq (%rax), %rdi
callq 0x2310
leaq 0x6ab3a84e(%rip), %r13  # 0x6ab400c8
movq %r13, %rdi
callq 0x2110
movl 0x6ab3a837(%rip), %r9d  # 0x6ab400c0
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
leaq 0x6ab3a5a6(%rip), %rsi  # 0x6ab3fe40
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x2140
testq %rax, %rax
je 0x5f8c
movb $0x1, 0x6ab3ac98(%rip)  # 0x6ab40550
movl $0x1000, %esi           # imm = 0x1000
xorl %edi, %edi
movl $0x3b6, %edx            # imm = 0x3B6
callq 0x2170
movl %eax, 0x6ab3ac85(%rip)  # 0x6ab40554
cmpl $-0x1, %eax
je 0x5fa1
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x23a0
movq %rax, 0x6ab3ac6e(%rip)  # 0x6ab40558
cmpq $-0x1, %rax
je 0x5faa
movl $0x0, (%rax)
leaq 0x127438f(%rip), %rax   # 0x1279c90
leaq 0xed34388(%rip), %rcx   # 0xed39c90
movq %rax, (%rcx)
leaq 0xdabffc8(%rax), %rcx
leaq 0xed3437f(%rip), %rdx   # 0xed39c98
movq %rcx, (%rdx)
leaq 0x38(%rax), %rcx
movl $0x3e7fff, %edx         # imm = 0x3E7FFF
movq %rcx, -0x38(%rcx)
addq $0x38, %rcx
decq %rdx
jne 0x5925
movq $0x0, 0xdabffc8(%rax)
leaq 0x51951b6c(%rip), %rax  # 0x519574b0
leaq 0x651d1b65(%rip), %rcx  # 0x651d74b0
movq %rax, (%rcx)
leaq 0x653d1b83(%rip), %rax  # 0x653d74d8
incl (%rax)
leaq 0x54061b52(%rip), %rax  # 0x540674b0
leaq 0x653d1b7b(%rip), %rcx  # 0x653d74e0
incl (%rcx)
leaq 0x651d1b4a(%rip), %rcx  # 0x651d74b8
movq %rax, (%rcx)
xorl %eax, %eax
leaq 0x2b6f7b36(%rip), %rdx  # 0x2b6fd4b0
leaq 0x3e824b2f(%rip), %rsi  # 0x3e82a4b0
leaq 0x34f8e328(%rip), %rdi  # 0x34f93cb0
leaq 0x480bb321(%rip), %r8   # 0x480c0cb0
xorl %ecx, %ecx
movl %ecx, (%rdx,%rax)
movl %ecx, (%rsi,%rax)
movl %ecx, (%rdi,%rax)
movl %ecx, (%r8,%rax)
incq %rcx
addq $0x10, %rax
cmpq $0x989680, %rcx         # imm = 0x989680
jne 0x5991
movsd 0x174a(%rip), %xmm0     # 0x7100
movl $0xa, %edi
callq 0x312c
leaq 0x611(%rip), %rdx       # 0x5fd8
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x24d0
testl %eax, %eax
jne 0x5fb3
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rsi
callq 0x6077
testq %rax, %rax
je 0x5fd1
movq %rax, %rbx
movq %rax, %rdi
callq 0x2250
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2330
cmpl $-0x1, %r14d
je 0x5fbc
cmpl $0x7f, %r14d
je 0x5fc5
leaq 0x1c54(%rip), %rbx      # 0x7677
leaq 0x1b71(%rip), %r14      # 0x759b
leaq -0x29(%rbp), %r15
movq %rbx, %rdi
callq 0x2440
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x22f0
cmpb $0x71, -0x29(%rbp)
jne 0x5a2e
leaq 0x1b4e(%rip), %rbx      # 0x759e
movq %rbx, %rdi
callq 0x2250
cmpl $-0x1, %eax
je 0x5a50
cmpl $0x7f, %eax
je 0x5a50
leaq 0x1c2e(%rip), %rdi      # 0x7697
callq 0x2440
movl $0x1, %edi
callq 0x21d0
movq 0x6ab3aae1(%rip), %rdi  # 0x6ab40560
callq 0x23b0
testl %eax, %eax
je 0x5a94
leaq 0x1c21(%rip), %rdi      # 0x76b0
callq 0x2440
leaq 0x480d(%rip), %rax      # 0xa2a8
movq (%rax), %rdi
callq 0x2a40
movq 0x6ab3aabe(%rip), %rdi  # 0x6ab40568
callq 0x23b0
testl %eax, %eax
je 0x5abf
leaq 0x1c22(%rip), %rdi      # 0x76dc
callq 0x2440
leaq 0x47de(%rip), %r14      # 0xa2a4
cmpl $0x0, (%r14)
jle 0x5b72
xorl %r15d, %r15d
leaq 0x6ab0b526(%rip), %r12  # 0x6ab11000
leaq 0x1486f(%rip), %r13     # 0x1a350
leaq -0x58(%rbp), %rbx
movl (%r12), %eax
addl %r15d, %eax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movups (%r13,%rax), %xmm0
movups 0x10(%r13,%rax), %xmm1
movups 0x20(%r13,%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x397f
movl -0x48(%rbp), %eax
movl %eax, 0x10(%rsp)
movups -0x58(%rbp), %xmm0
movups %xmm0, (%rsp)
callq 0x31d1
movl (%r12), %ecx
addl %r15d, %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movups (%r13,%rcx), %xmm0
movups 0x10(%r13,%rcx), %xmm1
movups 0x20(%r13,%rcx), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %eax, %edi
callq 0x39c9
incl %r15d
cmpl (%r14), %r15d
jl 0x5ae5
leaq 0x653d1947(%rip), %r15  # 0x653d74c0
movl (%r15), %eax
xorl %ecx, %ecx
leaq 0x126410b(%rip), %rdx   # 0x1269c90
movq %rcx, %rsi
shlq $0x6, %rsi
movl (%rdx,%rsi), %edi
testl %edi, %edi
jle 0x5be0
addq %rdx, %rsi
addq $0x8, %rsi
movslq %eax, %r8
leaq (%r8,%r8,2), %r8
shlq $0x4, %r8
addq 0x4434(%rip), %r8       # 0x9fe0
negl %edi
xorl %r9d, %r9d
movq (%rsi), %rsi
movups 0x8(%rsi), %xmm0
movups 0x18(%rsi), %xmm1
movups 0x28(%rsi), %xmm2
movups %xmm2, 0x20(%r8)
movups %xmm1, 0x10(%r8)
movups %xmm0, (%r8)
addq $0x30, %r8
decl %r9d
cmpl %r9d, %edi
jne 0x5bb1
subl %r9d, %eax
movl %eax, (%r15)
incq %rcx
cmpq $0x400, %rcx            # imm = 0x400
jne 0x5b85
leaq 0x1840(%rip), %rdi      # 0x7433
leaq 0x184c(%rip), %rsi      # 0x7446
callq 0x2320
movq %rax, -0x40(%rbp)
leaq 0x653d18ba(%rip), %rax  # 0x653d74c4
movl (%rax), %eax
cmpl (%r15), %eax
jge 0x5ea2
xorl %r13d, %r13d
callq 0x3b54
testb %al, %al
je 0x5e8c
callq 0x4788
movq %rax, %rbx
movslq (%rax), %rax
imulq $0x2aaaaaab, %rax, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x23, %rdx
addl %eax, %edx
movq -0x40(%rbp), %r12
movq %r12, %rdi
leaq 0x17f7(%rip), %rsi      # 0x7449
xorl %eax, %eax
callq 0x23c0
movl %eax, -0x34(%rbp)
movl (%rbx), %edx
movq %r12, %rdi
leaq 0x17f3(%rip), %rsi      # 0x745b
xorl %eax, %eax
callq 0x23c0
movl %eax, -0x30(%rbp)
movl 0x4(%rbx), %edx
movq %r12, %rdi
leaq 0x17f3(%rip), %rsi      # 0x7472
xorl %eax, %eax
callq 0x23c0
movl %eax, %r15d
movl 0x8(%rbx), %edx
movq %r12, %rdi
leaq 0x17f4(%rip), %rsi      # 0x748a
xorl %eax, %eax
callq 0x23c0
movl %eax, -0x38(%rbp)
movl 0xc(%rbx), %edx
movq %r12, %rdi
leaq 0x17f5(%rip), %rsi      # 0x74a2
xorl %eax, %eax
callq 0x23c0
movl %eax, %r14d
movl 0x10(%rbx), %edx
movq %r12, %rdi
leaq 0x17f8(%rip), %rsi      # 0x74bc
xorl %eax, %eax
callq 0x23c0
orl -0x30(%rbp), %r15d
orl -0x38(%rbp), %r15d
orl %r14d, %r15d
orl -0x34(%rbp), %r15d
orl %eax, %r15d
jns 0x5ceb
leaq 0x17f0(%rip), %rdi      # 0x74d6
callq 0x2440
movq %rbx, %rdi
callq 0x2330
leaq 0x653d17ca(%rip), %rax  # 0x653d74c4
movslq (%rax), %r14
leaq (%r14,%r14,2), %rsi
shlq $0x4, %rsi
leaq 0xed33fa4(%rip), %rdi   # 0xed39cb0
addq %rdi, %rsi
leaq 0x653d17aa(%rip), %rax  # 0x653d74c0
movslq (%rax), %rbx
subq %r14, %rbx
movq %rbx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdx
callq 0x2240
testq %r14, %r14
leaq 0x2b6f777a(%rip), %rcx  # 0x2b6fd4b0
leaq 0x3e824773(%rip), %rdx  # 0x3e82a4b0
leaq 0x34f8df6c(%rip), %rsi  # 0x34f93cb0
leaq 0x480baf65(%rip), %rdi  # 0x480c0cb0
jle 0x5d70
shlq $0x4, %r14
xorl %eax, %eax
movq %r13, 0x8(%rcx,%rax)
movq %r13, 0x8(%rsi,%rax)
movq %r13, 0x8(%rdx,%rax)
movq %r13, 0x8(%rdi,%rax)
addq $0x10, %rax
cmpq %rax, %r14
jne 0x5d53
leaq 0x653d1761(%rip), %r12  # 0x653d74d8
movslq (%r12), %rdx
shlq $0xb, %rdx
xorl %r14d, %r14d
leaq 0x51951727(%rip), %rdi  # 0x519574b0
xorl %esi, %esi
callq 0x2160
leaq 0x653d1749(%rip), %rax  # 0x653d74e0
movslq (%rax), %rdx
shlq $0xb, %rdx
leaq 0x5406170b(%rip), %r15  # 0x540674b0
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x653d1726(%rip), %rax  # 0x653d74dc
movslq (%rax), %rdx
shlq $0xc, %rdx
leaq 0x567716ec(%rip), %rdi  # 0x567774b0
xorl %esi, %esi
callq 0x2160
leaq 0x653d1712(%rip), %r12  # 0x653d74e4
movslq (%r12), %rdx
shlq $0xc, %rdx
leaq 0x5dca16cf(%rip), %rdi  # 0x5dca74b0
xorl %esi, %esi
callq 0x2160
movl $0x100000, %edx         # imm = 0x100000
leaq 0x651d16cc(%rip), %rdi  # 0x651d74c0
xorl %esi, %esi
callq 0x2160
movl $0x100000, %edx         # imm = 0x100000
leaq 0x652d16b9(%rip), %rdi  # 0x652d74c0
xorl %esi, %esi
callq 0x2160
leaq 0x651d169b(%rip), %rax  # 0x651d74b0
leaq 0x51951694(%rip), %rcx  # 0x519574b0
movq %rcx, (%rax)
leaq 0x651d1692(%rip), %rax  # 0x651d74b8
movq %r15, (%rax)
leaq 0x653d1690(%rip), %r15  # 0x653d74c0
movl %ebx, (%r15)
leaq 0x653d168a(%rip), %rax  # 0x653d74c4
movl %r14d, (%rax)
movl $0x1, %eax
leaq 0x653d168f(%rip), %rcx  # 0x653d74d8
movl %eax, (%rcx)
leaq 0x653d168e(%rip), %rcx  # 0x653d74e0
movl %eax, (%rcx)
leaq 0x653d1681(%rip), %rax  # 0x653d74dc
movl %r14d, (%rax)
movl %r14d, (%r12)
leaq 0x653d165f(%rip), %rax  # 0x653d74c8
movl %r14d, (%rax)
leaq 0x653d1659(%rip), %rax  # 0x653d74cc
movl %r14d, (%rax)
leaq 0x653d1653(%rip), %rax  # 0x653d74d0
movl %r14d, (%rax)
leaq 0x653d164d(%rip), %rax  # 0x653d74d4
movl %r14d, (%rax)
jmp 0x5e99
leaq 0x653d1631(%rip), %rax  # 0x653d74c4
movl (%rax), %r14d
movl (%r15), %ebx
cmpl %ebx, %r14d
jl 0x5c18
callq 0x4788
movq %rax, %rbx
movslq (%rax), %rax
imulq $0x2aaaaaab, %rax, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x23, %rdx
addl %eax, %edx
leaq 0x1581(%rip), %rsi      # 0x7449
movq -0x40(%rbp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x23c0
movl %eax, -0x34(%rbp)
movl (%rbx), %edx
leaq 0x1579(%rip), %rsi      # 0x745b
movq %r15, %rdi
xorl %eax, %eax
callq 0x23c0
movl %eax, -0x30(%rbp)
movl 0x4(%rbx), %edx
leaq 0x1579(%rip), %rsi      # 0x7472
movq %r15, %rdi
xorl %eax, %eax
callq 0x23c0
movl %eax, %r13d
movl 0x8(%rbx), %edx
leaq 0x157a(%rip), %rsi      # 0x748a
movq %r15, %rdi
xorl %eax, %eax
callq 0x23c0
movl %eax, %r12d
movl 0xc(%rbx), %edx
leaq 0x157b(%rip), %rsi      # 0x74a2
movq %r15, %rdi
xorl %eax, %eax
callq 0x23c0
movl %eax, %r14d
movl 0x10(%rbx), %edx
leaq 0x157e(%rip), %rsi      # 0x74bc
movq %r15, %rdi
xorl %eax, %eax
callq 0x23c0
orl -0x30(%rbp), %r13d
orl %r12d, %r13d
orl %r14d, %r13d
orl -0x34(%rbp), %r13d
orl %eax, %r13d
jns 0x5f67
leaq 0x1574(%rip), %rdi      # 0x74d6
callq 0x2440
movq %rbx, %rdi
callq 0x2330
leaq 0x6ab3a152(%rip), %rdi  # 0x6ab400c8
callq 0x2370
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16c9(%rip), %rdi      # 0x765c
jmp 0x57ab
leaq 0x181a(%rip), %rdi      # 0x77b9
jmp 0x5fcc
leaq 0x17ef(%rip), %rdi      # 0x7797
jmp 0x5fcc
leaq 0x17d9(%rip), %rdi      # 0x778a
jmp 0x5fcc
leaq 0x17a4(%rip), %rdi      # 0x775e
jmp 0x5fcc
leaq 0x1743(%rip), %rdi      # 0x7706
jmp 0x5fcc
leaq 0x1766(%rip), %rdi      # 0x7732
callq 0x2440
xorl %edi, %edi
callq 0x2350