LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: Gydo194[P]server/controller/actions.cpp
// Function: Actions::testAction(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*)
void Actions::testAction(vector<string> *vals)
{
	cout << "TestAction: argument count: " << vals->size() << endl;
	uint8_t n = 0;
	for(string i : *vals)
	{
		printf("TestAction: argument no '%hu' = '%s'\n", n, i.c_str());
		++n;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq 0x70bd(%rip), %rdi      # 0x9fd0
leaq 0x31cf(%rip), %rsi      # 0x60e9
callq 0x2240
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3010
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x20a0
movq %rax, %rdi
movq 0x7076(%rip), %rsi      # 0x9fb8
callq 0x2280
movb $0x0, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3030
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3060
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3090
testb $0x1, %al
jne 0x2f80
jmp 0x2ff2
leaq -0x20(%rbp), %rdi
callq 0x30d0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x2120
movq -0x70(%rbp), %rdi
movzbl -0x9(%rbp), %eax
movl %eax, -0x64(%rbp)
callq 0x2110
movl -0x64(%rbp), %esi
movq %rax, %rdx
leaq 0x3150(%rip), %rdi      # 0x6106
xorl %eax, %eax
callq 0x2050
jmp 0x2fbf
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x2190
leaq -0x20(%rbp), %rdi
callq 0x30f0
jmp 0x2f6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x2190
jmp 0x2ff8
addq $0x70, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x23c0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: Gydo194[P]server/controller/../misc/map_get.hpp
// Function: bool map_get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, void (*)(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*)>(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, void (*)(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*), std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, void (*)(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*)>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, void (**)(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*))
bool map_get(map<K,V> *src_map, const K key_source, V *dest_var) {
    try {
        *dest_var = src_map->at(key_source);
        return true;
    } catch(out_of_range oor) {
        return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4090
movq %rax, -0x48(%rbp)
jmp 0x3733
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x3793
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x379e
movq -0x28(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x22f0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x36d0
movq -0x50(%rbp), %rdi
callq 0x2100
movb $0x0, -0x1(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2330
callq 0x2380
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x23c0
nopw (%rax,%rax)
// File: Gydo194[P]server/main.cpp
// Function: main
int main(int argc, char **argv)
{
	//add controller actions
	attachActions();
	//set server callbacks
	server.onConnect(&Controller::handleServerConnection);
	server.onDisconnect(&Controller::handleServerDisconnect);
	server.onInput(&Controller::handleServerInput);
	server.init();
	
	//actual main loop
	while(true)
	{
		server.loop();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x4bc0
leaq 0x561e(%rip), %rdi      # 0xa290
leaq -0x1b39(%rip), %rsi     # 0x3140
callq 0x2e10
leaq 0x560b(%rip), %rdi      # 0xa290
leaq -0x1afc(%rip), %rsi     # 0x3190
callq 0x2e30
leaq 0x55f8(%rip), %rdi      # 0xa290
leaq -0x1abf(%rip), %rsi     # 0x31e0
callq 0x2df0
leaq 0x55e5(%rip), %rdi      # 0xa290
callq 0x2db0
leaq 0x55d9(%rip), %rdi      # 0xa290
callq 0x2ca0
jmp 0x4cb0
nop
// File: Gydo194[P]server/parser/parser.cpp
// Function: Parser::parse(char const*)
void Parser::parse(const char *buffer)
{
	string in = buffer;
	istringstream iss(in);

	string sub;
	while(iss >> sub)
	{
		values.push_back(sub);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x23d0
movq -0x1f8(%rbp), %rsi
movq -0x1f0(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x4cc0
jmp 0x5082
leaq -0x31(%rbp), %rdi
callq 0x22a0
leaq -0x1c8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x23b0
jmp 0x50a2
leaq -0x1e8(%rbp), %rdi
callq 0x2320
leaq -0x1c8(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x2310
movq %rax, -0x208(%rbp)
jmp 0x50ca
movq -0x208(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2300
movb %al, -0x209(%rbp)
jmp 0x50e8
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x50f4
jmp 0x5156
movq -0x200(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x51a0
jmp 0x5109
jmp 0x50ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x22a0
jmp 0x5189
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5180
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x2190
leaq -0x1c8(%rbp), %rdi
callq 0x2140
jmp 0x5180
leaq -0x1e8(%rbp), %rdi
callq 0x2190
leaq -0x1c8(%rbp), %rdi
callq 0x2140
leaq -0x30(%rbp), %rdi
callq 0x2190
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x2190
movq -0x40(%rbp), %rdi
callq 0x23c0
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: State::create_mutant(int, int, double)
void State::create_mutant (int phage, int cell, double killness)
{
  int mutant_curr = mutant[phage];
  int mutant_new = nMutants;

  copy_mutant(mutant_curr, mutant_new);

  KillProb[ MP(S.clade[cell], mutant_new) ] = killness;
  
  mutant[phage] = mutant_new;
  nMutants++;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movsd %xmm0, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movslq 0x3c(%rsp), %rax
movl 0xfa8(%rdi,%rax,4), %eax
movl %eax, 0x2c(%rsp)
movl 0x4(%rdi), %eax
movl %eax, 0x28(%rsp)
movl 0x2c(%rsp), %esi
movl 0x28(%rsp), %edx
callq 0x1280
movq 0x18(%rsp), %rax
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0xabe8, %rax           # imm = 0xABE8
movq %rax, 0x8(%rsp)
movslq 0x38(%rsp), %rax
leaq 0x5c43(%rip), %rdi      # 0x70d0
addq $0x8, %rdi
shlq $0x2, %rax
addq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1cf0
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
leaq 0x20(%rsp), %rsi
callq 0x1c00
movsd 0x10(%rsp), %xmm0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movsd %xmm0, (%rcx)
movl 0x28(%rsp), %edx
movslq 0x3c(%rsp), %rcx
movl %edx, 0xfa8(%rax,%rcx,4)
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: State::create_clade(int, int)
void State::create_clade (int phage, int cell)
{
  int clade_curr = clade[cell];
  int clade_new = nClades;
  
  S.copy_clade(clade_curr, clade_new);

  KillProb[ MP(mutant[phage], clade_new) ] = 0;

  clade[cell] = clade_new;
  nClades++;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movslq 0x28(%rsp), %rcx
movl 0x8(%rax,%rcx,4), %ecx
movl %ecx, 0x24(%rsp)
movl (%rax), %eax
movl %eax, 0x20(%rsp)
movl 0x24(%rsp), %esi
movl 0x20(%rsp), %edx
leaq 0x5ba3(%rip), %rdi      # 0x70d0
callq 0x1350
movq 0x10(%rsp), %rdi
movq %rdi, %rax
addq $0xabe8, %rax           # imm = 0xABE8
movq %rax, 0x8(%rsp)
addq $0xfa8, %rdi            # imm = 0xFA8
movslq 0x2c(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0x1cf0
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0x1c00
movq %rax, %rcx
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rcx)
movl 0x20(%rsp), %edx
movslq 0x28(%rsp), %rcx
movl %edx, 0x8(%rax,%rcx,4)
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x38, %rsp
retq
nop
// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: State::kill_cell(int, int)
void State::kill_cell (int phage, int cell)
{
  // a random cell replicates substituting the current cell
  int replicated_cell = (cell + randi(CELLS-1)) % CELLS;
  clade[cell] = clade[replicated_cell];
  //S.copy_clade(clade[replicated_cell], clade[cell]);

  // new PHAGES_BORN are born substituting some random PHAGES_BORN phages
  int new_phage[PHAGES_BORN];
  for(int p=0; p<PHAGES_BORN; p++) {
    new_phage[p] = randi(PHAGES);

    for(int q=0; q<p; q++)
      if(new_phage[q] == new_phage[p]) {
        p--; // generate a new random value
        break;
      }

    mutant[ new_phage[p] ] = mutant[phage];
  }
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x1c0(%rsp)
movl %esi, 0x1bc(%rsp)
movl %edx, 0x1b8(%rsp)
movq 0x1c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x1b8(%rsp), %eax
movl %eax, 0xc(%rsp)
movl $0x3e7, %edi            # imm = 0x3E7
callq 0x1d20
movl %eax, %ecx
movl 0xc(%rsp), %eax
addl %ecx, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movq 0x10(%rsp), %rax
movl %edx, 0x1b4(%rsp)
movslq 0x1b4(%rsp), %rcx
movl 0x8(%rax,%rcx,4), %edx
movslq 0x1b8(%rsp), %rcx
movl %edx, 0x8(%rax,%rcx,4)
movl $0x0, 0x1c(%rsp)
cmpl $0x64, 0x1c(%rsp)
jge 0x16b2
movl $0x2710, %edi           # imm = 0x2710
callq 0x1d20
movl %eax, %ecx
movslq 0x1c(%rsp), %rax
movl %ecx, 0x20(%rsp,%rax,4)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0x167d
movslq 0x18(%rsp), %rax
movl 0x20(%rsp,%rax,4), %eax
movslq 0x1c(%rsp), %rcx
cmpl 0x20(%rsp,%rcx,4), %eax
jne 0x166e
movl 0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x167d
jmp 0x1670
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x1643
movq 0x10(%rsp), %rax
movslq 0x1bc(%rsp), %rcx
movl 0xfa8(%rax,%rcx,4), %edx
movslq 0x1c(%rsp), %rcx
movslq 0x20(%rsp,%rcx,4), %rcx
movl %edx, 0xfa8(%rax,%rcx,4)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x161b
addq $0x1c8, %rsp            # imm = 0x1C8
retq
nopw (%rax,%rax)
// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: init()
void init ()
{
  S.nClades = 1;
  S.nMutants = 1;

  for(int c=0; c<CELLS; c++)
    S.clade[c] = 0;
  
  for(int p=0; p<CELLS; p++)
    S.mutant[p] = 0;

  S.KillProb[ MP(0,0) ] = 0.0;
}

// Assembly:
subq $0x18, %rsp
movl $0x1, 0x59a2(%rip)      # 0x70d0
movl $0x1, 0x599c(%rip)      # 0x70d4
movl $0x0, 0x14(%rsp)
cmpl $0x3e8, 0x14(%rsp)      # imm = 0x3E8
jge 0x176b
movslq 0x14(%rsp), %rcx
leaq 0x597a(%rip), %rax      # 0x70d0
movl $0x0, 0x8(%rax,%rcx,4)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x1740
movl $0x0, 0x10(%rsp)
cmpl $0x3e8, 0x10(%rsp)      # imm = 0x3E8
jge 0x17a1
movslq 0x10(%rsp), %rcx
leaq 0x5947(%rip), %rax      # 0x70d0
movl $0x0, 0xfa8(%rax,%rcx,4)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x1773
movl $0x0, 0x4(%rsp)
movl $0x0, (%rsp)
leaq 0x4(%rsp), %rdi
movq %rsp, %rsi
callq 0x1d40
movq %rax, 0x8(%rsp)
leaq 0x5907(%rip), %rdi      # 0x70d0
addq $0xabe8, %rdi           # imm = 0xABE8
leaq 0x8(%rsp), %rsi
callq 0x1c00
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: attack(int, int)
void attack (int phage, int cell)
{
  // mutations with only one level of killness
  if (randf() <= mutationProb[0]) {
    // 2)
    S.create_mutant(phage, cell, mutantKillness[0]);
    printf("create_mutant\n");
  }

  // whether the phage kills the cell
  if (randf() <= S.KillProb[ MP(S.mutant[phage],S.clade[cell]) ])
    // 3)
    S.kill_cell(phage, cell);
  else {
    // 4.1)
    if (randf() <= NEW_SPACER_PROB) {
      S.create_clade(phage, cell);
      printf("create_clade\n");
    }

    // 4.2)
    S.kill_phage(phage);
    //printf("phage killed\n");
  }
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl %esi, 0x10(%rsp)
callq 0x1d70
movaps %xmm0, %xmm1
movsd 0x58a4(%rip), %xmm0     # 0x70b0
ucomisd %xmm1, %xmm0
jb 0x183c
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movsd 0x5896(%rip), %xmm0     # 0x70b8
leaq 0x58a7(%rip), %rdi      # 0x70d0
callq 0x1420
leaq 0x27e3(%rip), %rdi      # 0x4018
movb $0x0, %al
callq 0x1030
callq 0x1d70
movsd %xmm0, (%rsp)
movslq 0x14(%rsp), %rax
leaq 0x587e(%rip), %rdi      # 0x70d0
addq $0xfa8, %rdi            # imm = 0xFA8
shlq $0x2, %rax
addq %rax, %rdi
movslq 0x10(%rsp), %rax
leaq 0x5864(%rip), %rsi      # 0x70d0
addq $0x8, %rsi
shlq $0x2, %rax
addq %rax, %rsi
callq 0x1cf0
movq %rax, 0x8(%rsp)
leaq 0x5848(%rip), %rdi      # 0x70d0
addq $0xabe8, %rdi           # imm = 0xABE8
leaq 0x8(%rsp), %rsi
callq 0x1c00
movsd (%rsp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x18be
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
leaq 0x5819(%rip), %rdi      # 0x70d0
callq 0x15a0
jmp 0x1906
callq 0x1d70
movaps %xmm0, %xmm1
movsd 0x273a(%rip), %xmm0     # 0x4008
ucomisd %xmm1, %xmm0
jb 0x18f6
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
leaq 0x57ed(%rip), %rdi      # 0x70d0
callq 0x14f0
leaq 0x2738(%rip), %rdi      # 0x4027
movb $0x0, %al
callq 0x1030
movl 0x14(%rsp), %esi
leaq 0x57cf(%rip), %rdi      # 0x70d0
callq 0x16c0
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: live()
void live ()
{
  for(int step=1; step<=STEPS; step++) {
    //int c = randi(CELLS);
    int c = (step-1) % CELLS;
    int p = randi(PHAGES);

    attack(p, c);
    stat(step);
  }
}

// Assembly:
subq $0x18, %rsp
movl $0x1, 0x14(%rsp)
cmpl $0x5f5e100, 0x14(%rsp)  # imm = 0x5F5E100
jg 0x1b9a
movl 0x14(%rsp), %eax
subl $0x1, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movl %edx, 0x10(%rsp)
movl $0x2710, %edi           # imm = 0x2710
callq 0x1d20
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %edi
movl 0x10(%rsp), %esi
callq 0x17f0
movl 0x14(%rsp), %edi
callq 0x1910
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x1b4c
addq $0x18, %rsp
retq
nop
// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: main
int main ()
{
  srand(0);

  init();
  live();

  return 0;
}

// Assembly:
pushq %rax
movl $0x0, 0x4(%rsp)
xorl %edi, %edi
callq 0x10d0
callq 0x1720
callq 0x1b40
xorl %eax, %eax
popq %rcx
retq
nop
// File: tsoding[P]cxx-invert-file-tree/inverter.cpp
// Function: main
int main(int argc, char **argv)
{
    if (argc < 2) {
        usage(std::cerr);
        std::cerr << "ERROR: folder path is not provided" << std::endl;
        return 1;
    }

    fs::path folder_path(argv[1]);
    invert_folder(folder_path);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x3cc3
movq 0x835d(%rip), %rdi      # 0xbff0
callq 0x3570
movq 0x8351(%rip), %rdi      # 0xbff0
leaq 0x4386(%rip), %rsi      # 0x802c
callq 0x3250
movq %rax, %rdi
movq 0x8303(%rip), %rsi      # 0xbfb8
callq 0x3290
movl $0x1, -0x4(%rbp)
jmp 0x3d11
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movl $0x2, %edx
callq 0x45d0
movq -0x50(%rbp), %rdi
callq 0x3870
jmp 0x3ce8
movl $0x0, -0x4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4090
jmp 0x3d11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4090
jmp 0x3d1a
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x33b0
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: establishment[P]sandman/src/config_json_impl.hpp
// Function: AutoJson::Json::operator ProcessConfig::DiskQuota<ProcessConfig::DiskQuota>()
AutoJson::Json::operator ::ProcessConfig::DiskQuota() {
	::ProcessConfig::DiskQuota obj;
	obj.blockQuota = (*this)["blockQuota"].Get<int>();
	obj.inodeQuota = (*this)["inodeQuota"].Get<int>();
	return obj;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %rdi
callq 0xa1b60
movq (%rsp), %rdi
leaq 0x6366a(%rip), %rsi     # 0xf5281
callq 0x91960
movq %rax, %rdi
callq 0xa1b80
movq (%rsp), %rdi
movl %eax, 0x10(%rsp)
leaq 0x63659(%rip), %rsi     # 0xf528c
callq 0x91960
movq %rax, %rdi
callq 0xa1b80
movl %eax, 0x14(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nop
// File: establishment[P]sandman/src/config_json_impl.hpp
// Function: AutoJson::Json::operator ProcessConfig::Environment<ProcessConfig::Environment>()
AutoJson::Json::operator ::ProcessConfig::Environment() {
	::ProcessConfig::Environment obj;
	obj.useDefaultRules = (*this)["useDefaultRules"].Get<int>();
	obj.passEnvironment = (*this)["passEnvironment"].Get<int>();
	obj.rules = (*this)["rules"].Get<vector<string>>();
	return obj;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x38(%rsp)
movb $0x0, 0x77(%rsp)
callq 0xa1ca0
movq 0x38(%rsp), %rdi
leaq 0x63476(%rip), %rsi     # 0xf5297
callq 0x91960
movq %rax, 0x40(%rsp)
jmp 0x91e2d
movq 0x40(%rsp), %rdi
callq 0xa1b80
movl %eax, 0x24(%rsp)
jmp 0x91e3d
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rax
movl 0x24(%rsp), %ecx
movl %ecx, (%rax)
leaq 0x63453(%rip), %rsi     # 0xf52a7
callq 0x91960
movq %rax, 0x18(%rsp)
jmp 0x91e60
movq 0x18(%rsp), %rdi
callq 0xa1b80
movl %eax, 0x14(%rsp)
jmp 0x91e70
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
movl %ecx, 0x4(%rax)
leaq 0x6342f(%rip), %rsi     # 0xf52b7
callq 0x91960
movq %rax, 0x8(%rsp)
jmp 0x91e94
movq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0xa1ce0
jmp 0x91ea5
movq 0x28(%rsp), %rdi
addq $0x8, %rdi
leaq 0x48(%rsp), %rsi
callq 0xa1d10
leaq 0x48(%rsp), %rdi
callq 0xa1d50
movb $0x1, 0x77(%rsp)
testb $0x1, 0x77(%rsp)
jne 0x91ef4
jmp 0x91eea
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
callq 0xa1db0
jmp 0x91f01
movq 0x28(%rsp), %rdi
callq 0xa1db0
movq 0x30(%rsp), %rax
addq $0x88, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x8ca40
nopl (%rax,%rax)
// File: establishment[P]sandman/src/config_json_impl.hpp
// Function: AutoJson::Json::operator ProcessConfig::FilePermissions<ProcessConfig::FilePermissions>()
AutoJson::Json::operator ::ProcessConfig::FilePermissions() {
	::ProcessConfig::FilePermissions obj;
	obj.rules = (*this)["rules"].Get<vector<string>>();
	obj.fullPermissionsOverFolder = (*this)["fullPermissionsOverFolder"].Get<int>();
	return obj;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movb $0x0, 0x67(%rsp)
callq 0xa1dd0
movq 0x28(%rsp), %rdi
leaq 0x6324c(%rip), %rsi     # 0xf52b7
callq 0x91960
movq %rax, 0x30(%rsp)
jmp 0x92077
movq 0x30(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0xa1ce0
jmp 0x92088
movq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %rsi, 0x8(%rsp)
callq 0xa1d10
movq 0x8(%rsp), %rdi
callq 0xa1d50
movq 0x28(%rsp), %rdi
leaq 0x6320b(%rip), %rsi     # 0xf52bd
callq 0x91960
movq %rax, 0x10(%rsp)
jmp 0x920be
movq 0x10(%rsp), %rdi
callq 0xa1b80
movl %eax, 0x4(%rsp)
jmp 0x920ce
movq 0x18(%rsp), %rax
movl 0x4(%rsp), %ecx
movl %ecx, 0x18(%rax)
movb $0x1, 0x67(%rsp)
testb $0x1, 0x67(%rsp)
jne 0x9210c
jmp 0x92102
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
callq 0xa1e00
jmp 0x92116
movq 0x18(%rsp), %rdi
callq 0xa1e00
movq 0x20(%rsp), %rax
addq $0x78, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x8ca40
// File: establishment[P]sandman/src/runstats.hpp
// Function: void RunStats::update<RunStats::TimeStat>(RunStats::TimeStat const&)
void RunStats::update(const RunStats::TimeStat& timeStat) {
    updateValue(this->timeStat.wallTimeMs, timeStat.wallTimeMs);
    updateValue(this->timeStat.cpuTimeMs, timeStat.cpuTimeMs);
    updateValue(this->timeStat.userTimeMs, timeStat.userTimeMs);
    updateValue(this->timeStat.systemTimeMs, timeStat.systemTimeMs);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq 0x8(%rsp), %rdx
movq %rsi, %rdi
callq 0xa2690
movq (%rsp), %rdi
movq %rdi, %rsi
addq $0x8, %rsi
movq 0x8(%rsp), %rdx
addq $0x8, %rdx
callq 0xa2690
movq (%rsp), %rdi
movq %rdi, %rsi
addq $0x10, %rsi
movq 0x8(%rsp), %rdx
addq $0x10, %rdx
callq 0xa2690
movq (%rsp), %rdi
movq %rdi, %rsi
addq $0x18, %rsi
movq 0x8(%rsp), %rdx
addq $0x18, %rdx
callq 0xa2690
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: establishment[P]sandman/src/runstats_json_impl.hpp
// Function: AutoJson::Json::Json<RunStats::TimeStat>(RunStats::TimeStat const&)
AutoJson::Json::Json(const ::RunStats::TimeStat& rhs) : type(JsonType::OBJECT), content(new std::map<std::string, Json>()) {
	(*this)["wallTimeMs"] = rhs.wallTimeMs;
	(*this)["cpuTimeMs"] = rhs.cpuTimeMs;
	(*this)["userTimeMs"] = rhs.userTimeMs;
	(*this)["systemTimeMs"] = rhs.systemTimeMs;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x38(%rsp)
movl $0x4, (%rax)
movl $0x30, %edi
callq 0x8c5a0
movq %rax, %rdi
movq %rdi, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0xa0b60
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x98(%rsp), %rax
movq (%rax), %rsi
leaq 0x88(%rsp), %rdi
callq 0xa1e90
movq 0x38(%rsp), %rdi
leaq 0x5fc9b(%rip), %rsi     # 0xf558c
callq 0x91960
movq %rax, 0x40(%rsp)
jmp 0x958fd
movq 0x40(%rsp), %rdi
leaq 0x88(%rsp), %rsi
movq %rsi, 0x20(%rsp)
callq 0x8ed80
movq 0x20(%rsp), %rdi
callq 0x8ead0
movq 0x98(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x68(%rsp), %rdi
callq 0xa1e90
movq 0x38(%rsp), %rdi
leaq 0x5fc57(%rip), %rsi     # 0xf5597
callq 0x91960
movq %rax, 0x28(%rsp)
jmp 0x9594c
movq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %rsi, 0x10(%rsp)
callq 0x8ed80
movq 0x10(%rsp), %rdi
callq 0x8ead0
movq 0x98(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x58(%rsp), %rdi
callq 0xa1e90
movq 0x38(%rsp), %rdi
leaq 0x5fc15(%rip), %rsi     # 0xf55a1
callq 0x91960
movq %rax, 0x18(%rsp)
jmp 0x95998
movq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movq %rsi, (%rsp)
callq 0x8ed80
movq (%rsp), %rdi
callq 0x8ead0
movq 0x98(%rsp), %rax
movq 0x18(%rax), %rsi
leaq 0x48(%rsp), %rdi
callq 0xa1e90
movq 0x38(%rsp), %rdi
leaq 0x5fbd6(%rip), %rsi     # 0xf55ac
callq 0x91960
movq %rax, 0x8(%rsp)
jmp 0x959e2
movq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x8ed80
leaq 0x48(%rsp), %rdi
callq 0x8ead0
addq $0xa8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x8ead0
jmp 0x95a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x8ead0
jmp 0x95a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x8ead0
jmp 0x95a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x8ead0
movq 0x80(%rsp), %rdi
callq 0x8ca40
nopw %cs:(%rax,%rax)
// File: establishment[P]sandman/src/runstats_json_impl.hpp
// Function: AutoJson::Json::operator RunStats::TimeStat<RunStats::TimeStat>()
AutoJson::Json::operator ::RunStats::TimeStat() {
	::RunStats::TimeStat obj;
	obj.wallTimeMs = (*this)["wallTimeMs"].Get<unsigned long long>();
	obj.cpuTimeMs = (*this)["cpuTimeMs"].Get<unsigned long long>();
	obj.userTimeMs = (*this)["userTimeMs"].Get<unsigned long long>();
	obj.systemTimeMs = (*this)["systemTimeMs"].Get<unsigned long long>();
	return obj;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0x5fad8(%rip), %rsi     # 0xf558c
callq 0x91960
movq %rax, %rdi
callq 0xa22b0
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
leaq 0x5fabf(%rip), %rsi     # 0xf5597
callq 0x91960
movq %rax, %rdi
callq 0xa22b0
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
leaq 0x5faa4(%rip), %rsi     # 0xf55a1
callq 0x91960
movq %rax, %rdi
callq 0xa22b0
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
leaq 0x5fa8a(%rip), %rsi     # 0xf55ac
callq 0x91960
movq %rax, %rdi
callq 0xa22b0
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rdi)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: establishment[P]sandman/src/lib.hpp
// Function: ProcessKeeper::ProcessKeeper(ProcessConfig, int, int*)
ProcessKeeper::ProcessKeeper(ProcessConfig config, int processPid, int errorPipes[2]) : processStats() {
    this->config = config;
    this->processPid = processPid;
    this->errorPipes[0] = errorPipes[0];
    this->errorPipes[1] = errorPipes[1];
    processKeeper = this;
}

// Assembly:
subq $0x58, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
callq 0xa1ff0
movq 0x20(%rsp), %rdi
addq $0x178, %rdi            # imm = 0x178
xorl %esi, %esi
callq 0xa2d60
jmp 0x967e8
movq 0x18(%rsp), %rdi
addq $0x198, %rdi            # imm = 0x198
movq %rdi, 0x8(%rsp)
callq 0xa2b80
jmp 0x96800
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0xa2db0
jmp 0x96811
movq 0x18(%rsp), %rax
movl 0x44(%rsp), %ecx
movl %ecx, 0x168(%rax)
movq 0x38(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x16c(%rax)
movq 0x38(%rsp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x170(%rax)
movq %rax, 0x893ee(%rip)     # 0x11fc30
addq $0x58, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x9686f
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0xa2cc0
movq 0x20(%rsp), %rdi
callq 0xa2450
movq 0x30(%rsp), %rdi
callq 0x8ca40
nopw %cs:(%rax,%rax)
// File: establishment[P]sandman/src/lib.hpp
// Function: ProcessKeeper::alarmSignalHandler(int)
void ProcessKeeper::alarmSignalHandler(int UNUSED signum) {
    /// signal callback must be static method / function
    /// it calls the processKeeper pointer which is set up in
    /// initProcessKeeper function
    RunStats::ResultCode status = processKeeper->checkLimits();
    if (status != RunStats::OK) {
        processKeeper->killProcess(status);
    }
}

// Assembly:
subq $0x58, %rsp
movl %edi, 0x54(%rsp)
movq 0x89391(%rip), %rdi     # 0x11fc30
callq 0xa2f30
movl %eax, 0x50(%rsp)
cmpl $0x1, 0x50(%rsp)
je 0x9694b
movq 0x89376(%rip), %rax     # 0x11fc30
movq %rax, (%rsp)
movl 0x50(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0x2f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x8ca50
movq 0x10(%rsp), %rdx
leaq 0x5e8cb(%rip), %rsi     # 0xf51ac
leaq 0x30(%rsp), %rdi
callq 0xa0a90
jmp 0x968ed
movl 0xc(%rsp), %esi
movq (%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xa2fe0
jmp 0x96901
leaq 0x30(%rsp), %rdi
callq 0x8cbd8
leaq 0x2f(%rsp), %rdi
callq 0x8c630
jmp 0x9694b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
jmp 0x9693f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x8cbd8
leaq 0x2f(%rsp), %rdi
callq 0x8c630
jmp 0x96950
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x8ca40
nopw (%rax,%rax)
// File: establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::ASyncStart(void*)
int ProcessInitialiser::ASyncStart(void* args) {
    ProcessInitialiser* initialiser = (ProcessInitialiser*)args;
    initialiser->setupSystem();

    Msg("Provided run command:%s\n", initialiser->config.runCommand.c_str());

    char** processArgs = Base::StringToCharSS(Base::ParseCommandLine(initialiser->config.runCommand));
    auto environment = Rules::Environment(initialiser->config.environment);
    char** env = environment.getEnvironment();

    /// child process inherits everything from parent
    /// * opened std{in,out,err}
    /// * cpu, mem, disk, network limits
    /// * cgroup id (associated with limits)
    /// * pwd, relative root
    /// all these limitations can't be enlarged, only reduced/shrinked

    char** c = processArgs;
    while (*c != nullptr) {
        Msg("Run command:\t%s\n", *c);
        c++;
    }

    execvpe(processArgs[0], processArgs, env);
    Die("execvpe(%s): %m", processArgs[0]);

    return 0;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
callq 0xa31d0
movq 0x98(%rsp), %rdi
addq $0xe8, %rdi
callq 0x8c1f0
movq %rax, %rsi
leaq 0x5ec62(%rip), %rdi     # 0xf568c
xorl %eax, %eax
callq 0x94e30
movq 0x98(%rsp), %rsi
addq $0xe8, %rsi
leaq 0x78(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x93940
movq (%rsp), %rdi
callq 0x93c50
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
callq 0xa1d50
movq 0x8(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x98(%rsp), %rsi
addq $0x108, %rsi            # imm = 0x108
leaq 0x40(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xa3280
movq 0x10(%rsp), %rdi
callq 0xa3550
movq %rax, 0x18(%rsp)
jmp 0x96aa1
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x96b05
movq 0x20(%rsp), %rax
movq (%rax), %rsi
leaq 0x5ebd3(%rip), %rdi     # 0xf56a5
xorl %eax, %eax
callq 0x94e30
jmp 0x96adb
movq 0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
jmp 0x96ab8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xa3850
jmp 0x96b35
movq 0x90(%rsp), %rsi
movq (%rsi), %rdi
movq 0x38(%rsp), %rdx
callq 0x8cb60
movq 0x90(%rsp), %rax
movq (%rax), %rsi
leaq 0x5eb8a(%rip), %rdi     # 0xf56b6
xorl %eax, %eax
callq 0x94bf0
jmp 0x96b35
movq 0x30(%rsp), %rdi
callq 0x8ca40
nop
// File: establishment[P]sandman/src/bin.cpp
// Function: CopyArguments(int, char**)
char** CopyArguments(int argc, char** argv) {
    char** new_argv = (char**)malloc((argc + 1) * sizeof(char*));
    new_argv[argc] = nullptr;
    for (int i = 0; i < argc; i += 1) {
        int len = strlen(argv[i]);
        char* txt = (char*)malloc(len * sizeof(char));
        for (int j = 0; j < len; j += 1) {
            txt[j] = argv[i][j];
        }
        txt[len] = '\0';
        new_argv[i] = txt;
    }

    return new_argv;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movq %rsi, 0x28(%rsp)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x8c7f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x96c2a
movq 0x28(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8c230
movl %eax, 0x18(%rsp)
movslq 0x18(%rsp), %rdi
shlq $0x0, %rdi
callq 0x8c7f0
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x18(%rsp), %eax
jge 0x96bf9
movq 0x28(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xc(%rsp), %rcx
movb (%rax,%rcx), %dl
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x96bbf
movq 0x10(%rsp), %rax
movslq 0x18(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x10(%rsp), %rdx
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x96b7f
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: establishment[P]sandman/src/bin.cpp
// Function: DeleteArgumentsCopy(char**)
void DeleteArgumentsCopy(char** argv) {
    char** start = argv;
    while (*argv != nullptr) {
        delete *argv;
        argv++;
    }

    delete start;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x96c90
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x96c80
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x8c5b0
movq 0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
jmp 0x96c53
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x96caf
movq 0x8(%rsp), %rdi
movl $0x8, %esi
callq 0x8c5b0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: establishment[P]sandman/src/bin.cpp
// Function: main
int main(int argc, char** argv) {
    DieLogToFile("/eval/isolate.log");

    auto config = ParseCommandLineArguments(argc, argv);

    if (config.mode == ProcessConfig::kUnspecified) {
        Die("Please specify an isolate command (e.g. --init, --run).");
    }

    if (geteuid()) {
        Die("Must be started as root");
    }

    if (config.mode == ProcessConfig::kRun) {
        if (config.runCommand == "") {
            Die("--run mode requires a command to run");
        }
    }
    if (config.mode != ProcessConfig::kInit && config.mode != ProcessConfig::kRun &&
        config.mode != ProcessConfig::kCleanup) {
        Die("Internal error: mode mismatch");
    }

    Jailer jailer(config, argv + optind);  /// share the stack size with the isolated process.);
    jailer.Start();

    exit(0);
}

// Assembly:
subq $0x368, %rsp            # imm = 0x368
movl $0x0, 0x364(%rsp)
movl %edi, 0x360(%rsp)
movq %rsi, 0x358(%rsp)
leaq 0x337(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x8ca50
movq 0x10(%rsp), %rdx
leaq 0x56174(%rip), %rsi     # 0xf5ef3
leaq 0x338(%rsp), %rdi
callq 0xa0a90
jmp 0x9fd8e
leaq 0x338(%rsp), %rdi
callq 0x94cd0
jmp 0x9fd9d
leaq 0x338(%rsp), %rdi
callq 0x8cbd8
leaq 0x337(%rsp), %rdi
callq 0x8c630
movl 0x360(%rsp), %esi
movq 0x358(%rsp), %rdx
leaq 0x1b8(%rsp), %rdi
callq 0x9e6c0
cmpl $0x0, 0x1b8(%rsp)
jne 0x9fe4f
leaq 0x56121(%rip), %rdi     # 0xf5f05
xorl %eax, %eax
callq 0x94bf0
jmp 0x9fded
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x328(%rsp)
movl %eax, 0x324(%rsp)
jmp 0x9fe24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x328(%rsp)
movl %eax, 0x324(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x8cbd8
leaq 0x337(%rsp), %rdi
callq 0x8c630
jmp 0x9ff3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x328(%rsp)
movl %eax, 0x324(%rsp)
jmp 0x9ff32
callq 0x8c310
cmpl $0x0, %eax
je 0x9fe69
leaq 0x560dd(%rip), %rdi     # 0xf5f3d
xorl %eax, %eax
callq 0x94bf0
jmp 0x9fe69
cmpl $0x2, 0x1b8(%rsp)
jne 0x9fea9
leaq 0x2a0(%rsp), %rdi
leaq 0x5532a(%rip), %rsi     # 0xf51ac
callq 0xa11e0
movb %al, 0xf(%rsp)
jmp 0x9fe8d
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x9fe97
jmp 0x9fea7
leaq 0x560b7(%rip), %rdi     # 0xf5f55
xorl %eax, %eax
callq 0x94bf0
jmp 0x9fea7
jmp 0x9fea9
cmpl $0x1, 0x1b8(%rsp)
je 0x9fed7
cmpl $0x2, 0x1b8(%rsp)
je 0x9fed7
cmpl $0x3, 0x1b8(%rsp)
je 0x9fed7
leaq 0x560ac(%rip), %rdi     # 0xf5f7a
xorl %eax, %eax
callq 0x94bf0
jmp 0x9fed7
movq 0x358(%rsp), %rax
movq 0x7e0a2(%rip), %rcx     # 0x11df88
movslq (%rcx), %rcx
leaq (%rax,%rcx,8), %rdx
leaq 0x18(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0xa5c50
jmp 0x9ff01
leaq 0x18(%rsp), %rdi
callq 0xa5e20
jmp 0x9ff0d
xorl %edi, %edi
callq 0x8c700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x328(%rsp)
movl %eax, 0x324(%rsp)
leaq 0x18(%rsp), %rdi
callq 0xa5eb0
leaq 0x1b8(%rsp), %rdi
callq 0xa2450
movq 0x328(%rsp), %rdi
callq 0x8ca40
nopl (%rax)
// File: establishment[P]sandman/src/runstats.hpp
// Function: RunStats::RunStats()
RunStats() {
        this->timeStat = {0, 0, 0, 0};

        this->memoryKB = 0;
        
        this->rssPeak = 0;
        this->cswVoluntary = 0;
        this->cswForced = 0;
        this->softPageFaults = 0;
        this->hardPageFaults = 0;

        this->nrSysCalls = 0;
        this->lastSysCall = 0;
        this->terminalSignal = 0;

        this->exitCode = 0;
        this->processWasKilled = false;
        this->resultCode = INTERNAL_ERROR;

        this->internalMessage = "";
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
addq $0x68, %rdi
movq %rdi, 0x8(%rsp)
callq 0x8c840
movq (%rsp), %rax
movq 0x8(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x38(%rax)
movq $0x0, 0x40(%rax)
movq $0x0, 0x48(%rax)
movl $0x0, 0x50(%rax)
movl $0x0, 0x54(%rax)
movl $0x0, 0x58(%rax)
movl $0x0, 0x5c(%rax)
movb $0x0, 0x60(%rax)
movl $0xa, 0x64(%rax)
leaq 0x52587(%rip), %rsi     # 0xf51ac
callq 0x8c810
jmp 0xa2c2c
addq $0x48, %rsp
retq
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0x8cbd8
movq 0x18(%rsp), %rdi
callq 0x8ca40
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: establishment[P]sandman/src/lib.hpp
// Function: ProcessKeeper::checkLimits()
RunStats::ResultCode checkLimits() {
        if (config.cpuTimeLimitMs && getProcTimeMs() >= config.cpuTimeLimitMs + config.extraTimeMs) {
            return RunStats::TIME_LIMIT_EXCEEDED;
        }

        if (config.wallTimeLimitMs && getWallTimeMs() >= config.wallTimeLimitMs + config.extraTimeMs) {
            return RunStats::WALL_TIME_LIMIT_EXCEEDED;
        }

        if (config.memoryLimitKB && getMemoryKB() >= config.memoryLimitKB) {
            return RunStats::MEMORY_LIMIT_EXCEEDED;
        }

        return RunStats::OK;
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x30(%rax)
je 0xa2f6d
movq (%rsp), %rdi
callq 0xaa830
movq (%rsp), %rdx
movq 0x30(%rdx), %rcx
addq 0x40(%rdx), %rcx
cmpq %rcx, %rax
jb 0xa2f6d
movl $0x3, 0x14(%rsp)
jmp 0xa2fca
movq (%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0xa2f9c
movq (%rsp), %rdi
callq 0xaa850
movq (%rsp), %rdx
movq 0x38(%rdx), %rcx
addq 0x40(%rdx), %rcx
cmpq %rcx, %rax
jb 0xa2f9c
movl $0x4, 0x14(%rsp)
jmp 0xa2fca
movq (%rsp), %rax
cmpl $0x0, 0x50(%rax)
je 0xa2fc2
movq (%rsp), %rdi
callq 0xaa890
movq (%rsp), %rcx
cmpl 0x50(%rcx), %eax
jl 0xa2fc2
movl $0x5, 0x14(%rsp)
jmp 0xa2fca
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: establishment[P]sandman/src/lib.hpp
// Function: ProcessKeeper::killProcess(RunStats::ResultCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void killProcess(RunStats::ResultCode killReason, string internalMessage = "") {
        clearTimer();

        kill(-processPid, SIGKILL);
        kill(processPid, SIGKILL);

        struct rusage rus;
        int p, stat;

        do {
            p = wait4(processPid, &stat, 0, &rus);
        } while (p < 0 && errno == EINTR);

        processStats.processWasKilled = true;
        processStats.update(killReason);
        processStats.update(rus);
        processStats.exitCode = 0;
        processStats.internalMessage = internalMessage;

        updateStats();
    }

// Assembly:
subq $0xc8, %rsp
movq %rdx, 0x8(%rsp)
movq %rdi, 0xc0(%rsp)
movl %esi, 0xbc(%rsp)
movq %rdx, 0xb0(%rsp)
movq 0xc0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xabca0
movq 0x10(%rsp), %rax
xorl %edi, %edi
subl 0x168(%rax), %edi
movl $0x9, %esi
callq 0x8c870
movq 0x10(%rsp), %rax
movl 0x168(%rax), %edi
movl $0x9, %esi
callq 0x8c870
movq 0x10(%rsp), %rax
movl 0x168(%rax), %edi
leaq 0x18(%rsp), %rsi
xorl %edx, %edx
leaq 0x20(%rsp), %rcx
callq 0x8c2e0
movl %eax, 0x1c(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x1c(%rsp)
movb %al, 0x7(%rsp)
jge 0xa307d
callq 0x8c070
cmpl $0x4, (%rax)
sete %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xa3041
movq 0x10(%rsp), %rdi
movb $0x1, 0x1f8(%rdi)
addq $0x198, %rdi            # imm = 0x198
leaq 0xbc(%rsp), %rsi
callq 0x941c0
movq 0x10(%rsp), %rdi
addq $0x198, %rdi            # imm = 0x198
leaq 0x20(%rsp), %rsi
callq 0x94150
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
movl $0x0, 0x1f4(%rdi)
addq $0x198, %rdi            # imm = 0x198
addq $0x68, %rdi
callq 0x8c060
movq 0x10(%rsp), %rdi
callq 0xabcc0
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::setupSystem()
void setupSystem() {
        Base::die_fd = errorPipes[1];
        close(errorPipes[0]);

        cg.enter();
        setupRoot();
        setupPipes();
        setupFilePermissions();
        setupRlimits();
        setupCredentials();

        /// changes dir before executin to dir provided from flag / set dir
        if (config.execDirectory.size() && chdir(config.execDirectory.c_str())) {
            Die("chdir: %m");
        }
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x174(%rax), %ecx
movl %ecx, 0x7b415(%rip)     # 0x11e604
movl 0x170(%rax), %edi
callq 0x8cb80
leaq 0x7ba07(%rip), %rdi     # 0x11ec08
callq 0xabf60
movq 0x8(%rsp), %rdi
callq 0xac540
movq 0x8(%rsp), %rdi
callq 0xac830
movq 0x8(%rsp), %rdi
callq 0xaca70
movq 0x8(%rsp), %rdi
callq 0xacae0
movq 0x8(%rsp), %rdi
callq 0xacba0
movq 0x8(%rsp), %rdi
addq $0xb8, %rdi
callq 0x8c3f0
cmpq $0x0, %rax
je 0xa327b
movq 0x8(%rsp), %rdi
addq $0xb8, %rdi
callq 0x8c1f0
movq %rax, %rdi
callq 0x8c8d0
cmpl $0x0, %eax
je 0xa327b
leaq 0x52e72(%rip), %rdi     # 0xf60e6
movb $0x0, %al
callq 0x94bf0
addq $0x18, %rsp
retq
// File: establishment[P]sandman/src/lib.hpp
// Function: Jailer::Jailer(ProcessConfig const&, void*)
Jailer(const ProcessConfig& config, void* isolatedProcessStack = nullptr)
          : config(config), isolatedProcessStack(isolatedProcessStack) {
        /// sanity check
        if (config.boxId == -1) {
            Die("Specify box-id.");
        }

        if (config.processId < 0 or config.processId >= maxProcessesPerCG) {
            Die("Process if out of range [0, %d). Id=%d", maxProcessesPerCG, config.processId);
        }

        uid = firstProcessUid + maxProcessesPerCG * config.boxId + config.processId;
        gid = firstProcessGid + maxProcessesPerCG * config.boxId + config.processId;
        cgid = firstCgroupId + maxProcessesPerCG * config.boxId + config.processId;

        boxDir = Base::StrCat(baseBoxDir, "/", config.boxId);
        this->meta_fd = -1;
    }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq 0x70(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x68(%rsp), %rsi
callq 0xc6f60
movq (%rsp), %rdi
movq 0x60(%rsp), %rax
movq %rax, 0x168(%rdi)
addq $0x170, %rdi            # imm = 0x170
movq %rdi, 0x8(%rsp)
callq 0x8c840
movq 0x68(%rsp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0xa5cc5
leaq 0x5099d(%rip), %rdi     # 0xf6646
xorl %eax, %eax
callq 0x94bf0
jmp 0xa5cb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0xa5df5
movq 0x68(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jl 0xa5ce0
movq 0x68(%rsp), %rax
movl 0x8(%rax), %eax
cmpl 0x78936(%rip), %eax     # 0x11e614
jl 0xa5cfe
movl 0x7892e(%rip), %esi     # 0x11e614
movq 0x68(%rsp), %rax
movl 0x8(%rax), %edx
leaq 0x50961(%rip), %rdi     # 0xf6656
xorl %eax, %eax
callq 0x94bf0
jmp 0xa5cfe
movq (%rsp), %rax
movl 0x78900(%rip), %ecx     # 0x11e608
movl 0x78906(%rip), %esi     # 0x11e614
movq 0x68(%rsp), %rdx
movl 0x4(%rdx), %edi
movl 0x8(%rdx), %edx
imull %edi, %esi
addl %esi, %ecx
addl %edx, %ecx
movl %ecx, 0x190(%rax)
movl 0x788e0(%rip), %ecx     # 0x11e60c
movl 0x788e2(%rip), %esi     # 0x11e614
movq 0x68(%rsp), %rdx
movl 0x4(%rdx), %edi
movl 0x8(%rdx), %edx
imull %edi, %esi
addl %esi, %ecx
addl %edx, %ecx
movl %ecx, 0x194(%rax)
movl 0x788c0(%rip), %ecx     # 0x11e610
movl 0x788be(%rip), %esi     # 0x11e614
movq 0x68(%rsp), %rdx
movl 0x4(%rdx), %edi
movl 0x8(%rdx), %edx
imull %edi, %esi
addl %esi, %ecx
addl %edx, %ecx
movl %ecx, 0x198(%rax)
leaq 0x79ec3(%rip), %rsi     # 0x11fc38
leaq 0x10(%rsp), %rdi
callq 0x8c220
jmp 0xa5d81
movq 0x68(%rsp), %rax
movl 0x4(%rax), %ecx
leaq 0x504f4(%rip), %rdx     # 0xf6284
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xc71e0
jmp 0xa5da1
movq (%rsp), %rdi
addq $0x170, %rdi            # imm = 0x170
leaq 0x30(%rsp), %rsi
callq 0x8c720
leaq 0x30(%rsp), %rdi
callq 0x8cbd8
leaq 0x10(%rsp), %rdi
callq 0x8cbd8
movq (%rsp), %rax
movl $0xffffffff, 0x19c(%rax) # imm = 0xFFFFFFFF
addq $0x78, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x8cbd8
movq 0x8(%rsp), %rdi
callq 0x8cbd8
movq (%rsp), %rdi
callq 0xa2450
movq 0x58(%rsp), %rdi
callq 0x8ca40
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: establishment[P]sandman/src/lib.hpp
// Function: Jailer::Start()
void Start() {
        Base::verbose_level = config.verboseLevel;

        BoxInit();
        typedef ProcessConfig::Modes Modes;
        switch (config.mode) {
            case Modes::kUnspecified:
                Die("Specify a mode for isolate");
                break;
            case Modes::kInit:
                Init();
                break;
            case Modes::kRun:
                Run();
                break;
            case Modes::kCleanup:
                Cleanup();
                break;
            default:
                Die("Unknown mode");
                break;
        }
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movl 0xc(%rdi), %eax
movl %eax, 0x78c8d(%rip)     # 0x11eac8
callq 0xc7a00
movq (%rsp), %rax
movl (%rax), %eax
movq %rax, 0x8(%rsp)
subq $0x3, %rax
ja 0xa5e95
movq 0x8(%rsp), %rax
leaq 0x4f1c3(%rip), %rcx     # 0xf5020
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x50810(%rip), %rdi     # 0xf667d
movb $0x0, %al
callq 0x94bf0
movq (%rsp), %rdi
callq 0xc7b70
jmp 0xa5ea3
movq (%rsp), %rdi
callq 0xc7c70
jmp 0xa5ea3
movq (%rsp), %rdi
callq 0xc80b0
jmp 0xa5ea3
leaq 0x507fc(%rip), %rdi     # 0xf6698
movb $0x0, %al
callq 0x94bf0
addq $0x18, %rsp
retq
nopl (%rax,%rax)