// File: /workspace/github_c_makefile_star2_O3/silverneko[P]miku/./src/server_io.cpp
// Function: fetchSubmission(submission&)
int fetchSubmission(submission &sub)
{
   FILE *Pipe = popen("fetch_submission.py", "r");
   fscanf(Pipe, "%d", &sub.submission_id);
   if(sub.submission_id < 0){
      pclose(Pipe);
      return sub.submission_id;
   }
   fscanf(Pipe, "%d", &sub.problem_id);
   fscanf(Pipe, "%d", &sub.problem_type);
   fscanf(Pipe, "%d", &sub.submitter_id);
   char buff[30];
   fscanf(Pipe, "%s", buff);
   pclose(Pipe);
   if(string(buff) == "c++11"){
      sub.lang = "c++";
      sub.std = "c++11";
   }else if(string(buff) == "c++"){
      sub.lang = "c++";
      sub.std = "";
   }else if(string(buff) == "c"){
      sub.lang = "c";
      sub.std = "";
   }else if(string(buff) == "haskell"){
      sub.lang = "haskell";
      sub.std = "";
   }else{
      sub.lang = "c++";
      sub.std = "c++11";
   }
   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x1d63(%rip), %rdi      # 0x96cd
leaq 0x1e80(%rip), %rsi      # 0x97f1
callq 0x30e0
movq %rax, %r14
leaq 0x4(%rbx), %r15
leaq 0x1dfa(%rip), %rsi      # 0x977e
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
cmpl $0x0, 0x4(%rbx)
js 0x7b89
leaq 0x1ddc(%rip), %r15      # 0x977e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3500
leaq 0xcc(%rbx), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3500
leaq 0xc8(%rbx), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3500
leaq 0x1d00(%rip), %rsi      # 0x96e1
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
movq %r14, %rdi
callq 0x3380
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r15, %rdi
callq 0x3130
leaq (%rsp,%rax), %rdx
addq $0x20, %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f86
leaq 0x1cba(%rip), %rsi      # 0x96e4
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7a49
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
je 0x7b99
movq %rsp, %r14
movq %r12, (%r14)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x3130
leaq (%rsp,%rax), %rdx
addq $0x20, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f86
leaq 0x1aa5(%rip), %rsi      # 0x9523
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7a9d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
je 0x7bd7
movq %rsp, %r14
movq %r12, (%r14)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x3130
leaq (%rsp,%rax), %rdx
addq $0x20, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f86
leaq 0x197a(%rip), %rsi      # 0x944c
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7af1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
je 0x7bee
movq %rsp, %r14
movq %r12, (%r14)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x3130
leaq (%rsp,%rax), %rdx
addq $0x20, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f86
leaq 0x18ed(%rip), %rsi      # 0x9413
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7b45
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x68(%rbx), %rdi
leaq 0x88(%rbx), %r14
movq 0x70(%rbx), %rdx
testl %ebp, %ebp
je 0x7c3b
leaq 0x19c0(%rip), %rcx      # 0x9523
movl $0x3, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
leaq 0x1b66(%rip), %rcx      # 0x96e4
movl $0x5, %r8d
movq %r14, %rdi
jmp 0x7bd3
movq %r14, %rdi
callq 0x3380
movl (%r15), %eax
jmp 0x7c2e
leaq 0x68(%rbx), %rdi
movq 0x70(%rbx), %rdx
leaq 0x197b(%rip), %rcx      # 0x9523
movl $0x3, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
addq $0x88, %rbx
leaq 0x1b1a(%rip), %rcx      # 0x96e4
movl $0x5, %r8d
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x7c27
leaq 0x68(%rbx), %rdi
movq 0x70(%rbx), %rdx
leaq 0x193d(%rip), %rcx      # 0x9523
movl $0x3, %r8d
jmp 0x7c03
leaq 0x68(%rbx), %rdi
movq 0x70(%rbx), %rdx
leaq 0x184f(%rip), %rcx      # 0x944c
movl $0x1, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
addq $0x88, %rbx
leaq 0x1903(%rip), %rcx      # 0x9522
movq %rbx, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x3400
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17d1(%rip), %rcx      # 0x9413
movl $0x7, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
leaq 0x18c5(%rip), %rcx      # 0x9522
movq %r14, %rdi
jmp 0x7c22