// File: /workspace/github_c_makefile_star2_O3/silverneko[P]miku/./src/sandbox.cpp
// Function: sandboxExec(int, sandboxOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int sandboxExec(int boxid, const sandboxOptions &opt, const string &comm)
{
   ostringstream sout;
   sout << "isolate --box-id=" << boxid;
   if(opt.cgroup) sout << " --cg";
   if(opt.preserve_env) sout << " --full-env";
   for(int i = 0; i < opt.dirs.size(); ++i)
      sout << " --dir=" << opt.dirs[i];
   if(!opt.input.empty()) sout << " --stdin=" << opt.input;
   if(!opt.output.empty()) sout << " --stdout=" << opt.output;
   if(!opt.errout.empty()) sout << " --stderr=" << opt.errout;
   if(!opt.meta.empty()) sout << " --meta=" << opt.meta;
   if(opt.mem != 0) sout << " --mem=" << opt.mem;
   sout << " --processes=" << opt.procs;
   double timeout = opt.timeout * 0.001;
   if(opt.timeout != 0){
      sout << " --time=" << fixed << setprecision(3) << timeout;
      sout << " --wall-time=" << fixed << setprecision(3) << timeout * 2;
   }
   if(opt.fsize_limit) sout << " --fsize=" << opt.fsize_limit;
   sout << " --file-limit=" << opt.file_limit;
   sout << " --extra-time=0.2";
   sout << " --run -- " << comm;
   cerr << "[debug] box-" << boxid << " execute command : " << sout.str() << endl;
   
   system(sout.str().c_str());
   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdx, %r14
movq %rsi, %r15
movl %edi, 0x4(%rsp)
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0x3350
leaq 0x5235(%rip), %rsi      # 0x9280
movl $0x11, %edx
movq %r12, %rdi
callq 0x32f0
leaq 0x30(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x34d0
cmpb $0x1, (%r15)
jne 0x4082
leaq 0x521f(%rip), %rsi      # 0x9292
leaq 0x30(%rsp), %rdi
movl $0x5, %edx
callq 0x32f0
cmpb $0x1, 0x1(%r15)
jne 0x409f
leaq 0x5208(%rip), %rsi      # 0x9298
leaq 0x30(%rsp), %rdi
movl $0xb, %edx
callq 0x32f0
movq 0x10(%r15), %rax
cmpq 0x8(%r15), %rax
je 0x40f9
movl $0x8, %ebp
xorl %ebx, %ebx
leaq 0x51ed(%rip), %r12      # 0x92a4
leaq 0x30(%rsp), %r13
movl $0x7, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x32f0
movq 0x8(%r15), %rax
movq -0x8(%rax,%rbp), %rsi
movq (%rax,%rbp), %rdx
movq %r13, %rdi
callq 0x32f0
movq 0x10(%r15), %rax
subq 0x8(%r15), %rax
incq %rbx
sarq $0x5, %rax
addq $0x20, %rbp
cmpq %rbx, %rax
ja 0x40bc
cmpq $0x0, 0x28(%r15)
je 0x4128
leaq 0x51a5(%rip), %rsi      # 0x92ac
leaq 0x30(%rsp), %rdi
movl $0x9, %edx
callq 0x32f0
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
leaq 0x30(%rsp), %rdi
callq 0x32f0
cmpq $0x0, 0x48(%r15)
je 0x4157
leaq 0x5180(%rip), %rsi      # 0x92b6
leaq 0x30(%rsp), %rdi
movl $0xa, %edx
callq 0x32f0
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
leaq 0x30(%rsp), %rdi
callq 0x32f0
cmpq $0x0, 0x68(%r15)
je 0x4186
leaq 0x515c(%rip), %rsi      # 0x92c1
leaq 0x30(%rsp), %rdi
movl $0xa, %edx
callq 0x32f0
movq 0x60(%r15), %rsi
movq 0x68(%r15), %rdx
leaq 0x30(%rsp), %rdi
callq 0x32f0
cmpq $0x0, 0x88(%r15)
je 0x41be
leaq 0x5135(%rip), %rsi      # 0x92cc
leaq 0x30(%rsp), %rdi
movl $0x8, %edx
callq 0x32f0
movq 0x80(%r15), %rsi
movq 0x88(%r15), %rdx
leaq 0x30(%rsp), %rdi
callq 0x32f0
cmpl $0x0, 0xa0(%r15)
je 0x41ef
leaq 0x5106(%rip), %rsi      # 0x92d5
leaq 0x30(%rsp), %rdi
movl $0x7, %edx
callq 0x32f0
movl 0xa0(%r15), %esi
leaq 0x30(%rsp), %rdi
callq 0x34d0
leaq 0x50e7(%rip), %rsi      # 0x92dd
leaq 0x30(%rsp), %rdi
movl $0xd, %edx
callq 0x32f0
movl 0xa4(%r15), %esi
leaq 0x30(%rsp), %rdi
callq 0x34d0
movl 0xa8(%r15), %ebx
testl %ebx, %ebx
je 0x42c9
leaq 0x50bf(%rip), %rsi      # 0x92eb
leaq 0x30(%rsp), %rdi
movl $0x8, %edx
callq 0x32f0
cvtsi2sd %ebx, %xmm0
mulsd 0x5031(%rip), %xmm0     # 0x9278
leaq 0x30(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x48(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x48(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x3, 0x38(%rsp,%rax)
movsd %xmm0, 0x28(%rsp)
callq 0x3440
leaq 0x5072(%rip), %rsi      # 0x92f4
leaq 0x30(%rsp), %rdi
movl $0xd, %edx
callq 0x32f0
leaq 0x30(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x48(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x48(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x3, 0x38(%rsp,%rax)
movsd 0x28(%rsp), %xmm0
addsd %xmm0, %xmm0
callq 0x3440
cmpl $0x0, 0xb0(%r15)
je 0x42fa
leaq 0x5028(%rip), %rsi      # 0x9302
leaq 0x30(%rsp), %rdi
movl $0x9, %edx
callq 0x32f0
movl 0xb0(%r15), %esi
leaq 0x30(%rsp), %rdi
callq 0x34d0
leaq 0x500b(%rip), %rsi      # 0x930c
leaq 0x30(%rsp), %rdi
movl $0xe, %edx
callq 0x32f0
movl 0xac(%r15), %esi
leaq 0x30(%rsp), %rdi
callq 0x34d0
leaq 0x4ff3(%rip), %rsi      # 0x931b
leaq 0x30(%rsp), %rdi
movl $0x11, %edx
callq 0x32f0
leaq 0x4fef(%rip), %rsi      # 0x932d
leaq 0x30(%rsp), %rdi
movl $0xa, %edx
callq 0x32f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x30(%rsp), %rdi
callq 0x32f0
movq 0x8c83(%rip), %rdi      # 0xcfe8
leaq 0x4fcc(%rip), %rsi      # 0x9338
movl $0xc, %edx
callq 0x32f0
movq 0x8c6b(%rip), %rdi      # 0xcfe8
movl 0x4(%rsp), %esi
callq 0x34d0
movq %rax, %r14
leaq 0x4fb5(%rip), %rsi      # 0x9345
movl $0x13, %edx
movq %rax, %rdi
callq 0x32f0
leaq 0x38(%rsp), %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3430
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x32f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0x18(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x4406
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3430
movq 0x8(%rsp), %rdi
callq 0x3240
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4434
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8b7d(%rip), %rsi      # 0xcfb8
leaq 0x30(%rsp), %rdi
callq 0x3170
leaq 0xa0(%rsp), %rdi
callq 0x3100
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x448a
jmp 0x44a0
jmp 0x449d
jmp 0x449d
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x44a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x44a0
jmp 0x449d
jmp 0x449d
movq %rax, %rbx
movq 0x8b11(%rip), %rsi      # 0xcfb8
leaq 0x30(%rsp), %rdi
callq 0x3170
leaq 0xa0(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x34e0