// File: /workspace/github_cpp_makefile_star2_O2/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 0x5c1c
movq %rsi, %r15
cmpl $0x4, %edi
jne 0x5472
movq 0x18(%r15), %rsi
cmpb $0x2d, (%rsi)
jne 0x545f
cmpb $0x74, 0x1(%rsi)
jne 0x545f
cmpb $0x0, 0x2(%rsi)
je 0x5489
leaq 0x10f4(%rip), %rdi      # 0x655a
xorl %eax, %eax
callq 0x2040
jmp 0x5bff
jbe 0x558c
leaq 0x12f8(%rip), %rdi      # 0x6777
callq 0x2450
jmp 0x5bff
leaq 0x105d(%rip), %rdi      # 0x64ed
xorl %eax, %eax
callq 0x2040
leaq 0x1062(%rip), %r13      # 0x6500
leaq 0x6ab3999b(%rip), %rsi  # 0x6ab3ee40
movq %r13, %rdi
xorl %eax, %eax
callq 0x2300
leaq 0x104d(%rip), %rdi      # 0x6503
xorl %eax, %eax
callq 0x2040
leaq 0x6ab39a7c(%rip), %r14  # 0x6ab3ef40
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x103e(%rip), %rdi      # 0x6516
xorl %eax, %eax
callq 0x2040
leaq 0x6ab39ada(%rip), %r12  # 0x6ab3efc0
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x1033(%rip), %rdi      # 0x652d
xorl %eax, %eax
callq 0x2040
leaq 0x6ab39b38(%rip), %rbx  # 0x6ab3f040
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x1028(%rip), %rdi      # 0x6544
xorl %eax, %eax
callq 0x2040
leaq 0x102d(%rip), %rdi      # 0x6557
leaq 0x6ab39b8f(%rip), %rsi  # 0x6ab3f0c0
xorl %eax, %eax
callq 0x2300
movq 0x3a91(%rip), %rax      # 0x8fd0
movq (%rax), %rdi
callq 0x2320
leaq 0x6ab39b7a(%rip), %r13  # 0x6ab3f0c8
movq %r13, %rdi
callq 0x2130
movl 0x6ab39b63(%rip), %r9d  # 0x6ab3f0c0
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
leaq 0x6ab398d2(%rip), %rsi  # 0x6ab3ee40
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x2160
testq %rax, %rax
je 0x5c10
movb $0x1, 0x6ab39fc4(%rip)  # 0x6ab3f550
movl $0x1000, %esi           # imm = 0x1000
xorl %edi, %edi
movl $0x3b6, %edx            # imm = 0x3B6
callq 0x2190
movl %eax, 0x6ab39fb1(%rip)  # 0x6ab3f554
cmpl $-0x1, %eax
je 0x5c25
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x23b0
movq %rax, 0x6ab39f9a(%rip)  # 0x6ab3f558
cmpq $-0x1, %rax
je 0x5c2e
andl $0x0, (%rax)
leaq 0x12736be(%rip), %rax   # 0x1278c90
leaq 0xed336b7(%rip), %rcx   # 0xed38c90
movq %rax, (%rcx)
leaq 0xdabffc8(%rax), %rcx
leaq 0xed336ae(%rip), %rdx   # 0xed38c98
movq %rcx, (%rdx)
leaq 0x38(%rax), %rcx
movl $0x3e7fff, %edx         # imm = 0x3E7FFF
subq $0x1, %rdx
jb 0x5606
movq %rcx, -0x38(%rcx)
addq $0x38, %rcx
jmp 0x55f6
andq $0x0, 0xdabffc8(%rax)
leaq 0x51950e9b(%rip), %rax  # 0x519564b0
leaq 0x651d0e94(%rip), %rcx  # 0x651d64b0
movq %rax, (%rcx)
leaq 0x653d0eb2(%rip), %rax  # 0x653d64d8
incl (%rax)
leaq 0x54060e81(%rip), %rax  # 0x540664b0
leaq 0x653d0eaa(%rip), %rcx  # 0x653d64e0
incl (%rcx)
leaq 0x651d0e79(%rip), %rcx  # 0x651d64b8
movq %rax, (%rcx)
xorl %eax, %eax
leaq 0x2b6f6e65(%rip), %rdx  # 0x2b6fc4b0
leaq 0x3e823e5e(%rip), %rsi  # 0x3e8294b0
leaq 0x34f8d657(%rip), %rdi  # 0x34f92cb0
leaq 0x480ba650(%rip), %r8   # 0x480bfcb0
xorl %ecx, %ecx
cmpq $0x989680, %rcx         # imm = 0x989680
je 0x5681
movl %ecx, (%rdx,%rax)
movl %ecx, (%rsi,%rax)
movl %ecx, (%rdi,%rax)
movl %ecx, (%r8,%rax)
incq %rcx
addq $0x10, %rax
jmp 0x5662
pushq $0xa
popq %rdi
movsd 0xa4c(%rip), %xmm0      # 0x60d8
callq 0x2fe3
leaq 0x5c4(%rip), %rdx       # 0x5c5c
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x24d0
testl %eax, %eax
jne 0x5c37
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rsi
callq 0x5cfb
testq %rax, %rax
je 0x5c55
movq %rax, %rbx
movq %rax, %rdi
callq 0x2260
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2340
cmpl $-0x1, %r14d
je 0x5c40
cmpl $0x7f, %r14d
je 0x5c49
leaq 0xf55(%rip), %rbx       # 0x6649
leaq 0xe72(%rip), %r14       # 0x656d
leaq -0x29(%rbp), %r15
movq %rbx, %rdi
callq 0x2450
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2300
cmpb $0x71, -0x29(%rbp)
jne 0x56ff
leaq 0xe4f(%rip), %rbx       # 0x6570
movq %rbx, %rdi
callq 0x2260
cmpl $-0x1, %eax
je 0x5721
cmpl $0x7f, %eax
je 0x5721
leaq 0xf2f(%rip), %rdi       # 0x6669
callq 0x2450
pushq $0x1
popq %rdi
callq 0x21e0
movq 0x6ab39e12(%rip), %rdi  # 0x6ab3f560
callq 0x23c0
testl %eax, %eax
je 0x5763
leaq 0xf24(%rip), %rdi       # 0x6682
callq 0x2450
leaq 0x3b3e(%rip), %rax      # 0x92a8
movq (%rax), %rdi
callq 0x29b5
movq 0x6ab39def(%rip), %rdi  # 0x6ab3f568
callq 0x23c0
testl %eax, %eax
je 0x578e
leaq 0xf25(%rip), %rdi       # 0x66ae
callq 0x2450
xorl %r14d, %r14d
leaq 0x3b0c(%rip), %r15      # 0x92a4
leaq 0x6ab0a861(%rip), %r12  # 0x6ab10000
leaq 0x13baa(%rip), %r13     # 0x19350
leaq -0x58(%rbp), %rbx
cmpl (%r15), %r14d
jge 0x5834
movl (%r12), %eax
addl %r14d, %eax
imulq $0x30, %rax, %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 0x389b
movl -0x48(%rbp), %eax
movl %eax, 0x10(%rsp)
movups -0x58(%rbp), %xmm0
movups %xmm0, (%rsp)
callq 0x305c
movl (%r12), %ecx
addl %r14d, %ecx
imulq $0x30, %rcx, %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 0x38e9
incl %r14d
jmp 0x57aa
leaq 0x653d0c85(%rip), %rbx  # 0x653d64c0
movl (%rbx), %eax
xorl %ecx, %ecx
leaq 0x126344a(%rip), %rdx   # 0x1268c90
cmpq $0x400, %rcx            # imm = 0x400
je 0x58b0
movq %rcx, %rsi
shlq $0x6, %rsi
movl (%rdx,%rsi), %edi
testl %edi, %edi
jle 0x58ab
addq %rdx, %rsi
addq $0x8, %rsi
movslq %eax, %r8
imulq $0x30, %r8, %r9
addq 0x376e(%rip), %r9       # 0x8fe0
negl %edi
xorl %r10d, %r10d
cmpl %r10d, %edi
je 0x58a5
movq (%rsi), %rsi
incq %r8
movups 0x8(%rsi), %xmm0
movups 0x18(%rsi), %xmm1
movups 0x28(%rsi), %xmm2
movups %xmm2, 0x20(%r9)
movups %xmm1, 0x10(%r9)
movups %xmm0, (%r9)
decl %r10d
addq $0x30, %r9
jmp 0x5877
movl %r8d, (%rbx)
subl %r10d, %eax
incq %rcx
jmp 0x5846
leaq 0xb4e(%rip), %rdi       # 0x6405
leaq 0xb5a(%rip), %rsi       # 0x6418
callq 0x2330
movq %rax, -0x40(%rbp)
leaq 0x653d0bf6(%rip), %rax  # 0x653d64c4
movl (%rax), %eax
cmpl (%rbx), %eax
jge 0x5b33
callq 0x3a68
testb %al, %al
je 0x58c7
callq 0x4420
movq %rax, %rbx
movl (%rax), %eax
cltd
pushq $0x30
popq %rcx
idivl %ecx
movq -0x40(%rbp), %r15
movq %r15, %rdi
leaq 0xb1c(%rip), %rsi       # 0x641b
movl %eax, %edx
xorl %eax, %eax
callq 0x23d0
movl %eax, -0x34(%rbp)
movl (%rbx), %edx
movq %r15, %rdi
leaq 0xb16(%rip), %rsi       # 0x642d
xorl %eax, %eax
callq 0x23d0
movl %eax, -0x30(%rbp)
movl 0x4(%rbx), %edx
movq %r15, %rdi
leaq 0xb16(%rip), %rsi       # 0x6444
xorl %eax, %eax
callq 0x23d0
movl %eax, %r12d
movl 0x8(%rbx), %edx
movq %r15, %rdi
leaq 0xb17(%rip), %rsi       # 0x645c
xorl %eax, %eax
callq 0x23d0
movl %eax, %r13d
movl 0xc(%rbx), %edx
movq %r15, %rdi
leaq 0xb18(%rip), %rsi       # 0x6474
xorl %eax, %eax
callq 0x23d0
movl %eax, %r14d
movl 0x10(%rbx), %edx
movq %r15, %rdi
leaq 0xb1b(%rip), %rsi       # 0x648e
xorl %eax, %eax
callq 0x23d0
orl -0x30(%rbp), %r12d
orl %r13d, %r12d
orl %r14d, %r12d
orl -0x34(%rbp), %r12d
orl %eax, %r12d
jns 0x5999
leaq 0xb14(%rip), %rdi       # 0x64a8
callq 0x2450
movq %rbx, %rdi
callq 0x2340
leaq 0x653d0b1c(%rip), %rax  # 0x653d64c4
movslq (%rax), %r14
imulq $0x30, %r14, %rsi
leaq 0xed332fa(%rip), %rdi   # 0xed38cb0
addq %rdi, %rsi
leaq 0x653d0b00(%rip), %rax  # 0x653d64c0
movslq (%rax), %rbx
subq %r14, %rbx
imulq $0x30, %rbx, %rdx
callq 0x2250
testl %r14d, %r14d
movl $0x0, %eax
cmovgl %r14d, %eax
shlq $0x4, %rax
xorl %ecx, %ecx
leaq 0x2b6f6ac8(%rip), %rdx  # 0x2b6fc4b0
leaq 0x3e823ac1(%rip), %rsi  # 0x3e8294b0
leaq 0x34f8d2ba(%rip), %rdi  # 0x34f92cb0
leaq 0x480ba2b3(%rip), %r8   # 0x480bfcb0
cmpq %rcx, %rax
je 0x5a20
andq $0x0, 0x8(%rdx,%rcx)
andq $0x0, 0x8(%rdi,%rcx)
andq $0x0, 0x8(%rsi,%rcx)
andq $0x0, 0x8(%r8,%rcx)
addq $0x10, %rcx
jmp 0x59fd
leaq 0x653d0ab1(%rip), %r15  # 0x653d64d8
movslq (%r15), %rdx
shlq $0xb, %rdx
leaq 0x51950a7b(%rip), %r14  # 0x519564b0
movq %r14, %rdi
xorl %esi, %esi
callq 0x2180
leaq 0x653d0a9a(%rip), %r13  # 0x653d64e0
movslq (%r13), %rdx
shlq $0xb, %rdx
leaq 0x54060a5b(%rip), %r12  # 0x540664b0
movq %r12, %rdi
xorl %esi, %esi
callq 0x2180
leaq 0x653d0a76(%rip), %r15  # 0x653d64dc
movslq (%r15), %rdx
shlq $0xc, %rdx
leaq 0x56770a3c(%rip), %rdi  # 0x567764b0
xorl %esi, %esi
callq 0x2180
leaq 0x653d0a62(%rip), %r13  # 0x653d64e4
movslq (%r13), %rdx
shlq $0xc, %rdx
leaq 0x5dca0a1f(%rip), %rdi  # 0x5dca64b0
xorl %esi, %esi
callq 0x2180
movl $0x100000, %edx         # imm = 0x100000
leaq 0x651d0a1c(%rip), %rdi  # 0x651d64c0
xorl %esi, %esi
callq 0x2180
movl $0x100000, %edx         # imm = 0x100000
leaq 0x652d0a09(%rip), %rdi  # 0x652d64c0
xorl %esi, %esi
callq 0x2180
leaq 0x653d09ff(%rip), %rax  # 0x653d64c4
andl $0x0, (%rax)
andl $0x0, (%r15)
leaq 0x653d09ed(%rip), %rax  # 0x653d64c0
movl %ebx, (%rax)
movq %rax, %rbx
andl $0x0, (%r13)
leaq 0x651d09cc(%rip), %rax  # 0x651d64b0
movq %r14, (%rax)
leaq 0x653d09da(%rip), %rax  # 0x653d64c8
andl $0x0, (%rax)
leaq 0x651d09c0(%rip), %rax  # 0x651d64b8
movq %r12, (%rax)
leaq 0x653d09ca(%rip), %rax  # 0x653d64cc
andl $0x0, (%rax)
pushq $0x1
popq %rax
leaq 0x653d09c9(%rip), %rcx  # 0x653d64d8
movl %eax, (%rcx)
leaq 0x653d09b8(%rip), %rcx  # 0x653d64d0
andl $0x0, (%rcx)
leaq 0x653d09be(%rip), %rcx  # 0x653d64e0
movl %eax, (%rcx)
leaq 0x653d09a9(%rip), %rax  # 0x653d64d4
andl $0x0, (%rax)
jmp 0x58c7
callq 0x4420
movq %rax, %rbx
movl (%rax), %eax
cltd
pushq $0x30
popq %rcx
idivl %ecx
leaq 0x8d1(%rip), %rsi       # 0x641b
movq -0x40(%rbp), %r15
movq %r15, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x23d0
movl %eax, -0x34(%rbp)
movl (%rbx), %edx
leaq 0x8c7(%rip), %rsi       # 0x642d
movq %r15, %rdi
xorl %eax, %eax
callq 0x23d0
movl %eax, -0x30(%rbp)
movl 0x4(%rbx), %edx
leaq 0x8c7(%rip), %rsi       # 0x6444
movq %r15, %rdi
xorl %eax, %eax
callq 0x23d0
movl %eax, %r12d
movl 0x8(%rbx), %edx
leaq 0x8c8(%rip), %rsi       # 0x645c
movq %r15, %rdi
xorl %eax, %eax
callq 0x23d0
movl %eax, %r13d
movl 0xc(%rbx), %edx
leaq 0x8c9(%rip), %rsi       # 0x6474
movq %r15, %rdi
xorl %eax, %eax
callq 0x23d0
movl %eax, %r14d
movl 0x10(%rbx), %edx
leaq 0x8cc(%rip), %rsi       # 0x648e
movq %r15, %rdi
xorl %eax, %eax
callq 0x23d0
orl -0x30(%rbp), %r12d
orl %r13d, %r12d
orl %r14d, %r12d
orl -0x34(%rbp), %r12d
orl %eax, %r12d
jns 0x5beb
leaq 0x8c2(%rip), %rdi       # 0x64a8
callq 0x2450
movq %rbx, %rdi
callq 0x2340
leaq 0x6ab394ce(%rip), %rdi  # 0x6ab3f0c8
callq 0x2380
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa17(%rip), %rdi       # 0x662e
jmp 0x547f
leaq 0xb68(%rip), %rdi       # 0x678b
jmp 0x5c50
leaq 0xb3d(%rip), %rdi       # 0x6769
jmp 0x5c50
leaq 0xb27(%rip), %rdi       # 0x675c
jmp 0x5c50
leaq 0xaf2(%rip), %rdi       # 0x6730
jmp 0x5c50
leaq 0xa91(%rip), %rdi       # 0x66d8
jmp 0x5c50
leaq 0xab4(%rip), %rdi       # 0x6704
callq 0x2450
xorl %edi, %edi
callq 0x2360