LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/queries.cpp
// Function: yy_scan_buffer(char*, unsigned long)
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
{
	YY_BUFFER_STATE b;
    
	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return 0;

	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );

	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
	b->yy_buf_pos = b->yy_ch_buf = base;
	b->yy_is_our_buffer = 0;
	b->yy_input_file = 0;
	b->yy_n_chars = b->yy_buf_size;
	b->yy_is_interactive = 0;
	b->yy_at_bol = 1;
	b->yy_fill_buffer = 0;
	b->yy_buffer_status = YY_BUFFER_NEW;

	yy_switch_to_buffer(b  );

	return b;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x2, %rsi
jb 0x72f4e
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x0, -0x2(%rdi,%rsi)
jne 0x72f4e
cmpb $0x0, -0x1(%r15,%r14)
je 0x72f59
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movl $0x40, %edi
callq 0x8510
testq %rax, %rax
je 0x72fa7
movq %rax, %rbx
addq $-0x2, %r14
movq %r14, 0x18(%rax)
movq %r15, 0x8(%rax)
movq %r15, 0x10(%rax)
movl $0x0, 0x24(%rax)
xorl %eax, %eax
movq %rax, (%rbx)
movl %r14d, 0x20(%rbx)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, 0x28(%rbx)
movq %rax, 0x38(%rbx)
movq %rbx, %rdi
callq 0x72c5c
jmp 0x72f50
callq 0x8bfd
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/queries.cpp
// Function: yy_scan_bytes(char const*, int)
YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = _yybytes_len + 2;
	buf = (char *) yyalloc(n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

	for ( i = 0; i < _yybytes_len; ++i )
		buf[i] = yybytes[i];

	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;

	b = yy_scan_buffer(buf,n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );

	/* It's okay to grow etc. this buffer, and we should throw it
	 * away when we're done.
	 */
	b->yy_is_our_buffer = 1;

	return b;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %r12
leal 0x2(%r14), %eax
movslq %eax, %rbx
movq %rbx, %rdi
callq 0x8510
testq %rax, %rax
je 0x73025
movq %rax, %r15
testl %r14d, %r14d
jle 0x72ff8
movl %r14d, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x82f0
movslq %r14d, %rax
movw $0x0, (%r15,%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x72f2e
testq %rax, %rax
je 0x7302a
movl $0x1, 0x24(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x8c4d
callq 0x8c25
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: proc_stat[abi:cxx11](int, int)
const string proc_stat(const int target, const pid_t pid) {
  stringstream ss;
  ss << "/proc/" << pid << "/stat";
  ifstream fin(ss.str().c_str());
  string token;
  for (int i = 0; fin.good(); ++i) {
    fin >> token;
    if (i == target) break;
  }
  fin.close();
  return token;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x230(%rsp), %rdi
callq 0x8290
leaq 0x240(%rsp), %r15
leaq 0xc454(%rip), %rsi      # 0x7f7f5
movl $0x6, %edx
movq %r15, %rdi
callq 0x8470
movq %r15, %rdi
movl %r14d, %esi
callq 0x86d0
leaq 0xc3bf(%rip), %rsi      # 0x7f77f
movl $0x5, %edx
movq %rax, %rdi
callq 0x8470
leaq 0x248(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x8630
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movl $0x8, %edx
callq 0x8770
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73406
callq 0x8390
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x48(%rsp,%rax)
jne 0x7344f
incl %ebp
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x84e0
decl %ebp
je 0x7344f
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x48(%rsp,%rax)
je 0x73430
leaq 0x28(%rsp), %rdi
callq 0x80b0
leaq 0x28(%rsp), %rdi
callq 0x80c0
leaq 0x230(%rsp), %rdi
callq 0x87e8
movq %rbx, %rax
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7349f
jmp 0x734a4
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x734be
callq 0x8390
jmp 0x734be
jmp 0x7349f
movq %rax, %r14
jmp 0x734be
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x734b4
callq 0x8390
leaq 0x28(%rsp), %rdi
callq 0x80c0
leaq 0x230(%rsp), %rdi
callq 0x87e8
movq %r14, %rdi
callq 0x8720
movq %rax, %rdi
callq 0x68c53
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: ash::unix::cwd[abi:cxx11]()
const string unix::cwd() {
  char * c = get_current_dir_name();
  if (!c) return DBObject::quote(0);
  string cwd(c);
  free(c);
  return DBObject::quote(cwd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x8780
testq %rax, %rax
je 0x73542
movq %rax, %r14
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rax, %rdi
callq 0x8190
movq %r14, %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x68de4
movq %r14, %rdi
callq 0x84b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a6be
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7354c
callq 0x8390
jmp 0x7354c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6bdba
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7356d
callq 0x8390
movq %rbx, %rdi
callq 0x8720
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: exists(char const*)
bool exists(const char * dir) {
  struct stat st;
  if (stat(dir, &st) != 0) {
    LOG(DEBUG) << "tested file does not exist: '" << dir << "': "
               << strerror(errno);
    return false;
  }
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rdi, %r15
leaq 0x320(%rsp), %rsi
callq 0x8350
movl %eax, %ebx
testl %eax, %eax
je 0x7365b
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x70186
leaq 0x10(%rsp), %r14
leaq 0xc1d2(%rip), %rsi      # 0x7f785
movl $0x1d, %edx
movq %r14, %rdi
callq 0x8470
testq %r15, %r15
je 0x735dd
movq %r15, %rdi
callq 0x8190
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x8470
jmp 0x735f6
movq 0x10(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x30(%rsp,%rax), %esi
orl $0x1, %esi
callq 0x86b0
leaq 0xc1a6(%rip), %rsi      # 0x7f7a3
movl $0x3, %edx
movq %r14, %rdi
callq 0x8470
callq 0x8060
movl (%rax), %edi
callq 0x8150
testq %rax, %rax
je 0x73636
movq %rax, %r15
movq %rax, %rdi
callq 0x8190
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x8470
jmp 0x73651
movq 0x10(%rsp), %rax
movq -0x18(%rax), %rax
addq %rax, %r14
movl 0x30(%rsp,%rax), %esi
orl $0x1, %esi
movq %r14, %rdi
callq 0x86b0
leaq 0x8(%rsp), %rdi
callq 0x70626
testl %ebx, %ebx
sete %al
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x70626
movq %rbx, %rdi
callq 0x8720
movq %rax, %rdi
callq 0x68c53
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: ps(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
const char * ps(const string & args, pid_t pid) {
  LOG(DEBUG) << "looking at ps output for ps " << args << " " << pid;
  stringstream ss;
  ss << "/bin/ps " << args << " " << pid;
  FILE * p = popen(ss.str().c_str(), "r");
  if (p) {
    char buffer[256];
    char * rval = fgets(buffer, 256, p);
    pclose(p);
    if (!rval) return "null";
    for (size_t i = strlen(rval) - 1; i > 0; --i)
      if (rval[i] == '\n') {
        rval[i] = '\0';
        break;
      }
    return rval;
  }
  return "null";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x420, %rsp            # imm = 0x420
movl %esi, %ebx
movq %rdi, %r14
leaq 0x108(%rsp), %rdi
xorl %esi, %esi
callq 0x70186
leaq 0x110(%rsp), %r15
leaq 0xc0ee(%rip), %rsi      # 0x7f7a7
movl $0x1c, %edx
movq %r15, %rdi
callq 0x8470
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x8470
movq %rax, %r15
leaq 0x7c73(%rip), %rsi      # 0x7b352
movl $0x1, %edx
movq %rax, %rdi
callq 0x8470
movq %r15, %rdi
movl %ebx, %esi
callq 0x86d0
leaq 0x108(%rsp), %rdi
callq 0x70626
leaq 0x108(%rsp), %rdi
callq 0x8290
leaq 0x118(%rsp), %r15
leaq 0xc0a5(%rip), %rsi      # 0x7f7c4
movl $0x8, %edx
movq %r15, %rdi
callq 0x8470
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x8470
movq %rax, %r14
leaq 0x7c0d(%rip), %rsi      # 0x7b352
movl $0x1, %edx
movq %rax, %rdi
callq 0x8470
movq %r14, %rdi
movl %ebx, %esi
callq 0x86d0
leaq 0x120(%rsp), %rsi
movq %rsp, %rdi
callq 0x8630
leaq 0x10(%rsp), %rbx
movq -0x10(%rbx), %rdi
leaq 0x63ba(%rip), %rsi      # 0x79b36
callq 0x8120
movq %rax, %r14
movq -0x10(%rbx), %rdi
cmpq %rbx, %rdi
je 0x73792
callq 0x8390
testq %r14, %r14
je 0x737d9
movq %rsp, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x8620
movq %rax, %rbx
movq %r14, %rdi
callq 0x8550
testq %rbx, %rbx
je 0x737d9
movq %rbx, %rdi
callq 0x8190
cmpq $0x1, %rax
je 0x737e0
leaq -0x1(%rax), %rcx
cmpb $0xa, -0x1(%rbx,%rax)
movq %rcx, %rax
jne 0x737bf
movb $0x0, (%rbx,%rcx)
jmp 0x737e0
leaq 0xaab5(%rip), %rbx      # 0x7e295
leaq 0x108(%rsp), %rdi
callq 0x87e8
movq %rbx, %rax
addq $0x420, %rsp            # imm = 0x420
popq %rbx
popq %r14
popq %r15
retq
jmp 0x737ff
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x87e8
jmp 0x73821
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x70626
movq %rbx, %rdi
callq 0x8720
movq %rax, %rdi
callq 0x68c53
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: ash::unix::shell[abi:cxx11]()
const string unix::shell() {
  if (exists("/proc")) {
    LOG(DEBUG) << "looking for shell name in /proc/" << shell_pid() << "/stat.";
    string sh = proc_stat(1, shell_pid());
    // If the shell name is wrapped in parentheses, strip them.
    if (!sh.empty() && sh[0] == '(' && sh[sh.length() - 1] == ')') {
      sh = sh.substr(1, sh.length() - 2);
    }
    return DBObject::quote(sh);
  } else {
    // This is expected on OSX - no procfs so no /proc directory.
    string sh = ps("ho command", shell_pid());
    return sh == "null" ? sh : DBObject::quote(sh);
  }
  return "null";
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rdi, %rbx
leaq 0xbe42(%rip), %rdi      # 0x7f7cd
callq 0x73575
testb %al, %al
je 0x73a77
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x70186
leaq 0x38(%rsp), %r14
leaq 0xbe2b(%rip), %rsi      # 0x7f7db
movl $0x20, %edx
movq %r14, %rdi
callq 0x8470
callq 0x8540
movl %eax, %edi
callq 0x73831
movq %r14, %rdi
movl %eax, %esi
callq 0x86d0
leaq 0xbe22(%rip), %rsi      # 0x7f7fc
movl $0x6, %edx
movq %rax, %rdi
callq 0x8470
leaq 0x30(%rsp), %rdi
callq 0x70626
callq 0x8540
movl %eax, %edi
callq 0x73831
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
movl %eax, %edx
callq 0x73370
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0x73a65
movq 0x30(%rsp), %rax
cmpb $0x28, (%rax)
jne 0x73a65
cmpb $0x29, -0x1(%rax,%rcx)
jne 0x73a65
addq $-0x2, %rcx
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x8420
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x81f0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73a65
callq 0x8390
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a6be
jmp 0x73b11
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xbd7c(%rip), %rsi      # 0x7f803
leaq 0xbd7f(%rip), %rdx      # 0x7f80d
leaq 0x10(%rsp), %rdi
callq 0x68de4
callq 0x8540
movl %eax, %edi
callq 0x73831
leaq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0x7368a
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x8170
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x73ad1
callq 0x8390
leaq 0xa7bd(%rip), %rsi      # 0x7e295
leaq 0x30(%rsp), %rdi
callq 0x80f0
testl %eax, %eax
je 0x73af5
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a6be
jmp 0x73b11
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x68e74
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73b24
callq 0x8390
movq %rbx, %rax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73b58
callq 0x8390
jmp 0x73b58
jmp 0x73b55
jmp 0x73b55
jmp 0x73b68
movq %rax, %rbx
jmp 0x73b89
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x73b75
jmp 0x73b89
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x73b89
callq 0x8390
jmp 0x73b89
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x70626
movq %rbx, %rdi
callq 0x8720
movq %rax, %rdi
callq 0x68c53
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: ash::unix::time_zone[abi:cxx11]()
const string unix::time_zone() {
  stringstream ss;
  char zone_buffer[5];
  time_t now = ::time(0);
  strftime(zone_buffer, 5, "%Z", localtime(&now));
  ss << zone_buffer;
  return DBObject::quote(ss.str());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, %rbx
leaq 0x38(%rsp), %rdi
callq 0x8290
xorl %edi, %edi
callq 0x8370
leaq 0x30(%rsp), %rdi
movq %rax, (%rdi)
callq 0x82b0
leaq 0xbbf0(%rip), %rdx      # 0x7f80e
leaq 0xb(%rsp), %r14
movl $0x5, %esi
movq %r14, %rdi
movq %rax, %rcx
callq 0x82e0
leaq 0x48(%rsp), %r15
movq %r14, %rdi
callq 0x8190
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x8470
leaq 0x50(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x8630
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a6be
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73c7d
callq 0x8390
leaq 0x38(%rsp), %rdi
callq 0x87e8
movq %rbx, %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73cb4
callq 0x8390
jmp 0x73cb4
jmp 0x73cb1
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x87e8
movq %rbx, %rdi
callq 0x8720
movq %rax, %rdi
callq 0x68c53
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: ash::unix::host_name[abi:cxx11]()
const string unix::host_name() {
  char buffer[1024];
  if (gethostname(buffer, sizeof(buffer))) {
    perror("advanced shell history: Unix: gethostname");
  }
  return DBObject::quote(buffer);
}

// Assembly:
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %rbx
movq %rsp, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x85d0
testl %eax, %eax
jne 0x74255
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x6bdba
movq %rbx, %rax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
retq
leaq 0xb67e(%rip), %rdi      # 0x7f8da
callq 0x8300
jmp 0x7423e
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/unix.cpp
// Function: ash::unix::tty[abi:cxx11]()
const string unix::tty() {
  string tty = DBObject::quote(ttyname(0));
  if (tty.find("/dev/") == 1) {
    return "'" + tty.substr(6);
  }
  return tty;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
xorl %edi, %edi
callq 0x8260
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x6bdba
leaq 0xb660(%rip), %rsi      # 0x7f904
movl $0x5, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x86f0
cmpq $0x1, %rax
jne 0x742fd
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x6, %edx
movq $-0x1, %rcx
callq 0x8420
leaq 0xa068(%rip), %rsi      # 0x7e343
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x743ae
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74319
callq 0x8390
jmp 0x74319
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x68e74
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7432c
callq 0x8390
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74354
callq 0x8390
jmp 0x74354
jmp 0x74351
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74367
callq 0x8390
movq %rbx, %rdi
callq 0x8720
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/util.cpp
// Function: ash::Util::to_string[abi:cxx11](int)
string Util::to_string(int value) {
  static stringstream ss;
  ss.str("");
  ss << value;
  return ss.str();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movb 0x2251d(%rip), %al      # 0x96960
testb %al, %al
je 0x744a8
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x9f09(%rip), %rdx      # 0x7e360
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x68de4
leaq 0x22387(%rip), %rdi     # 0x967f0
movq %rsp, %rsi
callq 0x85c0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x7447f
callq 0x8390
leaq 0x22362(%rip), %rdi     # 0x967e8
movl %ebp, %esi
callq 0x86d0
leaq 0x2235c(%rip), %rsi     # 0x967f0
movq %rbx, %rdi
callq 0x8630
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x224b1(%rip), %rdi     # 0x96960
callq 0x8750
testl %eax, %eax
je 0x74447
leaq 0x22319(%rip), %rdi     # 0x967d8
callq 0x8290
movq 0x1fad5(%rip), %rdi     # 0x93fa0
leaq 0x22306(%rip), %rsi     # 0x967d8
leaq 0x1ff1f(%rip), %rdx     # 0x943f8
callq 0x8340
leaq 0x2247b(%rip), %rdi     # 0x96960
callq 0x8230
jmp 0x74447
movq %rax, %rbx
leaq 0x22467(%rip), %rdi     # 0x96960
callq 0x8220
jmp 0x74516
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x74516
callq 0x8390
jmp 0x74516
movq %rax, %rbx
movq %rbx, %rdi
callq 0x8720
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/server_udp.c
// Function: main
int main(int argc, char *argv[]) {
   char buf[BUFSIZE];
   ssize_t bytesread;
   char hostinfo[BUFSIZE];
   u_port_t port;
   int requestfd;
   u_buf_t senderinfo;

   if (argc != 2) {
      fprintf(stderr, "Usage: %s port\n", argv[0]);
      return 1;
   }
   port = (u_port_t) atoi(argv[1]);        /* create communication endpoint */
   if ((requestfd = u_openudp(port)) == -1) {
      perror("Failed to create UDP endpoint");
      return 1;
   }
   for ( ; ; ) {                                 /* process client requests */
      bytesread = u_recvfrom(requestfd, buf, BUFSIZE, &senderinfo);
      if (bytesread < 0) {
         perror("Failed to receive request");
         continue;
      }
      u_gethostinfo(&senderinfo, hostinfo, BUFSIZE);
      if ((r_write(STDOUT_FILENO, hostinfo, strlen(hostinfo)) == -1) ||
          (r_write(STDOUT_FILENO, buf, bytesread) == -1)) {
         perror("Failed to echo reply to standard output");
      }
   }     
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
cmpl $0x2, %edi
jne 0x13d1
movq 0x8(%rsi), %rdi
callq 0x1190
movzwl %ax, %edi
callq 0x1b84
cmpl $-0x1, %eax
je 0x13db
movl %eax, %ebx
leaq -0x840(%rbp), %r14
leaq -0x38(%rbp), %r15
leaq -0x440(%rbp), %r12
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rcx
callq 0x1c37
leaq 0xcc2(%rip), %rdi       # 0x2032
testq %rax, %rax
js 0x13ca
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x1d22
movq %r12, %rdi
callq 0x1080
movl $0x1, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1589
leaq 0xca5(%rip), %rdi       # 0x204c
cmpq $-0x1, %rax
je 0x13ca
movl $0x1, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1589
leaq 0xc88(%rip), %rdi       # 0x204c
cmpq $-0x1, %rax
jne 0x1357
callq 0x1180
jmp 0x1357
movq %rsi, %rdi
callq 0x11f0
jmp 0x13e7
leaq 0xc32(%rip), %rdi       # 0x2014
callq 0x1180
movl $0x1, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciname.c
// Function: addr2name
void addr2name(struct in_addr addr, char *name, int namelen) {
   struct hostent *hostptr;
   hostptr = gethostbyaddr((char *)&addr, 4, AF_INET);
   if (hostptr == NULL)
      strncpy(name, inet_ntoa(addr), namelen-1);
   else
      strncpy(name, hostptr->h_name, namelen-1);
   name[namelen-1] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movq %rsi, %rbx
leaq -0x14(%rbp), %rax
movl %edi, (%rax)
movq %rax, %rdi
movl $0x4, %esi
movl $0x2, %edx
callq 0x11a0
testq %rax, %rax
je 0x1aff
movq (%rax), %rsi
jmp 0x1b0a
movl -0x14(%rbp), %edi
callq 0x1070
movq %rax, %rsi
leal -0x1(%r14), %eax
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x1040
movslq %r14d, %rax
movb $0x0, -0x1(%rbx,%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciname.c
// Function: name2addr
int name2addr(char *name, in_addr_t *addrp) {
   struct hostent *hp;

   if (isdigit((int)(*name)))
      *addrp = inet_addr(name);
   else {
      hp = gethostbyname(name);
      if (hp == NULL)
         return -1;
      memcpy((char *)addrp, hp->h_addr_list[0], hp->h_length);
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x11c0
movq (%rax), %rax
movsbq (%r14), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x1b6c
movq %r14, %rdi
callq 0x1100
testq %rax, %rax
je 0x1b7d
movq 0x18(%rax), %rcx
movq (%rcx), %rsi
movslq 0x14(%rax), %rdx
movq %rbx, %rdi
callq 0x1120
jmp 0x1b76
movq %r14, %rdi
callq 0x10f0
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1b78
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_openudp
int u_openudp(u_port_t port) {
   int error;
   int one = 1;
   struct sockaddr_in server;
   int sock;

   if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
      return -1;

   if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) == -1) {
      error = errno;
      r_close(sock);
      errno = error;
      return -1;
   }
       
   if (port > 0) {
      server.sin_family = AF_INET;
      server.sin_addr.s_addr = htonl(INADDR_ANY);
      server.sin_port = htons((short)port);
 
      if (bind(sock, (struct sockaddr *)&server, sizeof(server)) == -1) {
         error = errno;
         r_close(sock);
         errno = error;
         return -1;
      }
   }
   return sock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edi, %r15d
movl $0x1, -0x24(%rbp)
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x11d0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x1c28
movl %eax, %r14d
leaq -0x24(%rbp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x1050
cmpl $-0x1, %eax
je 0x1c12
testw %r15w, %r15w
je 0x1c0d
leaq -0x34(%rbp), %rsi
movw $0x2, (%rsi)
movl $0x0, 0x4(%rsi)
rolw $0x8, %r15w
movw %r15w, 0x2(%rsi)
movl %r14d, %edi
movl $0x10, %edx
callq 0x1150
cmpl $-0x1, %eax
je 0x1c12
movl %r14d, %ebx
jmp 0x1c28
callq 0x1030
movq %rax, %r15
movl (%rax), %r12d
movl %r14d, %edi
callq 0x1400
movl %r12d, (%r15)
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_recvfrom
ssize_t u_recvfrom(int fd, void *buf, size_t nbytes, u_buf_t *ubufp) {
   int len;
   struct sockaddr *remote;
   int retval;

   len = sizeof (struct sockaddr_in);
   remote = (struct sockaddr *)ubufp;
   while (((retval = recvfrom(fd, buf, nbytes, 0, remote, &len)) == -1) &&
           (errno == EINTR)) ;  
   return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
leaq -0x2c(%rbp), %rax
movl $0x10, (%rax)
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %rbx, %r8
leaq -0x2c(%rbp), %r9
callq 0x1140
movq %rax, %r13
cmpl $-0x1, %r13d
jne 0x1c85
callq 0x1030
cmpl $0x4, (%rax)
je 0x1c5b
movslq %r13d, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_recvfromtimed
ssize_t u_recvfromtimed(int fd, void *buf, size_t nbytes, u_buf_t *ubufp,
                         double seconds) {
   int len;
   struct sockaddr *remote;
   int retval;
   struct timeval timedone;

   timedone = add2currenttime(seconds);
   if (waitfdtimed(fd, timedone) == -1)
      return (ssize_t)(-1);
   len = sizeof (struct sockaddr_in);
   remote = (struct sockaddr *)ubufp;
   while (((retval = recvfrom(fd, buf, nbytes, 0, remote, &len)) == -1) &&
           (errno == EINTR)) ;  
   return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
callq 0x15e8
movl %r12d, %edi
movq %rax, %rsi
callq 0x186f
cmpl $-0x1, %eax
je 0x1cff
leaq -0x2c(%rbp), %rax
movl $0x10, (%rax)
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %rbx, %r8
leaq -0x2c(%rbp), %r9
callq 0x1140
movq %rax, %r13
cmpl $-0x1, %r13d
jne 0x1cfa
callq 0x1030
cmpl $0x4, (%rax)
je 0x1cd0
movslq %r13d, %rax
jmp 0x1d06
movq $-0x1, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_gethostinfo
void u_gethostinfo(u_buf_t *ubufp, char *info, int infosize) {
   int len;
   int portnumber;

   portnumber = ntohs(ubufp->sin_port);
   len = snprintf(info, infosize, "port number is %d on host ", portnumber);
   info[infosize-1] = 0;                              /* in case name not fit */
   if (len >= infosize) return;
   u_gethostname(ubufp, info+len, infosize-len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x2(%rdi), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
movslq %edx, %r15
leaq 0x341(%rip), %rdx       # 0x2088
movq %rsi, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10a0
movb $0x0, -0x1(%rbx,%r15)
subl %eax, %r15d
jle 0x1d7d
cltq
addq %rax, %rbx
movl 0x4(%r14), %edi
movq %rbx, %rsi
movl %r15d, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1acc
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_comparehost
int u_comparehost(u_buf_t *ubufp, char *hostn, u_port_t port) {
   in_addr_t addr;
   struct sockaddr_in *remotep;

   remotep = (struct sockaddr_in *)ubufp;
   if ((port != ntohs(remotep->sin_port)) ||
       (name2addr(hostn, &addr) == -1) ||
       (memcmp(&(remotep->sin_addr.s_addr), &addr, sizeof(in_addr_t)) != 0))
      return 0;
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movzwl 0x2(%rdi), %eax
rolw $0x8, %ax
xorl %ebx, %ebx
cmpw %dx, %ax
jne 0x1dc5
movq %rdi, %r14
leaq -0x14(%rbp), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1b2a
cmpl $-0x1, %eax
je 0x1dc5
movl 0x4(%r14), %eax
xorl %ebx, %ebx
cmpl -0x14(%rbp), %eax
sete %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_sendto
ssize_t u_sendto(int fd, void *buf, size_t nbytes, u_buf_t *ubufp) {
   int len;
   struct sockaddr *remotep;
   int retval;

   len = sizeof(struct sockaddr_in);
   remotep = (struct sockaddr *)ubufp;
   while (((retval = sendto(fd, buf, nbytes, 0, remotep, len)) == -1) &&
           (errno == EINTR)) ;  
   return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq %rbx, %r8
movl $0x10, %r9d
callq 0x10c0
movq %rax, %r13
cmpl $-0x1, %r13d
jne 0x1e16
callq 0x1030
cmpl $0x4, (%rax)
je 0x1dea
movslq %r13d, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_sendtohost
ssize_t u_sendtohost(int fd, void *buf, size_t nbytes, char *hostn,
                     u_port_t port) {
   struct sockaddr_in remote;

   if (name2addr(hostn, &(remote.sin_addr.s_addr)) == -1) {
      errno = EINVAL;
      return -1;
   }
   remote.sin_port = htons((short)port);
   remote.sin_family = AF_INET;
   return u_sendto(fd, buf, nbytes, &remote);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %r15d
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r12d
leaq -0x2c(%rbp), %rsi
movq %rcx, %rdi
callq 0x1b2a
cmpl $-0x1, %eax
je 0x1e77
rolw $0x8, %r15w
leaq -0x30(%rbp), %rcx
movw %r15w, 0x2(%rcx)
movw $0x2, (%rcx)
movl %r12d, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1dd0
jmp 0x1e89
callq 0x1030
movl $0x16, (%rax)
movq $-0x1, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_join
int u_join(char *IP_address, u_port_t port, u_buf_t *ubufp) {
   int mcastfd;
   struct ip_mreq tempaddress;

   if ((mcastfd = u_openudp(port)) == -1)
      return mcastfd;
   
   tempaddress.imr_multiaddr.s_addr = inet_addr(IP_address);
   tempaddress.imr_interface.s_addr = htonl(INADDR_ANY);

        /* Join the multicast group. Let kernel choose the interface */
   if (setsockopt(mcastfd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
                   &tempaddress, sizeof(tempaddress)) == -1)
      return -1;
   ubufp->sin_family = AF_INET;
   ubufp->sin_addr.s_addr = inet_addr(IP_address);
   ubufp->sin_port = htons((short)port);
   return mcastfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r12
movl %esi, %edi
callq 0x1b84
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x1f0e
movl %eax, %r15d
movq %r12, %rdi
callq 0x10f0
leaq -0x30(%rbp), %rcx
movl %eax, (%rcx)
movl $0x0, 0x4(%rcx)
movl %r15d, %edi
xorl %esi, %esi
movl $0x23, %edx
movl $0x8, %r8d
callq 0x1050
cmpl $-0x1, %eax
je 0x1f0e
movw $0x2, (%rbx)
movq %r12, %rdi
callq 0x10f0
movl %eax, 0x4(%rbx)
rolw $0x8, %r14w
movw %r14w, 0x2(%rbx)
movl %r15d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/amanelis[P]uici/uiciudp.c
// Function: u_leave
int u_leave(int mcastfd, u_buf_t *ubufp) {  
   struct ip_mreq tempaddress;
 
   memcpy(&(tempaddress.imr_multiaddr),
         &(ubufp->sin_addr), sizeof(struct in_addr));   
   tempaddress.imr_interface.s_addr = htonl(INADDR_ANY);
   return setsockopt(mcastfd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
                   &tempaddress, sizeof(tempaddress));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl 0x4(%rsi), %eax
leaq -0x8(%rbp), %rcx
movl %eax, (%rcx)
movl $0x0, 0x4(%rcx)
xorl %esi, %esi
movl $0x24, %edx
movl $0x8, %r8d
callq 0x1050
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ls4154[P]hash-c/sha512_check.c
// Function: main
int main(int argc, char **argv)
{
	int fd = STDIN_FILENO;
	if (argc > 1 && (fd = open(argv[1], O_RDONLY)) < 0) {
		fprintf(stderr, "%s : cannot access '%s'\n", argv[0], argv[1]);
		exit(EXIT_FAILURE);
	}

	struct sha512_ctx ctx;
	sha512_init(&ctx);

	int total = 0;
	int rd = 0;
	while ((rd = read(fd, buffer + total, CHUNK_SIZE - total)) > 0) {
		total += rd;
		if (total >= CHUNK_SIZE) {
			sha512_update(&ctx, buffer);
			total = 0;
		}
	}
	sha512_update_last(&ctx, buffer, total);

	for (int i = 0; i < WORD_CNT; ++i)
		printf("%016lx", ctx.h[i]);
	printf("\n");

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
xorl %ebx, %ebx
cmpl $0x2, %edi
jl 0x11fa
movq %rsi, %r14
movq 0x8(%rsi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x1080
movl %eax, %ebx
testl %eax, %eax
js 0x12ae
leaq 0x8(%rsp), %rdi
callq 0x12bc
leaq 0x2e65(%rip), %r14      # 0x4070
movl $0x80, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x1050
xorl %r13d, %r13d
testl %eax, %eax
jle 0x125b
leaq 0x8(%rsp), %r15
addl %r13d, %eax
cmpl $0x80, %eax
jl 0x123d
movq %r15, %rdi
movq %r14, %rsi
callq 0x1334
xorl %eax, %eax
movl %eax, %r13d
movl %eax, %r12d
leaq (%r14,%r12), %rsi
movl $0x80, %edx
subl %eax, %edx
movl %ebx, %edi
callq 0x1050
testl %eax, %eax
jg 0x1226
jmp 0x125e
xorl %r12d, %r12d
leaq 0x2e0b(%rip), %rsi      # 0x4070
leaq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0x1534
leaq 0xda4(%rip), %rbx       # 0x201d
xorl %r14d, %r14d
movq 0x8(%rsp,%r14,8), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1040
incq %r14
cmpq $0x8, %r14
jne 0x127c
movl $0xa, %edi
callq 0x1030
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x8(%r14), %rsi
movq %r14, %rdi
callq 0x10b0
nop
// File: /workspace/github_c_makefile_star2_O1/ls4154[P]hash-c/sha512.c
// Function: sha512_init
void sha512_init(struct sha512_ctx *ctx)
{
	ctx->h[0] = 0x6a09e667f3bcc908ull;
	ctx->h[1] = 0xbb67ae8584caa73bull;
	ctx->h[2] = 0x3c6ef372fe94f82bull;
	ctx->h[3] = 0xa54ff53a5f1d36f1ull;
	ctx->h[4] = 0x510e527fade682d1ull;
	ctx->h[5] = 0x9b05688c2b3e6c1full;
	ctx->h[6] = 0x1f83d9abfb41bd6bull;
	ctx->h[7] = 0x5be0cd19137e2179ull;

	ctx->len = 0;
}

// Assembly:
movabsq $0x6a09e667f3bcc908, %rax # imm = 0x6A09E667F3BCC908
movq %rax, (%rdi)
movabsq $-0x4498517a7b3558c5, %rax # imm = 0xBB67AE8584CAA73B
movq %rax, 0x8(%rdi)
movabsq $0x3c6ef372fe94f82b, %rax # imm = 0x3C6EF372FE94F82B
movq %rax, 0x10(%rdi)
movabsq $-0x5ab00ac5a0e2c90f, %rax # imm = 0xA54FF53A5F1D36F1
movq %rax, 0x18(%rdi)
movabsq $0x510e527fade682d1, %rax # imm = 0x510E527FADE682D1
movq %rax, 0x20(%rdi)
movabsq $-0x64fa9773d4c193e1, %rax # imm = 0x9B05688C2B3E6C1F
movq %rax, 0x28(%rdi)
movabsq $0x1f83d9abfb41bd6b, %rax # imm = 0x1F83D9ABFB41BD6B
movq %rax, 0x30(%rdi)
movabsq $0x5be0cd19137e2179, %rax # imm = 0x5BE0CD19137E2179
movq %rax, 0x38(%rdi)
movq $0x0, 0x40(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/ls4154[P]hash-c/sha512.c
// Function: sha512_update_last
void sha512_update_last(struct sha512_ctx *ctx, byte_t *chunk, len_t len)
{
	ctx->len += len;
	len_t bit_len = ctx->len * 8;

	byte_t padding[128];
	memset(padding, 0, sizeof(padding));

	memcpy(padding, chunk, len);
	*(padding + len) = 0x80;

	if (len >= 112) {
		_sha512_iterate(ctx, padding);
		memset(padding, 0, sizeof(padding));
	}

	/* todo : length should be 128 bit */
	byte_t *ptr = padding + 112 + 8;
	for (int i = 7; i >= 0; --i) {
		*ptr = (bit_len >> 8 * i) & 0xFF;
		++ptr;
	}
	_sha512_iterate(ctx, padding);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq 0x40(%rdi), %r15
addq %rdx, %r15
movq %r15, 0x40(%rdi)
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, 0x70(%rdi)
movaps %xmm0, 0x60(%rdi)
movaps %xmm0, 0x50(%rdi)
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x1070
movb $-0x80, (%rsp,%r14)
cmpq $0x6f, %r14
jbe 0x15be
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1344
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%r14)
movaps %xmm0, 0x60(%r14)
movaps %xmm0, 0x50(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
shlq $0x3, %r15
movl $0x38, %ecx
leaq 0x78(%rsp), %rax
movq %r15, %rdx
shrq %cl, %rdx
movb %dl, (%rax)
addq $-0x8, %rcx
incq %rax
cmpq $-0x8, %rcx
jne 0x15cc
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x1344
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ls4154[P]hash-c/sha512.c
// Function: sha512_offline
void sha512_offline(struct sha512_ctx *ctx, byte_t *msg, len_t len)
{
	sha512_init(ctx);

	while (len >= 128) {
		sha512_update(ctx, msg);

		msg += 128;
		len -= 128;
	}

	sha512_update_last(ctx, msg, len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movabsq $0x6a09e667f3bcc908, %rax # imm = 0x6A09E667F3BCC908
movq %rax, (%rdi)
movabsq $-0x4498517a7b3558c5, %rax # imm = 0xBB67AE8584CAA73B
movq %rax, 0x8(%rdi)
movabsq $0x3c6ef372fe94f82b, %rax # imm = 0x3C6EF372FE94F82B
movq %rax, 0x10(%rdi)
movabsq $-0x5ab00ac5a0e2c90f, %rax # imm = 0xA54FF53A5F1D36F1
movq %rax, 0x18(%rdi)
movabsq $0x510e527fade682d1, %rax # imm = 0x510E527FADE682D1
movq %rax, 0x20(%rdi)
movabsq $-0x64fa9773d4c193e1, %rax # imm = 0x9B05688C2B3E6C1F
movq %rax, 0x28(%rdi)
movabsq $0x1f83d9abfb41bd6b, %rax # imm = 0x1F83D9ABFB41BD6B
movq %rax, 0x30(%rdi)
movabsq $0x5be0cd19137e2179, %rax # imm = 0x5BE0CD19137E2179
movq %rax, 0x38(%rdi)
movq $0x0, 0x40(%rdi)
cmpq $0x80, %rdx
jb 0x16a5
movq %r15, %rdi
movq %r14, %rsi
callq 0x1344
subq $-0x80, 0x40(%r15)
subq $-0x80, %r14
addq $-0x80, %rbx
cmpq $0x7f, %rbx
ja 0x1687
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1534
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/tests/onlinequantile/main.c
// Function: parse_line
static int
parse_line(FILE * fp, char * instr, double * val)
{
	char line[LINELEN];

	/* Repeat until we have a non-comment, non-blank line. */
	do {
		if (fgets(line, LINELEN, fp) == NULL) {
			/* Handle error or EOF. */
			if (ferror(fp)) {
				warnp("fgets");
				goto err0;
			}
			goto eof;
		}

		/* If we have a newline, remove it. */
		if (line[strlen(line) - 1] == '\n')
			line[strlen(line) - 1] = '\0';
	} while ((line[0] == '#') || (line[0] == '\0'));

	/* Sanity-check the format.  Multiple tabs characters are ok. */
	if (line[1] != '\t') {
		warn0("Unrecognized character in line: %s", line);
		goto err0;
	}

	/* Get instruction and value from the line. */
	*instr = line[0];
	if (PARSENUM(val, &line[2])) {
		warnp("parsenum");
		goto err0;
	}

	/* Success! */
	return (0);

eof:
	/* End of file! */
	return (1);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movl $0x50, %esi
movq %r15, %rdx
callq 0x1100
testq %rax, %rax
je 0x1747
movq %r12, %rdi
callq 0x10b0
cmpb $0xa, -0x1(%rax,%r12)
jne 0x16c1
movb $0x0, 0xf(%rsp,%rax)
movzbl 0x10(%rsp), %eax
cmpl $0x23, %eax
je 0x1693
testl %eax, %eax
je 0x1693
cmpb $0x9, 0x11(%rsp)
jne 0x178d
movb %al, (%r14)
callq 0x1060
movq %rax, %r14
movl $0x0, (%rax)
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, (%rbx)
leaq 0x12(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1080
movq (%r12), %rax
cmpq %r15, %rax
je 0x171b
cmpb $0x0, (%rax)
je 0x1722
movl $0x16, (%r14)
movsd %xmm0, (%rbx)
cmpl $0x0, (%r14)
je 0x17bc
leaq 0x19ce(%rip), %rdi      # 0x3105
xorl %eax, %eax
callq 0x1840
movl $0x0, (%r14)
jmp 0x17ab
movq %r15, %rdi
callq 0x1070
testl %eax, %eax
je 0x1776
callq 0x1060
cmpl $0x0, (%rax)
je 0x177d
movq %rax, %rbx
leaq 0x1975(%rip), %rdi      # 0x30dc
xorl %eax, %eax
callq 0x1840
movl $0x0, (%rbx)
jmp 0x17ab
movl $0x1, %eax
jmp 0x17b0
leaq 0x1958(%rip), %rdi      # 0x30dc
xorl %eax, %eax
callq 0x195f
jmp 0x17ab
leaq 0x194e(%rip), %rdi      # 0x30e2
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x195f
callq 0x1060
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x17b0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/onlinequantile.c
// Function: onlinequantile_init
struct onlinequantile *
onlinequantile_init(double q)
{
	struct onlinequantile * Q;

	/* Allocate structure and initialize parameters. */
	if ((Q = malloc(sizeof(struct onlinequantile))) == NULL)
		goto err0;
	Q->larger_min = (double)INFINITY;
	Q->smaller_max = - (double)INFINITY;
	Q->N = 0;
	Q->N_smaller = 0;
	Q->q = q;

	/* Create "smaller" heap. */
	if ((Q->smaller = doubleheap_init()) == NULL)
		goto err1;

	/* Create "larger" heap. */
	if ((Q->larger = doubleheap_init()) == NULL)
		goto err2;

	/* Success! */
	return (Q);

err2:
	doubleheap_free(Q->smaller);
err1:
	free(Q);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movl $0x38, %edi
callq 0x1130
testq %rax, %rax
je 0x1afa
movq %rax, %rbx
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, 0x10(%rbx)
movabsq $-0x10000000000000, %rax # imm = 0xFFF0000000000000
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movsd (%rsp), %xmm0
movsd %xmm0, 0x30(%rbx)
callq 0x20f0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x1af2
movq %rax, %r14
callq 0x20f0
movq %rax, (%rbx)
testq %rax, %rax
jne 0x1afc
movq %r14, %rdi
callq 0x2456
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/doubleheap.c
// Function: doubleheap_create
struct doubleheap *
doubleheap_create(double * buf, size_t N)
{
	struct doubleheap * H;
	size_t i;

	/* Allocate structure. */
	if ((H = malloc(sizeof(struct doubleheap))) == NULL)
		goto err0;

	/* We will have N elements. */
	H->nelems = N;

	/* Allocate space for N heap elements. */
	if ((H->elems = doublelist_init(N)) == NULL)
		goto err1;

	/* Copy the heap elements in. */
	for (i = 0; i < N; i++)
		*doublelist_get(H->elems, i) = buf[i];

	/* Turn this into a heap. */
	for (i = N - 1; i < N; i--)
		heapify(H->elems, i, N);

	/* Success! */
	return (H);

err1:
	free(H);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %r15
movl $0x10, %edi
callq 0x1130
testq %rax, %rax
je 0x2194
movq %rax, %rbx
movq %r14, 0x8(%rax)
movl $0x8, %esi
movq %r14, %rdi
callq 0x24f0
movq %rax, (%rbx)
testq %rax, %rax
je 0x218c
testq %r14, %r14
je 0x2196
movq %rax, %r12
xorl %r13d, %r13d
movsd (%r15,%r13,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x8, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x27a1
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
incq %r13
cmpq %r13, %r14
jne 0x2142
leaq -0x1(%r14), %r15
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x21a7
decq %r15
cmpq %r14, %r15
jb 0x2174
jmp 0x2196
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/doubleheap.c
// Function: heapify
static void
heapify(DOUBLELIST elems, size_t i, size_t N)
{
	size_t min;

	/* Iterate down the tree. */
	do {
		/* Look for the minimum element out of {i, 2i+1, 2i+2}. */
		min = i;

		/* Is this bigger than element 2i+1? */
		if (2 * i + 1 < N &&
		    *doublelist_get(elems, min) >
		    *doublelist_get(elems, 2 * i + 1))
			min = 2 * i + 1;

		/* Is this bigger than element 2i+2? */
		if (2 * i + 2 < N &&
		    *doublelist_get(elems, min) >
		    *doublelist_get(elems, 2 * i + 2))
			min = 2 * i + 2;

		/* If the minimum is i, we have heap-property. */
		if (min == i)
			break;

		/* Move the minimum into position i. */
		swap(elems, min, i);

		/* Move down the tree. */
		i = min;
	} while (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %r12
leaq 0x1(,%r15,2), %r13
cmpq %rbx, %r13
jae 0x2209
movl $0x8, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x27a1
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x8, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x27a1
movsd 0x8(%rsp), %xmm0
ucomisd (%rax), %xmm0
movq %r15, %r12
jbe 0x2209
movq %r13, %r12
leaq (%r15,%r15), %r13
addq $0x2, %r13
cmpq %rbx, %r13
jae 0x224f
movl $0x8, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x27a1
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x8, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x27a1
movsd 0x8(%rsp), %xmm0
ucomisd (%rax), %xmm0
jbe 0x224f
movq %r13, %r12
cmpq %r15, %r12
je 0x226a
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2471
movq %r12, %r15
jmp 0x21c0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/doubleheap.c
// Function: doubleheap_add
int
doubleheap_add(struct doubleheap * H, double x)
{

	/* Add the element to the end of the heap. */
	if (doublelist_append(H->elems, &x, 1))
		goto err0;
	H->nelems += 1;

	/* Move the new element up in the tree if necessary. */
	heapifyup(H->elems, H->nelems - 1);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r12
leaq 0x8(%rsp), %rsi
movsd %xmm0, (%rsi)
movq (%rdi), %rdi
movl $0x1, %edx
movl $0x8, %ecx
callq 0x2668
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x22bc
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%r12), %r14
movq 0x8(%r12), %r15
leaq 0x1(%r15), %rax
movq %rax, 0x8(%r12)
xorl %ebx, %ebx
testq %r15, %r15
je 0x22ac
movl $0x8, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x27a1
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
leaq -0x1(%r15), %r13
movq %r13, %r12
shrq %r12
movl $0x8, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x27a1
movsd (%rsp), %xmm0
ucomisd (%rax), %xmm0
jae 0x22ac
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2471
movq %r12, %r15
cmpq $0x1, %r13
ja 0x22d5
jmp 0x22ac
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/doubleheap.c
// Function: doubleheap_getmin
int
doubleheap_getmin(struct doubleheap * H, double * x)
{

	/* If we have any elements, the minimum is in position 0. */
	if (H->nelems) {
		*x = *doublelist_get(H->elems, 0);
		return (0);
	} else
		return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x8(%rdi)
je 0x2356
movq %rsi, %rbx
movq (%rdi), %rdi
xorl %r14d, %r14d
movl $0x8, %edx
xorl %esi, %esi
callq 0x27a1
movsd (%rax), %xmm0
movsd %xmm0, (%rbx)
jmp 0x235c
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/doubleheap.c
// Function: doubleheap_setmin
void
doubleheap_setmin(struct doubleheap * H, double x)
{

	/* Sanity-check; We must have a minimum element. */
	assert(H->nelems > 0);

	/* Set the new value. */
	*doublelist_get(H->elems, 0) = x;

	/* Move it down the heap if necessary. */
	heapify(H->elems, 0, H->nelems);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
cmpq $0x0, 0x8(%rdi)
je 0x23a8
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x8, %edx
xorl %esi, %esi
callq 0x27a1
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
jmp 0x21a7
leaq 0xfc2(%rip), %rdi       # 0x3371
leaq 0xfc9(%rip), %rsi       # 0x337f
leaq 0xfe1(%rip), %rcx       # 0x339e
movl $0xc7, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/datastruct/doubleheap.c
// Function: doubleheap_deletemin
void
doubleheap_deletemin(struct doubleheap * H)
{

	/* Sanity-check: Can't delete something which doesn't exist. */
	assert(H->nelems > 0);

	/* Move the last element to the top. */
	*doublelist_get(H->elems, 0) =
	    *doublelist_get(H->elems, H->nelems - 1);

	/* Shrink the heap. */
	doublelist_shrink(H->elems, 1);
	H->nelems--;

	/* Move it down the heap until it finds the right place. */
	heapify(H->elems, 0, H->nelems);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq 0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x2437
movq %rdi, %rbx
movq (%rdi), %rdi
decq %rsi
movl $0x8, %edx
callq 0x27a1
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rbx), %rdi
movl $0x8, %edx
xorl %esi, %esi
callq 0x27a1
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq (%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq 0x270c
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
decq %rdx
movq %rdx, 0x8(%rbx)
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
jmp 0x21a7
leaq 0xf33(%rip), %rdi       # 0x3371
leaq 0xf3a(%rip), %rsi       # 0x337f
leaq 0xf86(%rip), %rcx       # 0x33d2
movl $0xd9, %edx
callq 0x10c0