LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/Answer.cpp
// Function: mDNSResolver::Answer::process(unsigned char*, unsigned int, mDNSResolver::Cache&)
MDNS_RESULT Answer::process(unsigned char* buffer, unsigned int len, Cache& cache) {
    if((buffer[2] & 0b10000000) != 0b10000000) {
      // Not an answer packet
      return E_MDNS_OK;
    }

    if(buffer[2] & 0b00000010) {
      // Truncated - we don't know what to do with these
      return E_MDNS_TRUNCATED;
    }

    if (buffer[3] & 0b00001111) {
      return E_MDNS_PACKET_ERROR;
    }

    unsigned int answerCount = (buffer[6] << 8) + buffer[7];
    if(answerCount == 0) {
      return E_MDNS_OK;
    }

    unsigned int offset = 0;

    MDNS_RESULT questionResult = skipQuestions(buffer, len, &offset);
    if(questionResult != E_MDNS_OK) {
      return questionResult;
    }

    MDNS_RESULT answerResult;
    for(int i = 0; i < answerCount; i++) {
      answerResult = resolve(buffer, len, &offset, cache);
      if(answerResult != E_MDNS_OK) {
        return answerResult;
      }
    }

    resolveCnames(cache);

    return answerResult;
  }

// Assembly:
movb 0x2(%rdi), %cl
pushq $0x20
popq %rax
testb %cl, %cl
js 0x394ab
retq
testb $0x2, %cl
jne 0x394d9
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
testb $0xf, 0x3(%rdi)
je 0x394dd
pushq $0x23
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x25
popq %rax
retq
movzbl 0x6(%r15), %r12d
shll $0x8, %r12d
movzbl 0x7(%r15), %r13d
movl %r12d, %ecx
orl %r13d, %ecx
je 0x394ca
movq %rdx, %rbx
movl %esi, %r14d
leaq -0x2c(%rbp), %rdx
andl $0x0, (%rdx)
movq %r15, %rdi
callq 0x39540
cmpl $0x20, %eax
jne 0x394ca
addl %r12d, %r13d
incl %r13d
leaq -0x2c(%rbp), %r12
decl %r13d
je 0x39534
movq %r15, %rdi
movl %r14d, %esi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x395ba
cmpl $0x20, %eax
je 0x39517
jmp 0x394ca
movq %rbx, %rdi
callq 0x39892
pushq $0x20
jmp 0x394c9
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/Answer.cpp
// Function: mDNSResolver::Answer::skipQuestions(unsigned char*, unsigned int, unsigned int*)
MDNS_RESULT Answer::skipQuestions(unsigned char* buffer, unsigned int len, unsigned int* offset) {
    unsigned int questionCount = (buffer[4] << 8) + buffer[5];

    *offset += 12;
    for(int i = 0; i < questionCount; i++) {

      while(buffer[*offset] != '\0') {
        // If it's a pointer, add two to the counter
        if((buffer[*offset] & 0xc0) == 0xc0) {
          (*offset) += 2;
          break;
        } else {
          unsigned int labelLength = (unsigned int)buffer[*offset];

          if(labelLength > 0x3f) {
            return E_MDNS_INVALID_LABEL_LENGTH;
          }

          (*offset) += 1; // Increment to move to the next byte
          (*offset) += labelLength;

          if(*offset > len) {
            return E_MDNS_PACKET_ERROR;
          }
        }
      }

      (*offset) += 5; // 2 bytes for the qtypes and 2 bytes qclass + plus one to land us on the next bit
    }

    if(*offset > len + 1) {
      return E_MDNS_PACKET_ERROR;
    }

    return E_MDNS_OK;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movzwl 0x4(%rdi), %eax
rolw $0x8, %ax
movzwl %ax, %r8d
movl (%rdx), %ecx
addl $0xc, %ecx
movl %ecx, (%rdx)
xorl %r9d, %r9d
movl $0x26, %eax
movl $0x23, %r10d
cmpl %r8d, %r9d
je 0x395a8
movl %ecx, %r11d
movzbl (%rdi,%r11), %r11d
testl %r11d, %r11d
je 0x39598
movl %r11d, %ebx
notl %ebx
testb $-0x40, %bl
je 0x39595
cmpb $0x3f, %r11b
ja 0x395a5
addl %r11d, %ecx
incl %ecx
movl %ecx, (%rdx)
cmpl %esi, %ecx
jbe 0x3956b
jmp 0x395a2
addl $0x2, %ecx
addl $0x5, %ecx
movl %ecx, (%rdx)
incl %r9d
jmp 0x39566
movl %r10d, %eax
popq %rbx
popq %rbp
retq
incl %esi
xorl %eax, %eax
cmpl %esi, %ecx
seta %al
leal (%rax,%rax,2), %eax
addl $0x20, %eax
jmp 0x395a5
nop
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/Answer.cpp
// Function: mDNSResolver::Answer::resolveCnames(mDNSResolver::Cache&)
MDNS_RESULT Answer::resolveCnames(Cache &cache) {
    for(int i = 0; i < cache.length(); i++) {
      if(cache[i].cname != NULL && cache[i].cname->resolved) {
        cache[i].ipAddress = cache[i].cname->ipAddress;
        cache[i].resolved = true;
        cache[i].cname = NULL;
      }
    }
    return E_MDNS_OK;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x2eb46
cmpl %eax, %r14d
jge 0x3993a
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e916
cmpq $0x0, 0x110(%rax)
je 0x39932
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e916
movq 0x110(%rax), %rax
cmpb $0x1, 0x108(%rax)
jne 0x39932
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e916
movq 0x110(%rax), %r15
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e916
movl 0x10c(%r15), %ecx
movl %ecx, 0x10c(%rax)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e916
movb $0x1, 0x108(%rax)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2e916
andq $0x0, 0x110(%rax)
incl %r14d
jmp 0x398a2
pushq $0x20
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/Answer.cpp
// Function: mDNSResolver::Answer::resolveAName(unsigned char*, unsigned int, unsigned int*, mDNSResolver::Response&, long, int)
MDNS_RESULT Answer::resolveAName(unsigned char *buffer, unsigned int len, unsigned int *offset, Response& response, long ttl, int dataLen) {
    if(dataLen == 4) {
      unsigned int a = (unsigned int)*(buffer + (*offset)++);
      unsigned int b = (unsigned int)*(buffer + (*offset)++);
      unsigned int c = (unsigned int)*(buffer + (*offset)++);
      unsigned int d = (unsigned int)*(buffer + (*offset)++);

      response.resolved = true;
      response.ttl = ttl;
      response.ipAddress = IPAddress(a, b, c, d);

    } else {
      (*offset) += dataLen;
    }

    return E_MDNS_OK;
  }

// Assembly:
movl (%rdx), %r10d
cmpl $0x4, %r9d
jne 0x399bd
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
leal 0x1(%r10), %eax
movl %eax, (%rdx)
movzbl (%rdi,%r10), %esi
leal 0x2(%r10), %ecx
movl %ecx, (%rdx)
movzbl (%rdi,%rax), %eax
leal 0x3(%r10), %r9d
movl %r9d, (%rdx)
movzbl (%rdi,%rcx), %ecx
addl $0x4, %r10d
movl %r10d, (%rdx)
movzbl (%rdi,%r9), %r9d
movb $0x1, 0x108(%rbx)
movq %r8, 0x100(%rbx)
leaq -0x14(%rbp), %r14
movq %r14, %rdi
movl %eax, %edx
movl %r9d, %r8d
callq 0x3b57e
movl (%r14), %eax
movl %eax, 0x10c(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x399c3
addl %r9d, %r10d
movl %r10d, (%rdx)
pushq $0x20
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/Answer.cpp
// Function: mDNSResolver::Answer::parseName(char**, char const*, unsigned int)
MDNS_RESULT Answer::parseName(char** name, const char* mapped, unsigned int len) {
    unsigned int namePointer = 0;
    unsigned int mapPointer = 0;

    while(mapPointer < len) {
      int labelLength = mapped[mapPointer++];

      if(labelLength > 0x3f) {
        return E_MDNS_INVALID_LABEL_LENGTH;
      }

      if(namePointer + labelLength > len - 1) {
        return E_MDNS_PACKET_ERROR;
      }

      if(namePointer != 0) {
        (*name)[namePointer++] = '.';
      }

      for(int i = 0; i < labelLength; i++) {
        (*name)[namePointer++] = mapped[mapPointer++];
      }
    }

    (*name)[len - 1] = '\0';

    return E_MDNS_OK;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leal -0x1(%rdx), %ecx
xorl %r8d, %r8d
movl $0x26, %eax
movl $0x23, %r9d
xorl %r11d, %r11d
xorl %r10d, %r10d
cmpl %edx, %r10d
jae 0x39a59
movl %r10d, %ebx
movsbl (%rsi,%rbx), %ebx
cmpl $0x3f, %ebx
jg 0x39a6c
leal (%r11,%rbx), %r14d
cmpl %ecx, %r14d
ja 0x39a69
testl %r11d, %r11d
je 0x39a2e
movq (%rdi), %r14
movl %r11d, %r15d
incl %r11d
movb $0x2e, (%r14,%r15)
movl %r11d, %r14d
jmp 0x39a31
xorl %r14d, %r14d
testl %ebx, %ebx
cmovlel %r8d, %ebx
leal (%r14,%rbx), %r11d
incl %r10d
subl $0x1, %ebx
jb 0x399fc
movl %r10d, %r15d
movb (%rsi,%r15), %r15b
movq (%rdi), %r12
movl %r14d, %r13d
incl %r14d
movb %r15b, (%r12,%r13)
jmp 0x39a3b
movq (%rdi), %rax
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl $0x20, %eax
jmp 0x39a6c
movl %r9d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/Answer.cpp
// Function: mDNSResolver::Answer::assembleName(unsigned char*, unsigned int, unsigned int*, char**, unsigned int)
int Answer::assembleName(unsigned char *buffer, unsigned int len, unsigned int *offset, char **name, unsigned int maxlen) {
    unsigned int index = 0;
    unsigned int nameLength = 0;

    while(index < maxlen) {
      if((buffer[*offset] & 0xc0) == 0xc0) {
        unsigned int pointerOffset = ((buffer[(*offset)++] & 0x3f) << 8) + buffer[(*offset)++];
        if(pointerOffset > len) {
          // Points to somewhere beyond the packet
          return -1 * E_MDNS_POINTER_OVERFLOW;
        }

        char *namePointer = *name + nameLength;
        int pointerLen = assembleName(buffer, len, &pointerOffset, &namePointer, MDNS_MAX_NAME_LEN - nameLength);

        if(pointerLen < 0) {
          return pointerLen;
        }

        nameLength += pointerLen;

        break;
      } else if(buffer[*offset] == '\0') {
        (*name)[nameLength++] = buffer[(*offset)++];
        break;
      } else {
        (*name)[nameLength++] = buffer[(*offset)++];
      }
      index++;
    }

    return nameLength;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movl %r8d, %eax
xorl %ebx, %ebx
cmpq %rbx, %rax
je 0x39b24
movl (%rdx), %r8d
movb (%rdi,%r8), %r9b
cmpb $-0x40, %r9b
jae 0x39ab8
testb %r9b, %r9b
je 0x39ae5
leal 0x1(%r8), %r9d
movl %r9d, (%rdx)
movb (%rdi,%r8), %r8b
movq (%rcx), %r9
movb %r8b, (%r9,%rbx)
incq %rbx
jmp 0x39a86
leal 0x1(%r8), %eax
movl %eax, (%rdx)
movzbl (%rdi,%r8), %r9d
andl $0x3f, %r9d
shll $0x8, %r9d
addl $0x2, %r8d
movl %r8d, (%rdx)
movzbl (%rdi,%rax), %eax
orl %r9d, %eax
movl %eax, -0xc(%rbp)
cmpl %esi, %eax
jbe 0x39afa
pushq $-0x22
popq %rax
jmp 0x39b24
leal 0x1(%r8), %eax
movl %eax, (%rdx)
movb (%rdi,%r8), %dl
movq (%rcx), %rcx
leal 0x1(%rbx), %eax
movb %dl, (%rcx,%rbx)
jmp 0x39b24
movq (%rcx), %rax
addq %rbx, %rax
leaq -0x18(%rbp), %rcx
movq %rax, (%rcx)
movl $0xff, %r8d
subl %ebx, %r8d
leaq -0xc(%rbp), %rdx
callq 0x39a78
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovnsl %ebx, %eax
addl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/mDNSResolver.cpp
// Function: mDNSResolver::Resolver::search(char const*)
IPAddress Resolver::search(const char* name) {
    if(!isMDNSName(name)) {
      return INADDR_NONE;
    }

    cache.expire();

    int attempts = 0;

    while(attempts < MDNS_ATTEMPTS) {
      int index = cache.search(name);

      if(index == -1) {
        cache.insert(Response(name, 5));
        continue;
      } else if(cache[index].resolved) {
        return cache[index].ipAddress;
      }

      long now = millis();

      // Send a query packet every second
      if(now - timeout > MDNS_RETRY) {
        query(name);
        timeout = now;
        attempts++;
      }

      MDNS_RESULT result = read();
      if(result != E_MDNS_OK) {
        return INADDR_NONE;
      }
    }

    return INADDR_NONE;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
callq 0x3b0f2
leaq 0x1f6c1(%rip), %rcx     # 0x5a6b8
testb %al, %al
je 0x3b0ac
leaq 0x1f6ba(%rip), %r12     # 0x5a6c0
movq %r12, %rdi
callq 0x2ead0
xorl %ebx, %ebx
leaq -0x148(%rbp), %r13
cmpl $0x4, %ebx
jg 0x3b0a5
movq %r12, %rdi
movq %r14, %rsi
callq 0x2ea7a
cmpl $-0x1, %eax
jne 0x3b053
movq %r13, %rdi
movq %r14, %rsi
pushq $0x5
popq %rdx
callq 0x2fdde
movq %r12, %rdi
movq %r13, %rsi
callq 0x2e92a
movq %r13, %rdi
callq 0x2fe3c
jmp 0x3b017
movl %eax, %r15d
movq %r12, %rdi
movl %eax, %esi
callq 0x2e916
cmpb $0x1, 0x108(%rax)
je 0x3b0c0
callq 0x3b5cc
movq %rax, %r15
movq -0x30(%rbp), %rdi
subq 0x28(%rdi), %rax
cmpq $0x3e9, %rax            # imm = 0x3E9
jl 0x3b097
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x3b132
movq -0x30(%rbp), %rdi
movq %r15, 0x28(%rdi)
incl %ebx
callq 0x3b1b4
cmpl $0x20, %eax
je 0x3b017
leaq 0x1f60c(%rip), %rcx     # 0x5a6b8
movl (%rcx), %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f5f9(%rip), %rdi     # 0x5a6c0
movl %r15d, %esi
callq 0x2e916
movq %rax, %rcx
addq $0x10c, %rcx            # imm = 0x10C
jmp 0x3b0ac
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x2fe3c
movq %rbx, %rdi
callq 0xa6c0
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/mDNSResolver.cpp
// Function: mDNSResolver::Resolver::isMDNSName(char const*)
bool Resolver::isMDNSName(const char* name) {
    int len = strlen(name);
    int tldLen = strlen(MDNS_TLD);

    if(len < tldLen) {
      return false;
    }

    return strcmp(name + len - tldLen, MDNS_TLD) == 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, %rdi
callq 0xa1b0
cmpl $0x6, %eax
jge 0x3b10c
xorl %eax, %eax
jmp 0x3b12a
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq (%rbx,%rax), %rdi
addq $-0x6, %rdi
leaq 0x396d(%rip), %rsi      # 0x3ea8d
callq 0xa520
testl %eax, %eax
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/mDNSResolver.cpp
// Function: mDNSResolver::Resolver::query(char const*)
void Resolver::query(const char* name) {
    Query query(name);
    
#if defined(ESP32)
	udp.beginMulticast(MDNS_BROADCAST_IP, MDNS_PORT);
	udp.beginMulticastPacket();
#else
	udp.beginPacketMulticast(MDNS_BROADCAST_IP, MDNS_PORT, localIP, UDP_TIMEOUT);
#endif
    query.sendPacket(udp);
    udp.endPacket();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq -0x10(%rbp), %rdi
callq 0x293f0
leaq -0x14(%rbp), %rdi
movl $0xe0, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0xfb, %r8d
callq 0x3b57e
movl 0x20(%rbx), %ecx
addq $0x8, %rbx
movl -0x14(%rbp), %esi
movq %rbx, %rdi
movl $0x14e9, %edx           # imm = 0x14E9
movl $0xff, %r8d
callq 0x3b4c6
leaq -0x10(%rbp), %rdi
movq %rbx, %rsi
callq 0x29400
movq %rbx, %rdi
callq 0x3b4ce
leaq -0x10(%rbp), %rdi
callq 0x293fa
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x10(%rbp), %rdi
callq 0x293fa
movq %rbx, %rdi
callq 0xa6c0
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/mDNSResolver.cpp
// Function: mDNSResolver::Resolver::read()
MDNS_RESULT Resolver::read() {
    cache.expire();

    if(!init) {
      init = true;
#if defined(ESP32)
	udp.beginMulticast(MDNS_BROADCAST_IP, MDNS_PORT);
#else
	udp.beginMulticast(localIP, MDNS_BROADCAST_IP, MDNS_PORT);
#endif
    }

    unsigned int len = udp.parsePacket();

    if(len > 0) {
      unsigned char *buffer = (unsigned char *)malloc(sizeof(unsigned char) * len);

      if(buffer == NULL) {
        // Out of memory - the packet is probably too big to parse. Probably.
        // Silently bombing out, possibly isn't great, but it'll do for the moment.
        return E_MDNS_OUT_OF_MEMORY;
      }

      udp.read(buffer, len);
      lastResult = Answer::process(buffer, len, cache);

      free(buffer);
      return lastResult;
    }

    return E_MDNS_OK;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1f4f4(%rip), %rdi     # 0x5a6c0
callq 0x2ead0
cmpb $0x0, 0x24(%rbx)
jne 0x3b212
movb $0x1, 0x24(%rbx)
leaq 0x8(%rbx), %r14
movl 0x20(%rbx), %r15d
leaq -0x2c(%rbp), %r12
movq %r12, %rdi
movl $0xe0, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0xfb, %r8d
callq 0x3b57e
movl (%r12), %edx
movq %r14, %rdi
movl %r15d, %esi
movl $0x14e9, %ecx           # imm = 0x14E9
callq 0x3b4ae
leaq 0x8(%rbx), %r12
movq %r12, %rdi
callq 0x3b568
testl %eax, %eax
je 0x3b267
movl %eax, %r14d
movl %eax, %r13d
movq %r13, %rdi
callq 0xa4f0
testq %rax, %rax
je 0x3b26b
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x3b4f2
leaq 0x1f473(%rip), %rdx     # 0x5a6c0
movq %r15, %rdi
movl %r14d, %esi
callq 0x394a0
movl %eax, %r14d
movl %eax, (%rbx)
movq %r15, %rdi
callq 0xa480
jmp 0x3b26f
pushq $0x20
jmp 0x3b26d
pushq $0x27
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/src/mDNSResolver.cpp
// Function: mDNSResolver::Resolver::loop()
void Resolver::loop() {
    // Clear the buffers out.
    // This wouldn't be needed if the UDP library had the ability to
    // leave a multicast group
    unsigned int len = udp.parsePacket();
    unsigned char *buffer = (unsigned char *)malloc(sizeof(unsigned char) * len);
    if(buffer != NULL) {
      udp.read(buffer, len);
      free(buffer);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x3b568
movl %eax, %r14d
movq %r14, %rdi
callq 0xa4f0
testq %rax, %rax
je 0x3b2ce
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x3b4f2
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa480
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/mocks/WiFiUdp.cpp
// Function: WiFiUDP::loadFromFile(char const*)
WiFiUDP* WiFiUDP::loadFromFile(const char *path) {
  unsigned char *source = NULL;
  WiFiUDP* udp = new WiFiUDP;

  FILE *fp = fopen(path, "rb");

  if(fp != NULL) {
    if(fseek(fp, 0L, SEEK_END) != 0) {
      fprintf(stderr, "ERROR: Unable to seek to the end of the file: %s\n", path);
      fclose(fp);
      return udp;
    }

    long bufsize = ftell(fp);
    if(bufsize == -1) {
      fprintf(stderr, "ERROR: Unable to get file position\n");
      fclose(fp);
      return udp;
    }

    // Need to do something more c++ friendly, as this is a memory leak
    source = (unsigned char *)malloc(sizeof(unsigned char) * (bufsize + 1));
    if(fseek(fp, 0L, SEEK_SET) != 0) {
      fprintf(stderr, "ERROR: Unable to see to the beginning of the file: %s\n", path);
      fclose(fp);
      return udp;
    }

    size_t len = fread(source, sizeof(unsigned char), bufsize, fp);
    if(ferror(fp) != 0) {
      fprintf(stderr, "ERROR: Unable to read the file (%i): %s\n", ferror(fp), path);
      fclose(fp);
      return udp;
    }

    udp->setReadBuffer(source, len);
    fclose(fp);
    return udp;
  } else {
    fprintf(stderr, "ERROR: Unable to seek to open file: %s\n", path);
  }

  return udp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
pushq $0x18
popq %rdi
callq 0xa3e0
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x4d18(%rip), %rsi      # 0x4008c
movq %r15, %rdi
callq 0xa460
testq %rax, %rax
je 0x3b41e
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0xa420
testl %eax, %eax
jne 0x3b43b
movq %r14, %rdi
callq 0xa030
cmpq $-0x1, %rax
je 0x3b44e
movq %rax, %r13
leaq 0x1(%rax), %rdi
callq 0xa4f0
movq %rax, %r12
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa420
testl %eax, %eax
jne 0x3b46c
pushq $0x1
popq %rsi
movq %r12, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0xa590
movq %rax, %r13
movq %r14, %rdi
callq 0xa730
testl %eax, %eax
jne 0x3b48c
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x3b304
movq %r14, %rdi
callq 0xa3d0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1eb9b(%rip), %rax     # 0x59fc0
movq (%rax), %rdi
leaq 0x4d16(%rip), %rsi      # 0x40145
movq %r15, %rdx
xorl %eax, %eax
callq 0xa530
jmp 0x3b40c
movq 0x1eb7e(%rip), %rax     # 0x59fc0
movq (%rax), %rdi
leaq 0x4c43(%rip), %rsi      # 0x4008f
jmp 0x3b47d
movq 0x1eb6b(%rip), %rax     # 0x59fc0
movq (%rax), %rcx
leaq 0x4c62(%rip), %rdi      # 0x400c1
pushq $0x23
popq %rsi
pushq $0x1
popq %rdx
callq 0xa770
jmp 0x3b404
movq 0x1eb4d(%rip), %rax     # 0x59fc0
movq (%rax), %rdi
leaq 0x4c68(%rip), %rsi      # 0x400e5
movq %r15, %rdx
xorl %eax, %eax
callq 0xa530
jmp 0x3b404
movq 0x1eb2d(%rip), %rcx     # 0x59fc0
movq (%rcx), %rdi
leaq 0x4c7f(%rip), %rsi      # 0x4011c
movl %eax, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xa530
jmp 0x3b404
// File: /workspace/github_cpp_makefile_star2_O2/madpilot[P]mDNSResolver/mocks/WiFiUdp.cpp
// Function: WiFiUDP::write(unsigned char const*, unsigned long)
size_t WiFiUDP::write(const uint8_t *buffer, size_t size) {
  //if(this->writeBuffer != NULL) {
    //free(this->writeBuffer);
    //this->writeBuffer = NULL;
  //}

  this->writeBuffer = (unsigned char *)malloc(sizeof(unsigned char) * size);
  memcpy(this->writeBuffer, buffer, size);
  this->writeBufferLength = size;

  return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0xa4f0
movq %rax, 0x8(%r15)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa330
movl %ebx, 0x14(%r15)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dvjdjvu[P]bntree/./src/bntree.cpp
// Function: bntree::clear(node_s*)
void bntree::clear(node_t *p) {
    if (p != NULL) {
        if (p->right) {
            this->clear(p->right);
            this->node_free(p->right);
        }

        if (p->left) {
            this->clear(p->left);
            this->node_free(p->left);
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x23f8
movq %rsi, %rbx
movq %rdi, %r14
movq 0x50(%rsi), %rsi
testq %rsi, %rsi
je 0x23d7
movq %r14, %rdi
callq 0x23ae
movq 0x50(%rbx), %rsi
callq 0x243a
movq 0x48(%rbx), %rsi
testq %rsi, %rsi
je 0x23f8
movq %r14, %rdi
callq 0x23ae
movq 0x48(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x243a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/dvjdjvu[P]bntree/./src/bntree.cpp
// Function: bntree::search(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
uint64_t bntree::search(string key) {
    if (!this->tree->root) {
        return -1;
    }

    node_t *search_node = this->tree->root;
    uint64_t index_node = this->get_child_weight(search_node->left);

    for (;;) {
        if (key == search_node->data.key) {
            return index_node; // найден узел с таким ключем, вернем его индекс
        } else if (key > search_node->data.key) {
            search_node = search_node->right;

            if (search_node == NULL)
                return -1;

            index_node += (this->get_child_weight(search_node->left) + 1);
        } else {
            search_node = search_node->left;

            if (search_node == NULL)
                return -1;

            index_node -= (this->get_child_weight(search_node->left) + 1);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdi), %rax
movq (%rax), %r15
testq %r15, %r15
je 0x247a
movq %rsi, %rbx
movq 0x48(%r15), %rax
testq %rax, %rax
je 0x2480
movq 0x40(%rax), %r14
jmp 0x2483
pushq $-0x1
popq %r14
jmp 0x24ef
xorl %r14d, %r14d
pushq $-0x1
popq %r12
pushq $0x1
popq %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2d76
testb %al, %al
jne 0x24ef
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2d99
testb %al, %al
je 0x24c4
movq 0x50(%r15), %r15
testq %r15, %r15
je 0x24ec
movq 0x48(%r15), %rax
testq %rax, %rax
je 0x24df
movq 0x40(%rax), %rax
incq %rax
jmp 0x24e7
movq 0x48(%r15), %r15
testq %r15, %r15
je 0x24ec
movq 0x48(%r15), %rax
testq %rax, %rax
je 0x24e4
movq 0x40(%rax), %rax
notq %rax
jmp 0x24e7
movq %r13, %rax
jmp 0x24e7
movq %r12, %rax
addq %rax, %r14
jmp 0x248b
movq %r12, %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/dvjdjvu[P]bntree/./src/bntree.cpp
// Function: bntree::erase_simple(node_s*)
bool bntree::erase_simple(node_t *search_node) {

    node_t *prev_node = search_node->parent;

    if (!search_node->left && !search_node->right) {
        // Удаляемый узел является листом.

        // Обнуляем соответствующую ссылку родителя.
        if (prev_node == NULL) {
            // Удаляемый узел корень.
            this->tree->root = NULL;
        } else if (prev_node->left == search_node) {
            prev_node->left = NULL;
        } else if (prev_node->right == search_node) {
            prev_node->right = NULL;
        }

    } else if (search_node->left && !search_node->right) {
        // Удаляемый узел имеет только левого ребенка.

        // Перекомпануем ссылки родителя на левого внука.
        if (prev_node == NULL) {
            // Удаляемый узел корень.
            this->tree->root = search_node->left;
            this->tree->root->parent = NULL;
        } else if (prev_node->left == search_node) {
            prev_node->left = search_node->left;
            search_node->left->parent = prev_node;
        } else if (prev_node->right == search_node) {
            prev_node->right = search_node->left;
            search_node->left->parent = prev_node;
        }

    } else if (!search_node->left && search_node->right) {
        // Удаляемый узел имеет только правого ребенка.

        // Перекомпануем ссылки родителя на правого внука.
        if (prev_node == NULL) {
            // Удаляемый узел корень.
            this->tree->root = search_node->right;
            this->tree->root->parent = NULL;
        } else if (prev_node->left == search_node) {
            prev_node->left = search_node->right;
            search_node->right->parent = prev_node;
        } else if (prev_node->right == search_node) {
            prev_node->right = search_node->right;
            search_node->right->parent = prev_node;
        }

    } else {
        // Удаляемый узел имеет двух детей. Здесь не обрабатываем.

        return false;
    }

    return true;
}

// Assembly:
movq 0x58(%rsi), %rcx
movq 0x48(%rsi), %r8
movq 0x50(%rsi), %rdx
testq %r8, %r8
je 0x27a3
testq %rdx, %rdx
je 0x27c8
xorl %eax, %eax
retq
testq %rdx, %rdx
je 0x27e4
testq %rcx, %rcx
je 0x27fd
cmpq %rsi, 0x48(%rcx)
je 0x2817
movb $0x1, %al
cmpq %rsi, 0x50(%rcx)
jne 0x27a2
movq %rdx, 0x50(%rcx)
movq 0x50(%rsi), %rdx
movq %rcx, 0x58(%rdx)
retq
testq %rcx, %rcx
je 0x280a
cmpq %rsi, 0x48(%rcx)
je 0x2821
movb $0x1, %al
cmpq %rsi, 0x50(%rcx)
jne 0x27a2
movq %r8, 0x50(%rcx)
movq %rcx, 0x58(%r8)
retq
testq %rcx, %rcx
je 0x282f
cmpq %rsi, 0x48(%rcx)
je 0x2838
movb $0x1, %al
cmpq %rsi, 0x50(%rcx)
jne 0x27a2
andq $0x0, 0x50(%rcx)
retq
movq (%rdi), %rax
movq %rdx, (%rax)
andq $0x0, 0x58(%rdx)
jmp 0x283d
movq (%rdi), %rax
movq %r8, (%rax)
andq $0x0, 0x58(%r8)
jmp 0x283d
movq %rdx, 0x48(%rcx)
movq %rcx, 0x58(%rdx)
jmp 0x283d
movq %r8, 0x48(%rcx)
movq 0x48(%rsi), %rax
movq %rcx, 0x58(%rax)
jmp 0x283d
movq (%rdi), %rax
andq $0x0, (%rax)
jmp 0x283d
andq $0x0, 0x48(%rcx)
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/dvjdjvu[P]bntree/./src/bntree.cpp
// Function: bntree::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
data_t *bntree::get(string key) {
    node_t *search_node = this->tree->root;
    uint64_t index_node = this->get_child_weight(search_node->left);

    for (;;) {
        if (key == search_node->data.key) {
            return &search_node->data;
        } else if (key > search_node->data.key) {
            search_node = search_node->right;
            index_node += (this->get_child_weight(search_node->left) + 1);
        } else {
            search_node = search_node->left;
            index_node -= (this->get_child_weight(search_node->right) + 1);
        }
    }

    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %rax
movq (%rax), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d76
testb %al, %al
jne 0x2b84
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d99
movzbl %al, %eax
leaq (%r14,%rax,8), %rax
addq $0x48, %rax
jmp 0x2b5a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dvjdjvu[P]bntree/./src/bntree.cpp
// Function: bntree::print(node_s*, int)
void bntree::print(node_t *p, int indent) {
    if (p != NULL) {
        if (p->right) {
            this->print(p->right, indent + 4);
        }
        if (indent) {
            //std::cout << std::setw(indent) << ' ' << p->weight << ' ';
            std::cout << std::setw(indent) << ' ';
        }
        if (p->right) {
            std::cout << " /\n" << std::setw(indent) << ' ';
        }
        //std::cout << p->data.key << ":" << p->data.val << "\n ";
        std::cout << p->data.key << ":" << p << ":" << p->parent << "\n ";
        if (p->left) {
            std::cout << std::setw(indent) << ' ' << " \\\n";
            this->print(p->left, indent + 4);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, (%rsp)
movslq %edx, %r14
leal 0x4(%r14), %ebp
movq 0x341a(%rip), %r15      # 0x5fd8
leaq 0x1443(%rip), %r12      # 0x4008
pushq $0x20
popq %r13
testq %rbx, %rbx
je 0x2cb3
movq 0x50(%rbx), %rsi
testq %rsi, %rsi
je 0x2be6
movq (%rsp), %rdi
movl %ebp, %edx
callq 0x2b9e
testq %r14, %r14
je 0x2c02
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r14, 0x10(%r15,%rax)
movq %r15, %rdi
movl %r13d, %esi
callq 0x2190
cmpq $0x0, 0x50(%rbx)
je 0x2c2f
movq %r15, %rdi
leaq 0x13f1(%rip), %rsi      # 0x4004
callq 0x2170
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r14, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %r13d, %esi
callq 0x2190
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2140
movq %rax, %rdi
movq %r12, %rsi
callq 0x2170
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2110
movq %rax, %rdi
movq %r12, %rsi
callq 0x2170
movq 0x58(%rbx), %rsi
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
leaq 0x1399(%rip), %rsi      # 0x400a
callq 0x2170
cmpq $0x0, 0x48(%rbx)
je 0x2cb3
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r14, 0x10(%r15,%rax)
movq %r15, %rdi
movl %r13d, %esi
callq 0x2190
movq %rax, %rdi
leaq 0x136f(%rip), %rsi      # 0x400d
callq 0x2170
movq 0x48(%rbx), %rbx
addq $0x4, %r14
addl $0x4, %ebp
jmp 0x2bc9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dvjdjvu[P]bntree/./src/bntree.cpp
// Function: bntree::weight_to_depth(node_s*)
uint64_t bntree::weight_to_depth(node_t *p) {
    if (p == NULL) {
        return 0;
    }

    if (p->weight == 1) {
        return 1;
    } else if (p->weight == 2) {
        return 2;
    }

    return this->ilog2(this->cpl2(p->weight));
}

// Assembly:
testq %rsi, %rsi
je 0x2d00
movq 0x40(%rsi), %rax
leaq -0x1(%rax), %rcx
cmpq $0x2, %rcx
jb 0x2cff
pushq %rbx
subq $0x10, %rsp
movq %rax, %rsi
callq 0x2d04
cvtsi2sd %rax, %xmm0
leaq 0xc(%rsp), %rbx
movq %rbx, %rdi
callq 0x2210
movl (%rbx), %eax
decl %eax
cltq
addq $0x10, %rsp
popq %rbx
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dvjdjvu[P]bntree/./src/test.cpp
// Function: std::vector<std::pair<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> get_sequence<std::vector<std::pair<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
S get_sequence(const string& _file_name)
{
    ifstream infile(_file_name);
    S result;

    typename S::value_type item;

    while (infile >> item)
    {
        result.emplace_back(move(item));
    }

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x21e0
andq $0x0, 0x10(%rbx)
leaq 0x10(%rsp), %r15
andq $0x0, -0x8(%r15)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movb $0x0, (%rax)
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x2e10
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x50(%rsp,%rax)
jne 0x3480
movq %rbx, %rdi
movq %r12, %rsi
callq 0x36fc
jmp 0x3458
movq %r15, %rdi
callq 0x20b0
leaq 0x30(%rsp), %rdi
callq 0x2050
movq %rbx, %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %r15, %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x34d4
leaq 0x30(%rsp), %rdi
callq 0x2050
movq %r14, %rdi
callq 0x2200
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/TLB.cpp
// Function: TLB::operator[](int)
int& TLB::operator[] (const int pnum) {
	// before returning a reference to tb[pnum], update the queue according to LRU policy
	if (tb.count(pnum))
		// if pnum is in tb
		q.remove(pnum);
	else {
		// TLB miss; tb[pnum] will create a new entry in tb and reference 0 (default int)
		if (q.size() == TLB_SIZE) {
			// if queue (TLB) full
			int victim = q.front();	// victim page number
			tb.erase(tb.find(victim));	// remove victim entry
			q.pop_front();
		}
	}
	q.push_back(pnum);	// add pnum at the end of queue

	return tb[pnum];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x14(%rbp), %rax
movl %esi, (%rax)
movq %rax, %rsi
callq 0x25d4
testq %rax, %rax
je 0x257c
leaq 0x30(%rbx), %rdi
leaq -0x14(%rbp), %rsi
callq 0x25f8
jmp 0x25af
cmpq $0x10, 0x40(%rbx)
jne 0x25af
leaq 0x30(%rbx), %r14
movq 0x30(%rbx), %rax
movl 0x10(%rax), %eax
leaq -0x18(%rbp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x278e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27e6
movq %r14, %rdi
callq 0x265a
leaq 0x30(%rbx), %rdi
leaq -0x14(%rbp), %r14
movq %r14, %rsi
callq 0x2668
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2678
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/PageTable.cpp
// Function: PageTable::~PageTable()
PageTable::~PageTable() {
	// commit all dirty pages to backing store
	for (auto const& kv : pt) {
		if (kv.second.second)
			bs.write(kv.first, kv.second.first);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %r15
leaq 0x8(%rdi), %r12
leaq 0x98(%rdi), %r14
cmpq %r12, %r15
je 0x2dfc
cmpb $0x1, 0x28(%r15)
jne 0x2def
movl 0x20(%r15), %esi
movl 0x24(%r15), %edx
movq %r14, %rdi
callq 0x3b24
movq %r15, %rdi
callq 0x21b0
movq %rax, %r15
jmp 0x2dd3
leaq 0x3a8(%rbx), %rdi
callq 0x31f4
movq %r14, %rdi
callq 0x3214
leaq 0x80(%rbx), %rdi
callq 0x276a
leaq 0x60(%rbx), %rdi
callq 0x2110
leaq 0x30(%rbx), %rdi
callq 0x32f2
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3348
movq %rax, %r15
leaq 0x3a8(%rbx), %rdi
callq 0x31f4
movq %r14, %rdi
callq 0x3214
leaq 0x80(%rbx), %rdi
callq 0x3242
leaq 0x60(%rbx), %rdi
callq 0x2110
leaq 0x30(%rbx), %rdi
callq 0x324c
movq %rbx, %rdi
callq 0x3256
movq %r15, %rdi
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/PageTable.cpp
// Function: PageTable::operator[](int)
int PageTable::operator[](const int pnum) {
	/*
	Get the number (index) of the frame in physical memory corresponding to given page number (pnum) in logical memory;
	this is done prior to every access to Memory. Page faults are resolved automatically.
	*/
	int fnum;
	pageFault = tlbMiss = false;
	if (tlb.contains(pnum)) // look in TLB first
		fnum = tlb[pnum];
	else { // TLB miss; look in page table
		tlbMiss = true;
		fnum = pt[pnum].first;

		if (fnum == -1) {
			// page fault!
			pageFault = true;
			numPageFaults++;
			// read the requested page from backing store into a free frame
			fnum = getFreeFrameNum();	// somehow find a free frame
			bs.read(pnum);		// read the page at pnum on backing store
			copy(bs.getBuff(), bs.getBuff() + FRAME_SIZE, Memory[fnum]);	// copy into the frame at fnum of physical memory
			pt[pnum].first = fnum;	// point the pnum enty to fnum in page table
		}

		tlb[pnum] = fnum;	// update TLB
	}


	if (pageFault) {
		// with either FIFO or LRU, if a page is newly brought into memory, its index is inserted at tail of queue
		q.push_back(pnum);
	}
	else {
		// in the case of no page fault, FIFO does nothing;
		// LRU will move the recently accessed page number to the tail of queue
		if (pageReplacementPolicy == "LRU") {
			q.remove(pnum);
			q.push_back(pnum);
		}
	}


	return fnum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, -0x2c(%rbp)
xorl %eax, %eax
movb %al, 0x3f8(%rdi)
movb %al, 0x3f0(%rdi)
leaq 0x3a8(%rdi), %r15
movq %r15, %rdi
callq 0x3260
testl %eax, %eax
je 0x2ecf
movq %r15, %rdi
movl %r14d, %esi
callq 0x254c
movl (%rax), %r14d
jmp 0x2f58
movb $0x1, 0x3f8(%rbx)
leaq -0x2c(%rbp), %rsi
movq %rbx, %rdi
callq 0x31a2
movl (%rax), %r14d
cmpl $-0x1, %r14d
jne 0x2f4a
movb $0x1, 0x3f0(%rbx)
incl 0x3f4(%rbx)
movq %rbx, %rdi
callq 0x2faa
movl %eax, %r14d
leaq 0x98(%rbx), %rdi
leaq -0x2c(%rbp), %r12
movl (%r12), %esi
callq 0x3a78
leaq 0x2a8(%rbx), %rsi
movslq %r14d, %r13
movq %r13, %rax
shlq $0x8, %rax
leaq 0x52e1(%rip), %rdi      # 0x8210
addq %rax, %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x2320
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31a2
movl %r13d, (%rax)
movl -0x2c(%rbp), %esi
movq %r15, %rdi
callq 0x254c
movl %r14d, (%rax)
cmpb $0x1, 0x3f0(%rbx)
jne 0x2f67
subq $-0x80, %rbx
jmp 0x2f8b
leaq 0x60(%rbx), %rdi
leaq 0x20c0(%rip), %rsi      # 0x5032
callq 0x3191
testb %al, %al
je 0x2f97
subq $-0x80, %rbx
leaq -0x2c(%rbp), %rsi
movq %rbx, %rdi
callq 0x25f8
leaq -0x2c(%rbp), %rsi
movq %rbx, %rdi
callq 0x2668
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/PageTable.cpp
// Function: PageTable::getFreeFrameNum()
int PageTable::getFreeFrameNum() {
	/*
	Find a free frame and return its frame number
	*/
	int fnum;
	if (!fs.empty()) {
		fnum = *fs.begin();		// always get the free frame with the smallest frame number
		fs.erase(fnum);			// remove fnum from the set of free frames
	}
	else {	// need to replace a page, q is full (since we don't delete a page by itself, fs.size() == 64 - q.size())
		// either FIFO or LRU replaces the page at the front of the queue
		int pnum = q.front();	// victim page number
		fnum = pt[pnum].first;

		// if a dirty page, write its memory frame to backing store
		if (pt[pnum].second) {
			bs.write(pnum, fnum);
			setDirty(pnum, false);	// reset dirty bit
		}

		pt[pnum].first = -1;	// reset victim page's frame number
		q.pop_front();
	}
	return fnum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x58(%rdi)
je 0x2fe5
movq 0x48(%rbx), %rax
addq $0x30, %rbx
movl 0x20(%rax), %eax
leaq -0x28(%rbp), %r14
movl %eax, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x38b0
movl (%r14), %r15d
jmp 0x3053
leaq 0x80(%rbx), %r14
movq 0x80(%rbx), %rax
movl 0x10(%rax), %eax
leaq -0x24(%rbp), %r12
movl %eax, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31a2
movl (%rax), %r15d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31a2
cmpb $0x1, 0x4(%rax)
jne 0x303c
leaq 0x98(%rbx), %rdi
movl -0x24(%rbp), %esi
movl %r15d, %edx
callq 0x3b24
movl -0x24(%rbp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x327c
leaq -0x24(%rbp), %rsi
movq %rbx, %rdi
callq 0x31a2
orl $-0x1, (%rax)
movq %r14, %rdi
callq 0x265a
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/PageTable.cpp
// Function: operator<<(std::ostream&, PageTable const&)
ostream& operator<<(ostream &strm, const PageTable &PT) {
	for (auto const& kv : PT.pt) {
		if (kv.second.first != -1)
			strm << kv.first << ' ' << kv.second.first << endl;
	}
	return strm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %r12
addq $0x8, %r14
pushq $0x20
popq %r15
cmpq %r14, %r12
je 0x30c7
cmpl $-0x1, 0x24(%r12)
je 0x30ba
movl 0x20(%r12), %esi
movq %rbx, %rdi
callq 0x2370
movq %rax, %rdi
movl %r15d, %esi
callq 0x2250
movl 0x24(%r12), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
callq 0x2130
movq %r12, %rdi
callq 0x2240
movq %rax, %r12
jmp 0x3080
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/./BackingStore.h
// Function: BackingStore::BackingStore(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
BackingStore(std::string name) {
		// open the file that simulates disk in rw mode
		store.open(name, std::ios::binary | std::ios::in | std::ios::out);	// c++11 allows istream.open string rather than char*
		if (!store)
			throw std::invalid_argument("Can't open backing store file!");
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2260
pushq $0x1c
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22d0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x3110
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x2140
movq %rax, %r14
leaq 0x1f14(%rip), %rsi      # 0x5036
movq %rax, %rdi
callq 0x23a0
movq 0x4e9f(%rip), %rsi      # 0x7fd0
movq 0x4e88(%rip), %rdx      # 0x7fc0
movq %r14, %rdi
callq 0x2360
movq %rax, %r15
movq %r14, %rdi
callq 0x21c0
jmp 0x3150
movq %rax, %r15
movq %rbx, %rdi
callq 0x2090
movq %r15, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/BackingStore.cpp
// Function: BackingStore::read(int)
void BackingStore::read(int pnum) {
	assert(!store.eof());

	// seek to the page at pnum
	if (store.seekg(pnum * FRAME_SIZE, ios::beg))
		store.read((char *)buff, FRAME_SIZE);
	else
		throw runtime_error("Seek error");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%rdi,%rax)
jne 0x3ac3
movq %rdi, %rbx
shll $0x8, %esi
movslq %esi, %rsi
xorl %edx, %edx
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3ae0
leaq 0x210(%rbx), %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2270
leaq 0x158c(%rip), %rdi      # 0x5056
leaq 0x1592(%rip), %rsi      # 0x5063
leaq 0x159c(%rip), %rcx      # 0x5074
pushq $0xd
popq %rdx
callq 0x21a0
pushq $0x10
popq %rdi
callq 0x2140
movq %rax, %rbx
leaq 0x159f(%rip), %rsi      # 0x5091
movq %rax, %rdi
callq 0x20e0
movq 0x44ef(%rip), %rsi      # 0x7ff0
movq 0x44a0(%rip), %rdx      # 0x7fa8
movq %rbx, %rdi
callq 0x2360
movq %rax, %r14
movq %rbx, %rdi
callq 0x21c0
movq %r14, %rdi
callq 0x2380
nop
// File: /workspace/github_cpp_makefile_star2_O2/yiboyang[P]VirtualMemory/BackingStore.cpp
// Function: BackingStore::write(int, int)
void BackingStore::write(int pnum, int fnum) {
	assert(!store.eof());

	// seek to the page at pnum
	if (store.seekg(pnum * FRAME_SIZE, ios::beg))
		store.write((char *)Memory[fnum], FRAME_SIZE);
	else
		throw runtime_error("Seek error");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%rdi,%rax)
jne 0x3b7d
movl %edx, %r14d
movq %rdi, %rbx
shll $0x8, %esi
movslq %esi, %rsi
xorl %edx, %edx
callq 0x22c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3b9a
movslq %r14d, %rsi
shlq $0x8, %rsi
addq 0x4428(%rip), %rsi      # 0x7f90
addq $0x10, %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x22b0
leaq 0x14d2(%rip), %rdi      # 0x5056
leaq 0x14d8(%rip), %rsi      # 0x5063
leaq 0x150a(%rip), %rcx      # 0x509c
pushq $0x1a
popq %rdx
callq 0x21a0
pushq $0x10
popq %rdi
callq 0x2140
movq %rax, %rbx
leaq 0x14e5(%rip), %rsi      # 0x5091
movq %rax, %rdi
callq 0x20e0
movq 0x4435(%rip), %rsi      # 0x7ff0
movq 0x43e6(%rip), %rdx      # 0x7fa8
movq %rbx, %rdi
callq 0x2360
movq %rax, %r14
movq %rbx, %rdi
callq 0x21c0
movq %r14, %rdi
callq 0x2380
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/ALSchwalm[P]cppEvolve/examples/primes.cpp
// Function: treeFitness(evolve::tree::Tree<int> const*)
double treeFitness(const tree::Tree<int>* tree)
{
    double total = 0;
    std::vector<int> used;
    for(nodes::x=0; nodes::x < static_cast<int>(primes.size()); ++nodes::x) {
        auto val = tree->eval();
        if (std::find(primes.begin(), primes.end(), val) != primes.end() &&
            std::find(used.begin(), used.end(), val) == used.end()) {

            used.push_back(val);
            total += 1;
        }
    }
    return total;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq -0x50(%rbp), %r14
andq $0x0, 0x10(%r14)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorl %eax, %eax
leaq 0x4c36(%rip), %r15      # 0x7064
leaq 0x4c57(%rip), %r12      # 0x708c
leaq -0x34(%rbp), %r13
movl %eax, 0x9cfd(%rip)      # 0xc13c
cmpl $0x9, %eax
jg 0x24a0
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movl %eax, -0x34(%rbp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3598
cmpq %r12, %rax
je 0x2496
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0x3623
cmpq -0x48(%rbp), %rax
jne 0x2496
movq %r14, %rdi
movq %r13, %rsi
callq 0x286a
movsd -0x30(%rbp), %xmm0
addsd 0x4b77(%rip), %xmm0     # 0x7008
movsd %xmm0, -0x30(%rbp)
movl 0x9ca0(%rip), %eax      # 0xc13c
incl %eax
jmp 0x2439
leaq -0x50(%rbp), %rdi
callq 0x3584
movsd -0x30(%rbp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x24bf
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3584
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: void evolve::tree::TreeFactory<int>::addNode<int, int>(int (*)(int, int), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void addNode(Rtype (*f)(T...), const std::string& name) {
        static_assert(sizeof...(T) > 0,
                      "Node function with 0 arguments should be terminator");
        const auto val = currentID;

        // explicitly capture to avoid bug in gcc
        std::function<BaseNode<Rtype>*()> func = [f, name, val]() {
            return new Node<std::function<Rtype(T...)>>(f, name, val);
        };
        nodes[currentID++] = func;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %r15d
leaq -0x60(%rbp), %r14
movq %rsi, -0x8(%r14)
movq %r14, %rdi
movq %rdx, %rsi
callq 0x2190
movl %r15d, 0x20(%r14)
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3802
movq %r14, %rdi
callq 0x2090
leaq 0x8(%rbx), %rdi
movl 0x4(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%rbx)
leaq -0x68(%rbp), %rsi
movl %eax, (%rsi)
callq 0x384a
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x389c
leaq -0x38(%rbp), %rdi
callq 0x5e42
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x2090
jmp 0x2921
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x5e42
movq %rbx, %rdi
callq 0x21f0
nop