LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReceiverOTCorrelation::ReadFromFile(std::basic_ifstream<char, std::char_traits<char>>&, unsigned char)
void ReceiverOTCorrelation::ReadFromFile(ifstream &fin, uint8_t bitsPerFSM)
{

  fin.read((char *)&N, sizeof(N));
  fin.read((char *)&K, sizeof(K));

  uint64_t packedLength = packLength(N, bitsPerFSM);

  uint8_t *packedBlindingFactors = new uint8_t[packedLength];
  blindingFactors = new uint8_t[N];

  fin.read((char *)packedBlindingFactors, sizeof(uint8_t) * packedLength);

  Unpack(bitsPerFSM, N, packedBlindingFactors, blindingFactors);
  delete[] packedBlindingFactors;

  uint8_t keyBuf[AESContext::AES_KEY_LEN];
  fin.read((char *)keyBuf, AESContext::AES_KEY_LEN);  

  choiceKey.Init(keyBuf);


  ComputeChoiceBits();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x4(%rdi), %rsi
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x22f0
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x22f0
movl 0x4(%rbx), %r15d
movl %ebp, %r12d
imulq %r15, %r12
addq $0x7, %r12
shrq $0x3, %r12
movq %r12, %rdi
callq 0x2030
movq %r15, %rdi
movq %rax, %r13
callq 0x2030
movq %rax, 0x128(%rbx)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x22f0
movl 0x4(%rbx), %esi
movq 0x128(%rbx), %rcx
movl %ebp, %edi
movq %r13, %rdx
callq 0x4105
movq %r13, %rdi
callq 0x2300
movq %rsp, %r15
pushq $0x10
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22f0
leaq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x5122
movq %rbx, %rdi
callq 0x3b7c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: CreateOTCorrelation(SenderOTCorrelation&, ReceiverOTCorrelation&, unsigned char, unsigned char)
void CreateOTCorrelation(SenderOTCorrelation &sc,
                         ReceiverOTCorrelation &rc, uint8_t bitsPerFSMROT, uint8_t bitsPerFSMSOT)
{
  if ((sc.N != rc.N) ||
      (sc.K != rc.K))
  {
    throw "sender/receiver correlation type mismatch";
  }

  uint8_t K = rc.K;
  uint32_t N = rc.N;

  AESContext senderKey;
  senderKey.FillBuffer((uint8_t *)sc.blindingFactors, N * K * sizeof(uint8_t), 0);

  for (int i = 0; i < N * K; i++){
    sc.blindingFactors[i] &= (uint8_t)((1 << bitsPerFSMSOT) - 1);
  }
  
  AESContext receiverKey;
  receiverKey.FillBuffer((uint8_t *)rc.choices, N, 0);

  sc.msgKey = senderKey;
  rc.choiceKey = receiverKey;

  for (uint32_t i = 0; i < N; i++)
  {
    rc.choices[i] %= K;
    rc.blindingFactors[i] = sc.blindingFactors[i * K + rc.choices[i]] & ((uint8_t) (1 << bitsPerFSMROT) - 1);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movl 0x4(%rdi), %r15d
movl %ecx, 0xc(%rsp)
movl %edx, 0x8(%rsp)
cmpl 0x4(%rsi), %r15d
jne 0x3963
movb (%rdi), %r12b
movzbl (%rsi), %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpb %bpl, %r12b
jne 0x3963
leaq 0x120(%rsp), %rdi
callq 0x4f00
movq 0x120(%r14), %rsi
movl %r15d, %r13d
imull %ebp, %r13d
leaq 0x120(%rsp), %rdi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x526a
pushq $-0x1
popq %rax
movl 0xc(%rsp), %ecx
xorl %edx, %edx
shlxl %ecx, %eax, %eax
movl %r13d, %ecx
notb %al
cmpq %rdx, %rcx
je 0x3899
movq 0x120(%r14), %rsi
andb %al, (%rsi,%rdx)
incq %rdx
jmp 0x3885
leaq 0x10(%rsp), %rdi
callq 0x4f00
movq 0x120(%rbx), %rsi
leaq 0x10(%rsp), %rdi
xorl %r13d, %r13d
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x526a
leaq 0x10(%r14), %rdi
leaq 0x120(%rsp), %rsi
movl $0x110, %edx            # imm = 0x110
callq 0x21c0
leaq 0x10(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movl $0x110, %edx            # imm = 0x110
callq 0x21c0
pushq $0x1
popq %rax
movl 0x8(%rsp), %ecx
xorl %edx, %edx
shlxl %ecx, %eax, %ecx
decb %cl
cmpq %rdx, %r15
je 0x393a
movq 0x120(%rbx), %rsi
movzbl (%rsi,%rdx), %eax
divb %r12b
movzbl %ah, %eax
movb %al, (%rsi,%rdx)
movq 0x120(%rbx), %rsi
movq 0x120(%r14), %rax
movq 0x128(%rbx), %rdi
movzbl (%rsi,%rdx), %esi
addl %r13d, %esi
addl %ebp, %r13d
movb (%rax,%rsi), %al
andb %cl, %al
movb %al, (%rdi,%rdx)
incq %rdx
jmp 0x38f5
leaq 0x10(%rsp), %rdi
callq 0x5140
leaq 0x120(%rsp), %rdi
callq 0x5140
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x2140
movq 0x5656(%rip), %rsi      # 0x8fc8
leaq 0x28d0(%rip), %rcx      # 0x6249
movq %rax, %rdi
xorl %edx, %edx
movq %rcx, (%rax)
callq 0x23c0
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0x5140
jmp 0x399a
jmp 0x3997
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x5140
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ConstructOTReceiverMsg(unsigned char*, ReceiverOTCorrelation const&, unsigned char const*, unsigned int)
void ConstructOTReceiverMsg(uint8_t *receiverMsg, const ReceiverOTCorrelation &rc,
                            const uint8_t *inputArr, uint32_t nOTs)
{
  if (nOTs > rc.N)
  {
    throw "insufficient number of OT correlations";
  }

  for (int i = 0; i < nOTs; i++)
  {
    receiverMsg[i] = (rc.choices[i] - inputArr[i] + rc.K) % rc.K;
  }
}

// Assembly:
pushq %rax
cmpl %ecx, 0x4(%rsi)
jb 0x39ed
movq %rdx, %r8
movl %ecx, %ecx
xorl %r9d, %r9d
cmpq %r9, %rcx
je 0x39eb
movq 0x120(%rsi), %rax
movzbl (%r8,%r9), %edx
movzbl (%rsi), %r10d
movzbl (%rax,%r9), %eax
subl %edx, %eax
addl %r10d, %eax
cwtd
idivw %r10w
movb %dl, (%rdi,%r9)
incq %r9
jmp 0x39bd
popq %rax
retq
pushq $0x8
popq %rdi
callq 0x2140
movq 0x55cc(%rip), %rsi      # 0x8fc8
leaq 0x2870(%rip), %rcx      # 0x6273
movq %rax, %rdi
xorl %edx, %edx
movq %rcx, (%rax)
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ConstructOTSenderMsg(unsigned char*, SenderOTCorrelation const&, unsigned char const*, unsigned char*, unsigned int, unsigned char)
void ConstructOTSenderMsg(uint8_t *senderMsg, const SenderOTCorrelation &sc,
                          const uint8_t *msgs, uint8_t *receiverArr, uint32_t nOTs, uint8_t bitsPerMsg)
{
  if (nOTs > sc.N)
  {
    throw "insufficient number of OT correlations";
  }

  memcpy(senderMsg, msgs, nOTs * sc.K * sizeof(uint8_t));
  for (int i = 0; i < nOTs; i++)
  {
    for (int j = 0; j < sc.K; j++)
    {
      senderMsg[sc.K * i + j] ^= sc.blindingFactors[sc.K * i + ((j + receiverArr[i]) % sc.K)];
      senderMsg[sc.K * i + j] &= (uint8_t)(1 << bitsPerMsg) - 1;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl %r8d, 0x4(%rsi)
jb 0x3ab4
movzbl (%rsi), %eax
movq %rsi, %r14
movl %r9d, %r12d
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdi, %r15
movq %rdx, %rsi
imull %r8d, %eax
movq %rax, %rdx
callq 0x21c0
pushq $0x1
popq %rax
shlxl %r12d, %eax, %ecx
movl %ebp, %esi
xorl %edi, %edi
decb %cl
cmpq %rsi, %rdi
je 0x3aab
xorl %r8d, %r8d
movzbl (%r14), %r9d
cmpl %r9d, %r8d
jae 0x3aa6
movzbl (%rbx,%rdi), %eax
movq 0x120(%r14), %r10
movl %edi, %r11d
imull %r9d, %r11d
xorl %edx, %edx
addl %r8d, %eax
divw %r9w
imull %edi, %r9d
movzwl %dx, %eax
addq %r11, %rax
movb (%r10,%rax), %al
addl %r8d, %r9d
xorb %al, (%r15,%r9)
movzbl (%r14), %eax
imulq %rdi, %rax
addq %r15, %rax
andb %cl, (%r8,%rax)
incq %r8
jmp 0x3a59
incq %rdi
jmp 0x3a51
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x2140
movq 0x5505(%rip), %rsi      # 0x8fc8
leaq 0x27a9(%rip), %rcx      # 0x6273
movq %rax, %rdi
xorl %edx, %edx
movq %rcx, (%rax)
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: RecoverReceiverMsg(unsigned char*, ReceiverOTCorrelation const&, unsigned char*, unsigned char*, unsigned int, unsigned char, unsigned char)
void RecoverReceiverMsg(uint8_t *msgs, const ReceiverOTCorrelation &rc,
                        uint8_t *inputArr, uint8_t *senderMsg, uint32_t nOTs, uint8_t bitsPerMsg, uint8_t bitsPerFSM)
{
  if (nOTs > rc.N) {
    throw "insufficient number of OT correlations";
  }

  memcpy(msgs, rc.blindingFactors, nOTs * sizeof(uint8_t));
  for (int i = 0; i < nOTs; i++) {
      msgs[i] ^= (senderMsg[rc.K*i + inputArr[i]] & ((uint8_t) (1 << bitsPerFSM) - 1));
      msgs[i] &= (uint8_t) (1 << bitsPerMsg) - 1;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl %r8d, 0x4(%rsi)
jb 0x3b59
movq %rsi, %r15
movq 0x128(%rsi), %rsi
movl %r9d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movl %r8d, %r13d
movq %r13, %rdx
movq %rdi, %r12
callq 0x21c0
pushq $0x1
popq %rcx
movb 0x40(%rsp), %al
xorl %edx, %edx
shlxl %eax, %ecx, %eax
shlxl %ebp, %ecx, %ecx
decb %al
decb %cl
cmpq %rdx, %r13
je 0x3b4a
movzbl (%r15), %esi
movzbl (%r14,%rdx), %edi
imull %edx, %esi
addl %esi, %edi
movb (%rbx,%rdi), %sil
andb %al, %sil
xorb (%r12,%rdx), %sil
andb %cl, %sil
movb %sil, (%r12,%rdx)
incq %rdx
jmp 0x3b20
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x2140
movq 0x5460(%rip), %rsi      # 0x8fc8
leaq 0x2704(%rip), %rcx      # 0x6273
movq %rax, %rdi
xorl %edx, %edx
movq %rcx, (%rax)
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReceiverOTCorrelation::ComputeChoiceBits()
void ReceiverOTCorrelation::ComputeChoiceBits()
{
  choices = new uint8_t[N];
  
  choiceKey.FillBuffer((uint8_t *)choices, N, 0);

  for (uint32_t i = 0; i < N; i++)
  {
    choices[i] %= K;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x4(%rdi), %r14d
movq %rdi, %rbx
movq %r14, %rdi
callq 0x2030
leaq 0x10(%rbx), %rdi
movq %rax, 0x120(%rbx)
xorl %r15d, %r15d
movq %rax, %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x526a
movl 0x4(%rbx), %eax
cmpq %rax, %r15
jae 0x3bcd
movq 0x120(%rbx), %rcx
movzbl (%rcx,%r15), %eax
divb (%rbx)
movzbl %ah, %eax
movb %al, (%rcx,%r15)
incq %r15
jmp 0x3bab
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: OTSenderProtocol(CSocket*, SenderOTCorrelation const&, unsigned int, unsigned char const*)
void OTSenderProtocol(CSocket *socket, const SenderOTCorrelation &corr,
                      uint32_t nOTs, const uint8_t *msgs)
{
  if (nOTs > corr.N)
  {
    throw "insufficient number of of OT correlations";
  }

  uint8_t *clientMsg = new uint8_t[nOTs];
  socket->ReceiveLarge(clientMsg, nOTs * sizeof(uint8_t));

  cout << "Receiving: " << (uint32_t) clientMsg[0] << endl;

  uint8_t *senderMsg = new uint8_t[corr.K * nOTs];
  ConstructOTSenderMsg(senderMsg, corr, msgs, clientMsg, nOTs, 8);

  socket->SendLarge((uint8_t *)senderMsg, corr.K * nOTs * sizeof(uint8_t));

  cout << "Sending: " << (uint32_t) senderMsg[0] << (uint32_t)senderMsg[1] << (uint32_t)senderMsg[2] <<(uint32_t) senderMsg[3] << endl;

  delete[] clientMsg;
  delete[] senderMsg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl %edx, 0x4(%rsi)
jb 0x3cdb
movq %rcx, %r13
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r15
movl %edx, %r14d
movq %r14, %rdi
callq 0x2030
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x4c24
movq 0x53c3(%rip), %rdi      # 0x8fd8
leaq 0x26a8(%rip), %rsi      # 0x62c4
callq 0x2250
movzbl (%rbx), %esi
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x2130
movzbl (%r12), %edi
imull %ebp, %edi
callq 0x2030
movq %rax, %r14
pushq $0x8
popq %r9
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x3a10
movzbl (%r12), %edx
movq %r15, %rdi
movq %r14, %rsi
imull %ebp, %edx
callq 0x4cba
movq 0x5362(%rip), %rdi      # 0x8fd8
leaq 0x2653(%rip), %rsi      # 0x62d0
callq 0x2250
movzbl (%r14), %esi
movq %rax, %rdi
callq 0x2180
movzbl 0x1(%r14), %esi
movq %rax, %rdi
callq 0x2180
movzbl 0x2(%r14), %esi
movq %rax, %rdi
callq 0x2180
movzbl 0x3(%r14), %esi
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2300
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2300
pushq $0x8
popq %rdi
callq 0x2140
movq 0x52de(%rip), %rsi      # 0x8fc8
leaq 0x25a9(%rip), %rcx      # 0x629a
movq %rax, %rdi
xorl %edx, %edx
movq %rcx, (%rax)
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: OTReceiverProtocol(CSocket*, unsigned char*, ReceiverOTCorrelation const&, unsigned int, unsigned char const*)
void OTReceiverProtocol(CSocket *socket, uint8_t *outputs, const ReceiverOTCorrelation &corr,
                        uint32_t nOTs, const uint8_t *choiceBits)
{
  if (nOTs > corr.N)
  {
    throw "insufficient number of of OT correlations";
  }

  cout << "Value has: " << (uint32_t)corr.K << endl;

  uint8_t *clientMsg = new uint8_t[nOTs];
  ConstructOTReceiverMsg(clientMsg, corr, choiceBits, nOTs);

  cout << "Sending: " << (uint32_t) clientMsg[0] << endl;

  socket->SendLarge(clientMsg, nOTs * sizeof(uint8_t));

  uint8_t *serverMsg = new uint8_t[corr.K * nOTs];
  socket->ReceiveLarge((uint8_t *)serverMsg, corr.K * nOTs * sizeof(uint8_t));

  cout << "Recieved: " << (uint32_t) serverMsg[0] << (uint32_t)serverMsg[1] << (uint32_t)serverMsg[2] <<(uint32_t) serverMsg[3] << endl;

  RecoverReceiverMsg(outputs, corr, clientMsg, serverMsg, nOTs, 8, 8);

  delete[] clientMsg;
  delete[] serverMsg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
cmpl %ecx, 0x4(%rdx)
jb 0x3e4e
movq %rdi, %rbp
movq 0x52b4(%rip), %rdi      # 0x8fd8
leaq 0x25af(%rip), %rsi      # 0x62da
movq %r8, %r15
movl %ecx, %ebx
movq %rdx, %r14
callq 0x2250
movzbl (%r14), %esi
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x2130
movl %ebx, %r13d
movq %r13, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x39af
movq 0x5267(%rip), %rdi      # 0x8fd8
leaq 0x2558(%rip), %rsi      # 0x62d0
callq 0x2250
movzbl (%r12), %esi
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x2130
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x4cba
movzbl (%r14), %r13d
imull %ebx, %r13d
movq %r13, %rdi
callq 0x2030
movq %rax, %r15
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x4c24
movq 0x5210(%rip), %rdi      # 0x8fd8
leaq 0x2517(%rip), %rsi      # 0x62e6
callq 0x2250
movzbl (%r15), %esi
movq %rax, %rdi
callq 0x2180
movzbl 0x1(%r15), %esi
movq %rax, %rdi
callq 0x2180
movzbl 0x2(%r15), %esi
movq %rax, %rdi
callq 0x2180
movzbl 0x3(%r15), %esi
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x2130
movl $0x8, (%rsp)
pushq $0x8
popq %r9
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
movl %ebx, %r8d
callq 0x3ad7
movq %r12, %rdi
callq 0x2300
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2300
pushq $0x8
popq %rdi
callq 0x2140
movq 0x516b(%rip), %rsi      # 0x8fc8
leaq 0x2436(%rip), %rcx      # 0x629a
movq %rax, %rdi
xorl %edx, %edx
movq %rcx, (%rax)
callq 0x23c0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: CreateAndExportOTCorrelation(std::basic_ofstream<char, std::char_traits<char>>&, std::basic_ofstream<char, std::char_traits<char>>&, unsigned int, unsigned char, unsigned char, unsigned char)
void CreateAndExportOTCorrelation(ofstream &out1, ofstream &out2, uint32_t N, uint8_t K, uint8_t bitsPerFSMROT, uint8_t bitsPerFSMSOT)
{
  SenderOTCorrelation senderOTC(N, K);
  ReceiverOTCorrelation receiverOTC(N, K);

  CreateOTCorrelation(senderOTC, receiverOTC, bitsPerFSMROT, bitsPerFSMSOT);

  senderOTC.WriteToFile(out1, bitsPerFSMSOT);
  receiverOTC.WriteToFile(out2, bitsPerFSMROT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %r14
leaq 0x130(%rsp), %rdi
movq %rsi, %rbx
movl %r9d, %ebp
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %r13d
movl %edx, %esi
movl %ecx, %edx
callq 0x3522
movq %rsp, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x3676
movzbl %r15b, %r15d
movzbl %bpl, %ebp
leaq 0x130(%rsp), %rdi
movq %rsp, %rsi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x3809
leaq 0x130(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3f3c
movq %rsp, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x3fb6
movq %rsp, %rdi
callq 0x37d6
leaq 0x130(%rsp), %rdi
callq 0x3654
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3f27
movq %rsp, %rdi
movq %rax, %rbx
callq 0x37d6
leaq 0x130(%rsp), %rdi
callq 0x3654
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: SenderOTCorrelation::WriteToFile(std::basic_ofstream<char, std::char_traits<char>>&, unsigned char) const
void SenderOTCorrelation::WriteToFile(ofstream &fout, uint8_t bitsPerFSM) const
{
  fout.write((char *)&N, sizeof(N));
  fout.write((char *)&K, sizeof(K));

  if (store_sOT_as_key == 1){
    fout.write((char *)msgKey.keyBytes, sizeof(msgKey.keyBytes));
  }
  else{

    uint8_t* packed = Pack(bitsPerFSM, N * K, blindingFactors);
    uint64_t newLength = packLength(N * K, bitsPerFSM);

    fout.write((char *)packed, sizeof(uint8_t) * newLength);

    delete[] packed;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edx, %ebp
movq %rdi, %r14
leaq 0x4(%rdi), %rsi
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x2320
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2320
movzbl (%r14), %esi
movq 0x120(%r14), %rdx
movl %ebp, %edi
imull 0x4(%r14), %esi
callq 0x403b
movq %rax, %r15
movzbl (%r14), %eax
movl %ebp, %edx
movq %rbx, %rdi
movq %r15, %rsi
imull 0x4(%r14), %eax
imulq %rax, %rdx
addq $0x7, %rdx
shrq $0x3, %rdx
callq 0x2320
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReceiverOTCorrelation::WriteToFile(std::basic_ofstream<char, std::char_traits<char>>&, unsigned char) const
void ReceiverOTCorrelation::WriteToFile(ofstream &fout, uint8_t bitsPerFSM) const
{
  fout.write((char *)&N, sizeof(N));
  fout.write((char *)&K, sizeof(K));

  uint8_t* packed = Pack(bitsPerFSM, N, blindingFactors);
  uint64_t newLength = packLength(N, bitsPerFSM);

  fout.write((char *)packed, sizeof(uint8_t) * newLength);

  delete[] packed;
  
  fout.write((char *)choiceKey.keyBytes, sizeof(choiceKey.keyBytes));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edx, %ebp
movq %rdi, %r14
leaq 0x4(%rdi), %rsi
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x2320
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2320
movl 0x4(%r14), %esi
movq 0x128(%r14), %rdx
movl %ebp, %edi
callq 0x403b
movq %rax, %r15
movl 0x4(%r14), %eax
movl %ebp, %edx
movq %rbx, %rdi
movq %r15, %rsi
imulq %rax, %rdx
addq $0x7, %rdx
shrq $0x3, %rdx
callq 0x2320
movq %r15, %rdi
callq 0x2300
addq $0x110, %r14            # imm = 0x110
pushq $0x10
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: Pack(unsigned char, unsigned long, unsigned char*)
uint8_t *Pack(uint8_t bitsPerMsg, uint64_t length, uint8_t* data){
  //Assumes bitsPerMsg <= 8
  uint64_t newLength = packLength(length, bitsPerMsg);
  uint8_t* buffer = new uint8_t[newLength];
  memset(buffer, 0, newLength);
  
  uint8_t bitPointer = 0;
  uint64_t index = 0;

  for (int i = 0; i < length; i++){
    if (bitPointer + bitsPerMsg <= 8){
      buffer[index] += data[i] << bitPointer;
      bitPointer += bitsPerMsg;
      if (bitPointer == 8){
        index += 1;
        bitPointer = 0;
      }
    }
    else{
      uint8_t rightBits = 8 - bitPointer;
      uint8_t mask = (1 << rightBits) - 1;
      buffer[index] += (data[i] & mask) << bitPointer;
      
      index += 1;
      buffer[index] =  data[i] >> rightBits;
      bitPointer = bitsPerMsg - rightBits;
    }
  }
  return buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r12d
imulq %rsi, %r12
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
addq $0x7, %r12
shrq $0x3, %r12
movq %r12, %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2160
pushq $0x8
popq %rax
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rcx, %r14
je 0x40e4
movzbl %sil, %edi
addl %ebp, %edi
cmpl $0x8, %edi
ja 0x40b3
movzbl (%rbx,%rcx), %r8d
shlxl %esi, %r8d, %esi
addb %sil, (%r15,%rdx)
xorl %esi, %esi
cmpl $0x8, %edi
sete %sil
cmovel %r13d, %edi
addq %rsi, %rdx
movl %edi, %esi
jmp 0x40df
movzbl (%rbx,%rcx), %r8d
movl %eax, %edi
subl %esi, %edi
movzbl %dil, %edi
bzhil %edi, %r8d, %r9d
shlxl %esi, %r9d, %esi
addb %sil, (%r15,%rdx)
shrxl %edi, %r8d, %esi
movb %sil, 0x1(%r15,%rdx)
movl %ebp, %esi
incq %rdx
subl %edi, %esi
incq %rcx
jmp 0x4081
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: Unpack(unsigned char, unsigned long, unsigned char*, unsigned char*)
uint8_t *Unpack(uint8_t bitsPerMsg, uint64_t length, uint8_t* data, uint8_t* out){
  //Assumes bitsPerMsg <= 8
  uint64_t newLength = packLength(length, bitsPerMsg);
  
  uint8_t bitPointer = 0;
  uint64_t index = 0;

  uint8_t mask = (1 << bitsPerMsg) - 1;

  for (int i = 0; i < length; i++){
    if (bitPointer + bitsPerMsg <= 8){
      //REGULAR CASE
      out[i] = (data[index] >> bitPointer) & mask;
      bitPointer += bitsPerMsg;
      if (bitPointer == 8){
        index += 1;
        bitPointer = 0;
      }
    }
    else{
      //OVERLAP CASE
      uint8_t reconstructedValue = 0;

      uint8_t rightBits = 8 - bitPointer;
      reconstructedValue += data[index] >> bitPointer;

      index += 1;
      uint8_t leftBits = bitsPerMsg - rightBits;
      uint8_t newMask = (1 << leftBits) - 1;
      reconstructedValue += (data[index] & newMask) << rightBits;
      out[i] = reconstructedValue;

      bitPointer = leftBits;
    }
  }
  return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x8, %r9d
xorl %r8d, %r8d
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %ebx, %ebx
shlxl %edi, %ecx, %ecx
notl %ecx
cmpq %r10, %rsi
je 0x4194
movzbl %bl, %r14d
addl %edi, %r14d
cmpl $0x8, %r14d
ja 0x415e
movzbl (%rdx,%r11), %ebp
shrxl %ebx, %ebp, %ebp
xorl %ebx, %ebx
andl %ecx, %ebp
cmpl $0x8, %r14d
sete %bl
cmovel %r8d, %r14d
addq %rbx, %r11
movl %r14d, %ebx
jmp 0x418b
movzbl (%rdx,%r11), %r14d
movzbl 0x1(%rdx,%r11), %r15d
movl %r9d, %ebp
subl %ebx, %ebp
incq %r11
movzbl %bpl, %ebp
shrxl %ebx, %r14d, %r14d
movl %edi, %ebx
subl %ebp, %ebx
bzhil %ebx, %r15d, %r15d
shlxl %ebp, %r15d, %ebp
addl %r14d, %ebp
movb %bpl, (%rax,%r10)
incq %r10
jmp 0x412b
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: WriteProtocolArgs(std::basic_ofstream<char, std::char_traits<char>>&, ProtocolArgs)
void WriteProtocolArgs(ofstream &out1, struct ProtocolArgs args)
{
  out1.write((char *)&args.N, sizeof(args.N));
  out1.write((char *)&args.C, sizeof(args.C));
  out1.write((char *)&args.FSM1_rounds, sizeof(args.FSM1_rounds));
  out1.write((char *)&args.FSM2_rounds, sizeof(args.FSM2_rounds));

  for (int i = 0; i < args.FSM1_rounds; i++){
    out1.write((char *)&args.FSM1_steps[i], sizeof(uint8_t));
  }
  for (int i = 0; i < args.FSM2_rounds; i++){
    out1.write((char *)&args.FSM2_steps[i], sizeof(uint8_t));
  }
  for (int i = 0; i < args.C; i++){
    out1.write((char *)&args.bits_per_component[i], sizeof(uint8_t));
  }
  

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x4
popq %rbp
movq %rbp, %rdx
callq 0x2320
leaq 0x4(%rbx), %rsi
movq %r14, %rdi
movq %rbp, %rdx
movq %rsi, (%rsp)
callq 0x2320
leaq 0x8(%rbx), %r13
movq %r14, %rdi
movq %rbp, %rdx
movq %r13, %rsi
callq 0x2320
leaq 0xc(%rbx), %r12
movq %r14, %rdi
movq %rbp, %rdx
movq %r12, %rsi
callq 0x2320
xorl %r15d, %r15d
pushq $0x1
popq %rbp
movl (%r13), %eax
cmpq %rax, %r15
jae 0x4214
movq 0x10(%rbx), %rsi
movq %r14, %rdi
movq %rbp, %rdx
addq %r15, %rsi
callq 0x2320
incq %r15
jmp 0x41f4
xorl %ebp, %ebp
pushq $0x1
popq %r13
movq (%rsp), %r15
movl (%r12), %eax
cmpq %rax, %rbp
jae 0x423e
movq 0x18(%rbx), %rsi
movq %r14, %rdi
movq %r13, %rdx
addq %rbp, %rsi
callq 0x2320
incq %rbp
jmp 0x421e
xorl %r13d, %r13d
pushq $0x1
popq %r12
movl (%r15), %eax
cmpq %rax, %r13
jae 0x4264
movq 0x20(%rbx), %rsi
movq %r14, %rdi
movq %r12, %rdx
addq %r13, %rsi
callq 0x2320
incq %r13
jmp 0x4245
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ProtocolArgs::ProtocolArgs(std::basic_ifstream<char, std::char_traits<char>>&)
ProtocolArgs::ProtocolArgs(ifstream &in)
{
  alloc_OT = false;

  in.read((char *)&N, sizeof(N));
  in.read((char *)&C, sizeof(C));
  in.read((char *)&FSM1_rounds, sizeof(FSM1_rounds));
  in.read((char *)&FSM2_rounds, sizeof(FSM2_rounds));

  FSM1_steps = new uint8_t[FSM1_rounds];
  for (int i = 0; i < FSM1_rounds; i++){
    in.read((char *)&FSM1_steps[i], sizeof(uint8_t));
  }

  FSM2_steps = new uint8_t[FSM2_rounds];
  for (int i = 0; i < FSM2_rounds; i++){
    in.read((char *)&FSM2_steps[i], sizeof(uint8_t));
  }
  bits_per_component = new uint8_t[C];
  for (int i = 0; i < C; i++){
    in.read((char *)&bits_per_component[i], sizeof(uint8_t));
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x28(%rdi)
pushq $0x4
popq %r15
movq %rsi, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x22f0
leaq 0x4(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x22f0
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x22f0
leaq 0xc(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x22f0
movl 0x8(%r14), %r12d
movq %r12, %rdi
callq 0x2030
xorl %r13d, %r13d
movq %rax, 0x10(%r14)
pushq $0x1
popq %r15
movl %r12d, %eax
cmpq %rax, %r13
jae 0x4300
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
addq %r13, %rsi
callq 0x22f0
movl 0x8(%r14), %r12d
incq %r13
jmp 0x42dd
movl 0xc(%r14), %r12d
movq %r12, %rdi
callq 0x2030
xorl %r13d, %r13d
movq %rax, 0x18(%r14)
pushq $0x1
popq %r15
movl %r12d, %eax
cmpq %rax, %r13
jae 0x433a
movq 0x18(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
addq %r13, %rsi
callq 0x22f0
movl 0xc(%r14), %r12d
incq %r13
jmp 0x4317
movl 0x4(%r14), %r12d
movq %r12, %rdi
callq 0x2030
xorl %r13d, %r13d
movq %rax, 0x20(%r14)
pushq $0x1
popq %r15
movl %r12d, %eax
cmpq %rax, %r13
jae 0x4374
movq 0x20(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
addq %r13, %rsi
callq 0x22f0
movl 0x4(%r14), %r12d
incq %r13
jmp 0x4351
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReadInConfigFile(std::basic_ifstream<char, std::char_traits<char>>&, unsigned int&)
uint8_t* ReadInConfigFile(ifstream& in, uint32_t &C){
  string line1;
  getline(in, line1);
  string strC = line1.substr(line1.find("=") + 1, line1.length());
  C = atoi(strC.c_str());
  
  uint8_t *out_bits_per_component = new uint8_t[C];

  string line2;
  getline(in, line2);
  string strBits = line2.substr(line2.find("=") + 1, line2.length());
  stringstream ss(strBits);

  int index = 0;
  for (int i; ss >> i;) {
    out_bits_per_component[index] = i;
    index++;
    if (ss.peek() == ',' || ss.peek() == ' ')
      ss.ignore();
    }

  return out_bits_per_component;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
leaq 0x40(%rsp), %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x30(%rsp), %rsi
callq 0x2070
leaq 0x30(%rsp), %r15
leaq 0x1f37(%rip), %rsi      # 0x62f1
xorl %edx, %edx
movq %r15, %rdi
callq 0x2440
movq 0x8(%r15), %rcx
leaq 0x1(%rax), %rdx
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x2290
movq 0x70(%rsp), %rdi
callq 0x2380
movl %eax, (%rbx)
movl %eax, %edi
callq 0x2030
leaq 0x20(%rsp), %rcx
movq %rax, %rbx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x2070
leaq 0x10(%rsp), %r14
leaq 0x1ed8(%rip), %rsi      # 0x62f1
xorl %edx, %edx
movq %r14, %rdi
callq 0x2440
movq 0x8(%r14), %rcx
leaq 0x1(%rax), %rdx
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x2290
leaq 0x90(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x23a0
leaq 0x90(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %rbx, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x2170
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x44a5
movb 0xc(%rsp), %al
movb %al, (%r12)
movq %r14, %rdi
callq 0x20f0
cmpl $0x2c, %eax
je 0x4498
movq %r14, %rdi
callq 0x20f0
cmpl $0x20, %eax
jne 0x44a0
movq %r14, %rdi
callq 0x2400
incq %r12
jmp 0x445d
leaq 0x90(%rsp), %rdi
callq 0x21b0
leaq 0x50(%rsp), %rdi
callq 0x2110
leaq 0x10(%rsp), %rdi
callq 0x2110
leaq 0x70(%rsp), %rdi
callq 0x2110
leaq 0x30(%rsp), %rdi
callq 0x2110
movq %rbx, %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x4514
jmp 0x44f3
movq %rax, %rbx
jmp 0x451e
movq %rax, %rbx
jmp 0x4528
jmp 0x44ff
movq %rax, %rbx
jmp 0x4532
leaq 0x90(%rsp), %rdi
movq %rax, %rbx
callq 0x21b0
leaq 0x50(%rsp), %rdi
callq 0x2110
leaq 0x10(%rsp), %rdi
callq 0x2110
leaq 0x70(%rsp), %rdi
callq 0x2110
leaq 0x30(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReadInSenderOTsFSM1(std::basic_ifstream<char, std::char_traits<char>>&, ProtocolArgs)
SenderOTCorrelation** ReadInSenderOTsFSM1(ifstream &in, struct ProtocolArgs args)
{
  SenderOTCorrelation** FSM1 = new SenderOTCorrelation*[args.FSM1_rounds];

  for (int i = 0; i < args.FSM1_rounds; i++)
  {
    FSM1[i] = new SenderOTCorrelation(in, bits_FSM1_SOT);
  }
  return FSM1;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x8(%rsi), %r12d
movq %rdi, %r14
movq %rsi, %rbx
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
pushq $0x1
popq %rbp
movl %r12d, %eax
cmpq %rax, %r13
jae 0x459d
movl $0x130, %edi            # imm = 0x130
callq 0x2270
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3574
movq %r12, (%r15,%r13,8)
incq %r13
movl 0x8(%rbx), %r12d
jmp 0x456e
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rax, %rbx
callq 0x2230
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReadInSenderOTsFSM2(std::basic_ifstream<char, std::char_traits<char>>&, ProtocolArgs)
SenderOTCorrelation** ReadInSenderOTsFSM2(ifstream &in, struct ProtocolArgs args)
{
  SenderOTCorrelation** FSM2 = new SenderOTCorrelation*[args.FSM2_rounds];
  for (int i = 0; i < args.FSM2_rounds; i++)
  {
    FSM2[i] = new SenderOTCorrelation(in, bits_FSM2_SOT);
  }
  return FSM2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0xc(%rsi), %r12d
movq %rdi, %r14
movq %rsi, %rbx
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
pushq $0x2
popq %rbp
movl %r12d, %eax
cmpq %rax, %r13
jae 0x461b
movl $0x130, %edi            # imm = 0x130
callq 0x2270
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3574
movq %r12, (%r15,%r13,8)
incq %r13
movl 0xc(%rbx), %r12d
jmp 0x45ec
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rax, %rbx
callq 0x2230
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReadInReceiverOTsFSM1(std::basic_ifstream<char, std::char_traits<char>>&, ProtocolArgs)
ReceiverOTCorrelation** ReadInReceiverOTsFSM1(ifstream &in, struct ProtocolArgs args)
{
  args.alloc_OT = true;
  ReceiverOTCorrelation** FSM1 = new ReceiverOTCorrelation *[args.FSM1_rounds];
  for (int i = 0; i < args.FSM1_rounds; i++)
  {
    FSM1[i] = new ReceiverOTCorrelation(in, bits_FSM1);
  }
  return FSM1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, 0x28(%rsi)
movq %rdi, %r14
movq %rsi, %rbx
movl 0x8(%rsi), %r12d
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
pushq $0x4
popq %rbp
movl %r12d, %eax
cmpq %rax, %r13
jae 0x469d
movl $0x130, %edi            # imm = 0x130
callq 0x2270
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x36d2
movq %r12, (%r15,%r13,8)
incq %r13
movl 0x8(%rbx), %r12d
jmp 0x466e
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rax, %rbx
callq 0x2230
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReadInReceiverOTsFSM2(std::basic_ifstream<char, std::char_traits<char>>&, ProtocolArgs)
ReceiverOTCorrelation** ReadInReceiverOTsFSM2(ifstream &in, struct ProtocolArgs args)
{
  args.alloc_OT = true;
  ReceiverOTCorrelation** FSM2 = new ReceiverOTCorrelation *[args.FSM2_rounds];
  for (int i = 0; i < args.FSM2_rounds; i++)
  {
    FSM2[i] = new ReceiverOTCorrelation(in, bits_FSM2);
  }
  return FSM2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, 0x28(%rsi)
movq %rdi, %r14
movq %rsi, %rbx
movl 0xc(%rsi), %r12d
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
pushq $0x6
popq %rbp
movl %r12d, %eax
cmpq %rax, %r13
jae 0x471f
movl $0x130, %edi            # imm = 0x130
callq 0x2270
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x36d2
movq %r12, (%r15,%r13,8)
incq %r13
movl 0xc(%rbx), %r12d
jmp 0x46f0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rax, %rbx
callq 0x2230
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReadInEntry(std::basic_ifstream<char, std::char_traits<char>>&, unsigned int)
uint32_t* ReadInEntry(ifstream& in, uint32_t C){
  string line;
  getline(in, line, '\n');

  istringstream f(line);
  string element;

  uint32_t* entry = new uint32_t[C];
  uint32_t i = 0;

  while (getline(f, element, ',')){
    entry[i] = (uint32_t) atoi(element.c_str());
    i += 1;
  }

  return entry;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1c0, %rsp            # imm = 0x1C0
leaq 0x30(%rsp), %rax
movl %esi, %ebx
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x20(%rsp), %rsi
pushq $0xa
popq %rdx
callq 0x2410
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x23b0
leaq 0x10(%rsp), %rax
movl %ebx, %edi
shlq $0x2, %rdi
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
callq 0x2030
leaq 0x40(%rsp), %r14
movq %rax, %rbx
xorl %r12d, %r12d
movq %rsp, %r15
pushq $0x2c
popq %rbp
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x2410
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x47f7
movq (%rsp), %rdi
callq 0x2380
movl %r12d, %ecx
movl %eax, (%rbx,%rcx,4)
incl %r12d
jmp 0x47c8
movq %rsp, %rdi
callq 0x2110
leaq 0x40(%rsp), %rdi
callq 0x2120
leaq 0x20(%rsp), %rdi
callq 0x2110
movq %rbx, %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x482f
jmp 0x482a
movq %rax, %rbx
jmp 0x4844
movq %rsp, %rdi
movq %rax, %rbx
callq 0x2110
leaq 0x40(%rsp), %rdi
callq 0x2120
leaq 0x20(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReadInDB(std::basic_ifstream<char, std::char_traits<char>>&, unsigned int, unsigned int)
uint32_t** ReadInDB(ifstream& in, uint32_t N, uint32_t C){
  uint32_t **db = new uint32_t *[N];
  for (int i = 0; i < N; i++)
  {
    db[i] = ReadInEntry(in, C);
  }
  return db;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movl %esi, %r12d
leaq (,%r12,8), %rdi
movl %edx, %ebx
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4892
movq %r14, %rdi
movl %ebx, %esi
callq 0x475a
movq %rax, (%r15,%r13,8)
incq %r13
jmp 0x487a
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: SendLargePacked(CSocket*, unsigned char, unsigned long, unsigned char*)
void SendLargePacked(CSocket* socket, uint8_t bitsPerMsg, uint64_t length, uint8_t* data){
  //Assumes bitsPerMsg <= 8
  uint64_t newLength = packLength(length, bitsPerMsg);
  uint8_t* buffer = new uint8_t[newLength];
  memset(buffer, 0, newLength);
  
  uint8_t bitPointer = 0;
  uint64_t index = 0;

  for (int i = 0; i < length; i++){
    if (bitPointer + bitsPerMsg <= 8){
      buffer[index] += data[i] << bitPointer;
      bitPointer += bitsPerMsg;
      if (bitPointer == 8){
        index += 1;
        bitPointer = 0;
      }
    }
    else{
      uint8_t rightBits = 8 - bitPointer;
      uint8_t mask = (1 << rightBits) - 1;
      buffer[index] += (data[i] & mask) << bitPointer;
      
      index += 1;
      buffer[index] =  data[i] >> rightBits;
      bitPointer = bitsPerMsg - rightBits;
    }
  }

#if LOGGING
  struct timespec start, stop;
  uint64_t duration;
  clock_gettime(CLOCK_REALTIME, &start);
#endif

  socket->SendLarge(buffer, newLength);

#if LOGGING
  clock_gettime(CLOCK_REALTIME, &stop);
  duration = (stop.tv_sec - start.tv_sec) * BILLION + stop.tv_nsec - start.tv_nsec;
  cout << "Time to send: " << duration << " ns with size: " << newLength << endl;
#endif
  
  delete[] buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
imulq %rdx, %rbx
movq %rcx, %r14
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, (%rsp)
addq $0x7, %rbx
shrq $0x3, %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, %r13
xorl %r15d, %r15d
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2160
pushq $0x8
popq %rax
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rcx, %r12
je 0x494d
movzbl %sil, %edi
addl %ebp, %edi
cmpl $0x8, %edi
ja 0x491b
movzbl (%r14,%rcx), %r8d
shlxl %esi, %r8d, %esi
addb %sil, (%r13,%rdx)
xorl %esi, %esi
cmpl $0x8, %edi
sete %sil
cmovel %r15d, %edi
addq %rsi, %rdx
movl %edi, %esi
jmp 0x4948
movzbl (%r14,%rcx), %r8d
movl %eax, %edi
subl %esi, %edi
movzbl %dil, %edi
bzhil %edi, %r8d, %r9d
shlxl %esi, %r9d, %esi
addb %sil, (%r13,%rdx)
shrxl %edi, %r8d, %esi
movb %sil, 0x1(%r13,%rdx)
movl %ebp, %esi
incq %rdx
subl %edi, %esi
incq %rcx
jmp 0x48e8
movq (%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4cba
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/protocol.cpp
// Function: ReceiveLargePacked(CSocket*, unsigned char, unsigned long, unsigned char*)
void ReceiveLargePacked(CSocket* socket, uint8_t bitsPerMsg, uint64_t length, uint8_t* out){
  //Assumes bitsPerMsg <= 8
  uint64_t newLength = packLength(length, bitsPerMsg);
  uint8_t* buffer = new uint8_t[newLength];

#if LOGGING
  struct timespec start, stop;
  uint64_t duration;
  clock_gettime(CLOCK_REALTIME, &start);
#endif

  socket->ReceiveLarge(buffer, newLength);

#if LOGGING
  clock_gettime(CLOCK_REALTIME, &stop);
  duration = (stop.tv_sec - start.tv_sec) * BILLION + stop.tv_nsec - start.tv_nsec;
  cout << "Time to receive: " << duration << " ns with size: " << newLength << endl;
#endif
  
  uint8_t bitPointer = 0;
  uint64_t index = 0;

  uint8_t mask = (1 << bitsPerMsg) - 1;

  for (int i = 0; i < length; i++){
    if (bitPointer + bitsPerMsg <= 8){
      //REGULAR CASE
      out[i] = (buffer[index] >> bitPointer) & mask;
      bitPointer += bitsPerMsg;
      if (bitPointer == 8){
        index += 1;
        bitPointer = 0;
      }
    }
    else{
      //OVERLAP CASE
      uint8_t reconstructedValue = 0;

      uint8_t rightBits = 8 - bitPointer;
      reconstructedValue += buffer[index] >> bitPointer;

      index += 1;
      uint8_t leftBits = bitsPerMsg - rightBits;
      uint8_t newMask = (1 << leftBits) - 1;
      reconstructedValue += (buffer[index] & newMask) << rightBits;
      out[i] = reconstructedValue;

      bitPointer = leftBits;
    }
  }
  delete[] buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r13d
imulq %rdx, %r13
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r12
addq $0x7, %r13
shrq $0x3, %r13
movq %r13, %rdi
callq 0x2030
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x4c24
pushq $-0x1
popq %rax
shlxl %ebp, %eax, %eax
xorl %ecx, %ecx
notl %eax
pushq $0x8
popq %rdx
xorl %esi, %esi
xorl %edi, %edi
xorl %r8d, %r8d
cmpq %rsi, %r14
je 0x4a35
movzbl %r8b, %r10d
addl %ebp, %r10d
cmpl $0x8, %r10d
ja 0x49fc
movzbl (%r15,%rdi), %r9d
shrxl %r8d, %r9d, %r9d
xorl %r8d, %r8d
andl %eax, %r9d
cmpl $0x8, %r10d
sete %r8b
cmovel %ecx, %r10d
addq %r8, %rdi
movl %r10d, %r8d
jmp 0x4a2c
movzbl (%r15,%rdi), %r10d
movzbl 0x1(%r15,%rdi), %r11d
movl %edx, %r9d
subl %r8d, %r9d
incq %rdi
movzbl %r9b, %r9d
shrxl %r8d, %r10d, %r10d
movl %ebp, %r8d
subl %r9d, %r8d
bzhil %r8d, %r11d, %r11d
shlxl %r9d, %r11d, %r9d
addl %r10d, %r9d
movb %r9b, (%rbx,%rsi)
incq %rsi
jmp 0x49c6
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/./socket.h
// Function: CSocket::Socket()
uint8_t Socket() {
    uint8_t success = false;
    uint8_t bOptVal = true;
    int bOptLen = sizeof(uint8_t);
    
    Close();

    success = (m_hSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) != INVALID_SOCKET; 
    
    return success;
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x331c
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
callq 0x2090
cmpl $-0x1, %eax
movl %eax, (%rbx)
setne %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/./socket.h
// Function: CSocket::Bind(unsigned short, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
uint8_t Bind(uint16_t nPort=0, string ip = "") {
    // Bind the socket to its port
    sockaddr_in sockAddr;
    memset(&sockAddr,0,sizeof(sockAddr));
    sockAddr.sin_family = AF_INET;

    if( ip != "" ) {
      int on = 1;
      setsockopt(m_hSock, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(on));

      sockAddr.sin_addr.s_addr = inet_addr(ip.c_str());

      if (sockAddr.sin_addr.s_addr == INADDR_NONE) {
        hostent* phost;
        phost = gethostbyname(ip.c_str());
        if (phost != NULL) {
          sockAddr.sin_addr.s_addr = ((in_addr*)phost->h_addr)->s_addr;
        }
        else {
          return 0;
        }
      }
    }
    else {
      sockAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    }
    
    sockAddr.sin_port = htons(nPort);

    return ::bind(m_hSock, (sockaddr *) &sockAddr, sizeof(sockaddr_in)) >= 0; 
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
andl $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
movl %esi, %ebp
leaq 0x16a0(%rip), %rsi      # 0x612a
movq %rdi, %rbx
movq %rdx, %rdi
movq %rdx, %r14
movw $0x2, 0xc(%rsp)
callq 0x4d4f
testb %al, %al
je 0x4aec
leaq 0x1c(%rsp), %rcx
movl $0x1, (%rcx)
movl (%rbx), %edi
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %r8
callq 0x23f0
movq (%r14), %rdi
callq 0x2280
movl %eax, 0x10(%rsp)
cmpl $-0x1, %eax
jne 0x4af1
movq (%r14), %rdi
callq 0x22c0
testq %rax, %rax
je 0x4b14
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0x10(%rsp)
jmp 0x4af1
andl $0x0, 0x10(%rsp)
leaq 0xc(%rsp), %rsi
movbew %bp, 0x2(%rsi)
movl (%rbx), %edi
pushq $0x10
popq %rdx
callq 0x2060
testl %eax, %eax
setns %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
jmp 0x4b0b
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/./socket.h
// Function: CSocket::Connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned short, int)
uint8_t Connect(string ip, uint16_t port, int32_t lTOSMilisec = -1) {
    sockaddr_in sockAddr;
    memset(&sockAddr,0,sizeof(sockAddr));
    sockAddr.sin_family = AF_INET;
    sockAddr.sin_addr.s_addr = inet_addr(ip.c_str());

    if (sockAddr.sin_addr.s_addr == INADDR_NONE) {
      hostent* lphost;
      lphost = gethostbyname(ip.c_str());
      if (lphost != NULL) {
        sockAddr.sin_addr.s_addr = ((in_addr*)lphost->h_addr)->s_addr;
      }
      else {
        return 0;
      }
    }

    sockAddr.sin_port = htons(port);
  
    timeval tv;
    socklen_t len;
    
    if (lTOSMilisec > 0) {
      tv.tv_sec = lTOSMilisec/1000;
      tv.tv_usec = (lTOSMilisec%1000)*1000;
  
      setsockopt(m_hSock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
    }

    int ret = connect(m_hSock, (sockaddr*)&sockAddr, sizeof(sockAddr));
    
    if (ret >= 0 && lTOSMilisec > 0) {
      tv.tv_sec = 100000; 
      tv.tv_usec = 0;

      setsockopt(m_hSock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
    }

    return ret >= 0;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
andq $0x0, 0x10(%rsp)
movw $0x2, 0x8(%rsp)
movq %rdi, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq (%rsi), %rdi
callq 0x2280
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
jne 0x4b93
movq (%r15), %rdi
callq 0x22c0
testq %rax, %rax
je 0x4c20
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movbew %r14w, 0xa(%rsp)
testl %ebp, %ebp
jle 0x4bcd
movl $0x3e8, %ecx            # imm = 0x3E8
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
imull $0x3e8, %edx, %eax      # imm = 0x3E8
movq %rax, 0x8(%rcx)
movl (%rbx), %edi
pushq $0x1
popq %rsi
pushq $0x14
popq %rdx
pushq $0x10
popq %r8
callq 0x23f0
movl (%rbx), %edi
testl %ebp, %ebp
leaq 0x8(%rsp), %rsi
setle %r14b
pushq $0x10
popq %rdx
callq 0x21d0
testl %eax, %eax
movl %eax, %ebp
sets %al
orb %r14b, %al
jne 0x4c10
leaq 0x18(%rsp), %rcx
movq $0x186a0, (%rcx)        # imm = 0x186A0
andq $0x0, 0x8(%rcx)
movl (%rbx), %edi
pushq $0x1
popq %rsi
pushq $0x14
popq %rdx
pushq $0x10
popq %r8
callq 0x23f0
testl %ebp, %ebp
setns %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x4c15
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/./socket.h
// Function: CSocket::ReceiveLarge(unsigned char*, unsigned long)
void ReceiveLarge(uint8_t* pBuf, uint64_t len) {
    int nBatches = (len + BLK_SIZE - 1) / BLK_SIZE;
    for (int i = 0; i < nBatches; i++) {
      int batchSize = BLK_SIZE;
      if (i == nBatches - 1) {
        batchSize = len % BLK_SIZE;
        if (batchSize == 0) {
          batchSize = BLK_SIZE;
        }
      }
      Receive(pBuf + i * BLK_SIZE, batchSize);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x7ffffffe(%rdx), %rax
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq %rdx, %rcx
xorl %edx, %edx
movq %rsi, %rbx
xorl %r12d, %r12d
divq %rdi
xorl %edx, %edx
movq %rax, %rsi
leal -0x1(%rax), %r8d
movq %rcx, %rax
divq %rdi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testq %rdx, %rdx
movq %rdx, %r15
cmovel %eax, %r15d
movl %esi, %eax
sarl $0x1f, %eax
imulq $0x7fffffff, %r8, %rbp  # imm = 0x7FFFFFFF
andnl %esi, %eax, %eax
imulq $0x7fffffff, %rax, %r13 # imm = 0x7FFFFFFF
cmpq %r12, %r13
je 0x4caa
cmpq %r12, %rbp
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq (%rbx,%r12), %rsi
movq %r14, %rdi
cmovel %r15d, %edx
xorl %ecx, %ecx
callq 0x4d66
addq $0x7fffffff, %r12       # imm = 0x7FFFFFFF
jmp 0x4c82
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop