// File: supragya[P]DirectorySync/DirectorySync.cpp
// Function: TransactionHistory_t::is_recorded(message)
bool is_recorded(message m){
        mtx.lock();
        bool FoundRecord = false;
        // Pass 1: Hard
        for(int i=0; i<MAXTRANSACTIONS; i++){
            if(!ValidTransactionHistory[i])
                continue;
            if( strcmp(m.FileName, TransactionHistory[i].FileName) == 0 &&
                m.FType == TransactionHistory[i].FType &&
                m.FileSize == TransactionHistory[i].FileSize &&
                m.FCType == TransactionHistory[i].FCType){
                    FoundRecord = true;
                    ValidTransactionHistory[i] = false;
                    break;
            }
        }
        // Pass 2: Soft
        if(!FoundRecord){
            for(int i=0; i<MAXTRANSACTIONS; i++){
                if(!ValidTransactionHistory[i])
                    continue;
                if( strcmp(m.FileName, TransactionHistory[i].FileName) == 0 &&
                    m.FType == TransactionHistory[i].FType ){
                    FoundRecord = true;
                    break;
                }
            }
        }
        mtx.unlock();
        return FoundRecord;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x19068, %rdi          # imm = 0x19068
callq 0x5000
movb $0x0, -0x9(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x64, -0x10(%rbp)
jge 0x5160
movq -0x20(%rbp), %rax
movslq -0x10(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x50a0
jmp 0x5152
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdi
addq $0x4, %rdi
addq $0x68, %rsi
movslq -0x10(%rbp), %rax
shlq $0xa, %rax
addq %rax, %rsi
addq $0x4, %rsi
callq 0x2290
cmpl $0x0, %eax
jne 0x5150
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movl 0x3f0(%rax), %eax
addq $0x68, %rcx
movslq -0x10(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
cmpl 0x3f0(%rcx), %eax
jne 0x5150
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x3f8(%rax), %rax
addq $0x68, %rcx
movslq -0x10(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
cmpq 0x3f8(%rcx), %rax
jne 0x5150
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movl 0x3ec(%rax), %eax
addq $0x68, %rcx
movslq -0x10(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
cmpl 0x3ec(%rcx), %eax
jne 0x5150
movq -0x20(%rbp), %rax
movb $0x1, -0x9(%rbp)
movslq -0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x5160
jmp 0x5152
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x5083
testb $0x1, -0x9(%rbp)
jne 0x51ea
movl $0x0, -0x14(%rbp)
cmpl $0x64, -0x14(%rbp)
jge 0x51e8
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x5187
jmp 0x51dd
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdi
addq $0x4, %rdi
addq $0x68, %rsi
movslq -0x14(%rbp), %rax
shlq $0xa, %rax
addq %rax, %rsi
addq $0x4, %rsi
callq 0x2290
cmpl $0x0, %eax
jne 0x51db
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movl 0x3f0(%rax), %eax
addq $0x68, %rcx
movslq -0x14(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
cmpl 0x3f0(%rcx), %eax
jne 0x51db
movb $0x1, -0x9(%rbp)
jmp 0x51e8
jmp 0x51dd
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5171
jmp 0x51ea
movq -0x20(%rbp), %rdi
addq $0x19068, %rdi          # imm = 0x19068
callq 0x5030
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop