// File: /workspace/github_c_makefile_star2_O1/silverneko[P]miku/./src/server_io.cpp
// Function: sendResult(submission&, int, bool)
int sendResult(submission &sub, int verdict, bool done)
{
   ostringstream sout;
   sout << "update_verdict.py " << sub.submission_id << ' ';
   if(verdict == CE){
      sout << "CE";
   }else if(verdict == ER){
      sout << "ER";
   }else{
      for(int i = 0; i < sub.testdata_count; ++i){
         sout << fromVerdict(sub.verdict[i]).toAbr() << '/';
         sout << sub.time[i] << '/';
         sout << sub.mem[i] << '/';
         
         cerr << "td" << i << " : time " << sub.time[i];
         cerr << " mem " << sub.mem[i];
         cerr << " verdict " << fromVerdict(sub.verdict[i]).toStr();
         cerr << endl;
      }
   }
   if(done){
      sout << " OK OK";
   }else{
      sout << " NO NO";
   }
   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
movl %edx, 0xc(%rsp)
movl %esi, %ebx
movq %rdi, %r14
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x3350
leaq 0xb02(%rip), %rsi       # 0x9771
movl $0x12, %edx
movq %r15, %rdi
callq 0x32f0
movl 0x4(%r14), %esi
leaq 0x30(%rsp), %rdi
callq 0x34d0
leaq 0x10(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x32f0
cmpl $0x11, %ebx
je 0x8cb2
cmpl $0x13, %ebx
jne 0x8ccd
leaq 0xad7(%rip), %rsi       # 0x9787
jmp 0x8cb9
leaq 0xacb(%rip), %rsi       # 0x9784
leaq 0x30(%rsp), %rdi
movl $0x2, %edx
callq 0x32f0
jmp 0x8e81
cmpl $0x0, 0xf0(%r14)
jle 0x8e81
xorl %r15d, %r15d
leaq 0x30(%rsp), %r12
leaq 0x10(%rsp), %r13
movq 0x42f9(%rip), %rbp      # 0xcfe8
movl 0x734(%r14,%r15,4), %eax
addl $-0xa, %eax
leaq 0x811(%rip), %rbx       # 0x9512
cmpl $0x9, %eax
ja 0x8d16
movl %eax, %eax
leaq 0xb8d(%rip), %rcx       # 0x989c
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
movq %rbx, %rdi
callq 0x3130
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x32f0
movb $0x2f, 0x10(%rsp)
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x32f0
movl 0xd74(%r14,%r15,4), %esi
movq %r12, %rdi
callq 0x34d0
movb $0x2f, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x32f0
movl 0xa54(%r14,%r15,4), %esi
movq %r12, %rdi
callq 0x34d0
movb $0x2f, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x32f0
movl $0x2, %edx
movq %rbp, %rdi
leaq 0x9f0(%rip), %rsi       # 0x978a
callq 0x32f0
movq %rbp, %rdi
movl %r15d, %esi
callq 0x34d0
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
leaq 0x9d1(%rip), %rsi       # 0x978d
callq 0x32f0
movl 0xd74(%r14,%r15,4), %esi
movq %rbx, %rdi
callq 0x34d0
movl $0x5, %edx
movq %rbp, %rdi
leaq 0x9b6(%rip), %rsi       # 0x9796
callq 0x32f0
movl 0xa54(%r14,%r15,4), %esi
movq %rbp, %rdi
callq 0x34d0
movl $0x9, %edx
movq %rbp, %rdi
leaq 0x998(%rip), %rsi       # 0x979c
callq 0x32f0
movl 0x734(%r14,%r15,4), %eax
addl $-0xa, %eax
leaq 0xa7c(%rip), %rbx       # 0x9897
cmpl $0x9, %eax
ja 0x8e30
movl %eax, %eax
leaq 0xa9b(%rip), %rcx       # 0x98c4
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
movq %rbx, %rdi
callq 0x3130
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x32f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
incq %r15
movslq 0xf0(%r14), %rax
cmpq %rax, %r15
jl 0x8cef
leaq 0x91e(%rip), %rax       # 0x97a6
leaq 0x91e(%rip), %rsi       # 0x97ad
cmpb $0x0, 0xc(%rsp)
cmovneq %rax, %rsi
leaq 0x30(%rsp), %rdi
movl $0x6, %edx
callq 0x32f0
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x3430
movq 0x10(%rsp), %rdi
callq 0x3240
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8edb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x40d6(%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
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8f38
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x8f38
jmp 0x8f35
jmp 0x8f35
jmp 0x8f35
jmp 0x8f35
movq %rax, %rbx
movq 0x4079(%rip), %rsi      # 0xcfb8
leaq 0x30(%rsp), %rdi
callq 0x3170
leaq 0xa0(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x34e0