LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: sile[P]unf/src/unf/trie/char_stream.hh
// Function: UNF::Trie::CharStreamForComposition::append_read_char_to_str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char const*) const
void append_read_char_to_str(std::string& s, const char* beg) const {
	if(eos1()==false) {
	  s.append(beg, cur());
	} else {
	  s.append(beg,  cur1);
	  s.append(beg2, cur());
	}
      }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x5850
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5cbe
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
callq 0x57c0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
callq 0x3a00
jmp 0x5d05
movq 0x28(%rsp), %rax
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x10(%rax), %rdx
callq 0x3a00
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x10(%rsp)
callq 0x57c0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x3a00
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: NKUSec[P]Rethinking-Honeywords/calc.cpp
// Function: main
int main(int argc, char* argv[])
{
	if (argc != 3)
	{
		printf("calc parameters wrong!\n");
		return 0;
	}

	char prefix[LINE_LEN], pr_file[LINE_LEN];
	strcpy(prefix, argv[1]);
	int dotpos = strlen(prefix)-1;
	while (prefix[dotpos] != '_' && dotpos > 0) dotpos--;
	prefix[dotpos] = '\0';
	strcpy(pr_file, prefix);
	strcat(pr_file, "_pr.txt");
	read_training_set(argv[2]);
	calc_honeywords_pr(argv[1], pr_file);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e40, %rsp           # imm = 0x4E40
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x2a69
leaq 0x15cf(%rip), %rdi      # 0x4025
movb $0x0, %al
callq 0x2040
movl $0x0, -0x4(%rbp)
jmp 0x2b39
leaq -0x2720(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x2120
leaq -0x2720(%rbp), %rdi
callq 0x20a0
subq $0x1, %rax
movl %eax, -0x4e34(%rbp)
movslq -0x4e34(%rbp), %rax
movsbl -0x2720(%rbp,%rax), %ecx
xorl %eax, %eax
cmpl $0x5f, %ecx
movb %al, -0x4e35(%rbp)
je 0x2abf
cmpl $0x0, -0x4e34(%rbp)
setg %al
movb %al, -0x4e35(%rbp)
movb -0x4e35(%rbp), %al
testb $0x1, %al
jne 0x2acb
jmp 0x2adc
movl -0x4e34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4e34(%rbp)
jmp 0x2a93
movslq -0x4e34(%rbp), %rax
movb $0x0, -0x2720(%rbp,%rax)
leaq -0x4e30(%rbp), %rdi
leaq -0x2720(%rbp), %rsi
callq 0x2120
leaq -0x4e30(%rbp), %rdi
leaq 0x1531(%rip), %rsi      # 0x403d
callq 0x2230
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x23a0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x4e30(%rbp), %rsi
callq 0x2650
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x4e40, %rsp           # imm = 0x4E40
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: plasma-umass[P]simplesocket/./simplesocket.h
// Function: simplesocket& simplesocket::operator<<<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
simplesocket& operator<<(TYPE t) {
    stringstream output;
    output << t;
    auto buf_str = output.str();
    auto buf = buf_str.c_str();
    write (buf, strlen(buf));
    return *this;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rsi, -0x1d8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3190
movq -0x1d8(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x3230
jmp 0x3ce6
leaq -0x1c8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x3250
jmp 0x3cfb
leaq -0x1c8(%rbp), %rdi
callq 0x30e0
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x30f0
movq -0x1e0(%rbp), %rdi
movq -0x1e8(%rbp), %rsi
movq %rax, %rdx
callq 0x4600
jmp 0x3d39
leaq -0x1c8(%rbp), %rdi
callq 0x3150
leaq -0x198(%rbp), %rdi
callq 0x31b0
movq -0x1e0(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x3d93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x3150
leaq -0x198(%rbp), %rdi
callq 0x31b0
movq -0x1a0(%rbp), %rdi
callq 0x33f0
nopl (%rax,%rax)
// File: plasma-umass[P]simplesocket/./simplesocket.h
// Function: simplesocket::operator>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
simplesocket& operator>>(string& t) {
    char buf[MAXBUF+1];
    memset (buf, 0, MAXBUF+1);
    read (buf, MAXBUF);
    t = buf;
    return *this;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10030, %rsp          # imm = 0x10030
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10028(%rbp)
leaq -0x10020(%rbp), %rdi
xorl %esi, %esi
movl $0x10001, %edx          # imm = 0x10001
callq 0x3110
movq -0x10028(%rbp), %rdi
leaq -0x10020(%rbp), %rsi
movl $0x10000, %edx          # imm = 0x10000
callq 0x4340
leaq -0x10020(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x3340
movq -0x10028(%rbp), %rax
addq $0x10030, %rsp          # imm = 0x10030
popq %rbp
retq
nopl (%rax)
// File: plasma-umass[P]simplesocket/simplesocket.cpp
// Function: simplesocket::resolve(addrinfo*)
void simplesocket::resolve (struct addrinfo * hint) {
  int err;
  int on = 1;
  
  char portStr[255];
  snprintf (portStr, sizeof(portStr), "%d", _port);
  
  if ((err = getaddrinfo (hostname(), portStr, hint, &_addresses)) != 0) {
    if (_debug)
      cerr << "Error in name resolution for " << name()
	   << ", with error " << gai_strerror(err) << "\n";
    _nameResolved = false;
    return;
  }
  
  _nameResolved = true;
  _socketfd = socket (AF_INET, SOCK_STREAM, 0);
  if (_socketfd < 0) {
    if (_debug)
      cerr << "SOCKET CREATION FAILURE... aborting.\n";
    return;
  }
  
  setsockopt (_socketfd, 
	      SOL_SOCKET,
	      SO_REUSEADDR, 
	      (void *) &on,
	      sizeof (on));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
movl $0x1, -0x18(%rbp)
leaq -0x120(%rbp), %rdi
movl 0x18(%rax), %ecx
movl $0xff, %esi
leaq 0x1a2c(%rip), %rdx      # 0x60a7
movb $0x0, %al
callq 0x33c0
movq -0x128(%rbp), %rdi
callq 0x53a0
movq -0x128(%rbp), %rcx
movq %rax, %rdi
leaq -0x120(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rcx
callq 0x3320
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x4746
movq -0x128(%rbp), %rax
testb $0x1, 0x1dc(%rax)
je 0x4739
movq 0x3921(%rip), %rdi      # 0x7ff0
leaq 0x19d4(%rip), %rsi      # 0x60aa
callq 0x3260
movq -0x128(%rbp), %rdi
movq %rax, -0x138(%rbp)
callq 0x53c0
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x3260
movq %rax, %rdi
leaq 0x19c1(%rip), %rsi      # 0x60c8
callq 0x3260
movq %rax, -0x130(%rbp)
movl -0x14(%rbp), %edi
callq 0x3360
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x3260
movq %rax, %rdi
leaq 0x1b2c(%rip), %rsi      # 0x6260
callq 0x3260
movq -0x128(%rbp), %rax
movb $0x0, 0x14(%rax)
jmp 0x47bc
movq -0x128(%rbp), %rax
movb $0x1, 0x14(%rax)
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x3080
movl %eax, %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $0x0, 0x10(%rax)
jge 0x4799
movq -0x128(%rbp), %rax
testb $0x1, 0x1dc(%rax)
je 0x4797
movq 0x3865(%rip), %rdi      # 0x7ff0
leaq 0x1944(%rip), %rsi      # 0x60d6
callq 0x3260
jmp 0x47bc
movq -0x128(%rbp), %rax
movl 0x10(%rax), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x18(%rbp), %rcx
movl $0x4, %r8d
callq 0x3410
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: plasma-umass[P]simplesocket/simplesocket.cpp
// Function: simplesocket::descriptorReady(int, int)
int simplesocket::descriptorReady (int fd, int timeout) {
  assert (timeout > 0);
  int ret = 0;
  fd_set rset;
  FD_ZERO(&rset);
  FD_SET(fd, &rset);
  struct timeval tv;
  memset(&tv, 0, sizeof(struct timeval));
  tv.tv_sec = timeout;
  tv.tv_usec = 0;
  do {
    ret = select(fd + 1, &rset, NULL, NULL, &tv);
  } while (ret < 0 && errno == EINTR);
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jle 0x482d
jmp 0x484c
leaq 0x18c8(%rip), %rdi      # 0x60fc
leaq 0x18cd(%rip), %rsi      # 0x6108
movl $0x2b, %edx
leaq 0x18d2(%rip), %rcx      # 0x6119
callq 0x3160
movl $0x0, -0x14(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpq $0x10, %rax
jae 0x489d
movq -0xa8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x486b
jmp 0x489f
movl -0xc(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movl -0xc(%rbp), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x98(%rbp,%rax,8), %rcx
movq %rcx, -0x98(%rbp,%rax,8)
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3110
movslq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq $0x0, -0xb0(%rbp)
movl -0xc(%rbp), %edi
addl $0x1, %edi
leaq -0x98(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0xb8(%rbp), %r8
movq %rcx, %rdx
callq 0x3240
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0xb9(%rbp)
jge 0x4941
callq 0x3040
cmpl $0x4, (%rax)
sete %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x48ff
movl -0x14(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: plasma-umass[P]simplesocket/simplesocket.cpp
// Function: simplesocket::sendNBytes(unsigned char*, int, bool)
ssize_t simplesocket::sendNBytes (unsigned char* data, int size, bool lessOk) {
  int ret, nSent = 0;
  int toSend = size;
  assert (toSend>0);
  do {
    ret = ::send (_socketfd, data, toSend, MSG_NOSIGNAL);
    if (_debug) cerr << "sent " << ret << " bytes of " << size << endl;
    if ((ret < 0) && (errno == EINTR))
      continue; 
    else if (ret < 0){
      if (_debug) {
	perror ("Simplesocket error: ");
      }
      assert (errno > 0);
      close();
      return -errno;
    } else if (ret == 0) {
      close();
      return -1; /* Send shouldn't return 0 */
    } else {
      data += ret;
      toSend -= ret;
      nSent += ret;
    }
  } while (toSend > 0 && !lessOk);
  return nSent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x4be7
jmp 0x4c06
leaq 0x15e8(%rip), %rdi      # 0x61d6
leaq 0x1513(%rip), %rsi      # 0x6108
movl $0x61, %edx
leaq 0x15de(%rip), %rcx      # 0x61df
callq 0x3160
jmp 0x4c08
movq -0x38(%rbp), %rax
movl 0x10(%rax), %edi
movq -0x18(%rbp), %rsi
movslq -0x2c(%rbp), %rdx
movl $0x4000, %ecx           # imm = 0x4000
callq 0x3100
movq %rax, %rcx
movq -0x38(%rbp), %rax
movl %ecx, -0x24(%rbp)
testb $0x1, 0x1dc(%rax)
je 0x4c7b
movq 0x33b5(%rip), %rdi      # 0x7ff0
leaq 0x15da(%rip), %rsi      # 0x621c
callq 0x3260
movq %rax, %rdi
movl -0x24(%rbp), %esi
callq 0x33e0
movq %rax, %rdi
leaq 0x15c6(%rip), %rsi      # 0x6222
callq 0x3260
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x33e0
movq %rax, %rdi
movq 0x3342(%rip), %rsi      # 0x7fb8
callq 0x3290
cmpl $0x0, -0x24(%rbp)
jge 0x4c90
callq 0x3040
cmpl $0x4, (%rax)
jne 0x4c90
jmp 0x4d3b
cmpl $0x0, -0x24(%rbp)
jge 0x4cf7
movq -0x38(%rbp), %rax
testb $0x1, 0x1dc(%rax)
je 0x4caf
leaq 0x1583(%rip), %rdi      # 0x622d
callq 0x3200
callq 0x3040
cmpl $0x0, (%rax)
jle 0x4cbb
jmp 0x4cda
leaq 0x150a(%rip), %rdi      # 0x61cc
leaq 0x143f(%rip), %rsi      # 0x6108
movl $0x6b, %edx
leaq 0x150a(%rip), %rcx      # 0x61df
callq 0x3160
movq -0x38(%rbp), %rdi
callq 0x47d0
callq 0x3040
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x4d61
cmpl $0x0, -0x24(%rbp)
jne 0x4d10
movq -0x38(%rbp), %rdi
callq 0x47d0
movq $-0x1, -0x8(%rbp)
jmp 0x4d61
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x4d37
jmp 0x4d39
jmp 0x4d3b
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x39(%rbp)
jle 0x4d4e
movb -0x1d(%rbp), %al
xorb $-0x1, %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x4c08
movslq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: plasma-umass[P]simplesocket/simplesocket.cpp
// Function: simplesocket::serve()
void simplesocket::serve (void) 
{
  struct addrinfo hint;
  memset ((void *) &hint, 0, sizeof(hint));
  hint.ai_flags = AI_PASSIVE;
  resolve (&hint);

  ((struct sockaddr_in*)(_addresses->ai_addr))->sin_addr.s_addr = htonl(INADDR_ANY);
  int r = bind (_socketfd,
		_addresses->ai_addr,
		_addresses->ai_addrlen);
  if (r < 0) {
    perror ("Bind failure.");
  }
  if (_debug) cerr << "waiting for a connection - " << _name << endl;
  r = listen (_socketfd, 255);
  if (r < 0) {
    if (_debug) cerr << "LISTEN FAILURE.\n";
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x3110
movq -0x48(%rbp), %rdi
movl $0x1, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x4640
xorl %edi, %edi
callq 0x31d0
movl %eax, %edx
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rcx), %rcx
movl %edx, 0x4(%rcx)
movl 0x10(%rax), %edi
movq 0x8(%rax), %rcx
movq 0x18(%rcx), %rsi
movq 0x8(%rax), %rax
movl 0x10(%rax), %edx
callq 0x3050
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x521c
leaq 0x108a(%rip), %rdi      # 0x62a1
callq 0x3200
movq -0x48(%rbp), %rax
testb $0x1, 0x1dc(%rax)
je 0x525b
movq 0x2dc0(%rip), %rdi      # 0x7ff0
leaq 0x1078(%rip), %rsi      # 0x62af
callq 0x3260
movq -0x48(%rbp), %rsi
movq %rax, %rdi
addq $0x40, %rsi
callq 0x3230
movq %rax, %rdi
movq 0x2d62(%rip), %rsi      # 0x7fb8
callq 0x3290
movq -0x48(%rbp), %rax
movl 0x10(%rax), %edi
movl $0xff, %esi
callq 0x32e0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x5297
movq -0x48(%rbp), %rax
testb $0x1, 0x1dc(%rax)
je 0x5295
movq 0x2d67(%rip), %rdi      # 0x7ff0
leaq 0x103b(%rip), %rsi      # 0x62cb
callq 0x3260
jmp 0x5297
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: plasma-umass[P]simplesocket/simplesocket.cpp
// Function: simplesocket::accept()
simplesocket * simplesocket::accept() {
  socklen_t len = sizeof(_addresses);
  int newfd = ::accept (_socketfd, _addresses->ai_addr, &len);
  if (newfd < 0) {
    if (_debug) cerr << "ACCEPT FAILURE.\n";
    return NULL;
  }
  simplesocket * newSock = new simplesocket (_hostname.c_str(), _port, -1, _debug);
  newSock->_socketfd = newfd;
  newSock->_nameResolved = true;
  return newSock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x8, -0x14(%rbp)
movl 0x10(%rax), %edi
movq 0x8(%rax), %rax
movq 0x18(%rax), %rsi
leaq -0x14(%rbp), %rdx
callq 0x30a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x5305
movq -0x38(%rbp), %rax
testb $0x1, 0x1dc(%rax)
je 0x52f8
movq 0x2d04(%rip), %rdi      # 0x7ff0
leaq 0xfe9(%rip), %rsi       # 0x62dc
callq 0x3260
movq $0x0, -0x8(%rbp)
jmp 0x538a
movl $0x1e0, %edi            # imm = 0x1E0
callq 0x3270
movq -0x38(%rbp), %rdi
movq %rax, -0x40(%rbp)
movq %rax, -0x48(%rbp)
addq $0x20, %rdi
callq 0x30e0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movq -0x38(%rbp), %rax
movl 0x18(%rax), %edx
movzbl 0x1dc(%rax), %r8d
andl $0x1, %r8d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x3e20
jmp 0x534a
movq -0x48(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movb $0x1, 0x14(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x538a
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x1e0, %esi            # imm = 0x1E0
callq 0x3280
jmp 0x5394
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x33f0
nopl (%rax)
// File: vssense[P]Compiler/src/back-end/back-end_main.cpp
// Function: main
int main(int argc, char const* argv[])
{
    BackEndInfo info = {};
    info.nametable_dump_required      = (strcmp(argv[nametable_dump_flag_offset],      "1") == 0);
    info.asm_listing_required         = (strcmp(argv[asm_listing_flag_offset],         "1") == 0);
    info.speed_optimization_required  = (strcmp(argv[speed_optimization_flag_offset],  "1") == 0);
    info.memory_optimization_required = (strcmp(argv[memory_optimization_flag_offset], "1") == 0);

    if (argc - 1 > memory_optimization_flag_offset)
    {
        info.output_file = argv[memory_optimization_flag_offset + 1];
    }

    Tree* tree = GetTreeFromFile(tree_tmp_file);

    Compile(tree, &info);

    DestructTree(tree);
    DeleteTree(tree);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movb $0x0, -0x18(%rbp)
movb $0x0, -0x17(%rbp)
movb $0x0, -0x16(%rbp)
movb $0x0, -0x15(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x8a8b(%rip), %rsi      # 0xad98
callq 0x2150
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x8a6c(%rip), %rsi      # 0xad98
callq 0x2150
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0x17(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x8a4d(%rip), %rsi      # 0xad98
callq 0x2150
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0x16(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x8a2e(%rip), %rsi      # 0xad98
callq 0x2150
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0x15(%rbp)
movl -0x8(%rbp), %eax
subl $0x1, %eax
cmpl $0x4, %eax
jle 0x2391
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq 0xdd68(%rip), %rdi      # 0x10100
callq 0x9920
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x23d0
movq -0x28(%rbp), %rdi
callq 0x7b90
movq -0x28(%rbp), %rdi
callq 0x7c20
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: Compile(Tree*, BackEndInfo*)
void Compile(Tree* tree, BackEndInfo* info)
{
    assert(tree);

    NameTable* table = MakeTableOfNames(tree);

    if (info->nametable_dump_required)
    {
        NameTableDump(table);
    }

    FILE* asm_file = nullptr;

    if (info->asm_listing_required)
    {
        asm_file = fopen(ASM_FILE_NAME, "w");
        assert(asm_file);
    }

    WriteAsmCode(tree, table, asm_file, info);

    if (info->asm_listing_required)
    {
        fclose(asm_file);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x23e9
jmp 0x2408
leaq 0x88b3(%rip), %rdi      # 0xaca3
leaq 0x84f4(%rip), %rsi      # 0xa8eb
movl $0x84, %edx
leaq 0x8503(%rip), %rcx      # 0xa906
callq 0x20a0
movq -0x8(%rbp), %rdi
callq 0x24b0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x2428
movq -0x18(%rbp), %rdi
callq 0x2540
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x247b
movq 0xdcc7(%rip), %rdi      # 0x10108
leaq 0x84e2(%rip), %rsi      # 0xa92a
callq 0x2120
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x245a
jmp 0x2479
leaq 0x84cb(%rip), %rdi      # 0xa92c
leaq 0x8483(%rip), %rsi      # 0xa8eb
movl $0x92, %edx
leaq 0x8492(%rip), %rcx      # 0xa906
callq 0x20a0
jmp 0x247b
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
callq 0x2770
movq -0x10(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x24a3
movq -0x20(%rbp), %rdi
callq 0x2100
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: MakeTableOfNames(Tree*)
NameTable* MakeTableOfNames(Tree* tree)
{
    assert(tree);

    size_t num_func = GetNumFunc(tree);

    NameTable* table = NewNameTable();
    table->functions = (Function*)calloc(num_func, sizeof(Function));
    table->num_func  = num_func;

    FillNameTable(table, tree);

    return table;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x24c5
jmp 0x24e4
leaq 0x87d7(%rip), %rdi      # 0xaca3
leaq 0x8418(%rip), %rsi      # 0xa8eb
movl $0x2ce, %edx            # imm = 0x2CE
leaq 0x86fb(%rip), %rcx      # 0xabda
callq 0x20a0
movq -0x8(%rbp), %rdi
callq 0x3da0
movq %rax, -0x10(%rbp)
callq 0x3e20
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl $0x30, %esi
callq 0x20b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x3e90
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmCode(Tree*, NameTable*, _IO_FILE*, BackEndInfo*)
void WriteAsmCode(Tree* tree, NameTable* table, FILE* file, BackEndInfo* info)
{
    assert(tree);
    assert(table);
    assert(info);

    Node* node = tree->root;

    Compiler compiler = {};

    InitCompiler(&compiler, table, file, info);
    WriteAsm_start(&compiler);
    WriteAsmStdFunctions(&compiler);

    for (size_t i = 0; i < table->num_func; ++i)
    {
        WriteAsmFunc(node->right, &compiler);

        compiler.function++;
        node = node->left;
    }

    WriteAsmStdData(&compiler);
    SetAllCalls(&compiler);
    SetElfHeaders(&compiler.writer);

    WriteByteCodeToFile(&compiler, info);

    DestructNameTable(table);
    DeleteNameTable(table);
    Destruct(&compiler.writer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2794
jmp 0x27b3
leaq 0x8508(%rip), %rdi      # 0xaca3
leaq 0x8149(%rip), %rsi      # 0xa8eb
movl $0xb2, %edx
leaq 0x81dd(%rip), %rcx      # 0xa98b
callq 0x20a0
cmpq $0x0, -0x10(%rbp)
je 0x27bc
jmp 0x27db
leaq 0x81bd(%rip), %rdi      # 0xa980
leaq 0x8121(%rip), %rsi      # 0xa8eb
movl $0xb3, %edx
leaq 0x81b5(%rip), %rcx      # 0xa98b
callq 0x20a0
cmpq $0x0, -0x20(%rbp)
je 0x27e4
jmp 0x2803
leaq 0x819b(%rip), %rdi      # 0xa986
leaq 0x80f9(%rip), %rsi      # 0xa8eb
movl $0xb4, %edx
leaq 0x818d(%rip), %rcx      # 0xa98b
callq 0x20a0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
movl $0x118, %edx            # imm = 0x118
callq 0x2090
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x140(%rbp), %rdi
callq 0x2920
leaq -0x140(%rbp), %rdi
callq 0x2a40
leaq -0x140(%rbp), %rdi
callq 0x2ad0
movq $0x0, -0x148(%rbp)
movq -0x148(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x28b3
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdi
leaq -0x140(%rbp), %rsi
callq 0x2be0
movq -0x138(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x138(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x148(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x148(%rbp)
jmp 0x285c
leaq -0x140(%rbp), %rdi
callq 0x2c90
leaq -0x140(%rbp), %rdi
callq 0x5970
leaq -0x140(%rbp), %rdi
addq $0x28, %rdi
callq 0x5ce0
movq -0x20(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x2da0
movq -0x10(%rbp), %rdi
callq 0x2ef0
movq -0x10(%rbp), %rdi
callq 0x2f80
leaq -0x140(%rbp), %rdi
addq $0x28, %rdi
callq 0x60a0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: InitCompiler(Compiler*, NameTable*, _IO_FILE*, BackEndInfo*)
void InitCompiler(Compiler* compiler, NameTable* table, FILE* file, BackEndInfo* info)
{
    assert(compiler);
    assert(table);
    assert(info);

    compiler->table    = table;
    compiler->function = table->functions;
    compiler->file     = file;
    compiler->label    = 0;

    compiler->asm_listing_required         = info->asm_listing_required;
    compiler->speed_optimization_required  = info->speed_optimization_required;
    compiler->memory_optimization_required = info->memory_optimization_required;

    Construct(&compiler->writer);
    InitElf64(&compiler->writer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2941
jmp 0x2960
leaq 0x7fed(%rip), %rdi      # 0xa935
leaq 0x7f9c(%rip), %rsi      # 0xa8eb
movl $0x9f, %edx
leaq 0x7fe3(%rip), %rcx      # 0xa93e
callq 0x20a0
cmpq $0x0, -0x10(%rbp)
je 0x2969
jmp 0x2988
leaq 0x8010(%rip), %rdi      # 0xa980
leaq 0x7f74(%rip), %rsi      # 0xa8eb
movl $0xa0, %edx
leaq 0x7fbb(%rip), %rcx      # 0xa93e
callq 0x20a0
cmpq $0x0, -0x20(%rbp)
je 0x2991
jmp 0x29b0
leaq 0x7fee(%rip), %rdi      # 0xa986
leaq 0x7f4c(%rip), %rsi      # 0xa8eb
movl $0xa1, %edx
leaq 0x7f93(%rip), %rcx      # 0xa93e
callq 0x20a0
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x20(%rbp), %rax
movb 0x9(%rax), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x20(%rax)
movq -0x20(%rbp), %rax
movb 0xa(%rax), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x21(%rax)
movq -0x20(%rbp), %rax
movb 0xb(%rax), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x22(%rax)
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x5d10
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x5a50
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsm_start(Compiler*)
void WriteAsm_start(Compiler* compiler)
{
    if (compiler->asm_listing_required)
    {
        fprintf(compiler->file, "section .text\n"
                                "global _start\n\n"
                                "_start:      \n\t");
    }

    WriteCall     (compiler, FindFunc("main", compiler->table));
    WriteMovR64Num(compiler, RAX, 0x3c);
    WriteMovR64Num(compiler, RDI, 0x00);
    WriteSyscall  (compiler);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x2a6c
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x7f64(%rip), %rsi      # 0xa9c9
movb $0x0, %al
callq 0x2160
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x7f74(%rip), %rdi      # 0xa9f6
callq 0x2fd0
movq -0x10(%rbp), %rdi
movq %rax, %rsi
callq 0x5620
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x46b0
movq -0x8(%rbp), %rdi
movl $0x7, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x46b0
movq -0x8(%rbp), %rdi
callq 0x58f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmStdFunctions(Compiler*)
void WriteAsmStdFunctions(Compiler* compiler)
{
    assert(compiler);

    ElfFileWriter* writer = &compiler->writer;

    memcpy(writer->buffer + writer->offset, byte_code_print, sizeof(byte_code_print));
    compiler->print_offset = writer->offset;
    writer->offset += sizeof(byte_code_print);

    memcpy(writer->buffer + writer->offset, byte_code_scan, sizeof(byte_code_scan));
    compiler->scan_offset = writer->offset;
    writer->offset += sizeof(byte_code_scan);

    if (compiler->asm_listing_required)
    {
        fprintf(compiler->file, "%s", nasm_print_func);
        fprintf(compiler->file, "%s", nasm_scan_func);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2ae5
jmp 0x2b04
leaq 0x7e49(%rip), %rdi      # 0xa935
leaq 0x7df8(%rip), %rsi      # 0xa8eb
movl $0xf9, %edx
leaq 0x7f7a(%rip), %rcx      # 0xaa79
callq 0x20a0
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rdi
leaq 0x757a(%rip), %rsi      # 0xa0a0
movl $0x66, %edx
callq 0x20c0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x108(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x66, %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rdi
leaq 0x75a7(%rip), %rsi      # 0xa110
movl $0x5c, %edx
callq 0x20c0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x110(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x5c, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x2bda
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0xd569(%rip), %rdx      # 0x10118
leaq 0x7ec0(%rip), %rsi      # 0xaa76
movb $0x0, %al
callq 0x2160
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0xd554(%rip), %rdx      # 0x10120
leaq 0x7ea3(%rip), %rsi      # 0xaa76
movb $0x0, %al
callq 0x2160
addq $0x10, %rsp
popq %rbp
retq
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmFunc(Node*, Compiler*)
void WriteAsmFunc(Node* node, Compiler* compiler)
{
    ASSERT_COMPILER;

    WriteFuncDecl(compiler, FUNC);

    WritePushR64  (compiler, RBP);
    WriteMovR64R64(compiler, RBP, RSP);
    WriteSubR64Num(compiler, RSP, FUNC->num_vars * sizeof(int64_t));

    WriteAsmCompound(node->left->right, compiler);

    WriteMovR64R64(compiler, RSP, RBP);
    WritePopR64   (compiler, RBP);
    WriteRet      (compiler);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x5860
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x4e10
movq -0x10(%rbp), %rdi
movl $0x5, %esi
movl $0x4, %edx
callq 0x4390
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
shlq $0x3, %rax
movl %eax, %edx
movl $0x4, %esi
callq 0x4b00
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x3090
movq -0x10(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
callq 0x4390
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x5020
movq -0x10(%rbp), %rdi
callq 0x57f0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmStdData(Compiler*)
void WriteAsmStdData(Compiler* compiler)
{
    assert(compiler);

    int data_segment_offset = InitDataSegment(&compiler->writer);

    memcpy(compiler->writer.buffer + compiler->writer.offset, byte_code_std_data, sizeof(byte_code_std_data));
    compiler->writer.offset += sizeof(byte_code_std_data);

    SetInt(&compiler->writer, start_virtual_offset + data_segment_offset, offset_to_set_data + compiler->print_offset);
    SetInt(&compiler->writer, start_virtual_offset + data_segment_offset, offset_to_set_data + compiler->scan_offset);

    if (compiler->asm_listing_required)
    {
        fprintf(compiler->file, "%s", asm_data);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2ca5
jmp 0x2cc4
leaq 0x7c89(%rip), %rdi      # 0xa935
leaq 0x7c38(%rip), %rsi      # 0xa8eb
movl $0x10e, %edx            # imm = 0x10E
leaq 0x7de0(%rip), %rcx      # 0xaa9f
callq 0x20a0
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x5bb0
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
movq 0x7485(%rip), %rdx      # 0xa170
movq %rdx, (%rax,%rcx)
movq 0x7482(%rip), %rdx      # 0xa178
movq %rdx, 0x8(%rax,%rcx)
movw 0x747e(%rip), %dx       # 0xa180
movw %dx, 0x10(%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x12, %rcx
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movslq -0xc(%rbp), %rax
addq $0x400000, %rax         # imm = 0x400000
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x108(%rax), %rdx
addq $0x2, %rdx
callq 0x5f90
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movslq -0xc(%rbp), %rax
addq $0x400000, %rax         # imm = 0x400000
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rdx
addq $0x2, %rdx
callq 0x5f90
movq -0x8(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x2d8e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0xd3a8(%rip), %rdx      # 0x10128
leaq 0x7cef(%rip), %rsi      # 0xaa76
movb $0x0, %al
callq 0x2160
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteByteCodeToFile(Compiler*, BackEndInfo*)
void WriteByteCodeToFile(Compiler* compiler, BackEndInfo* info)
{
    assert(compiler);
    assert(info);

    const char* output_file_name = DEFAULT_OUTPUT_FILE_NAME;

    if (info->output_file != nullptr)
    {
        output_file_name = info->output_file;
    }

    FILE* output = fopen(output_file_name, "w");
    assert(output && "Can't create output file");

    char chmod_str[chmod_str_len] = "";
    sprintf(chmod_str, "chmod +x %s", output_file_name);
    system(chmod_str);

    fwrite(compiler->writer.buffer, compiler->writer.offset, sizeof(char), output);
    fclose(output);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2dbc
jmp 0x2ddb
leaq 0x7b72(%rip), %rdi      # 0xa935
leaq 0x7b21(%rip), %rsi      # 0xa8eb
movl $0xe2, %edx
leaq 0x7c25(%rip), %rcx      # 0xa9fb
callq 0x20a0
cmpq $0x0, -0x10(%rbp)
je 0x2de4
jmp 0x2e03
leaq 0x7b9b(%rip), %rdi      # 0xa986
leaq 0x7af9(%rip), %rsi      # 0xa8eb
movl $0xe3, %edx
leaq 0x7bfd(%rip), %rcx      # 0xa9fb
callq 0x20a0
movq 0xd306(%rip), %rax      # 0x10110
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2e23
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x7afc(%rip), %rsi      # 0xa92a
callq 0x2120
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0xa1(%rbp)
je 0x2e50
movb $0x1, %al
movb %al, -0xa1(%rbp)
jmp 0x2e50
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x2e5c
jmp 0x2e5e
jmp 0x2e7d
leaq 0x7be3(%rip), %rdi      # 0xaa48
leaq 0x7a7f(%rip), %rsi      # 0xa8eb
movl $0xed, %edx
leaq 0x7b83(%rip), %rcx      # 0xa9fb
callq 0x20a0
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x2090
leaq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7bcb(%rip), %rsi      # 0xaa6d
movb $0x0, %al
callq 0x2060
leaq -0xa0(%rbp), %rdi
callq 0x20d0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x20(%rbp), %rcx
movl $0x1, %edx
callq 0x21c0
movq -0x20(%rbp), %rdi
callq 0x2100
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: DestructNameTable(NameTable*)
void DestructNameTable(NameTable* table)
{
    assert(table);

    for (size_t i = 0; i < table->num_func; ++i)
    {
        free(table->functions[i].vars);
    }
    
    free(table->functions);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2f05
jmp 0x2f24
leaq 0x7a74(%rip), %rdi      # 0xa980
leaq 0x79d8(%rip), %rsi      # 0xa8eb
movl $0x2dd, %edx            # imm = 0x2DD
leaq 0x7cdf(%rip), %rcx      # 0xabfe
callq 0x20a0
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2f60
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x30, -0x10(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x2130
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x2f2c
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x2130
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: FindFunc(char const*, NameTable*)
Function* FindFunc(const char* name, NameTable* table)
{
    assert(name);

    for (size_t i = 0; i < table->num_func; ++i)
    {
        if (strcmp(table->functions[i].name, name) == 0)
        {
            return table->functions + i;
        }
    }

    printf("error : unknown function : '%s'\n", name);

    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2fe9
jmp 0x3008
leaq 0x95c0(%rip), %rdi      # 0xc5b0
leaq 0x78f4(%rip), %rsi      # 0xa8eb
movl $0x28c, %edx            # imm = 0x28C
leaq 0x7b38(%rip), %rcx      # 0xab3b
callq 0x20a0
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x3063
movq -0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x30, -0x20(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2150
cmpl $0x0, %eax
jne 0x3053
movq -0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x30, -0x20(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x307d
jmp 0x3055
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3010
movq -0x10(%rbp), %rsi
leaq 0x7afb(%rip), %rdi      # 0xab69
movb $0x0, %al
callq 0x2040
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmCompound(Node*, Compiler*)
void WriteAsmCompound(Node* node, Compiler* compiler)
{
    if (node == nullptr)
    {
        return;
    }

    ASSERT_COMPILER;

    while (node != nullptr)
    {
        WriteAsmStatement(node->left, compiler);
        node = node->right;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x30a9
jmp 0x30d1
jmp 0x30ab
cmpq $0x0, -0x8(%rbp)
je 0x30d1
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x30e0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x30ab
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmStatement(Node*, Compiler*)
void WriteAsmStatement(Node* node, Compiler* compiler)
{
    ASSERT_COMPILER;

    switch (node->type)
    {
        case DECL_TYPE :
        {
            WriteAsmAssignment(node, compiler);
            break;
        }
        case ADECL_TYPE :
        {
            WriteAsmArrayDeclaration(node, compiler);
            break;
        }
        case ASSG_TYPE :
        {
            WriteAsmAssignment(node, compiler);
            break;
        }
        case JUMP_TYPE :
        {
            if (!FUNC->is_void)
            {
                WriteAsmExpression(node->right, compiler);
                WritePopR64(compiler, RAX);
            }

            WriteMovR64R64(compiler, RSP, RBP);
            WritePopR64   (compiler, RBP);
            WriteRet      (compiler);
            break;
        }
        case COND_TYPE :
        {
            WriteAsmCondition(node, compiler);
            break;
        }
        case LOOP_TYPE :
        {
            WriteAsmLoop(node, compiler);
            break;
        }
        case CALL_TYPE :
        {
            WriteAsmCall(node, compiler);
            break;
        }
        default :
        {
            printf("I am here, but I shouldn't, line = %d\n", __LINE__);
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0xc, %eax
ja 0x31d4
movq -0x18(%rbp), %rax
leaq 0x6f0e(%rip), %rcx      # 0xa020
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x31f0
jmp 0x31e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3310
jmp 0x31e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x31f0
jmp 0x31e7
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x10(%rax)
jne 0x317b
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33a0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x5020
movq -0x10(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
callq 0x4390
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x5020
movq -0x10(%rbp), %rdi
callq 0x57f0
jmp 0x31e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3410
jmp 0x31e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x35b0
jmp 0x31e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x36d0
jmp 0x31e7
leaq 0x78e5(%rip), %rdi      # 0xaac0
movl $0x172, %esi            # imm = 0x172
movb $0x0, %al
callq 0x2040
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmAssignment(Node*, Compiler*)
void WriteAsmAssignment(Node* node, Compiler* compiler)
{
    ASSERT_COMPILER;

    WriteAsmExpression(node->right, compiler);

    if (node->left->type == MEM_ACCESS_TYPE)
    {
        WriteAsmExpression(node->left->right, compiler);

        WriteMovR64Mem(compiler, RAX, RBP, GetVarOfs(FUNC, node->left->left->value.name));
        WritePopR64   (compiler, RBX);
        WriteSalR64   (compiler, RBX, 3);    //sizeof(int64_t)
        WriteSubR64R64(compiler, RAX, RBX);
        WritePopR64   (compiler, RBX);
        WriteMovMemR64(compiler, RAX, RBX);

        return;
    }

    WritePopR64   (compiler, RAX);
    WriteMovMemR64(compiler, RBP, RAX, GetVarOfs(FUNC, node->left->value.name));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33a0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x3, (%rax)
jne 0x32be
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33a0
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x37f0
movq -0x18(%rbp), %rdi
movl %eax, %ecx
xorl %esi, %esi
movl $0x5, %edx
callq 0x4470
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x5020
movq -0x10(%rbp), %rdi
movl $0x3, %edx
movl %edx, %esi
callq 0x5160
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x4a20
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x5020
movq -0x10(%rbp), %rdi
xorl %ecx, %ecx
movl $0x3, %edx
movl %ecx, %esi
callq 0x4590
jmp 0x32fc
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x5020
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x37f0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movl $0x5, %esi
xorl %edx, %edx
callq 0x4590
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmArrayDeclaration(Node*, Compiler*)
void WriteAsmArrayDeclaration(Node* node, Compiler* compiler)
{
    ASSERT_COMPILER;

    WriteAsmExpression(node->right, compiler);

    WriteMovMemR64(compiler, RBP, RSP, GetVarOfs(FUNC, node->left->value.name));
    WritePopR64   (compiler, RAX);
    WriteSalR64   (compiler, RAX, 3); //sizeof(int64_t)
    WriteSubR64R64(compiler, RSP, RAX);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33a0
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x37f0
movq -0x18(%rbp), %rdi
movl %eax, %ecx
movl $0x5, %esi
movl $0x4, %edx
callq 0x4590
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x5020
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x5160
movq -0x10(%rbp), %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x4a20
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmExpression(Node*, Compiler*)
void WriteAsmExpression(Node* node, Compiler* compiler)
{
    if (node == nullptr)
    {
        return;    
    }

    ASSERT_COMPILER;

    if (node->type == MATH_TYPE && node->value.op >= EQUAL_OP) // is comparison
    {
        WriteAsmExpression(node->left,  compiler);
        WriteAsmExpression(node->right, compiler);
        WriteAsmCompare(node, compiler);
    }
    else
    {
        WriteAsmSimpleExpression(node, compiler);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x33b9
jmp 0x340a
movq -0x8(%rbp), %rax
cmpl $0xe, (%rax)
jne 0x33fd
movq -0x8(%rbp), %rax
cmpl $0x4, 0x8(%rax)
jl 0x33fd
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33a0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3940
jmp 0x340a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3a60
addq $0x10, %rsp
popq %rbp
retq
// File: vssense[P]Compiler/src/back-end/compiling.cpp
// Function: WriteAsmLoop(Node*, Compiler*)
void WriteAsmLoop(Node* node, Compiler* compiler)
{
    ASSERT_COMPILER;

    size_t loop_label     = compiler->label++;
    size_t continue_label = compiler->label++;

    size_t loop_label_offset = WriteLabel(compiler, loop_label);

    WriteAsmExpression(node->left, compiler);

    WritePopR64(compiler, RAX);
    WriteTest  (compiler, RAX, RAX);
    size_t continue_jump_offset = WriteJumpOp(compiler, EQUAL_OP, continue_label);

    WriteAsmCompound(node->right->right, compiler);

    size_t loop_jump_offset      = WriteJump (compiler, loop_label);
    size_t continue_label_offset = WriteLabel(compiler, continue_label);

    SetInt(&compiler->writer, loop_label_offset     - loop_jump_offset     - sizeof(int), loop_jump_offset);
    SetInt(&compiler->writer, continue_label_offset - continue_jump_offset - sizeof(int), continue_jump_offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rcx)
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rcx)
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5590
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33a0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x5020
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5320
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x4, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x5400
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x3090
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x54e0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5590
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movq -0x28(%rbp), %rax
subq -0x38(%rbp), %rax
subq $0x4, %rax
movl %eax, %esi
movq -0x38(%rbp), %rdx
callq 0x5f90
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movq -0x40(%rbp), %rax
subq -0x30(%rbp), %rax
subq $0x4, %rax
movl %eax, %esi
movq -0x30(%rbp), %rdx
callq 0x5f90
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)