// File: yueww[P]TSR/index.cpp
// Function: recordPortIndexNum(flowRecord, int)
void recordPortIndexNum(flowRecord rec,int flag){
    if(flag==1){
        unsigned short portNum=rec.srcPort[0]*0x100+rec.srcPort[1];
        if(srcPortIndexTable.pTails[portNum]==NULL){
            srcPortIndexTable.pTails[portNum]=srcPortIndexTable.indexList[portNum]=&srcPortIndexNodeBuf[currUsedSrcPortIndexNodes];
        }else{
            srcPortIndexTable.pTails[portNum]->next=&srcPortIndexNodeBuf[currUsedSrcPortIndexNodes];
            srcPortIndexTable.pTails[portNum]=srcPortIndexTable.pTails[portNum]->next;
        }
        currUsedSrcPortIndexNodes++;
    }else{
        unsigned short portNum=rec.destPort[0]*0x100+rec.destPort[1];
        if(dstPortIndexTable.pTails[portNum]==NULL){
            dstPortIndexTable.pTails[portNum]=dstPortIndexTable.indexList[portNum]=&dstPortIndexNodeBuf[currUsedDstPortIndexNodes];
        }else{
            dstPortIndexTable.pTails[portNum]->next=&dstPortIndexNodeBuf[currUsedDstPortIndexNodes];
            dstPortIndexTable.pTails[portNum]=dstPortIndexTable.pTails[portNum]->next;
        }
        currUsedDstPortIndexNodes++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl %edi, -0x4(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x5d73
movq -0x10(%rbp), %rcx
movzbl 0x20(%rcx), %eax
shll $0x8, %eax
movzbl 0x21(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x6(%rbp)
movzwl -0x6(%rbp), %eax
movl %eax, %ecx
leaq 0x651d6835(%rip), %rax  # 0x651dc4f0
cmpq $0x0, 0x80000(%rax,%rcx,8)
jne 0x5d03
movslq 0x653d6833(%rip), %rax  # 0x653dc500
leaq 0x3e82980c(%rip), %rdx  # 0x3e82f4e0
shlq $0x4, %rax
addq %rax, %rdx
movzwl -0x6(%rbp), %eax
movl %eax, %ecx
leaq 0x651d6808(%rip), %rax  # 0x651dc4f0
movq %rdx, (%rax,%rcx,8)
movzwl -0x6(%rbp), %eax
movl %eax, %ecx
leaq 0x651d67f7(%rip), %rax  # 0x651dc4f0
movq %rdx, 0x80000(%rax,%rcx,8)
jmp 0x5d5f
movslq 0x653d67f6(%rip), %rax  # 0x653dc500
leaq 0x3e8297cf(%rip), %rcx  # 0x3e82f4e0
shlq $0x4, %rax
addq %rax, %rcx
movzwl -0x6(%rbp), %eax
movl %eax, %edx
leaq 0x651d67cb(%rip), %rax  # 0x651dc4f0
movq 0x80000(%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movzwl -0x6(%rbp), %eax
movl %eax, %ecx
leaq 0x651d67b2(%rip), %rax  # 0x651dc4f0
movq 0x80000(%rax,%rcx,8), %rax
movq 0x8(%rax), %rdx
movzwl -0x6(%rbp), %eax
movl %eax, %ecx
leaq 0x651d6799(%rip), %rax  # 0x651dc4f0
movq %rdx, 0x80000(%rax,%rcx,8)
movl 0x653d679b(%rip), %eax  # 0x653dc500
addl $0x1, %eax
movl %eax, 0x653d6792(%rip)  # 0x653dc500
jmp 0x5e48
movq -0x10(%rbp), %rcx
movzbl 0x22(%rcx), %eax
shll $0x8, %eax
movzbl 0x23(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x8(%rbp)
movzwl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x652d675b(%rip), %rax  # 0x652dc4f0
cmpq $0x0, 0x80000(%rax,%rcx,8)
jne 0x5ddd
movslq 0x653d675d(%rip), %rax  # 0x653dc504
leaq 0x480bff32(%rip), %rdx  # 0x480c5ce0
shlq $0x4, %rax
addq %rax, %rdx
movzwl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x652d672e(%rip), %rax  # 0x652dc4f0
movq %rdx, (%rax,%rcx,8)
movzwl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x652d671d(%rip), %rax  # 0x652dc4f0
movq %rdx, 0x80000(%rax,%rcx,8)
jmp 0x5e39
movslq 0x653d6720(%rip), %rax  # 0x653dc504
leaq 0x480bfef5(%rip), %rcx  # 0x480c5ce0
shlq $0x4, %rax
addq %rax, %rcx
movzwl -0x8(%rbp), %eax
movl %eax, %edx
leaq 0x652d66f1(%rip), %rax  # 0x652dc4f0
movq 0x80000(%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movzwl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x652d66d8(%rip), %rax  # 0x652dc4f0
movq 0x80000(%rax,%rcx,8), %rax
movq 0x8(%rax), %rdx
movzwl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x652d66bf(%rip), %rax  # 0x652dc4f0
movq %rdx, 0x80000(%rax,%rcx,8)
movl 0x653d66c5(%rip), %eax  # 0x653dc504
addl $0x1, %eax
movl %eax, 0x653d66bc(%rip)  # 0x653dc504
popq %rbp
retq
nopw (%rax,%rax)