// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/./src/batchjudge.cpp
// Function: main
int main(int argc, char *argv[])
{
   if(argc < 5) return -1;
   int problem_id, td, boxid, time_limit, mem_limit;
   string testee(argv[6]);
   stringstream stoi;
   for(int i = 1; i <= 5; ++i)
      stoi << argv[i] << ' ';
   stoi >> problem_id >> td >> boxid >> time_limit >> mem_limit;
   
   //init box
   sandboxInit(boxid);
   ostringstream sout;
   sout << "./testdata/" << setfill('0') << setw(4) << problem_id;
   sout << "/input" << setfill('0') << setw(3) << td;
   string tddir(sout.str());
   sout.str("");
   sout << " /tmp/box/" << boxid << "/box/";
   system(("cp " + tddir + sout.str() + "input").c_str());
   system(("chmod 755 " + sout.str()).c_str());
   system(("touch " + sout.str() + "input").c_str());
   system(("touch " + sout.str() + "output").c_str());
   system(("chmod 666 " + sout.str() + "input").c_str());
   system(("chmod 666 " + sout.str() + "output").c_str());
   system(("cp /tmp/box/" + testee + "/box/main.out" + sout.str() + "main.out").c_str());
   
   //set options
   sandboxOptions opt;
   //opt.dirs.push_back("/tmp/box/10/box");
   opt.cgroup = true;
   opt.procs = 1;
   opt.input = "input";
   opt.output = "output";
   opt.errout = "/dev/null";
   sout.str("");
   sout << td;
   opt.meta = "./testzone/META" + sout.str();
   opt.timeout = time_limit;
   opt.mem = mem_limit;
   opt.file_limit = 5;
   opt.fsize_limit = 65536;
   
   //invoke box command
   sandboxExec(boxid, opt, "main.out");

   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
cmpl $0x5, %edi
jge 0x23c6
pushq $-0x1
popq %rax
jmp 0x2a80
movq %rsi, %rbx
movq 0x30(%rsi), %rsi
leaq 0x178(%rsp), %rdi
leaq 0x310(%rsp), %rdx
callq 0x2c28
leaq 0x310(%rsp), %rdi
callq 0x20c0
pushq $0x1
popq %r15
leaq 0x320(%rsp), %r14
pushq $0x20
popq %rbp
cmpq $0x6, %r15
je 0x241f
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x2130
movq %rax, %rdi
movl %ebp, %esi
callq 0x2150
incq %r15
jmp 0x23fe
leaq 0x310(%rsp), %rdi
leaq 0x5c(%rsp), %rsi
callq 0x20b0
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x20b0
leaq 0x2c(%rsp), %rsi
movq %rax, %rdi
callq 0x20b0
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x20b0
leaq 0x54(%rsp), %rsi
movq %rax, %rdi
callq 0x20b0
movl 0x2c(%rsp), %edi
callq 0x325a
leaq 0x198(%rsp), %rdi
callq 0x2180
leaq 0x1b82(%rip), %rsi      # 0x4004
leaq 0x198(%rsp), %rdi
callq 0x2130
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x21c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x4, 0x10(%rax,%rcx)
movl 0x5c(%rsp), %esi
movq %rax, %rdi
callq 0x2200
leaq 0x1b53(%rip), %rsi      # 0x4010
leaq 0x198(%rsp), %rdi
callq 0x2130
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x21c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x3, 0x10(%rax,%rcx)
movl 0x50(%rsp), %esi
movq %rax, %rdi
callq 0x2200
leaq 0x1a0(%rsp), %rbx
leaq 0x158(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x1c47(%rip), %rsi      # 0x4157
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2c28
leaq 0x80(%rsp), %rsi
movq %rbx, %rdi
callq 0x2190
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x1afb(%rip), %rsi      # 0x4041
leaq 0x198(%rsp), %rdi
callq 0x2130
movl 0x2c(%rsp), %esi
movq %rax, %rdi
callq 0x2200
leaq 0x1ae0(%rip), %rsi      # 0x4046
movq %rax, %rdi
callq 0x2130
leaq 0x1aa2(%rip), %rsi      # 0x4017
leaq 0x30(%rsp), %rdi
leaq 0x158(%rsp), %rdx
callq 0x2ce9
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x2c82
leaq 0x1a62(%rip), %rdx      # 0x4011
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2c63
movq 0x80(%rsp), %rdi
callq 0x2100
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x60(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x1a0e(%rip), %rsi      # 0x401b
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2d5f
movq 0x80(%rsp), %rdi
callq 0x2100
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x19cf(%rip), %rsi      # 0x4026
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2d5f
leaq 0x19a4(%rip), %rdx      # 0x4011
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2c63
movq 0x80(%rsp), %rdi
callq 0x2100
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x1965(%rip), %rsi      # 0x4026
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2d5f
leaq 0x1956(%rip), %rdx      # 0x402d
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2c63
movq 0x80(%rsp), %rdi
callq 0x2100
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x1909(%rip), %rsi      # 0x4034
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2d5f
leaq 0x18d0(%rip), %rdx      # 0x4011
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2c63
movq 0x80(%rsp), %rdi
callq 0x2100
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x189f(%rip), %rsi      # 0x4034
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2d5f
leaq 0x1882(%rip), %rdx      # 0x402d
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2c63
movq 0x80(%rsp), %rdi
callq 0x2100
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x184d(%rip), %rsi      # 0x403f
leaq 0x60(%rsp), %rdi
leaq 0x178(%rsp), %rdx
callq 0x2ce9
leaq 0x1841(%rip), %rdx      # 0x404c
leaq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x2c63
leaq 0x138(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0x2c82
leaq 0x1809(%rip), %rdx      # 0x4051
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2c63
movq 0x80(%rsp), %rdi
callq 0x2100
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x2090
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x138(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x60(%rsp), %rdi
callq 0x2090
xorl %eax, %eax
movb %al, 0x1(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
andq $0x0, 0x18(%r14)
leaq 0xb0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xd0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xf0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x110(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rdx)
andl $0x0, 0x10(%rdx)
movabsq $0x4000000000, %rax     # imm = 0x4000000000
movq %rax, 0x18(%rdx)
andl $0x0, 0x20(%rdx)
leaq 0xa0(%rsp), %rdi
movb $0x1, -0x70(%rcx)
movl $0x1, 0x14(%rdx)
leaq 0x16e0(%rip), %rsi      # 0x4011
callq 0x2240
leaq 0xc0(%rsp), %rdi
leaq 0x16e8(%rip), %rsi      # 0x402d
callq 0x2240
leaq 0xe0(%rsp), %rdi
leaq 0x185f(%rip), %rsi      # 0x41b8
callq 0x2240
leaq 0x17f2(%rip), %rsi      # 0x4157
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2c28
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2190
leaq 0x8(%rsp), %rdi
callq 0x2090
movl 0x50(%rsp), %esi
leaq 0x198(%rsp), %rdi
callq 0x2200
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x21d0
leaq 0x16aa(%rip), %rsi      # 0x405a
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2d5f
leaq 0x100(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2160
movq %r14, %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
movl 0x58(%rsp), %eax
movl %eax, 0x28(%rbx)
movl 0x54(%rsp), %eax
movl %eax, 0x20(%rbx)
movabsq $0x1000000000005, %rax  # imm = 0x1000000000005
movq %rax, 0x2c(%rbx)
movl 0x2c(%rsp), %ebx
leaq 0x1641(%rip), %rsi      # 0x4051
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2c28
leaq 0x80(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movl %ebx, %edi
callq 0x2edc
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x80(%rsp), %rdi
callq 0x2d84
leaq 0x158(%rsp), %rdi
callq 0x2090
leaq 0x198(%rsp), %rdi
callq 0x2040
leaq 0x310(%rsp), %rdi
callq 0x20e0
leaq 0x178(%rsp), %rdi
callq 0x2090
xorl %eax, %eax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2aa4
jmp 0x2bcf
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x2aac
jmp 0x2bcf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2090
jmp 0x2bd2
jmp 0x2bcf
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x2090
jmp 0x2ad0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2090
jmp 0x2adf
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x2090
jmp 0x2af1
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2090
jmp 0x2b00
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x2ba9
jmp 0x2bca
jmp 0x2b33
jmp 0x2b45
jmp 0x2ba1
jmp 0x2bca
jmp 0x2b33
jmp 0x2b45
jmp 0x2ba1
jmp 0x2bca
jmp 0x2b33
jmp 0x2b45
jmp 0x2ba1
jmp 0x2bca
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x2090
jmp 0x2b48
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x2b9a
jmp 0x2ba1
jmp 0x2bca
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x2090
jmp 0x2b68
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x2ba9
jmp 0x2bca
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x2090
jmp 0x2b86
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2090
jmp 0x2b95
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2090
jmp 0x2ba4
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2090
jmp 0x2bdf
jmp 0x2bca
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x2ba9
jmp 0x2bca
jmp 0x2bfb
jmp 0x2c02
movq %rax, %rbx
jmp 0x2c12
movq %rax, %rbx
jmp 0x2bdf
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x2d84
leaq 0x158(%rsp), %rdi
callq 0x2090
leaq 0x198(%rsp), %rdi
callq 0x2040
jmp 0x2c05
movq %rax, %rbx
jmp 0x2bec
jmp 0x2c02
movq %rax, %rbx
leaq 0x310(%rsp), %rdi
callq 0x20e0
leaq 0x178(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2210
nop