// File: /workspace/github_c_makefile_star2_O1/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 0x1c73(%rip), %rdi      # 0x96bd
leaq 0x1d90(%rip), %rsi      # 0x97e1
callq 0x30e0
movq %rax, %r14
leaq 0x4(%rbx), %r15
leaq 0x1d0a(%rip), %rsi      # 0x976e
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
cmpl $0x0, 0x4(%rbx)
js 0x7c69
leaq 0x1cec(%rip), %r15      # 0x976e
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 0x1c10(%rip), %rsi      # 0x96d1
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 0x4040
leaq 0x1bca(%rip), %rsi      # 0x96d4
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7b29
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
je 0x7c79
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 0x4040
leaq 0x19b5(%rip), %rsi      # 0x9513
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7b7d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
je 0x7cb7
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 0x4040
leaq 0x188a(%rip), %rsi      # 0x943c
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7bd1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
je 0x7cce
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 0x4040
leaq 0x17fd(%rip), %rsi      # 0x9403
movq %r14, %rdi
callq 0x30d0
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7c25
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x68(%rbx), %rdi
leaq 0x88(%rbx), %r14
movq 0x70(%rbx), %rdx
testl %ebp, %ebp
je 0x7d1b
leaq 0x18d0(%rip), %rcx      # 0x9513
movl $0x3, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
leaq 0x1a76(%rip), %rcx      # 0x96d4
movl $0x5, %r8d
movq %r14, %rdi
jmp 0x7cb3
movq %r14, %rdi
callq 0x3380
movl (%r15), %eax
jmp 0x7d0e
leaq 0x68(%rbx), %rdi
movq 0x70(%rbx), %rdx
leaq 0x188b(%rip), %rcx      # 0x9513
movl $0x3, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
addq $0x88, %rbx
leaq 0x1a2a(%rip), %rcx      # 0x96d4
movl $0x5, %r8d
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x7d07
leaq 0x68(%rbx), %rdi
movq 0x70(%rbx), %rdx
leaq 0x184d(%rip), %rcx      # 0x9513
movl $0x3, %r8d
jmp 0x7ce3
leaq 0x68(%rbx), %rdi
movq 0x70(%rbx), %rdx
leaq 0x175f(%rip), %rcx      # 0x943c
movl $0x1, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
addq $0x88, %rbx
leaq 0x1813(%rip), %rcx      # 0x9512
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 0x16e1(%rip), %rcx      # 0x9403
movl $0x7, %r8d
xorl %esi, %esi
callq 0x3400
movq 0x90(%rbx), %rdx
leaq 0x17d5(%rip), %rcx      # 0x9512
movq %r14, %rdi
jmp 0x7d02